From 5a818d1e1e7f63c30ea00753397f5c9831c6c0d6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 24 May 2011 16:10:49 +0200 Subject: QtTools: Widget library split. --- demos/arthurplugin/plugin.cpp | 4 +-- .../calculatorbuilder/calculatorbuilder.pro | 1 + .../designer/calculatorbuilder/calculatorform.cpp | 4 ++- .../designer/calculatorform/calculatorform.pro | 1 + .../containerextension/containerextension.pro | 1 + .../containerextension/multipagewidget.cpp | 4 ++- .../customwidgetplugin/customwidgetplugin.pro | 1 + .../taskmenuextension/taskmenuextension.pro | 1 + .../designer/taskmenuextension/tictactoedialog.cpp | 4 ++- examples/designer/worldtimeclockbuilder/main.cpp | 4 +-- .../worldtimeclockbuilder.pro | 1 + .../worldtimeclockplugin/worldtimeclockplugin.pro | 1 + .../contextsensitivehelp/contextsensitivehelp.pro | 2 +- examples/help/contextsensitivehelp/helpbrowser.cpp | 2 +- examples/help/contextsensitivehelp/helpbrowser.h | 2 +- examples/help/contextsensitivehelp/main.cpp | 2 +- .../contextsensitivehelp/wateringconfigdialog.h | 2 +- examples/help/remotecontrol/main.cpp | 2 +- examples/help/remotecontrol/remotecontrol.cpp | 2 +- examples/help/remotecontrol/remotecontrol.h | 2 +- examples/help/remotecontrol/remotecontrol.pro | 1 + examples/help/simpletextviewer/assistant.cpp | 2 +- examples/help/simpletextviewer/findfiledialog.cpp | 18 +++++----- examples/help/simpletextviewer/findfiledialog.h | 2 +- examples/help/simpletextviewer/main.cpp | 2 +- examples/help/simpletextviewer/mainwindow.cpp | 10 +++--- examples/help/simpletextviewer/mainwindow.h | 2 +- .../help/simpletextviewer/simpletextviewer.pro | 2 ++ examples/help/simpletextviewer/textedit.h | 2 +- src/assistant/lib/lib.pro | 3 +- src/assistant/lib/qhelpcontentwidget.cpp | 2 +- src/assistant/lib/qhelpcontentwidget.h | 2 +- src/assistant/lib/qhelpengine.cpp | 2 +- src/assistant/lib/qhelpenginecore.cpp | 2 +- src/assistant/lib/qhelpindexwidget.cpp | 4 +-- src/assistant/lib/qhelpindexwidget.h | 4 +-- src/assistant/lib/qhelpsearchquerywidget.cpp | 12 +++---- src/assistant/lib/qhelpsearchquerywidget.h | 2 +- src/assistant/lib/qhelpsearchresultwidget.cpp | 16 ++++----- src/assistant/lib/qhelpsearchresultwidget.h | 2 +- src/assistant/tools/assistant/aboutdialog.cpp | 12 +++---- src/assistant/tools/assistant/aboutdialog.h | 4 +-- src/assistant/tools/assistant/assistant.pro | 2 +- src/assistant/tools/assistant/bookmarkdialog.cpp | 2 +- .../tools/assistant/bookmarkfiltermodel.h | 4 +-- src/assistant/tools/assistant/bookmarkmanager.cpp | 8 ++--- src/assistant/tools/assistant/bookmarkmanager.h | 2 +- .../tools/assistant/bookmarkmanagerwidget.cpp | 6 ++-- .../tools/assistant/bookmarkmanagerwidget.h | 2 +- src/assistant/tools/assistant/bookmarkmodel.cpp | 6 ++-- src/assistant/tools/assistant/bookmarkmodel.h | 2 +- src/assistant/tools/assistant/centralwidget.cpp | 14 ++++---- src/assistant/tools/assistant/centralwidget.h | 4 +-- src/assistant/tools/assistant/cmdlineparser.cpp | 2 +- src/assistant/tools/assistant/contentwindow.cpp | 4 +-- src/assistant/tools/assistant/contentwindow.h | 2 +- src/assistant/tools/assistant/filternamedialog.cpp | 2 +- src/assistant/tools/assistant/filternamedialog.h | 2 +- src/assistant/tools/assistant/findwidget.cpp | 12 +++---- src/assistant/tools/assistant/findwidget.h | 2 +- src/assistant/tools/assistant/globalactions.cpp | 4 +-- src/assistant/tools/assistant/helpviewer.h | 4 +-- src/assistant/tools/assistant/helpviewer_p.h | 2 +- src/assistant/tools/assistant/helpviewer_qtb.cpp | 4 +-- src/assistant/tools/assistant/helpviewer_qwv.cpp | 4 +-- src/assistant/tools/assistant/indexwindow.cpp | 10 +++--- src/assistant/tools/assistant/indexwindow.h | 4 +-- src/assistant/tools/assistant/installdialog.cpp | 4 +-- src/assistant/tools/assistant/installdialog.h | 2 +- src/assistant/tools/assistant/main.cpp | 2 +- src/assistant/tools/assistant/mainwindow.cpp | 30 ++++++++-------- src/assistant/tools/assistant/mainwindow.h | 2 +- src/assistant/tools/assistant/openpagesmanager.cpp | 4 +-- .../tools/assistant/openpagesswitcher.cpp | 2 +- src/assistant/tools/assistant/openpagesswitcher.h | 2 +- src/assistant/tools/assistant/openpageswidget.cpp | 6 ++-- src/assistant/tools/assistant/openpageswidget.h | 4 +-- .../tools/assistant/preferencesdialog.cpp | 10 +++--- src/assistant/tools/assistant/preferencesdialog.h | 2 +- src/assistant/tools/assistant/remotecontrol.cpp | 4 +-- src/assistant/tools/assistant/searchwidget.cpp | 8 ++--- src/assistant/tools/assistant/searchwidget.h | 2 +- src/assistant/tools/assistant/topicchooser.h | 2 +- .../tools/qhelpconverter/conversionwizard.cpp | 2 +- .../tools/qhelpconverter/conversionwizard.h | 2 +- src/assistant/tools/qhelpconverter/filespage.h | 2 +- src/assistant/tools/qhelpconverter/filterpage.cpp | 2 +- src/assistant/tools/qhelpconverter/filterpage.h | 2 +- src/assistant/tools/qhelpconverter/finishpage.cpp | 8 ++--- src/assistant/tools/qhelpconverter/finishpage.h | 2 +- src/assistant/tools/qhelpconverter/generalpage.cpp | 2 +- src/assistant/tools/qhelpconverter/generalpage.h | 2 +- src/assistant/tools/qhelpconverter/helpwindow.cpp | 6 ++-- src/assistant/tools/qhelpconverter/helpwindow.h | 2 +- .../tools/qhelpconverter/identifierpage.h | 2 +- src/assistant/tools/qhelpconverter/inputpage.cpp | 14 ++++---- src/assistant/tools/qhelpconverter/inputpage.h | 2 +- src/assistant/tools/qhelpconverter/main.cpp | 2 +- src/assistant/tools/qhelpconverter/outputpage.cpp | 2 +- src/assistant/tools/qhelpconverter/outputpage.h | 2 +- src/assistant/tools/qhelpconverter/pathpage.cpp | 2 +- src/assistant/tools/qhelpconverter/pathpage.h | 2 +- .../src/components/buddyeditor/buddyeditor.cpp | 8 ++--- .../components/buddyeditor/buddyeditor_plugin.cpp | 2 +- .../components/buddyeditor/buddyeditor_tool.cpp | 2 +- .../formeditor/default_actionprovider.cpp | 4 +-- .../components/formeditor/default_actionprovider.h | 6 ++-- .../src/components/formeditor/default_container.h | 10 +++--- .../components/formeditor/deviceprofiledialog.cpp | 8 ++--- .../components/formeditor/deviceprofiledialog.h | 2 +- .../src/components/formeditor/dpi_chooser.cpp | 14 ++++---- .../src/components/formeditor/dpi_chooser.h | 2 +- .../components/formeditor/embeddedoptionspage.cpp | 18 +++++----- .../components/formeditor/embeddedoptionspage.h | 2 +- .../formeditor/formeditor_optionspage.cpp | 8 ++--- .../src/components/formeditor/formwindow.cpp | 28 +++++++-------- .../components/formeditor/formwindow_dnditem.cpp | 2 +- .../formeditor/formwindow_widgetstack.cpp | 8 ++--- .../components/formeditor/formwindow_widgetstack.h | 2 +- .../components/formeditor/formwindowmanager.cpp | 18 +++++----- .../components/formeditor/formwindowsettings.cpp | 2 +- .../src/components/formeditor/formwindowsettings.h | 2 +- .../formeditor/itemview_propertysheet.cpp | 4 +-- .../components/formeditor/itemview_propertysheet.h | 4 +-- .../components/formeditor/layout_propertysheet.cpp | 2 +- .../components/formeditor/layout_propertysheet.h | 2 +- .../components/formeditor/line_propertysheet.cpp | 2 +- .../components/formeditor/previewactiongroup.cpp | 2 +- .../src/components/formeditor/previewactiongroup.h | 2 +- .../components/formeditor/qdesigner_resource.cpp | 42 +++++++++++----------- .../components/formeditor/qdesignerundostack.cpp | 4 +-- .../formeditor/qlayoutwidget_propertysheet.cpp | 2 +- .../formeditor/qmainwindow_container.cpp | 10 +++--- .../components/formeditor/qmainwindow_container.h | 2 +- .../components/formeditor/qmdiarea_container.cpp | 6 ++-- .../src/components/formeditor/qmdiarea_container.h | 4 +-- .../components/formeditor/qwizard_container.cpp | 4 +-- .../src/components/formeditor/qwizard_container.h | 4 +-- .../components/formeditor/qworkspace_container.cpp | 2 +- .../components/formeditor/qworkspace_container.h | 2 +- .../components/formeditor/spacer_propertysheet.cpp | 2 +- .../components/formeditor/templateoptionspage.h | 2 +- .../components/formeditor/tool_widgeteditor.cpp | 4 +-- .../src/components/formeditor/widgetselection.cpp | 14 ++++---- src/designer/src/components/lib/lib.pro | 2 +- .../components/objectinspector/objectinspector.cpp | 16 ++++----- .../objectinspector/objectinspectormodel.cpp | 10 +++--- .../objectinspector/objectinspectormodel_p.h | 4 +-- .../propertyeditor/brushpropertymanager.h | 2 +- .../propertyeditor/designerpropertymanager.cpp | 20 +++++------ .../propertyeditor/designerpropertymanager.h | 2 +- .../propertyeditor/newdynamicpropertydialog.cpp | 2 +- .../propertyeditor/newdynamicpropertydialog.h | 2 +- .../components/propertyeditor/paletteeditor.cpp | 6 ++-- .../src/components/propertyeditor/paletteeditor.h | 2 +- .../propertyeditor/paletteeditorbutton.h | 2 +- .../src/components/propertyeditor/previewframe.cpp | 4 +-- .../src/components/propertyeditor/previewframe.h | 2 +- .../components/propertyeditor/propertyeditor.cpp | 22 ++++++------ .../components/propertyeditor/stringlisteditor.cpp | 2 +- .../propertyeditor/stringlisteditorbutton.h | 2 +- .../components/signalsloteditor/connectdialog.cpp | 2 +- .../components/signalsloteditor/connectdialog_p.h | 2 +- .../signalsloteditor/signalsloteditor.cpp | 6 ++-- .../signalsloteditor/signalsloteditor_plugin.cpp | 2 +- .../signalsloteditor/signalsloteditor_tool.cpp | 2 +- .../signalsloteditor/signalsloteditorwindow.cpp | 30 ++++++++-------- .../signalsloteditor/signalsloteditorwindow.h | 2 +- .../components/tabordereditor/tabordereditor.cpp | 4 +-- .../src/components/tabordereditor/tabordereditor.h | 2 +- .../tabordereditor/tabordereditor_plugin.cpp | 2 +- .../tabordereditor/tabordereditor_tool.cpp | 2 +- .../src/components/taskmenu/button_taskmenu.cpp | 16 ++++----- .../src/components/taskmenu/button_taskmenu.h | 6 ++-- .../src/components/taskmenu/combobox_taskmenu.cpp | 10 +++--- .../src/components/taskmenu/combobox_taskmenu.h | 2 +- .../taskmenu/containerwidget_taskmenu.cpp | 20 +++++------ .../src/components/taskmenu/groupbox_taskmenu.cpp | 6 ++-- .../src/components/taskmenu/groupbox_taskmenu.h | 2 +- .../components/taskmenu/inplace_widget_helper.cpp | 6 ++-- .../src/components/taskmenu/itemlisteditor.cpp | 2 +- .../src/components/taskmenu/itemlisteditor.h | 2 +- .../src/components/taskmenu/label_taskmenu.cpp | 6 ++-- .../src/components/taskmenu/label_taskmenu.h | 2 +- .../src/components/taskmenu/layouttaskmenu.cpp | 2 +- .../src/components/taskmenu/lineedit_taskmenu.cpp | 6 ++-- .../src/components/taskmenu/lineedit_taskmenu.h | 2 +- .../components/taskmenu/listwidget_taskmenu.cpp | 8 ++--- .../src/components/taskmenu/listwidget_taskmenu.h | 2 +- .../src/components/taskmenu/listwidgeteditor.cpp | 6 ++-- .../src/components/taskmenu/listwidgeteditor.h | 2 +- .../src/components/taskmenu/menutaskmenu.cpp | 2 +- .../components/taskmenu/tablewidget_taskmenu.cpp | 10 +++--- .../src/components/taskmenu/tablewidget_taskmenu.h | 2 +- .../src/components/taskmenu/tablewidgeteditor.h | 2 +- .../src/components/taskmenu/textedit_taskmenu.cpp | 2 +- .../src/components/taskmenu/textedit_taskmenu.h | 4 +-- .../src/components/taskmenu/toolbar_taskmenu.cpp | 4 +-- .../src/components/taskmenu/toolbar_taskmenu.h | 4 +-- .../components/taskmenu/treewidget_taskmenu.cpp | 8 ++--- .../src/components/taskmenu/treewidget_taskmenu.h | 2 +- .../src/components/taskmenu/treewidgeteditor.cpp | 4 +-- .../src/components/taskmenu/treewidgeteditor.h | 2 +- .../src/components/widgetbox/widgetbox.cpp | 8 ++--- .../src/components/widgetbox/widgetbox_dnditem.cpp | 4 +-- .../widgetbox/widgetboxcategorylistview.cpp | 10 +++--- .../widgetbox/widgetboxcategorylistview.h | 2 +- .../components/widgetbox/widgetboxtreewidget.cpp | 12 +++---- .../src/components/widgetbox/widgetboxtreewidget.h | 4 +-- src/designer/src/designer/appfontdialog.cpp | 18 +++++----- src/designer/src/designer/appfontdialog.h | 4 +-- src/designer/src/designer/designer.pro | 2 +- src/designer/src/designer/mainwindow.cpp | 14 ++++---- src/designer/src/designer/mainwindow.h | 4 +-- src/designer/src/designer/newform.cpp | 16 ++++----- src/designer/src/designer/newform.h | 2 +- src/designer/src/designer/preferencesdialog.cpp | 4 +-- src/designer/src/designer/preferencesdialog.h | 2 +- src/designer/src/designer/qdesigner.cpp | 6 ++-- src/designer/src/designer/qdesigner.h | 2 +- src/designer/src/designer/qdesigner_actions.cpp | 24 ++++++------- .../src/designer/qdesigner_appearanceoptions.h | 2 +- src/designer/src/designer/qdesigner_formwindow.cpp | 12 +++---- src/designer/src/designer/qdesigner_formwindow.h | 2 +- src/designer/src/designer/qdesigner_pch.h | 6 ++-- src/designer/src/designer/qdesigner_settings.cpp | 6 ++-- src/designer/src/designer/qdesigner_toolwindow.cpp | 2 +- src/designer/src/designer/qdesigner_toolwindow.h | 2 +- src/designer/src/designer/qdesigner_workbench.cpp | 22 ++++++------ src/designer/src/designer/saveformastemplate.cpp | 6 ++-- src/designer/src/designer/versiondialog.cpp | 10 +++--- src/designer/src/designer/versiondialog.h | 2 +- src/designer/src/lib/lib.pro | 2 +- src/designer/src/lib/lib_pch.h | 6 ++-- src/designer/src/lib/sdk/abstractactioneditor.h | 2 +- src/designer/src/lib/sdk/abstractdialoggui_p.h | 4 +-- src/designer/src/lib/sdk/abstractformeditor.cpp | 2 +- src/designer/src/lib/sdk/abstractformwindow.cpp | 16 ++++----- src/designer/src/lib/sdk/abstractformwindow.h | 2 +- src/designer/src/lib/sdk/abstractnewformwidget.h | 2 +- src/designer/src/lib/sdk/abstractobjectinspector.h | 2 +- src/designer/src/lib/sdk/abstractpropertyeditor.h | 2 +- src/designer/src/lib/sdk/abstractresourcebrowser.h | 2 +- src/designer/src/lib/sdk/abstractwidgetbox.h | 4 +-- src/designer/src/lib/shared/actioneditor.cpp | 24 ++++++------- src/designer/src/lib/shared/actionprovider_p.h | 2 +- src/designer/src/lib/shared/actionrepository.cpp | 12 +++---- src/designer/src/lib/shared/actionrepository_p.h | 10 +++--- src/designer/src/lib/shared/codedialog.cpp | 20 +++++------ src/designer/src/lib/shared/codedialog_p.h | 2 +- src/designer/src/lib/shared/connectionedit.cpp | 6 ++-- src/designer/src/lib/shared/connectionedit_p.h | 4 +-- src/designer/src/lib/shared/deviceprofile.cpp | 10 +++--- src/designer/src/lib/shared/dialoggui.cpp | 4 +-- src/designer/src/lib/shared/filterwidget.cpp | 12 +++---- src/designer/src/lib/shared/filterwidget_p.h | 6 ++-- src/designer/src/lib/shared/formlayoutmenu.cpp | 12 +++---- src/designer/src/lib/shared/formwindowbase.cpp | 24 ++++++------- src/designer/src/lib/shared/grid.cpp | 2 +- src/designer/src/lib/shared/gridpanel_p.h | 2 +- src/designer/src/lib/shared/htmlhighlighter.cpp | 3 +- src/designer/src/lib/shared/htmlhighlighter_p.h | 2 ++ src/designer/src/lib/shared/iconloader.cpp | 2 +- src/designer/src/lib/shared/iconselector.cpp | 26 +++++++------- src/designer/src/lib/shared/iconselector_p.h | 4 +-- src/designer/src/lib/shared/invisible_widget_p.h | 2 +- src/designer/src/lib/shared/layout.cpp | 20 +++++------ src/designer/src/lib/shared/layout_p.h | 6 ++-- src/designer/src/lib/shared/layoutinfo.cpp | 6 ++-- src/designer/src/lib/shared/metadatabase.cpp | 2 +- src/designer/src/lib/shared/morphmenu.cpp | 36 +++++++++---------- src/designer/src/lib/shared/newactiondialog.cpp | 2 +- src/designer/src/lib/shared/newactiondialog_p.h | 2 +- src/designer/src/lib/shared/newformwidget.cpp | 6 ++-- src/designer/src/lib/shared/newformwidget_p.h | 2 +- src/designer/src/lib/shared/orderdialog.cpp | 2 +- src/designer/src/lib/shared/orderdialog_p.h | 2 +- src/designer/src/lib/shared/plaintexteditor.cpp | 8 ++--- src/designer/src/lib/shared/plaintexteditor_p.h | 2 +- src/designer/src/lib/shared/plugindialog.cpp | 6 ++-- .../src/lib/shared/previewconfigurationwidget.cpp | 8 ++--- .../src/lib/shared/previewconfigurationwidget_p.h | 2 +- src/designer/src/lib/shared/previewmanager.cpp | 20 +++++------ src/designer/src/lib/shared/promotionmodel.cpp | 2 +- src/designer/src/lib/shared/promotionmodel_p.h | 2 +- src/designer/src/lib/shared/promotiontaskmenu.cpp | 6 ++-- src/designer/src/lib/shared/propertylineedit.cpp | 2 +- src/designer/src/lib/shared/propertylineedit_p.h | 2 +- src/designer/src/lib/shared/qdesigner_command.cpp | 32 ++++++++--------- src/designer/src/lib/shared/qdesigner_command2.cpp | 4 +-- src/designer/src/lib/shared/qdesigner_command2_p.h | 2 +- src/designer/src/lib/shared/qdesigner_command_p.h | 2 +- src/designer/src/lib/shared/qdesigner_dnditem.cpp | 2 +- .../src/lib/shared/qdesigner_dockwidget.cpp | 4 +-- .../src/lib/shared/qdesigner_dockwidget_p.h | 2 +- .../src/lib/shared/qdesigner_formbuilder.cpp | 20 +++++------ .../src/lib/shared/qdesigner_formeditorcommand_p.h | 2 +- .../src/lib/shared/qdesigner_formwindowcommand.cpp | 4 +-- .../src/lib/shared/qdesigner_formwindowcommand_p.h | 2 +- .../src/lib/shared/qdesigner_membersheet.cpp | 2 +- src/designer/src/lib/shared/qdesigner_menu.cpp | 13 +++---- src/designer/src/lib/shared/qdesigner_menu_p.h | 4 +-- src/designer/src/lib/shared/qdesigner_menubar.cpp | 4 +-- src/designer/src/lib/shared/qdesigner_menubar_p.h | 4 +-- .../src/lib/shared/qdesigner_promotiondialog.cpp | 32 ++++++++--------- .../src/lib/shared/qdesigner_promotiondialog_p.h | 4 +-- .../src/lib/shared/qdesigner_propertycommand.cpp | 12 +++---- .../src/lib/shared/qdesigner_propertyeditor.cpp | 6 ++-- .../src/lib/shared/qdesigner_propertysheet.cpp | 20 +++++------ .../src/lib/shared/qdesigner_stackedbox.cpp | 8 ++--- .../src/lib/shared/qdesigner_tabwidget.cpp | 13 +++---- .../src/lib/shared/qdesigner_tabwidget_p.h | 2 +- src/designer/src/lib/shared/qdesigner_taskmenu.cpp | 20 +++++------ src/designer/src/lib/shared/qdesigner_toolbar.cpp | 13 +++---- src/designer/src/lib/shared/qdesigner_toolbar_p.h | 4 +-- src/designer/src/lib/shared/qdesigner_toolbox.cpp | 10 +++--- src/designer/src/lib/shared/qdesigner_utils.cpp | 12 +++---- src/designer/src/lib/shared/qdesigner_utils_p.h | 4 +-- src/designer/src/lib/shared/qdesigner_widget.cpp | 4 +-- src/designer/src/lib/shared/qdesigner_widget_p.h | 4 +-- .../src/lib/shared/qdesigner_widgetitem.cpp | 10 +++--- .../src/lib/shared/qdesigner_widgetitem_p.h | 2 +- src/designer/src/lib/shared/qlayout_widget.cpp | 8 ++--- src/designer/src/lib/shared/qlayout_widget_p.h | 4 +-- src/designer/src/lib/shared/qsimpleresource.cpp | 6 ++-- .../src/lib/shared/qtresourceeditordialog.cpp | 12 +++---- .../src/lib/shared/qtresourceeditordialog_p.h | 2 +- src/designer/src/lib/shared/qtresourceview.cpp | 24 ++++++------- src/designer/src/lib/shared/qtresourceview_p.h | 4 +-- src/designer/src/lib/shared/richtexteditor.cpp | 24 ++++++------- src/designer/src/lib/shared/richtexteditor_p.h | 4 +-- src/designer/src/lib/shared/scriptdialog.cpp | 10 +++--- src/designer/src/lib/shared/scriptdialog_p.h | 2 +- src/designer/src/lib/shared/scripterrordialog.cpp | 8 ++--- src/designer/src/lib/shared/scripterrordialog_p.h | 2 +- src/designer/src/lib/shared/sheet_delegate.cpp | 4 +-- src/designer/src/lib/shared/sheet_delegate_p.h | 4 +-- src/designer/src/lib/shared/signalslotdialog.cpp | 10 +++--- src/designer/src/lib/shared/signalslotdialog_p.h | 4 +-- src/designer/src/lib/shared/spacer_widget.cpp | 2 +- src/designer/src/lib/shared/spacer_widget_p.h | 4 +-- src/designer/src/lib/shared/stylesheeteditor.cpp | 18 +++++----- src/designer/src/lib/shared/stylesheeteditor_p.h | 6 ++-- src/designer/src/lib/shared/textpropertyeditor.cpp | 6 ++-- src/designer/src/lib/shared/textpropertyeditor_p.h | 2 +- src/designer/src/lib/shared/widgetdatabase_p.h | 2 +- src/designer/src/lib/shared/widgetfactory.cpp | 18 +++++----- src/designer/src/lib/shared/zoomwidget.cpp | 12 +++---- src/designer/src/lib/shared/zoomwidget_p.h | 4 +-- .../src/plugins/activeqt/qaxwidgetplugin.cpp | 2 +- .../src/plugins/activeqt/qaxwidgettaskmenu.cpp | 6 ++-- .../src/plugins/activeqt/qdesigneraxwidget.cpp | 4 +-- .../src/plugins/activeqt/qdesigneraxwidget.h | 2 +- .../src/plugins/phononwidgets/phononwidgets.pro | 2 +- .../plugins/phononwidgets/videoplayertaskmenu.cpp | 12 +++---- .../plugins/qdeclarativeview/qdeclarativeview.pro | 2 +- src/designer/src/plugins/qwebview/qwebview.pro | 2 +- src/designer/src/plugins/tools/view3d/view3d.h | 2 +- .../src/plugins/tools/view3d/view3d_plugin.cpp | 2 +- .../src/plugins/tools/view3d/view3d_tool.cpp | 2 +- src/linguist/linguist/batchtranslationdialog.cpp | 4 +-- src/linguist/linguist/batchtranslationdialog.h | 4 +-- src/linguist/linguist/errorsview.cpp | 10 +++--- src/linguist/linguist/formpreviewview.cpp | 26 +++++++------- src/linguist/linguist/formpreviewview.h | 2 +- src/linguist/linguist/linguist.pro | 2 +- src/linguist/linguist/main.cpp | 6 ++-- src/linguist/linguist/mainwindow.h | 2 +- src/linguist/linguist/messageeditor.h | 4 +-- src/linguist/linguist/messagehighlighter.cpp | 3 +- src/linguist/linguist/messagehighlighter.h | 2 ++ src/linguist/linguist/messagemodel.cpp | 2 +- src/linguist/linguist/translationsettingsdialog.h | 2 +- src/pixeltool/pixeltool.pro | 2 +- src/qdbus/qdbusviewer/main.cpp | 9 +++-- src/qdbus/qdbusviewer/qdbusviewer.cpp | 17 ++++++++- src/qdbus/qdbusviewer/qdbusviewer.h | 14 +++++--- src/qdbus/qdbusviewer/qdbusviewer.pro | 2 +- src/qmeegographicssystemhelper/qmeegoruntime.cpp | 4 +-- src/qtconfig/mainwindow.cpp | 2 +- src/qtconfig/mainwindow.h | 2 +- src/qtconfig/paletteeditoradvanced.h | 2 +- src/qtconfig/previewwidget.h | 2 +- src/qttracereplay/main.cpp | 9 +++-- src/qttracereplay/qttracereplay.pro | 2 +- .../symbianutils/bluetoothlistener_gui.cpp | 4 +-- src/shared/deviceskin/deviceskin.cpp | 2 +- src/shared/deviceskin/deviceskin.h | 2 +- src/shared/findwidget/abstractfindwidget.cpp | 12 +++---- src/shared/findwidget/abstractfindwidget.h | 4 +-- src/shared/findwidget/itemviewfindwidget.cpp | 6 ++-- src/shared/findwidget/texteditfindwidget.cpp | 4 +-- src/shared/fontpanel/fontpanel.cpp | 12 +++---- src/shared/fontpanel/fontpanel.h | 2 +- src/shared/qtgradienteditor/qtcolorbutton.cpp | 5 +-- src/shared/qtgradienteditor/qtcolorbutton.h | 2 +- src/shared/qtgradienteditor/qtcolorline.cpp | 2 +- src/shared/qtgradienteditor/qtcolorline.h | 2 +- src/shared/qtgradienteditor/qtgradientdialog.cpp | 2 +- src/shared/qtgradienteditor/qtgradientdialog.h | 2 +- src/shared/qtgradienteditor/qtgradienteditor.h | 2 +- .../qtgradienteditor/qtgradientstopscontroller.h | 2 +- .../qtgradienteditor/qtgradientstopswidget.cpp | 6 ++-- .../qtgradienteditor/qtgradientstopswidget.h | 2 +- src/shared/qtgradienteditor/qtgradientview.cpp | 2 +- src/shared/qtgradienteditor/qtgradientview.h | 2 +- .../qtgradienteditor/qtgradientviewdialog.cpp | 2 +- src/shared/qtgradienteditor/qtgradientviewdialog.h | 2 +- src/shared/qtgradienteditor/qtgradientwidget.cpp | 2 +- src/shared/qtgradienteditor/qtgradientwidget.h | 2 +- .../qtpropertybrowser/qtbuttonpropertybrowser.cpp | 8 ++--- src/shared/qtpropertybrowser/qteditorfactory.cpp | 28 +++++++-------- .../qtgroupboxpropertybrowser.cpp | 6 ++-- src/shared/qtpropertybrowser/qtpropertybrowser.cpp | 2 +- src/shared/qtpropertybrowser/qtpropertybrowser.h | 2 +- .../qtpropertybrowser/qtpropertybrowserutils.cpp | 10 +++--- .../qtpropertybrowser/qtpropertybrowserutils_p.h | 4 +-- src/shared/qtpropertybrowser/qtpropertymanager.cpp | 10 +++--- .../qtpropertybrowser/qttreepropertybrowser.cpp | 14 ++++---- src/shared/qtpropertybrowser/qtvariantproperty.cpp | 2 +- src/shared/qtpropertybrowser/qtvariantproperty.h | 2 +- src/shared/qttoolbardialog/qttoolbardialog.cpp | 10 +++--- src/shared/qttoolbardialog/qttoolbardialog.h | 2 +- 423 files changed, 1244 insertions(+), 1188 deletions(-) diff --git a/demos/arthurplugin/plugin.cpp b/demos/arthurplugin/plugin.cpp index 336e88da6..a2b07cd12 100644 --- a/demos/arthurplugin/plugin.cpp +++ b/demos/arthurplugin/plugin.cpp @@ -43,8 +43,8 @@ #include #include -#include -#include +#include +#include #include "xform.h" #include "pathdeform.h" diff --git a/examples/designer/calculatorbuilder/calculatorbuilder.pro b/examples/designer/calculatorbuilder/calculatorbuilder.pro index bf4fb1d13..1e0a35e42 100644 --- a/examples/designer/calculatorbuilder/calculatorbuilder.pro +++ b/examples/designer/calculatorbuilder/calculatorbuilder.pro @@ -5,6 +5,7 @@ HEADERS = calculatorform.h RESOURCES = calculatorbuilder.qrc SOURCES = calculatorform.cpp \ main.cpp +QT += widgets #! [0] # install diff --git a/examples/designer/calculatorbuilder/calculatorform.cpp b/examples/designer/calculatorbuilder/calculatorform.cpp index e14efa497..cc559e54a 100644 --- a/examples/designer/calculatorbuilder/calculatorform.cpp +++ b/examples/designer/calculatorbuilder/calculatorform.cpp @@ -41,7 +41,9 @@ //! [0] #include //! [0] -#include +#include +#include +#include #include "calculatorform.h" diff --git a/examples/designer/calculatorform/calculatorform.pro b/examples/designer/calculatorform/calculatorform.pro index 757d313c7..b2a7427c6 100644 --- a/examples/designer/calculatorform/calculatorform.pro +++ b/examples/designer/calculatorform/calculatorform.pro @@ -5,6 +5,7 @@ FORMS = calculatorform.ui #! [1] SOURCES = calculatorform.cpp \ main.cpp +QT += widgets # install target.path = $$[QT_INSTALL_EXAMPLES]/qttools/designer/calculatorform diff --git a/examples/designer/containerextension/containerextension.pro b/examples/designer/containerextension/containerextension.pro index a7bc02f4c..fc7a1ff81 100644 --- a/examples/designer/containerextension/containerextension.pro +++ b/examples/designer/containerextension/containerextension.pro @@ -4,6 +4,7 @@ TEMPLATE = lib TARGET = $$qtLibraryTarget($$TARGET) #! [1] CONFIG += designer plugin +QT += widgets #! [1] DESTDIR = $$QT.designer.plugins/designer diff --git a/examples/designer/containerextension/multipagewidget.cpp b/examples/designer/containerextension/multipagewidget.cpp index 5b44f36d2..ff2418b0c 100644 --- a/examples/designer/containerextension/multipagewidget.cpp +++ b/examples/designer/containerextension/multipagewidget.cpp @@ -38,7 +38,9 @@ ** ****************************************************************************/ -#include +#include +#include +#include #include "multipagewidget.h" diff --git a/examples/designer/customwidgetplugin/customwidgetplugin.pro b/examples/designer/customwidgetplugin/customwidgetplugin.pro index 3af8cc133..e70fe6575 100644 --- a/examples/designer/customwidgetplugin/customwidgetplugin.pro +++ b/examples/designer/customwidgetplugin/customwidgetplugin.pro @@ -1,5 +1,6 @@ #! [0] #! [1] CONFIG += designer plugin +QT += widgets #! [0] TARGET = $$qtLibraryTarget($$TARGET) #! [2] diff --git a/examples/designer/taskmenuextension/taskmenuextension.pro b/examples/designer/taskmenuextension/taskmenuextension.pro index 4e5df7d1b..aaf3ab89c 100644 --- a/examples/designer/taskmenuextension/taskmenuextension.pro +++ b/examples/designer/taskmenuextension/taskmenuextension.pro @@ -4,6 +4,7 @@ TEMPLATE = lib TARGET = $$qtLibraryTarget($$TARGET) #! [1] CONFIG += designer plugin +QT += widgets #! [1] DESTDIR = $$QT.designer.plugins/designer diff --git a/examples/designer/taskmenuextension/tictactoedialog.cpp b/examples/designer/taskmenuextension/tictactoedialog.cpp index 5af3c6f30..5b6a8c4a3 100644 --- a/examples/designer/taskmenuextension/tictactoedialog.cpp +++ b/examples/designer/taskmenuextension/tictactoedialog.cpp @@ -38,7 +38,9 @@ ** ****************************************************************************/ -#include +#include +#include +#include #include #include "tictactoe.h" diff --git a/examples/designer/worldtimeclockbuilder/main.cpp b/examples/designer/worldtimeclockbuilder/main.cpp index 680394190..e54a95a99 100644 --- a/examples/designer/worldtimeclockbuilder/main.cpp +++ b/examples/designer/worldtimeclockbuilder/main.cpp @@ -41,8 +41,8 @@ //! [0] #include //! [0] -#include - +#include +#include //! [1] int main(int argc, char *argv[]) { diff --git a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro index 6d1164d55..005e35043 100644 --- a/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro +++ b/examples/designer/worldtimeclockbuilder/worldtimeclockbuilder.pro @@ -1,5 +1,6 @@ #! [0] CONFIG += uitools +QT += widgets SOURCES = main.cpp RESOURCES = worldtimeclockbuilder.qrc #! [0] diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro index e394a3dc8..8caad5e92 100644 --- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro +++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.pro @@ -1,5 +1,6 @@ #! [0] CONFIG += designer plugin +QT += widgets #! [0] TARGET = $$qtLibraryTarget($$TARGET) #! [1] diff --git a/examples/help/contextsensitivehelp/contextsensitivehelp.pro b/examples/help/contextsensitivehelp/contextsensitivehelp.pro index 8941dcbb1..9fa1a2a66 100644 --- a/examples/help/contextsensitivehelp/contextsensitivehelp.pro +++ b/examples/help/contextsensitivehelp/contextsensitivehelp.pro @@ -1,7 +1,7 @@ TEMPLATE = app CONFIG += help - +QT += widgets SOURCES += main.cpp \ wateringconfigdialog.cpp \ helpbrowser.cpp diff --git a/examples/help/contextsensitivehelp/helpbrowser.cpp b/examples/help/contextsensitivehelp/helpbrowser.cpp index d37a72f3b..2182cf57b 100644 --- a/examples/help/contextsensitivehelp/helpbrowser.cpp +++ b/examples/help/contextsensitivehelp/helpbrowser.cpp @@ -39,7 +39,7 @@ ****************************************************************************/ #include -#include +#include #include #include "helpbrowser.h" diff --git a/examples/help/contextsensitivehelp/helpbrowser.h b/examples/help/contextsensitivehelp/helpbrowser.h index 684ed6827..245772ac9 100644 --- a/examples/help/contextsensitivehelp/helpbrowser.h +++ b/examples/help/contextsensitivehelp/helpbrowser.h @@ -41,7 +41,7 @@ #ifndef HELPBROWSER_H #define HELPBROWSER_H -#include +#include QT_BEGIN_NAMESPACE class QHelpEngineCore; diff --git a/examples/help/contextsensitivehelp/main.cpp b/examples/help/contextsensitivehelp/main.cpp index ca15d9fb6..d635db298 100644 --- a/examples/help/contextsensitivehelp/main.cpp +++ b/examples/help/contextsensitivehelp/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "wateringconfigdialog.h" diff --git a/examples/help/contextsensitivehelp/wateringconfigdialog.h b/examples/help/contextsensitivehelp/wateringconfigdialog.h index d1fd98643..835c46ec0 100644 --- a/examples/help/contextsensitivehelp/wateringconfigdialog.h +++ b/examples/help/contextsensitivehelp/wateringconfigdialog.h @@ -41,7 +41,7 @@ #ifndef WATERINGCONFIGDIALOG_H #define WATERINGCONFIGDIALOG_H -#include +#include #include "ui_wateringconfigdialog.h" class WateringConfigDialog : public QDialog diff --git a/examples/help/remotecontrol/main.cpp b/examples/help/remotecontrol/main.cpp index ad561ce4f..583c2e494 100644 --- a/examples/help/remotecontrol/main.cpp +++ b/examples/help/remotecontrol/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "remotecontrol.h" int main(int argc, char *argv[]) diff --git a/examples/help/remotecontrol/remotecontrol.cpp b/examples/help/remotecontrol/remotecontrol.cpp index 45d3fde82..d666489fb 100644 --- a/examples/help/remotecontrol/remotecontrol.cpp +++ b/examples/help/remotecontrol/remotecontrol.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include "remotecontrol.h" diff --git a/examples/help/remotecontrol/remotecontrol.h b/examples/help/remotecontrol/remotecontrol.h index e440add3f..16bd3f33c 100644 --- a/examples/help/remotecontrol/remotecontrol.h +++ b/examples/help/remotecontrol/remotecontrol.h @@ -41,7 +41,7 @@ #ifndef REMOTECONTROL_H #define REMOTECONTROL_H -#include +#include #include "ui_remotecontrol.h" QT_BEGIN_NAMESPACE diff --git a/examples/help/remotecontrol/remotecontrol.pro b/examples/help/remotecontrol/remotecontrol.pro index 2212db040..79fb7c1be 100644 --- a/examples/help/remotecontrol/remotecontrol.pro +++ b/examples/help/remotecontrol/remotecontrol.pro @@ -1,4 +1,5 @@ TEMPLATE = app +QT += widgets HEADERS += remotecontrol.h SOURCES += main.cpp \ diff --git a/examples/help/simpletextviewer/assistant.cpp b/examples/help/simpletextviewer/assistant.cpp index 2223b4bbf..392f2260e 100644 --- a/examples/help/simpletextviewer/assistant.cpp +++ b/examples/help/simpletextviewer/assistant.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include "assistant.h" diff --git a/examples/help/simpletextviewer/findfiledialog.cpp b/examples/help/simpletextviewer/findfiledialog.cpp index 086be965d..bbaf038d7 100644 --- a/examples/help/simpletextviewer/findfiledialog.cpp +++ b/examples/help/simpletextviewer/findfiledialog.cpp @@ -39,15 +39,15 @@ ****************************************************************************/ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "findfiledialog.h" #include "assistant.h" diff --git a/examples/help/simpletextviewer/findfiledialog.h b/examples/help/simpletextviewer/findfiledialog.h index 71abd4aac..9df00edbd 100644 --- a/examples/help/simpletextviewer/findfiledialog.h +++ b/examples/help/simpletextviewer/findfiledialog.h @@ -41,7 +41,7 @@ #ifndef FINDFILEDIALOG_H #define FINDFILEDIALOG_H -#include +#include QT_BEGIN_NAMESPACE class QComboBox; diff --git a/examples/help/simpletextviewer/main.cpp b/examples/help/simpletextviewer/main.cpp index 4c8aab9c8..8780e0d3a 100644 --- a/examples/help/simpletextviewer/main.cpp +++ b/examples/help/simpletextviewer/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "mainwindow.h" diff --git a/examples/help/simpletextviewer/mainwindow.cpp b/examples/help/simpletextviewer/mainwindow.cpp index 61fbdf3cb..c84c78c2f 100644 --- a/examples/help/simpletextviewer/mainwindow.cpp +++ b/examples/help/simpletextviewer/mainwindow.cpp @@ -39,11 +39,11 @@ ****************************************************************************/ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "mainwindow.h" #include "findfiledialog.h" diff --git a/examples/help/simpletextviewer/mainwindow.h b/examples/help/simpletextviewer/mainwindow.h index 4fab382f2..8c2f84123 100644 --- a/examples/help/simpletextviewer/mainwindow.h +++ b/examples/help/simpletextviewer/mainwindow.h @@ -41,7 +41,7 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include class Assistant; class TextEdit; diff --git a/examples/help/simpletextviewer/simpletextviewer.pro b/examples/help/simpletextviewer/simpletextviewer.pro index b51c141c0..5ef14c44a 100644 --- a/examples/help/simpletextviewer/simpletextviewer.pro +++ b/examples/help/simpletextviewer/simpletextviewer.pro @@ -8,6 +8,8 @@ SOURCES = main.cpp \ assistant.cpp \ textedit.cpp +QT += widgets + # install target.path = $$[QT_INSTALL_EXAMPLES]/qttools/help/simpletextviewer sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro diff --git a/examples/help/simpletextviewer/textedit.h b/examples/help/simpletextviewer/textedit.h index b9ecabd1d..6222ac189 100644 --- a/examples/help/simpletextviewer/textedit.h +++ b/examples/help/simpletextviewer/textedit.h @@ -42,7 +42,7 @@ #define TEXTEDIT_H #include -#include +#include class TextEdit : public QTextEdit { diff --git a/src/assistant/lib/lib.pro b/src/assistant/lib/lib.pro index f524aaa61..280c77915 100644 --- a/src/assistant/lib/lib.pro +++ b/src/assistant/lib/lib.pro @@ -1,6 +1,7 @@ load(qt_module) -QT += sql \ +QT += widgets \ + sql \ xml \ network \ core-private diff --git a/src/assistant/lib/qhelpcontentwidget.cpp b/src/assistant/lib/qhelpcontentwidget.cpp index 988a909e0..7e3cb93d1 100644 --- a/src/assistant/lib/qhelpcontentwidget.cpp +++ b/src/assistant/lib/qhelpcontentwidget.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/lib/qhelpcontentwidget.h b/src/assistant/lib/qhelpcontentwidget.h index 0e7567e20..ab7d80a43 100644 --- a/src/assistant/lib/qhelpcontentwidget.h +++ b/src/assistant/lib/qhelpcontentwidget.h @@ -46,7 +46,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/assistant/lib/qhelpengine.cpp b/src/assistant/lib/qhelpengine.cpp index f11b52a9c..007cc84a9 100644 --- a/src/assistant/lib/qhelpengine.cpp +++ b/src/assistant/lib/qhelpengine.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/assistant/lib/qhelpenginecore.cpp b/src/assistant/lib/qhelpenginecore.cpp index 1fd22428d..178e11ee6 100644 --- a/src/assistant/lib/qhelpenginecore.cpp +++ b/src/assistant/lib/qhelpenginecore.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/assistant/lib/qhelpindexwidget.cpp b/src/assistant/lib/qhelpindexwidget.cpp index 82d402442..1b34ca0aa 100644 --- a/src/assistant/lib/qhelpindexwidget.cpp +++ b/src/assistant/lib/qhelpindexwidget.cpp @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/lib/qhelpindexwidget.h b/src/assistant/lib/qhelpindexwidget.h index 0c4d307aa..41e66f647 100644 --- a/src/assistant/lib/qhelpindexwidget.h +++ b/src/assistant/lib/qhelpindexwidget.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/assistant/lib/qhelpsearchquerywidget.cpp b/src/assistant/lib/qhelpsearchquerywidget.cpp index e6a789a40..55974ada5 100644 --- a/src/assistant/lib/qhelpsearchquerywidget.cpp +++ b/src/assistant/lib/qhelpsearchquerywidget.cpp @@ -46,13 +46,13 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchquerywidget.h b/src/assistant/lib/qhelpsearchquerywidget.h index e9fb61ceb..e438df0b5 100644 --- a/src/assistant/lib/qhelpsearchquerywidget.h +++ b/src/assistant/lib/qhelpsearchquerywidget.h @@ -49,7 +49,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/assistant/lib/qhelpsearchresultwidget.cpp b/src/assistant/lib/qhelpsearchresultwidget.cpp index 2b5845062..964185b5e 100644 --- a/src/assistant/lib/qhelpsearchresultwidget.cpp +++ b/src/assistant/lib/qhelpsearchresultwidget.cpp @@ -46,15 +46,15 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchresultwidget.h b/src/assistant/lib/qhelpsearchresultwidget.h index cd6ac1051..f9300e979 100644 --- a/src/assistant/lib/qhelpsearchresultwidget.h +++ b/src/assistant/lib/qhelpsearchresultwidget.h @@ -49,7 +49,7 @@ #include #include -#include +#include QT_BEGIN_HEADER diff --git a/src/assistant/tools/assistant/aboutdialog.cpp b/src/assistant/tools/assistant/aboutdialog.cpp index b4c390e90..d306812bb 100644 --- a/src/assistant/tools/assistant/aboutdialog.cpp +++ b/src/assistant/tools/assistant/aboutdialog.cpp @@ -46,12 +46,12 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/aboutdialog.h b/src/assistant/tools/assistant/aboutdialog.h index 292312d05..70b315714 100644 --- a/src/assistant/tools/assistant/aboutdialog.h +++ b/src/assistant/tools/assistant/aboutdialog.h @@ -42,8 +42,8 @@ #ifndef ABOUTDIALOG_H #define ABOUTDIALOG_H -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/assistant.pro b/src/assistant/tools/assistant/assistant.pro index eeee0ad46..dc8928bad 100644 --- a/src/assistant/tools/assistant/assistant.pro +++ b/src/assistant/tools/assistant/assistant.pro @@ -10,7 +10,7 @@ TARGET = assistant CONFIG += qt \ warn_on \ help -QT += network help +QT += widgets network help PROJECTNAME = Assistant DESTDIR = $$QT.designer.bins target.path = $$[QT_INSTALL_BINS] diff --git a/src/assistant/tools/assistant/bookmarkdialog.cpp b/src/assistant/tools/assistant/bookmarkdialog.cpp index d2f88f968..e3cd9ac60 100644 --- a/src/assistant/tools/assistant/bookmarkdialog.cpp +++ b/src/assistant/tools/assistant/bookmarkdialog.cpp @@ -46,7 +46,7 @@ #include "tracer.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkfiltermodel.h b/src/assistant/tools/assistant/bookmarkfiltermodel.h index 65ed12f20..310e27512 100644 --- a/src/assistant/tools/assistant/bookmarkfiltermodel.h +++ b/src/assistant/tools/assistant/bookmarkfiltermodel.h @@ -43,8 +43,8 @@ #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkmanager.cpp b/src/assistant/tools/assistant/bookmarkmanager.cpp index 87331463b..29d8567a7 100644 --- a/src/assistant/tools/assistant/bookmarkmanager.cpp +++ b/src/assistant/tools/assistant/bookmarkmanager.cpp @@ -49,11 +49,11 @@ #include "centralwidget.h" #include "helpenginewrapper.h" -#include +#include #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkmanager.h b/src/assistant/tools/assistant/bookmarkmanager.h index f5823a7fa..0b6275af9 100644 --- a/src/assistant/tools/assistant/bookmarkmanager.h +++ b/src/assistant/tools/assistant/bookmarkmanager.h @@ -42,7 +42,7 @@ #define BOOKMARKMANAGER_H #include -#include +#include #include "ui_bookmarkwidget.h" diff --git a/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp b/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp index dd410d3a2..87a1f65be 100644 --- a/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp +++ b/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp @@ -49,10 +49,10 @@ #include #include -#include +#include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkmanagerwidget.h b/src/assistant/tools/assistant/bookmarkmanagerwidget.h index a0dec72a6..5c461b937 100644 --- a/src/assistant/tools/assistant/bookmarkmanagerwidget.h +++ b/src/assistant/tools/assistant/bookmarkmanagerwidget.h @@ -45,7 +45,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkmodel.cpp b/src/assistant/tools/assistant/bookmarkmodel.cpp index 5a02aa03d..d27731642 100644 --- a/src/assistant/tools/assistant/bookmarkmodel.cpp +++ b/src/assistant/tools/assistant/bookmarkmodel.cpp @@ -44,9 +44,9 @@ #include #include -#include -#include -#include +#include +#include +#include const quint32 VERSION = 0xe53798; const QLatin1String MIMETYPE("application/bookmarks.assistant"); diff --git a/src/assistant/tools/assistant/bookmarkmodel.h b/src/assistant/tools/assistant/bookmarkmodel.h index 33c9e981d..e23e9c41a 100644 --- a/src/assistant/tools/assistant/bookmarkmodel.h +++ b/src/assistant/tools/assistant/bookmarkmodel.h @@ -43,7 +43,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/centralwidget.cpp b/src/assistant/tools/assistant/centralwidget.cpp index c8c454f60..da27f033d 100644 --- a/src/assistant/tools/assistant/centralwidget.cpp +++ b/src/assistant/tools/assistant/centralwidget.cpp @@ -51,14 +51,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/assistant/tools/assistant/centralwidget.h b/src/assistant/tools/assistant/centralwidget.h index 2645fa8df..cdf132a1f 100644 --- a/src/assistant/tools/assistant/centralwidget.h +++ b/src/assistant/tools/assistant/centralwidget.h @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/cmdlineparser.cpp b/src/assistant/tools/assistant/cmdlineparser.cpp index 6a239d305..bc498a9d3 100644 --- a/src/assistant/tools/assistant/cmdlineparser.cpp +++ b/src/assistant/tools/assistant/cmdlineparser.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include #include "cmdlineparser.h" diff --git a/src/assistant/tools/assistant/contentwindow.cpp b/src/assistant/tools/assistant/contentwindow.cpp index fbf70aa1f..3fb1555e0 100644 --- a/src/assistant/tools/assistant/contentwindow.cpp +++ b/src/assistant/tools/assistant/contentwindow.cpp @@ -47,9 +47,9 @@ #include "openpagesmanager.h" #include "tracer.h" -#include +#include #include -#include +#include #include diff --git a/src/assistant/tools/assistant/contentwindow.h b/src/assistant/tools/assistant/contentwindow.h index b8bdc8fee..9c7f4c24f 100644 --- a/src/assistant/tools/assistant/contentwindow.h +++ b/src/assistant/tools/assistant/contentwindow.h @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/filternamedialog.cpp b/src/assistant/tools/assistant/filternamedialog.cpp index 1d9563d2f..d1424ee2a 100644 --- a/src/assistant/tools/assistant/filternamedialog.cpp +++ b/src/assistant/tools/assistant/filternamedialog.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "tracer.h" -#include +#include #include "filternamedialog.h" diff --git a/src/assistant/tools/assistant/filternamedialog.h b/src/assistant/tools/assistant/filternamedialog.h index 35575421e..bf65a7e15 100644 --- a/src/assistant/tools/assistant/filternamedialog.h +++ b/src/assistant/tools/assistant/filternamedialog.h @@ -42,7 +42,7 @@ #ifndef FILTERNAMEDIALOG_H #define FILTERNAMEDIALOG_H -#include +#include #include "ui_filternamedialog.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/findwidget.cpp b/src/assistant/tools/assistant/findwidget.cpp index d45ed30b0..296da0c8d 100644 --- a/src/assistant/tools/assistant/findwidget.cpp +++ b/src/assistant/tools/assistant/findwidget.cpp @@ -41,14 +41,14 @@ #include "tracer.h" #include "findwidget.h" -#include -#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/findwidget.h b/src/assistant/tools/assistant/findwidget.h index d3be0f587..b24e88019 100644 --- a/src/assistant/tools/assistant/findwidget.h +++ b/src/assistant/tools/assistant/findwidget.h @@ -41,7 +41,7 @@ #ifndef FINDWIDGET_H #define FINDWIDGET_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/globalactions.cpp b/src/assistant/tools/assistant/globalactions.cpp index 7fc59ebcd..6b8b8ea29 100644 --- a/src/assistant/tools/assistant/globalactions.cpp +++ b/src/assistant/tools/assistant/globalactions.cpp @@ -45,8 +45,8 @@ #include "helpviewer.h" #include "tracer.h" -#include -#include +#include +#include #if !defined(QT_NO_WEBKIT) #include diff --git a/src/assistant/tools/assistant/helpviewer.h b/src/assistant/tools/assistant/helpviewer.h index bba01d0e6..a5f4de668 100644 --- a/src/assistant/tools/assistant/helpviewer.h +++ b/src/assistant/tools/assistant/helpviewer.h @@ -47,11 +47,11 @@ #include #include -#include +#include #include #if defined(QT_NO_WEBKIT) -#include +#include #else #include #endif diff --git a/src/assistant/tools/assistant/helpviewer_p.h b/src/assistant/tools/assistant/helpviewer_p.h index 378871197..8beeb94b2 100644 --- a/src/assistant/tools/assistant/helpviewer_p.h +++ b/src/assistant/tools/assistant/helpviewer_p.h @@ -48,7 +48,7 @@ #include #ifdef QT_NO_WEBKIT -#include +#include #endif QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/helpviewer_qtb.cpp b/src/assistant/tools/assistant/helpviewer_qtb.cpp index 0a6325cb5..d3d128b74 100644 --- a/src/assistant/tools/assistant/helpviewer_qtb.cpp +++ b/src/assistant/tools/assistant/helpviewer_qtb.cpp @@ -50,9 +50,9 @@ #include #include -#include +#include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/helpviewer_qwv.cpp b/src/assistant/tools/assistant/helpviewer_qwv.cpp index efb9b5900..662177631 100644 --- a/src/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/src/assistant/tools/assistant/helpviewer_qwv.cpp @@ -51,8 +51,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/src/assistant/tools/assistant/indexwindow.cpp b/src/assistant/tools/assistant/indexwindow.cpp index 38bc8b96a..069e821cd 100644 --- a/src/assistant/tools/assistant/indexwindow.cpp +++ b/src/assistant/tools/assistant/indexwindow.cpp @@ -48,13 +48,13 @@ #include "topicchooser.h" #include "tracer.h" -#include -#include -#include +#include +#include +#include #include -#include +#include #include -#include +#include #include diff --git a/src/assistant/tools/assistant/indexwindow.h b/src/assistant/tools/assistant/indexwindow.h index 6c1c4e14e..1873cd6e4 100644 --- a/src/assistant/tools/assistant/indexwindow.h +++ b/src/assistant/tools/assistant/indexwindow.h @@ -43,8 +43,8 @@ #define INDEXWINDOW_H #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/installdialog.cpp b/src/assistant/tools/assistant/installdialog.cpp index 29473a2f9..82c0ccaa9 100644 --- a/src/assistant/tools/assistant/installdialog.cpp +++ b/src/assistant/tools/assistant/installdialog.cpp @@ -49,8 +49,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/src/assistant/tools/assistant/installdialog.h b/src/assistant/tools/assistant/installdialog.h index 0fb45a130..0f57b9ef0 100644 --- a/src/assistant/tools/assistant/installdialog.h +++ b/src/assistant/tools/assistant/installdialog.h @@ -43,7 +43,7 @@ #define INSTALLDIALOG_H #include -#include +#include #include #include "ui_installdialog.h" diff --git a/src/assistant/tools/assistant/main.cpp b/src/assistant/tools/assistant/main.cpp index 84972c546..d6e78d473 100644 --- a/src/assistant/tools/assistant/main.cpp +++ b/src/assistant/tools/assistant/main.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include diff --git a/src/assistant/tools/assistant/mainwindow.cpp b/src/assistant/tools/assistant/mainwindow.cpp index 342fc76da..18a215ecd 100644 --- a/src/assistant/tools/assistant/mainwindow.cpp +++ b/src/assistant/tools/assistant/mainwindow.cpp @@ -66,23 +66,23 @@ #include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/assistant/tools/assistant/mainwindow.h b/src/assistant/tools/assistant/mainwindow.h index 6fe10ec45..1ea0bbaf2 100644 --- a/src/assistant/tools/assistant/mainwindow.h +++ b/src/assistant/tools/assistant/mainwindow.h @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/openpagesmanager.cpp b/src/assistant/tools/assistant/openpagesmanager.cpp index 272d9e242..7bafeeafc 100644 --- a/src/assistant/tools/assistant/openpagesmanager.cpp +++ b/src/assistant/tools/assistant/openpagesmanager.cpp @@ -50,8 +50,8 @@ #include "tracer.h" #include "../shared/collectionconfiguration.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/openpagesswitcher.cpp b/src/assistant/tools/assistant/openpagesswitcher.cpp index 8e7f29bf0..b1f70d784 100644 --- a/src/assistant/tools/assistant/openpagesswitcher.cpp +++ b/src/assistant/tools/assistant/openpagesswitcher.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/openpagesswitcher.h b/src/assistant/tools/assistant/openpagesswitcher.h index 80c7e965d..c3e3a33ce 100644 --- a/src/assistant/tools/assistant/openpagesswitcher.h +++ b/src/assistant/tools/assistant/openpagesswitcher.h @@ -42,7 +42,7 @@ #ifndef OPENPAGESSWITCHER_H #define OPENPAGESSWITCHER_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/openpageswidget.cpp b/src/assistant/tools/assistant/openpageswidget.cpp index db037125b..6947c312c 100644 --- a/src/assistant/tools/assistant/openpageswidget.cpp +++ b/src/assistant/tools/assistant/openpageswidget.cpp @@ -45,11 +45,11 @@ #include "openpagesmodel.h" #include "tracer.h" -#include -#include +#include +#include #include #include -#include +#include #include #ifdef Q_WS_MAC diff --git a/src/assistant/tools/assistant/openpageswidget.h b/src/assistant/tools/assistant/openpageswidget.h index 6041fe22d..e629e4ffe 100644 --- a/src/assistant/tools/assistant/openpageswidget.h +++ b/src/assistant/tools/assistant/openpageswidget.h @@ -42,8 +42,8 @@ #ifndef OPENPAGESWIDGET_H #define OPENPAGESWIDGET_H -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/preferencesdialog.cpp b/src/assistant/tools/assistant/preferencesdialog.cpp index 9bfd35c00..64fc3c42d 100644 --- a/src/assistant/tools/assistant/preferencesdialog.cpp +++ b/src/assistant/tools/assistant/preferencesdialog.cpp @@ -51,12 +51,12 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/assistant/tools/assistant/preferencesdialog.h b/src/assistant/tools/assistant/preferencesdialog.h index f9b445e72..04bfcf8c3 100644 --- a/src/assistant/tools/assistant/preferencesdialog.h +++ b/src/assistant/tools/assistant/preferencesdialog.h @@ -42,7 +42,7 @@ #ifndef PREFERENCESDIALOG_H #define PREFERENCESDIALOG_H -#include +#include #include "ui_preferencesdialog.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/remotecontrol.cpp b/src/assistant/tools/assistant/remotecontrol.cpp index 5d93fbc2e..0990a357f 100644 --- a/src/assistant/tools/assistant/remotecontrol.cpp +++ b/src/assistant/tools/assistant/remotecontrol.cpp @@ -53,8 +53,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/src/assistant/tools/assistant/searchwidget.cpp b/src/assistant/tools/assistant/searchwidget.cpp index 627d9e745..31b8e739d 100644 --- a/src/assistant/tools/assistant/searchwidget.cpp +++ b/src/assistant/tools/assistant/searchwidget.cpp @@ -47,12 +47,12 @@ #include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include #include #include diff --git a/src/assistant/tools/assistant/searchwidget.h b/src/assistant/tools/assistant/searchwidget.h index 077c78771..c53498c94 100644 --- a/src/assistant/tools/assistant/searchwidget.h +++ b/src/assistant/tools/assistant/searchwidget.h @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/assistant/topicchooser.h b/src/assistant/tools/assistant/topicchooser.h index a80f1963d..6ac59f008 100644 --- a/src/assistant/tools/assistant/topicchooser.h +++ b/src/assistant/tools/assistant/topicchooser.h @@ -49,7 +49,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/conversionwizard.cpp b/src/assistant/tools/qhelpconverter/conversionwizard.cpp index 1df9facc5..0a80a0e71 100644 --- a/src/assistant/tools/qhelpconverter/conversionwizard.cpp +++ b/src/assistant/tools/qhelpconverter/conversionwizard.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include "conversionwizard.h" diff --git a/src/assistant/tools/qhelpconverter/conversionwizard.h b/src/assistant/tools/qhelpconverter/conversionwizard.h index eb9b3f556..ff66d271e 100644 --- a/src/assistant/tools/qhelpconverter/conversionwizard.h +++ b/src/assistant/tools/qhelpconverter/conversionwizard.h @@ -42,7 +42,7 @@ #ifndef CONVERSIONWIZARD_H #define CONVERSIONWIZARD_H -#include +#include #include "adpreader.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/filespage.h b/src/assistant/tools/qhelpconverter/filespage.h index 393c3d5e1..07022e898 100644 --- a/src/assistant/tools/qhelpconverter/filespage.h +++ b/src/assistant/tools/qhelpconverter/filespage.h @@ -42,7 +42,7 @@ #ifndef FILESPAGE_H #define FILESPAGE_H -#include +#include #include "ui_filespage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/filterpage.cpp b/src/assistant/tools/qhelpconverter/filterpage.cpp index 3b22ca0d1..efe32c79e 100644 --- a/src/assistant/tools/qhelpconverter/filterpage.cpp +++ b/src/assistant/tools/qhelpconverter/filterpage.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "filterpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/filterpage.h b/src/assistant/tools/qhelpconverter/filterpage.h index 0281a1ed3..336c650de 100644 --- a/src/assistant/tools/qhelpconverter/filterpage.h +++ b/src/assistant/tools/qhelpconverter/filterpage.h @@ -42,7 +42,7 @@ #ifndef FILTERPAGE_H #define FILTERPAGE_H -#include +#include #include "ui_filterpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/finishpage.cpp b/src/assistant/tools/qhelpconverter/finishpage.cpp index a7fa89e2e..cdbd634e6 100644 --- a/src/assistant/tools/qhelpconverter/finishpage.cpp +++ b/src/assistant/tools/qhelpconverter/finishpage.cpp @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include "finishpage.h" diff --git a/src/assistant/tools/qhelpconverter/finishpage.h b/src/assistant/tools/qhelpconverter/finishpage.h index 15b0c4a55..41dec54ca 100644 --- a/src/assistant/tools/qhelpconverter/finishpage.h +++ b/src/assistant/tools/qhelpconverter/finishpage.h @@ -42,7 +42,7 @@ #ifndef FINISHPAGE_H #define FINISHPAGE_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/generalpage.cpp b/src/assistant/tools/qhelpconverter/generalpage.cpp index 4b32cbbf9..ad0171270 100644 --- a/src/assistant/tools/qhelpconverter/generalpage.cpp +++ b/src/assistant/tools/qhelpconverter/generalpage.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "generalpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/generalpage.h b/src/assistant/tools/qhelpconverter/generalpage.h index 413a798df..c9a8b2452 100644 --- a/src/assistant/tools/qhelpconverter/generalpage.h +++ b/src/assistant/tools/qhelpconverter/generalpage.h @@ -42,7 +42,7 @@ #ifndef GENERALPAGE_H #define GENERALPAGE_H -#include +#include #include "ui_generalpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/helpwindow.cpp b/src/assistant/tools/qhelpconverter/helpwindow.cpp index 9fa33585e..5212092f7 100644 --- a/src/assistant/tools/qhelpconverter/helpwindow.cpp +++ b/src/assistant/tools/qhelpconverter/helpwindow.cpp @@ -41,9 +41,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "helpwindow.h" diff --git a/src/assistant/tools/qhelpconverter/helpwindow.h b/src/assistant/tools/qhelpconverter/helpwindow.h index ba176ed72..9a45f06e0 100644 --- a/src/assistant/tools/qhelpconverter/helpwindow.h +++ b/src/assistant/tools/qhelpconverter/helpwindow.h @@ -42,7 +42,7 @@ #ifndef HELPWINDOW_H #define HELPWINDOW_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/identifierpage.h b/src/assistant/tools/qhelpconverter/identifierpage.h index c05eb8f72..05de35ca9 100644 --- a/src/assistant/tools/qhelpconverter/identifierpage.h +++ b/src/assistant/tools/qhelpconverter/identifierpage.h @@ -42,7 +42,7 @@ #ifndef IDENTIFIERPAGE_H #define IDENTIFIERPAGE_H -#include +#include #include "ui_identifierpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/inputpage.cpp b/src/assistant/tools/qhelpconverter/inputpage.cpp index aa180b90e..9abbbe74b 100644 --- a/src/assistant/tools/qhelpconverter/inputpage.cpp +++ b/src/assistant/tools/qhelpconverter/inputpage.cpp @@ -42,13 +42,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "inputpage.h" #include "adpreader.h" diff --git a/src/assistant/tools/qhelpconverter/inputpage.h b/src/assistant/tools/qhelpconverter/inputpage.h index 4489dc781..185b7b2b2 100644 --- a/src/assistant/tools/qhelpconverter/inputpage.h +++ b/src/assistant/tools/qhelpconverter/inputpage.h @@ -42,7 +42,7 @@ #ifndef INPUTPAGE_H #define INPUTPAGE_H -#include +#include #include "ui_inputpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/main.cpp b/src/assistant/tools/qhelpconverter/main.cpp index 38f6ffc4e..1c2d1bf12 100644 --- a/src/assistant/tools/qhelpconverter/main.cpp +++ b/src/assistant/tools/qhelpconverter/main.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include "conversionwizard.h" diff --git a/src/assistant/tools/qhelpconverter/outputpage.cpp b/src/assistant/tools/qhelpconverter/outputpage.cpp index d8a6bd13f..434357b34 100644 --- a/src/assistant/tools/qhelpconverter/outputpage.cpp +++ b/src/assistant/tools/qhelpconverter/outputpage.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include "outputpage.h" diff --git a/src/assistant/tools/qhelpconverter/outputpage.h b/src/assistant/tools/qhelpconverter/outputpage.h index 535729bf8..e45afae10 100644 --- a/src/assistant/tools/qhelpconverter/outputpage.h +++ b/src/assistant/tools/qhelpconverter/outputpage.h @@ -42,7 +42,7 @@ #ifndef OUTPUTPAGE_H #define OUTPUTPAGE_H -#include +#include #include "ui_outputpage.h" QT_BEGIN_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/pathpage.cpp b/src/assistant/tools/qhelpconverter/pathpage.cpp index e5391eb80..a9ddf53a5 100644 --- a/src/assistant/tools/qhelpconverter/pathpage.cpp +++ b/src/assistant/tools/qhelpconverter/pathpage.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "pathpage.h" diff --git a/src/assistant/tools/qhelpconverter/pathpage.h b/src/assistant/tools/qhelpconverter/pathpage.h index aad387976..90b24236c 100644 --- a/src/assistant/tools/qhelpconverter/pathpage.h +++ b/src/assistant/tools/qhelpconverter/pathpage.h @@ -42,7 +42,7 @@ #ifndef PATHPAGE_H #define PATHPAGE_H -#include +#include #include "ui_pathpage.h" QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp index 34e1681ef..da20a1409 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp @@ -54,10 +54,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp index 17b93e1b5..18372cd7b 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "buddyeditor_plugin.h" #include "buddyeditor_tool.h" diff --git a/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp b/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp index 3779789fa..1464f9962 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor_tool.cpp @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/default_actionprovider.cpp b/src/designer/src/components/formeditor/default_actionprovider.cpp index c0a51dede..017414521 100644 --- a/src/designer/src/components/formeditor/default_actionprovider.cpp +++ b/src/designer/src/components/formeditor/default_actionprovider.cpp @@ -43,8 +43,8 @@ #include "invisible_widget_p.h" #include "qdesigner_toolbar_p.h" -#include -#include +#include +#include #include #include diff --git a/src/designer/src/components/formeditor/default_actionprovider.h b/src/designer/src/components/formeditor/default_actionprovider.h index 9eba71eef..41044353a 100644 --- a/src/designer/src/components/formeditor/default_actionprovider.h +++ b/src/designer/src/components/formeditor/default_actionprovider.h @@ -46,9 +46,9 @@ #include "actionprovider_p.h" #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/default_container.h b/src/designer/src/components/formeditor/default_container.h index 43e2700fe..06cac7279 100644 --- a/src/designer/src/components/formeditor/default_container.h +++ b/src/designer/src/components/formeditor/default_container.h @@ -46,11 +46,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/deviceprofiledialog.cpp b/src/designer/src/components/formeditor/deviceprofiledialog.cpp index b7030689d..9202f945f 100644 --- a/src/designer/src/components/formeditor/deviceprofiledialog.cpp +++ b/src/designer/src/components/formeditor/deviceprofiledialog.cpp @@ -45,10 +45,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/formeditor/deviceprofiledialog.h b/src/designer/src/components/formeditor/deviceprofiledialog.h index e35f30077..3c84aa2be 100644 --- a/src/designer/src/components/formeditor/deviceprofiledialog.h +++ b/src/designer/src/components/formeditor/deviceprofiledialog.h @@ -53,7 +53,7 @@ #ifndef SYSTEMSETTINGSDIALOG_H #define SYSTEMSETTINGSDIALOG_H -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/dpi_chooser.cpp b/src/designer/src/components/formeditor/dpi_chooser.cpp index 6d665dd79..b361267c6 100644 --- a/src/designer/src/components/formeditor/dpi_chooser.cpp +++ b/src/designer/src/components/formeditor/dpi_chooser.cpp @@ -43,13 +43,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/dpi_chooser.h b/src/designer/src/components/formeditor/dpi_chooser.h index 10e3c72d8..bfdcc047e 100644 --- a/src/designer/src/components/formeditor/dpi_chooser.h +++ b/src/designer/src/components/formeditor/dpi_chooser.h @@ -53,7 +53,7 @@ #ifndef DPICHOOSER_H #define DPICHOOSER_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.cpp b/src/designer/src/components/formeditor/embeddedoptionspage.cpp index 10f4509df..6254748e0 100644 --- a/src/designer/src/components/formeditor/embeddedoptionspage.cpp +++ b/src/designer/src/components/formeditor/embeddedoptionspage.cpp @@ -55,15 +55,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.h b/src/designer/src/components/formeditor/embeddedoptionspage.h index 792496c08..4aa58a6dd 100644 --- a/src/designer/src/components/formeditor/embeddedoptionspage.h +++ b/src/designer/src/components/formeditor/embeddedoptionspage.h @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/formeditor_optionspage.cpp b/src/designer/src/components/formeditor/formeditor_optionspage.cpp index e50072aac..477766ebf 100644 --- a/src/designer/src/components/formeditor/formeditor_optionspage.cpp +++ b/src/designer/src/components/formeditor/formeditor_optionspage.cpp @@ -55,10 +55,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp index 1abf7cd71..e9600da27 100644 --- a/src/designer/src/components/formeditor/formwindow.cpp +++ b/src/designer/src/components/formeditor/formwindow.cpp @@ -87,22 +87,22 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include Q_DECLARE_METATYPE(QWidget*) diff --git a/src/designer/src/components/formeditor/formwindow_dnditem.cpp b/src/designer/src/components/formeditor/formwindow_dnditem.cpp index 5b8f86b0f..8f16f3830 100644 --- a/src/designer/src/components/formeditor/formwindow_dnditem.cpp +++ b/src/designer/src/components/formeditor/formwindow_dnditem.cpp @@ -48,7 +48,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp index ac20e8ac1..b9646a8ff 100644 --- a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp +++ b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp @@ -42,11 +42,11 @@ #include "formwindow_widgetstack.h" #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/designer/src/components/formeditor/formwindow_widgetstack.h b/src/designer/src/components/formeditor/formwindow_widgetstack.h index 56f9743bb..67ab06aa0 100644 --- a/src/designer/src/components/formeditor/formwindow_widgetstack.h +++ b/src/designer/src/components/formeditor/formwindow_widgetstack.h @@ -44,7 +44,7 @@ #include "formeditor_global.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp index e58fdaf66..456151605 100644 --- a/src/designer/src/components/formeditor/formwindowmanager.cpp +++ b/src/designer/src/components/formeditor/formwindowmanager.cpp @@ -73,17 +73,17 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp index 04d5f8ca5..87a1391f1 100644 --- a/src/designer/src/components/formeditor/formwindowsettings.cpp +++ b/src/designer/src/components/formeditor/formwindowsettings.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include diff --git a/src/designer/src/components/formeditor/formwindowsettings.h b/src/designer/src/components/formeditor/formwindowsettings.h index f5c6f53e3..0fef04e6a 100644 --- a/src/designer/src/components/formeditor/formwindowsettings.h +++ b/src/designer/src/components/formeditor/formwindowsettings.h @@ -42,7 +42,7 @@ #ifndef FORMWINDOWSETTINGS_H #define FORMWINDOWSETTINGS_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/itemview_propertysheet.cpp b/src/designer/src/components/formeditor/itemview_propertysheet.cpp index e04c55d5a..7fe73b742 100644 --- a/src/designer/src/components/formeditor/itemview_propertysheet.cpp +++ b/src/designer/src/components/formeditor/itemview_propertysheet.cpp @@ -43,8 +43,8 @@ #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/itemview_propertysheet.h b/src/designer/src/components/formeditor/itemview_propertysheet.h index 59cf809c8..82792d42b 100644 --- a/src/designer/src/components/formeditor/itemview_propertysheet.h +++ b/src/designer/src/components/formeditor/itemview_propertysheet.h @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/layout_propertysheet.cpp b/src/designer/src/components/formeditor/layout_propertysheet.cpp index 34e51b178..72e709e8a 100644 --- a/src/designer/src/components/formeditor/layout_propertysheet.cpp +++ b/src/designer/src/components/formeditor/layout_propertysheet.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include #include diff --git a/src/designer/src/components/formeditor/layout_propertysheet.h b/src/designer/src/components/formeditor/layout_propertysheet.h index 72a59f876..fc5c980db 100644 --- a/src/designer/src/components/formeditor/layout_propertysheet.h +++ b/src/designer/src/components/formeditor/layout_propertysheet.h @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/line_propertysheet.cpp b/src/designer/src/components/formeditor/line_propertysheet.cpp index 64699eaa5..685d4c3c6 100644 --- a/src/designer/src/components/formeditor/line_propertysheet.cpp +++ b/src/designer/src/components/formeditor/line_propertysheet.cpp @@ -45,7 +45,7 @@ // sdk #include -#include +#include #include #include #include diff --git a/src/designer/src/components/formeditor/previewactiongroup.cpp b/src/designer/src/components/formeditor/previewactiongroup.cpp index 607212c41..e3f25341d 100644 --- a/src/designer/src/components/formeditor/previewactiongroup.cpp +++ b/src/designer/src/components/formeditor/previewactiongroup.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/previewactiongroup.h b/src/designer/src/components/formeditor/previewactiongroup.h index 9ba65512b..33da10170 100644 --- a/src/designer/src/components/formeditor/previewactiongroup.h +++ b/src/designer/src/components/formeditor/previewactiongroup.h @@ -53,7 +53,7 @@ #ifndef PREVIEWACTIONGROUP_H #define PREVIEWACTIONGROUP_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index 62957d30b..959a50f6d 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -85,27 +85,27 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/formeditor/qdesignerundostack.cpp b/src/designer/src/components/formeditor/qdesignerundostack.cpp index 56bb04f9e..2c64d1866 100644 --- a/src/designer/src/components/formeditor/qdesignerundostack.cpp +++ b/src/designer/src/components/formeditor/qdesignerundostack.cpp @@ -41,8 +41,8 @@ #include "qdesignerundostack.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp index 49c49fa8e..5c67f3601 100644 --- a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp +++ b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.cpp @@ -46,7 +46,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qmainwindow_container.cpp b/src/designer/src/components/formeditor/qmainwindow_container.cpp index d2664b418..07fc83acf 100644 --- a/src/designer/src/components/formeditor/qmainwindow_container.cpp +++ b/src/designer/src/components/formeditor/qmainwindow_container.cpp @@ -45,11 +45,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qmainwindow_container.h b/src/designer/src/components/formeditor/qmainwindow_container.h index 6151c97ff..d22bbf72c 100644 --- a/src/designer/src/components/formeditor/qmainwindow_container.h +++ b/src/designer/src/components/formeditor/qmainwindow_container.h @@ -47,7 +47,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp index 670d1d062..8e3dc6147 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.cpp +++ b/src/designer/src/components/formeditor/qmdiarea_container.cpp @@ -44,9 +44,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/formeditor/qmdiarea_container.h b/src/designer/src/components/formeditor/qmdiarea_container.h index 453e67109..20e5a4098 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.h +++ b/src/designer/src/components/formeditor/qmdiarea_container.h @@ -48,8 +48,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qwizard_container.cpp b/src/designer/src/components/formeditor/qwizard_container.cpp index d88bcf2f6..bbccf7a0b 100644 --- a/src/designer/src/components/formeditor/qwizard_container.cpp +++ b/src/designer/src/components/formeditor/qwizard_container.cpp @@ -44,8 +44,8 @@ #include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qwizard_container.h b/src/designer/src/components/formeditor/qwizard_container.h index 43a1e5f62..32c1ad18e 100644 --- a/src/designer/src/components/formeditor/qwizard_container.h +++ b/src/designer/src/components/formeditor/qwizard_container.h @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qworkspace_container.cpp b/src/designer/src/components/formeditor/qworkspace_container.cpp index ca7de1c56..fc5bcdea9 100644 --- a/src/designer/src/components/formeditor/qworkspace_container.cpp +++ b/src/designer/src/components/formeditor/qworkspace_container.cpp @@ -42,7 +42,7 @@ #include "qworkspace_container.h" #include "qmdiarea_container.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/qworkspace_container.h b/src/designer/src/components/formeditor/qworkspace_container.h index f595044f4..199b5b823 100644 --- a/src/designer/src/components/formeditor/qworkspace_container.h +++ b/src/designer/src/components/formeditor/qworkspace_container.h @@ -46,7 +46,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/spacer_propertysheet.cpp b/src/designer/src/components/formeditor/spacer_propertysheet.cpp index 6ea37c4d4..965ad6254 100644 --- a/src/designer/src/components/formeditor/spacer_propertysheet.cpp +++ b/src/designer/src/components/formeditor/spacer_propertysheet.cpp @@ -46,7 +46,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/templateoptionspage.h b/src/designer/src/components/formeditor/templateoptionspage.h index ea1c29b3f..46ccfab5b 100644 --- a/src/designer/src/components/formeditor/templateoptionspage.h +++ b/src/designer/src/components/formeditor/templateoptionspage.h @@ -47,7 +47,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/formeditor/tool_widgeteditor.cpp b/src/designer/src/components/formeditor/tool_widgeteditor.cpp index 456967f59..1c4eb3929 100644 --- a/src/designer/src/components/formeditor/tool_widgeteditor.cpp +++ b/src/designer/src/components/formeditor/tool_widgeteditor.cpp @@ -52,8 +52,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/src/designer/src/components/formeditor/widgetselection.cpp b/src/designer/src/components/formeditor/widgetselection.cpp index 501859130..d01049488 100644 --- a/src/designer/src/components/formeditor/widgetselection.cpp +++ b/src/designer/src/components/formeditor/widgetselection.cpp @@ -55,14 +55,14 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/lib/lib.pro b/src/designer/src/components/lib/lib.pro index 7b033641c..2a394dc52 100644 --- a/src/designer/src/components/lib/lib.pro +++ b/src/designer/src/components/lib/lib.pro @@ -8,7 +8,7 @@ QT += gui-private win32|mac: CONFIG += debug_and_release DESTDIR = $$QT_BUILD_TREE/lib !wince*:DLLDESTDIR = $$QT.designer.bins -QT += designer-private uilib-private +QT += widgets widgets-private designer-private uilib-private # QtDesignerComponents uses DEFINES += QT_STATICPLUGIN diff --git a/src/designer/src/components/objectinspector/objectinspector.cpp b/src/designer/src/components/objectinspector/objectinspector.cpp index 8bcd49e15..85f2cc9a3 100644 --- a/src/designer/src/components/objectinspector/objectinspector.cpp +++ b/src/designer/src/components/objectinspector/objectinspector.cpp @@ -63,15 +63,15 @@ #include // Qt -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp index 20f0ff18f..3386e5b55 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp +++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp @@ -53,11 +53,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/designer/src/components/objectinspector/objectinspectormodel_p.h b/src/designer/src/components/objectinspector/objectinspectormodel_p.h index 499a99afb..56f8fb90c 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel_p.h +++ b/src/designer/src/components/objectinspector/objectinspectormodel_p.h @@ -55,8 +55,8 @@ #include -#include -#include +#include +#include #include #include #include diff --git a/src/designer/src/components/propertyeditor/brushpropertymanager.h b/src/designer/src/components/propertyeditor/brushpropertymanager.h index 5c008e2c4..998c1ddea 100644 --- a/src/designer/src/components/propertyeditor/brushpropertymanager.h +++ b/src/designer/src/components/propertyeditor/brushpropertymanager.h @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp index d96eba90b..09894b1f1 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -56,19 +56,19 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.h b/src/designer/src/components/propertyeditor/designerpropertymanager.h index 4f4bb3c17..9ca2f7939 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.h +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.h @@ -52,7 +52,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp index 32277a0ba..692e9ab75 100644 --- a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp +++ b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h index 7c3966a43..9e3554123 100644 --- a/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h +++ b/src/designer/src/components/propertyeditor/newdynamicpropertydialog.h @@ -54,7 +54,7 @@ // #include "propertyeditor_global.h" -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/paletteeditor.cpp b/src/designer/src/components/propertyeditor/paletteeditor.cpp index c3047591d..eac1e5dca 100644 --- a/src/designer/src/components/propertyeditor/paletteeditor.cpp +++ b/src/designer/src/components/propertyeditor/paletteeditor.cpp @@ -49,9 +49,9 @@ #include #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/paletteeditor.h b/src/designer/src/components/propertyeditor/paletteeditor.h index 9caed1965..b2c31d2f6 100644 --- a/src/designer/src/components/propertyeditor/paletteeditor.h +++ b/src/designer/src/components/propertyeditor/paletteeditor.h @@ -43,7 +43,7 @@ #define PALETTEEDITOR_H #include "ui_paletteeditor.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/paletteeditorbutton.h b/src/designer/src/components/propertyeditor/paletteeditorbutton.h index 567605a19..fc7a93d7f 100644 --- a/src/designer/src/components/propertyeditor/paletteeditorbutton.h +++ b/src/designer/src/components/propertyeditor/paletteeditorbutton.h @@ -45,7 +45,7 @@ #include "propertyeditor_global.h" #include -#include +#include #include "abstractformeditor.h" diff --git a/src/designer/src/components/propertyeditor/previewframe.cpp b/src/designer/src/components/propertyeditor/previewframe.cpp index 5e426c9c7..c20c35e26 100644 --- a/src/designer/src/components/propertyeditor/previewframe.cpp +++ b/src/designer/src/components/propertyeditor/previewframe.cpp @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/previewframe.h b/src/designer/src/components/propertyeditor/previewframe.h index 567fd7f7a..e78890ff4 100644 --- a/src/designer/src/components/propertyeditor/previewframe.h +++ b/src/designer/src/components/propertyeditor/previewframe.h @@ -42,7 +42,7 @@ #ifndef PREVIEWFRAME_H #define PREVIEWFRAME_H -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp index 31ef2dae7..c88380fab 100644 --- a/src/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp @@ -68,17 +68,17 @@ #ifdef Q_OS_WIN # include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/propertyeditor/stringlisteditor.cpp b/src/designer/src/components/propertyeditor/stringlisteditor.cpp index cd55eff2e..243fdf81f 100644 --- a/src/designer/src/components/propertyeditor/stringlisteditor.cpp +++ b/src/designer/src/components/propertyeditor/stringlisteditor.cpp @@ -41,7 +41,7 @@ #include "stringlisteditor.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/propertyeditor/stringlisteditorbutton.h b/src/designer/src/components/propertyeditor/stringlisteditorbutton.h index 07bd291f5..2ab784ce5 100644 --- a/src/designer/src/components/propertyeditor/stringlisteditorbutton.h +++ b/src/designer/src/components/propertyeditor/stringlisteditorbutton.h @@ -45,7 +45,7 @@ #include "propertyeditor_global.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/connectdialog.cpp b/src/designer/src/components/signalsloteditor/connectdialog.cpp index 64be11345..cefe035d3 100644 --- a/src/designer/src/components/signalsloteditor/connectdialog.cpp +++ b/src/designer/src/components/signalsloteditor/connectdialog.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/connectdialog_p.h b/src/designer/src/components/signalsloteditor/connectdialog_p.h index dd81483d5..237d2d618 100644 --- a/src/designer/src/components/signalsloteditor/connectdialog_p.h +++ b/src/designer/src/components/signalsloteditor/connectdialog_p.h @@ -54,7 +54,7 @@ // #include "ui_connectdialog.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp index 673864032..77b9fbe96 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp @@ -52,9 +52,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp index 7e1f67f08..d03d299d2 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp index a56acc37d..559e9bc93 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp @@ -45,7 +45,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index 0d0683554..c8568ecc5 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -60,21 +60,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h index 179b6c5f4..c96d66ee4 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.h @@ -43,7 +43,7 @@ #define SIGNALSLOTEDITORWINDOW_H #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/tabordereditor/tabordereditor.cpp b/src/designer/src/components/tabordereditor/tabordereditor.cpp index 2932adca0..9946d1889 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor.cpp @@ -57,8 +57,8 @@ #include #include #include -#include -#include +#include +#include Q_DECLARE_METATYPE(QWidgetList) diff --git a/src/designer/src/components/tabordereditor/tabordereditor.h b/src/designer/src/components/tabordereditor/tabordereditor.h index 3eacd3739..2499baded 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor.h +++ b/src/designer/src/components/tabordereditor/tabordereditor.h @@ -45,7 +45,7 @@ #include "tabordereditor_global.h" #include -#include +#include #include #include #include diff --git a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp index 49581e5f6..99486fa68 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "tabordereditor_plugin.h" #include "tabordereditor_tool.h" diff --git a/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp b/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp index 2914cb58a..120c5f3b6 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor_tool.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/button_taskmenu.cpp b/src/designer/src/components/taskmenu/button_taskmenu.cpp index 953996b8c..10ab79705 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/button_taskmenu.cpp @@ -51,14 +51,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include Q_DECLARE_METATYPE(QButtonGroup*) diff --git a/src/designer/src/components/taskmenu/button_taskmenu.h b/src/designer/src/components/taskmenu/button_taskmenu.h index e7350ca87..2a34dcdb0 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.h +++ b/src/designer/src/components/taskmenu/button_taskmenu.h @@ -42,9 +42,9 @@ #ifndef BUTTON_TASKMENU_H #define BUTTON_TASKMENU_H -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/combobox_taskmenu.cpp b/src/designer/src/components/taskmenu/combobox_taskmenu.cpp index 2b9b1fe19..3c0d8d9dc 100644 --- a/src/designer/src/components/taskmenu/combobox_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/combobox_taskmenu.cpp @@ -46,11 +46,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/combobox_taskmenu.h b/src/designer/src/components/taskmenu/combobox_taskmenu.h index c1eee4837..b8631212b 100644 --- a/src/designer/src/components/taskmenu/combobox_taskmenu.h +++ b/src/designer/src/components/taskmenu/combobox_taskmenu.h @@ -42,7 +42,7 @@ #ifndef COMBOBOX_TASKMENU_H #define COMBOBOX_TASKMENU_H -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp index 9b6265f27..07a218416 100644 --- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp @@ -51,16 +51,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp b/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp index 1fae0f8ba..5d219c0ec 100644 --- a/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/groupbox_taskmenu.cpp @@ -44,9 +44,9 @@ #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/groupbox_taskmenu.h b/src/designer/src/components/taskmenu/groupbox_taskmenu.h index d30d8b1b6..16fd81683 100644 --- a/src/designer/src/components/taskmenu/groupbox_taskmenu.h +++ b/src/designer/src/components/taskmenu/groupbox_taskmenu.h @@ -42,7 +42,7 @@ #ifndef GROUPBOX_TASKMENU_H #define GROUPBOX_TASKMENU_H -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/inplace_widget_helper.cpp b/src/designer/src/components/taskmenu/inplace_widget_helper.cpp index 47554b3a8..d6b05adab 100644 --- a/src/designer/src/components/taskmenu/inplace_widget_helper.cpp +++ b/src/designer/src/components/taskmenu/inplace_widget_helper.cpp @@ -43,9 +43,9 @@ #include "inplace_widget_helper.h" #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/itemlisteditor.cpp b/src/designer/src/components/taskmenu/itemlisteditor.cpp index a04246de5..0ae2c6603 100644 --- a/src/designer/src/components/taskmenu/itemlisteditor.cpp +++ b/src/designer/src/components/taskmenu/itemlisteditor.cpp @@ -49,7 +49,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/itemlisteditor.h b/src/designer/src/components/taskmenu/itemlisteditor.h index ffacad293..ae9f684d0 100644 --- a/src/designer/src/components/taskmenu/itemlisteditor.h +++ b/src/designer/src/components/taskmenu/itemlisteditor.h @@ -44,7 +44,7 @@ #include "ui_itemlisteditor.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/label_taskmenu.cpp b/src/designer/src/components/taskmenu/label_taskmenu.cpp index 5f0acb209..4ff039fe5 100644 --- a/src/designer/src/components/taskmenu/label_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/label_taskmenu.cpp @@ -44,9 +44,9 @@ #include -#include -#include -#include +#include +#include +#include #include static const char *textPropertyC = "text"; diff --git a/src/designer/src/components/taskmenu/label_taskmenu.h b/src/designer/src/components/taskmenu/label_taskmenu.h index 7f3549128..007682dbf 100644 --- a/src/designer/src/components/taskmenu/label_taskmenu.h +++ b/src/designer/src/components/taskmenu/label_taskmenu.h @@ -42,7 +42,7 @@ #ifndef LABEL_TASKMENU_H #define LABEL_TASKMENU_H -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/layouttaskmenu.cpp b/src/designer/src/components/taskmenu/layouttaskmenu.cpp index 10d5d7c54..52a5f54a2 100644 --- a/src/designer/src/components/taskmenu/layouttaskmenu.cpp +++ b/src/designer/src/components/taskmenu/layouttaskmenu.cpp @@ -45,7 +45,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp b/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp index c00c493b1..cc138e63d 100644 --- a/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/lineedit_taskmenu.cpp @@ -44,9 +44,9 @@ #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/lineedit_taskmenu.h b/src/designer/src/components/taskmenu/lineedit_taskmenu.h index 239590bb8..43328faab 100644 --- a/src/designer/src/components/taskmenu/lineedit_taskmenu.h +++ b/src/designer/src/components/taskmenu/lineedit_taskmenu.h @@ -42,7 +42,7 @@ #ifndef LINEEDIT_TASKMENU_H #define LINEEDIT_TASKMENU_H -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp index bd8f6b9f8..90b1860a6 100644 --- a/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/listwidget_taskmenu.cpp @@ -46,10 +46,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/listwidget_taskmenu.h b/src/designer/src/components/taskmenu/listwidget_taskmenu.h index e7e527a38..5221065b7 100644 --- a/src/designer/src/components/taskmenu/listwidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/listwidget_taskmenu.h @@ -42,7 +42,7 @@ #ifndef LISTWIDGET_TASKMENU_H #define LISTWIDGET_TASKMENU_H -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/listwidgeteditor.cpp b/src/designer/src/components/taskmenu/listwidgeteditor.cpp index e1259f1c0..36fab5c2b 100644 --- a/src/designer/src/components/taskmenu/listwidgeteditor.cpp +++ b/src/designer/src/components/taskmenu/listwidgeteditor.cpp @@ -46,9 +46,9 @@ #include #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/listwidgeteditor.h b/src/designer/src/components/taskmenu/listwidgeteditor.h index 12d0591f2..0938b24a4 100644 --- a/src/designer/src/components/taskmenu/listwidgeteditor.h +++ b/src/designer/src/components/taskmenu/listwidgeteditor.h @@ -45,7 +45,7 @@ #include "itemlisteditor.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/menutaskmenu.cpp b/src/designer/src/components/taskmenu/menutaskmenu.cpp index cbcecb122..423040d45 100644 --- a/src/designer/src/components/taskmenu/menutaskmenu.cpp +++ b/src/designer/src/components/taskmenu/menutaskmenu.cpp @@ -43,7 +43,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp b/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp index e98714f62..dff119948 100644 --- a/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/tablewidget_taskmenu.cpp @@ -44,11 +44,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/tablewidget_taskmenu.h b/src/designer/src/components/taskmenu/tablewidget_taskmenu.h index cbf71fea6..ea5f467ef 100644 --- a/src/designer/src/components/taskmenu/tablewidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/tablewidget_taskmenu.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/tablewidgeteditor.h b/src/designer/src/components/taskmenu/tablewidgeteditor.h index 1d5ad1f57..3a5ee277e 100644 --- a/src/designer/src/components/taskmenu/tablewidgeteditor.h +++ b/src/designer/src/components/taskmenu/tablewidgeteditor.h @@ -46,7 +46,7 @@ #include "listwidgeteditor.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/textedit_taskmenu.cpp b/src/designer/src/components/taskmenu/textedit_taskmenu.cpp index 510a32f5f..5721267fd 100644 --- a/src/designer/src/components/taskmenu/textedit_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/textedit_taskmenu.cpp @@ -43,7 +43,7 @@ #include -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/textedit_taskmenu.h b/src/designer/src/components/taskmenu/textedit_taskmenu.h index 1429f315e..489cf2025 100644 --- a/src/designer/src/components/taskmenu/textedit_taskmenu.h +++ b/src/designer/src/components/taskmenu/textedit_taskmenu.h @@ -42,8 +42,8 @@ #ifndef TEXTEDIT_TASKMENU_H #define TEXTEDIT_TASKMENU_H -#include -#include +#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp b/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp index 8db233ca2..2ab2764f0 100644 --- a/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/src/designer/src/components/taskmenu/toolbar_taskmenu.h b/src/designer/src/components/taskmenu/toolbar_taskmenu.h index 6818e2607..2cea0e2fb 100644 --- a/src/designer/src/components/taskmenu/toolbar_taskmenu.h +++ b/src/designer/src/components/taskmenu/toolbar_taskmenu.h @@ -46,8 +46,8 @@ #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp b/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp index 96210dcdb..c9734a71d 100644 --- a/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/treewidget_taskmenu.cpp @@ -44,10 +44,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/treewidget_taskmenu.h b/src/designer/src/components/taskmenu/treewidget_taskmenu.h index e5a9e9073..6b7ecd6d0 100644 --- a/src/designer/src/components/taskmenu/treewidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/treewidget_taskmenu.h @@ -42,7 +42,7 @@ #ifndef TREEWIDGET_TASKMENU_H #define TREEWIDGET_TASKMENU_H -#include +#include #include #include diff --git a/src/designer/src/components/taskmenu/treewidgeteditor.cpp b/src/designer/src/components/taskmenu/treewidgeteditor.cpp index c26bd1808..dc1973be8 100644 --- a/src/designer/src/components/taskmenu/treewidgeteditor.cpp +++ b/src/designer/src/components/taskmenu/treewidgeteditor.cpp @@ -53,8 +53,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/taskmenu/treewidgeteditor.h b/src/designer/src/components/taskmenu/treewidgeteditor.h index f502bf3e4..1207aef10 100644 --- a/src/designer/src/components/taskmenu/treewidgeteditor.h +++ b/src/designer/src/components/taskmenu/treewidgeteditor.h @@ -46,7 +46,7 @@ #include "listwidgeteditor.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/widgetbox/widgetbox.cpp b/src/designer/src/components/widgetbox/widgetbox.cpp index c9b0d040a..41ae82702 100644 --- a/src/designer/src/components/widgetbox/widgetbox.cpp +++ b/src/designer/src/components/widgetbox/widgetbox.cpp @@ -51,10 +51,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp index c122c8411..5964de8c3 100644 --- a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp +++ b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp @@ -55,8 +55,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp index d2a0d43c0..840ed2621 100644 --- a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp +++ b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp @@ -46,11 +46,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.h b/src/designer/src/components/widgetbox/widgetboxcategorylistview.h index 5e6df1149..896dd3cb3 100644 --- a/src/designer/src/components/widgetbox/widgetboxcategorylistview.h +++ b/src/designer/src/components/widgetbox/widgetboxcategorylistview.h @@ -44,7 +44,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp index cbb62445f..6b84aa354 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -55,13 +55,13 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.h b/src/designer/src/components/widgetbox/widgetboxtreewidget.h index db4f7cdb1..0e22c2ad7 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.h +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.h @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include #include #include #include // Cannot forward declare them on Mac diff --git a/src/designer/src/designer/appfontdialog.cpp b/src/designer/src/designer/appfontdialog.cpp index 10ec254c4..9deff525a 100644 --- a/src/designer/src/designer/appfontdialog.cpp +++ b/src/designer/src/designer/appfontdialog.cpp @@ -45,16 +45,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/designer/src/designer/appfontdialog.h b/src/designer/src/designer/appfontdialog.h index a373217ac..24776c110 100644 --- a/src/designer/src/designer/appfontdialog.h +++ b/src/designer/src/designer/appfontdialog.h @@ -42,8 +42,8 @@ #ifndef QDESIGNER_APPFONTWIDGET_H #define QDESIGNER_APPFONTWIDGET_H -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/designer.pro b/src/designer/src/designer/designer.pro index 529b78db7..e922b688f 100644 --- a/src/designer/src/designer/designer.pro +++ b/src/designer/src/designer/designer.pro @@ -1,7 +1,7 @@ load(qt_module) DESTDIR = $$QT.designer.bins -QT += core-private xml network designer-private uilib-private +QT += core-private widgets xml network designer-private uilib-private CONFIG += module MODULE_PRI = ../../../../modules/qt_designer.pri diff --git a/src/designer/src/designer/mainwindow.cpp b/src/designer/src/designer/mainwindow.cpp index 67e1a4053..9fcc1b9f7 100644 --- a/src/designer/src/designer/mainwindow.cpp +++ b/src/designer/src/designer/mainwindow.cpp @@ -50,14 +50,14 @@ #include -#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/designer/mainwindow.h b/src/designer/src/designer/mainwindow.h index e39e57203..9e9781f38 100644 --- a/src/designer/src/designer/mainwindow.h +++ b/src/designer/src/designer/mainwindow.h @@ -42,9 +42,9 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/newform.cpp b/src/designer/src/designer/newform.cpp index 34461f52a..81ba3c21a 100644 --- a/src/designer/src/designer/newform.cpp +++ b/src/designer/src/designer/newform.cpp @@ -55,14 +55,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/newform.h b/src/designer/src/designer/newform.h index ad51118b9..097048f38 100644 --- a/src/designer/src/designer/newform.h +++ b/src/designer/src/designer/newform.h @@ -42,7 +42,7 @@ #ifndef NEWFORM_H #define NEWFORM_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/preferencesdialog.cpp b/src/designer/src/designer/preferencesdialog.cpp index f847baea8..ca4d5024f 100644 --- a/src/designer/src/designer/preferencesdialog.cpp +++ b/src/designer/src/designer/preferencesdialog.cpp @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/preferencesdialog.h b/src/designer/src/designer/preferencesdialog.h index 5ffd7d365..f3e0f6ab2 100644 --- a/src/designer/src/designer/preferencesdialog.h +++ b/src/designer/src/designer/preferencesdialog.h @@ -42,7 +42,7 @@ #ifndef PREFERENCESDIALOG_H #define PREFERENCESDIALOG_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp index 1e838c197..685deb92e 100644 --- a/src/designer/src/designer/qdesigner.cpp +++ b/src/designer/src/designer/qdesigner.cpp @@ -51,9 +51,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/designer/src/designer/qdesigner.h b/src/designer/src/designer/qdesigner.h index ff45edffd..5241b47d2 100644 --- a/src/designer/src/designer/qdesigner.h +++ b/src/designer/src/designer/qdesigner.h @@ -43,7 +43,7 @@ #define QDESIGNER_H #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 6eddeb99c..c19abefc4 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -73,19 +73,19 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #include #include #include @@ -98,8 +98,8 @@ #include #include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_appearanceoptions.h b/src/designer/src/designer/qdesigner_appearanceoptions.h index 2c7fda130..4dfd507fe 100644 --- a/src/designer/src/designer/qdesigner_appearanceoptions.h +++ b/src/designer/src/designer/qdesigner_appearanceoptions.h @@ -49,7 +49,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_formwindow.cpp b/src/designer/src/designer/qdesigner_formwindow.cpp index dfee657da..a7f6579e8 100644 --- a/src/designer/src/designer/qdesigner_formwindow.cpp +++ b/src/designer/src/designer/qdesigner_formwindow.cpp @@ -55,13 +55,13 @@ #include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_formwindow.h b/src/designer/src/designer/qdesigner_formwindow.h index 5ee4c40b4..58065baed 100644 --- a/src/designer/src/designer/qdesigner_formwindow.h +++ b/src/designer/src/designer/qdesigner_formwindow.h @@ -43,7 +43,7 @@ #define QDESIGNER_FORMWINDOW_H #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_pch.h b/src/designer/src/designer/qdesigner_pch.h index 12eb3f376..ea9d6d104 100644 --- a/src/designer/src/designer/qdesigner_pch.h +++ b/src/designer/src/designer/qdesigner_pch.h @@ -45,9 +45,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/designer/qdesigner_settings.cpp b/src/designer/src/designer/qdesigner_settings.cpp index b5a4e02f5..4201aaa27 100644 --- a/src/designer/src/designer/qdesigner_settings.cpp +++ b/src/designer/src/designer/qdesigner_settings.cpp @@ -53,9 +53,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/src/designer/src/designer/qdesigner_toolwindow.cpp b/src/designer/src/designer/qdesigner_toolwindow.cpp index 376b0afae..413a4a239 100644 --- a/src/designer/src/designer/qdesigner_toolwindow.cpp +++ b/src/designer/src/designer/qdesigner_toolwindow.cpp @@ -53,7 +53,7 @@ #include #include -#include +#include #include enum { debugToolWindow = 0 }; diff --git a/src/designer/src/designer/qdesigner_toolwindow.h b/src/designer/src/designer/qdesigner_toolwindow.h index 1c7b876d1..f151e258e 100644 --- a/src/designer/src/designer/qdesigner_toolwindow.h +++ b/src/designer/src/designer/qdesigner_toolwindow.h @@ -46,7 +46,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp index 0d646060a..75769c808 100644 --- a/src/designer/src/designer/qdesigner_workbench.cpp +++ b/src/designer/src/designer/qdesigner_workbench.cpp @@ -68,18 +68,18 @@ #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/saveformastemplate.cpp b/src/designer/src/designer/saveformastemplate.cpp index 49ac64ee5..c5015eb3b 100644 --- a/src/designer/src/designer/saveformastemplate.cpp +++ b/src/designer/src/designer/saveformastemplate.cpp @@ -43,9 +43,9 @@ #include "qdesigner_settings.h" #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/designer/versiondialog.cpp b/src/designer/src/designer/versiondialog.cpp index 63a95e6d7..f7a7181e6 100644 --- a/src/designer/src/designer/versiondialog.cpp +++ b/src/designer/src/designer/versiondialog.cpp @@ -41,13 +41,13 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #include "versiondialog.h" QT_BEGIN_NAMESPACE diff --git a/src/designer/src/designer/versiondialog.h b/src/designer/src/designer/versiondialog.h index 0e6760092..acea1b0c4 100644 --- a/src/designer/src/designer/versiondialog.h +++ b/src/designer/src/designer/versiondialog.h @@ -42,7 +42,7 @@ #ifndef VERSIONDIALOG_H #define VERSIONDIALOG_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/lib.pro b/src/designer/src/lib/lib.pro index b74cf02f3..55522d42b 100644 --- a/src/designer/src/lib/lib.pro +++ b/src/designer/src/lib/lib.pro @@ -2,7 +2,7 @@ load(qt_module) TEMPLATE=lib TARGET=QtDesigner -QT += core-private gui-private xml uilib-private +QT += core-private gui-private widgets widgets-private xml uilib-private contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols CONFIG += qt win32|mac: CONFIG += debug_and_release diff --git a/src/designer/src/lib/lib_pch.h b/src/designer/src/lib/lib_pch.h index 17c3d8cd6..b0e9fa097 100644 --- a/src/designer/src/lib/lib_pch.h +++ b/src/designer/src/lib/lib_pch.h @@ -48,17 +48,17 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include "qdesigner_widget_p.h" #include -#include +#include #include #include #include "layout_p.h" diff --git a/src/designer/src/lib/sdk/abstractactioneditor.h b/src/designer/src/lib/sdk/abstractactioneditor.h index 2d4241c23..4d95f0192 100644 --- a/src/designer/src/lib/sdk/abstractactioneditor.h +++ b/src/designer/src/lib/sdk/abstractactioneditor.h @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractdialoggui_p.h b/src/designer/src/lib/sdk/abstractdialoggui_p.h index af3843850..fef17b7e7 100644 --- a/src/designer/src/lib/sdk/abstractdialoggui_p.h +++ b/src/designer/src/lib/sdk/abstractdialoggui_p.h @@ -54,8 +54,8 @@ #define ABSTRACTDIALOGGUI_H #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractformeditor.cpp b/src/designer/src/lib/sdk/abstractformeditor.cpp index 6110a93e3..f2af58d29 100644 --- a/src/designer/src/lib/sdk/abstractformeditor.cpp +++ b/src/designer/src/lib/sdk/abstractformeditor.cpp @@ -66,7 +66,7 @@ #include #include -#include +#include // Must be done outside of the Qt namespace static void initResources() diff --git a/src/designer/src/lib/sdk/abstractformwindow.cpp b/src/designer/src/lib/sdk/abstractformwindow.cpp index bba78bf45..37ddfea0c 100644 --- a/src/designer/src/lib/sdk/abstractformwindow.cpp +++ b/src/designer/src/lib/sdk/abstractformwindow.cpp @@ -44,14 +44,14 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/designer/src/lib/sdk/abstractformwindow.h b/src/designer/src/lib/sdk/abstractformwindow.h index ab0f241ce..a6e81e518 100644 --- a/src/designer/src/lib/sdk/abstractformwindow.h +++ b/src/designer/src/lib/sdk/abstractformwindow.h @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractnewformwidget.h b/src/designer/src/lib/sdk/abstractnewformwidget.h index dc45acb93..5f77c87be 100644 --- a/src/designer/src/lib/sdk/abstractnewformwidget.h +++ b/src/designer/src/lib/sdk/abstractnewformwidget.h @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractobjectinspector.h b/src/designer/src/lib/sdk/abstractobjectinspector.h index 74c6e385a..58054f0d5 100644 --- a/src/designer/src/lib/sdk/abstractobjectinspector.h +++ b/src/designer/src/lib/sdk/abstractobjectinspector.h @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractpropertyeditor.h b/src/designer/src/lib/sdk/abstractpropertyeditor.h index a8d731631..e42fcab4a 100644 --- a/src/designer/src/lib/sdk/abstractpropertyeditor.h +++ b/src/designer/src/lib/sdk/abstractpropertyeditor.h @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractresourcebrowser.h b/src/designer/src/lib/sdk/abstractresourcebrowser.h index 836912d9a..5e7d4b2c3 100644 --- a/src/designer/src/lib/sdk/abstractresourcebrowser.h +++ b/src/designer/src/lib/sdk/abstractresourcebrowser.h @@ -44,7 +44,7 @@ #include -#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/sdk/abstractwidgetbox.h b/src/designer/src/lib/sdk/abstractwidgetbox.h index efbffd97c..6962cd76d 100644 --- a/src/designer/src/lib/sdk/abstractwidgetbox.h +++ b/src/designer/src/lib/sdk/abstractwidgetbox.h @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_HEADER diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp index 9db7ad741..9aa9ce3a1 100644 --- a/src/designer/src/lib/shared/actioneditor.cpp +++ b/src/designer/src/lib/shared/actioneditor.cpp @@ -60,21 +60,21 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/designer/src/lib/shared/actionprovider_p.h b/src/designer/src/lib/shared/actionprovider_p.h index ce8a1795e..8b49ee53f 100644 --- a/src/designer/src/lib/shared/actionprovider_p.h +++ b/src/designer/src/lib/shared/actionprovider_p.h @@ -56,7 +56,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/actionrepository.cpp b/src/designer/src/lib/shared/actionrepository.cpp index d7701cb9c..43239b6b7 100644 --- a/src/designer/src/lib/shared/actionrepository.cpp +++ b/src/designer/src/lib/shared/actionrepository.cpp @@ -50,13 +50,13 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/actionrepository_p.h b/src/designer/src/lib/shared/actionrepository_p.h index c2393cb0b..cebff479a 100644 --- a/src/designer/src/lib/shared/actionrepository_p.h +++ b/src/designer/src/lib/shared/actionrepository_p.h @@ -55,11 +55,11 @@ #include "shared_global_p.h" #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/codedialog.cpp b/src/designer/src/lib/shared/codedialog.cpp index f6ea29048..4f8da54b6 100644 --- a/src/designer/src/lib/shared/codedialog.cpp +++ b/src/designer/src/lib/shared/codedialog.cpp @@ -45,18 +45,18 @@ #include -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/codedialog_p.h b/src/designer/src/lib/shared/codedialog_p.h index bed7e224f..18c92a3b7 100644 --- a/src/designer/src/lib/shared/codedialog_p.h +++ b/src/designer/src/lib/shared/codedialog_p.h @@ -54,7 +54,7 @@ #define CODEPREVIEWDIALOG_H #include "shared_global_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/connectionedit.cpp b/src/designer/src/lib/shared/connectionedit.cpp index 5f5085c17..548a30002 100644 --- a/src/designer/src/lib/shared/connectionedit.cpp +++ b/src/designer/src/lib/shared/connectionedit.cpp @@ -49,10 +49,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include diff --git a/src/designer/src/lib/shared/connectionedit_p.h b/src/designer/src/lib/shared/connectionedit_p.h index 553fbe188..c7f69e93f 100644 --- a/src/designer/src/lib/shared/connectionedit_p.h +++ b/src/designer/src/lib/shared/connectionedit_p.h @@ -60,11 +60,11 @@ #include #include -#include +#include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/deviceprofile.cpp b/src/designer/src/lib/shared/deviceprofile.cpp index 3228cab5f..505cfecfa 100644 --- a/src/designer/src/lib/shared/deviceprofile.cpp +++ b/src/designer/src/lib/shared/deviceprofile.cpp @@ -45,12 +45,12 @@ #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/dialoggui.cpp b/src/designer/src/lib/shared/dialoggui.cpp index 3aa4c796d..f68106974 100644 --- a/src/designer/src/lib/shared/dialoggui.cpp +++ b/src/designer/src/lib/shared/dialoggui.cpp @@ -41,8 +41,8 @@ #include "dialoggui_p.h" -#include -#include +#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/filterwidget.cpp b/src/designer/src/lib/shared/filterwidget.cpp index e6c826cf8..6a6c4e76e 100644 --- a/src/designer/src/lib/shared/filterwidget.cpp +++ b/src/designer/src/lib/shared/filterwidget.cpp @@ -42,16 +42,16 @@ #include "filterwidget_p.h" #include "iconloader_p.h" -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/filterwidget_p.h b/src/designer/src/lib/shared/filterwidget_p.h index 5b5edcd7c..18aca67cb 100644 --- a/src/designer/src/lib/shared/filterwidget_p.h +++ b/src/designer/src/lib/shared/filterwidget_p.h @@ -55,10 +55,10 @@ #include "shared_global_p.h" -#include -#include +#include +#include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/formlayoutmenu.cpp b/src/designer/src/lib/shared/formlayoutmenu.cpp index d52bb53f5..07ec5676f 100644 --- a/src/designer/src/lib/shared/formlayoutmenu.cpp +++ b/src/designer/src/lib/shared/formlayoutmenu.cpp @@ -54,12 +54,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/formwindowbase.cpp b/src/designer/src/lib/shared/formwindowbase.cpp index 5875ae953..79b0804d3 100644 --- a/src/designer/src/lib/shared/formwindowbase.cpp +++ b/src/designer/src/lib/shared/formwindowbase.cpp @@ -61,18 +61,18 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/grid.cpp b/src/designer/src/lib/shared/grid.cpp index ba991c782..f40b95739 100644 --- a/src/designer/src/lib/shared/grid.cpp +++ b/src/designer/src/lib/shared/grid.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/gridpanel_p.h b/src/designer/src/lib/shared/gridpanel_p.h index adcfa3850..30aba0059 100644 --- a/src/designer/src/lib/shared/gridpanel_p.h +++ b/src/designer/src/lib/shared/gridpanel_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/htmlhighlighter.cpp b/src/designer/src/lib/shared/htmlhighlighter.cpp index d16ce62aa..e423f7fd9 100644 --- a/src/designer/src/lib/shared/htmlhighlighter.cpp +++ b/src/designer/src/lib/shared/htmlhighlighter.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include +#include #include "htmlhighlighter_p.h" @@ -48,7 +49,7 @@ QT_BEGIN_NAMESPACE namespace qdesigner_internal { HtmlHighlighter::HtmlHighlighter(QTextEdit *textEdit) - : QSyntaxHighlighter(textEdit) + : QSyntaxHighlighter(textEdit->document()) { QTextCharFormat entityFormat; entityFormat.setForeground(Qt::red); diff --git a/src/designer/src/lib/shared/htmlhighlighter_p.h b/src/designer/src/lib/shared/htmlhighlighter_p.h index 3c9bfc34b..9141e4ba8 100644 --- a/src/designer/src/lib/shared/htmlhighlighter_p.h +++ b/src/designer/src/lib/shared/htmlhighlighter_p.h @@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE +class QTextEdit; + namespace qdesigner_internal { /* HTML syntax highlighter based on Qt Quarterly example */ diff --git a/src/designer/src/lib/shared/iconloader.cpp b/src/designer/src/lib/shared/iconloader.cpp index b7f74b224..5b84040a0 100644 --- a/src/designer/src/lib/shared/iconloader.cpp +++ b/src/designer/src/lib/shared/iconloader.cpp @@ -42,7 +42,7 @@ #include "iconloader_p.h" #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/iconselector.cpp b/src/designer/src/lib/shared/iconselector.cpp index 10b5c9714..f485b9b66 100644 --- a/src/designer/src/lib/shared/iconselector.cpp +++ b/src/designer/src/lib/shared/iconselector.cpp @@ -53,21 +53,21 @@ #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/iconselector_p.h b/src/designer/src/lib/shared/iconselector_p.h index 4f68b730f..0e076558b 100644 --- a/src/designer/src/lib/shared/iconselector_p.h +++ b/src/designer/src/lib/shared/iconselector_p.h @@ -56,8 +56,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include #include diff --git a/src/designer/src/lib/shared/invisible_widget_p.h b/src/designer/src/lib/shared/invisible_widget_p.h index 04ca72458..baf861bcb 100644 --- a/src/designer/src/lib/shared/invisible_widget_p.h +++ b/src/designer/src/lib/shared/invisible_widget_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index 9fe438b08..2799a8ad7 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -58,18 +58,18 @@ #include #include -#include -#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/layout_p.h b/src/designer/src/lib/shared/layout_p.h index f901b63b9..286b71f0c 100644 --- a/src/designer/src/lib/shared/layout_p.h +++ b/src/designer/src/lib/shared/layout_p.h @@ -61,9 +61,9 @@ #include #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/layoutinfo.cpp b/src/designer/src/lib/shared/layoutinfo.cpp index 3d0e64250..7a25912bf 100644 --- a/src/designer/src/lib/shared/layoutinfo.cpp +++ b/src/designer/src/lib/shared/layoutinfo.cpp @@ -46,9 +46,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/metadatabase.cpp b/src/designer/src/lib/shared/metadatabase.cpp index 3cde7da13..6666a8306 100644 --- a/src/designer/src/lib/shared/metadatabase.cpp +++ b/src/designer/src/lib/shared/metadatabase.cpp @@ -46,7 +46,7 @@ #include // Qt -#include +#include #include #include diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp index 67121e597..4c18b2c36 100644 --- a/src/designer/src/lib/shared/morphmenu.cpp +++ b/src/designer/src/lib/shared/morphmenu.cpp @@ -56,24 +56,24 @@ #include #include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/newactiondialog.cpp b/src/designer/src/lib/shared/newactiondialog.cpp index 9aaa347c7..92938a8e3 100644 --- a/src/designer/src/lib/shared/newactiondialog.cpp +++ b/src/designer/src/lib/shared/newactiondialog.cpp @@ -50,7 +50,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/newactiondialog_p.h b/src/designer/src/lib/shared/newactiondialog_p.h index b06d1f9a5..2772b6c28 100644 --- a/src/designer/src/lib/shared/newactiondialog_p.h +++ b/src/designer/src/lib/shared/newactiondialog_p.h @@ -55,7 +55,7 @@ #include "qdesigner_utils_p.h" // PropertySheetIconValue -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/newformwidget.cpp b/src/designer/src/lib/shared/newformwidget.cpp index 150d97104..330bbeccc 100644 --- a/src/designer/src/lib/shared/newformwidget.cpp +++ b/src/designer/src/lib/shared/newformwidget.cpp @@ -61,10 +61,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/newformwidget_p.h b/src/designer/src/lib/shared/newformwidget_p.h index a840c9ad8..6eaa3c46b 100644 --- a/src/designer/src/lib/shared/newformwidget_p.h +++ b/src/designer/src/lib/shared/newformwidget_p.h @@ -58,7 +58,7 @@ #include -#include +#include #include #include diff --git a/src/designer/src/lib/shared/orderdialog.cpp b/src/designer/src/lib/shared/orderdialog.cpp index e992fdd34..c853c24e5 100644 --- a/src/designer/src/lib/shared/orderdialog.cpp +++ b/src/designer/src/lib/shared/orderdialog.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/orderdialog_p.h b/src/designer/src/lib/shared/orderdialog_p.h index 00d76fb15..33ef469a6 100644 --- a/src/designer/src/lib/shared/orderdialog_p.h +++ b/src/designer/src/lib/shared/orderdialog_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/plaintexteditor.cpp b/src/designer/src/lib/shared/plaintexteditor.cpp index 88b0b57aa..f1ffb5cde 100644 --- a/src/designer/src/lib/shared/plaintexteditor.cpp +++ b/src/designer/src/lib/shared/plaintexteditor.cpp @@ -44,10 +44,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/plaintexteditor_p.h b/src/designer/src/lib/shared/plaintexteditor_p.h index 830207bbd..78a624110 100644 --- a/src/designer/src/lib/shared/plaintexteditor_p.h +++ b/src/designer/src/lib/shared/plaintexteditor_p.h @@ -53,7 +53,7 @@ #ifndef PLAINTEXTEDITOR_H #define PLAINTEXTEDITOR_H -#include +#include #include "shared_global_p.h" QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/plugindialog.cpp b/src/designer/src/lib/shared/plugindialog.cpp index c4cdccf77..686d5f49a 100644 --- a/src/designer/src/lib/shared/plugindialog.cpp +++ b/src/designer/src/lib/shared/plugindialog.cpp @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/previewconfigurationwidget.cpp b/src/designer/src/lib/shared/previewconfigurationwidget.cpp index a65c3af9d..25253233d 100644 --- a/src/designer/src/lib/shared/previewconfigurationwidget.cpp +++ b/src/designer/src/lib/shared/previewconfigurationwidget.cpp @@ -51,10 +51,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/previewconfigurationwidget_p.h b/src/designer/src/lib/shared/previewconfigurationwidget_p.h index 21ea1f197..9f475adf9 100644 --- a/src/designer/src/lib/shared/previewconfigurationwidget_p.h +++ b/src/designer/src/lib/shared/previewconfigurationwidget_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/previewmanager.cpp b/src/designer/src/lib/shared/previewmanager.cpp index 47a732a32..1bdfed7ec 100644 --- a/src/designer/src/lib/shared/previewmanager.cpp +++ b/src/designer/src/lib/shared/previewmanager.cpp @@ -54,18 +54,18 @@ #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/promotionmodel.cpp b/src/designer/src/lib/shared/promotionmodel.cpp index deab66fa1..d9485db5e 100644 --- a/src/designer/src/lib/shared/promotionmodel.cpp +++ b/src/designer/src/lib/shared/promotionmodel.cpp @@ -46,7 +46,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/promotionmodel_p.h b/src/designer/src/lib/shared/promotionmodel_p.h index 214efb135..80664c930 100644 --- a/src/designer/src/lib/shared/promotionmodel_p.h +++ b/src/designer/src/lib/shared/promotionmodel_p.h @@ -53,7 +53,7 @@ #ifndef PROMOTIONMODEL_H #define PROMOTIONMODEL_H -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/promotiontaskmenu.cpp b/src/designer/src/lib/shared/promotiontaskmenu.cpp index dc76ef6cf..540316b26 100644 --- a/src/designer/src/lib/shared/promotiontaskmenu.cpp +++ b/src/designer/src/lib/shared/promotiontaskmenu.cpp @@ -55,9 +55,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/propertylineedit.cpp b/src/designer/src/lib/shared/propertylineedit.cpp index 29dff63ab..17daef514 100644 --- a/src/designer/src/lib/shared/propertylineedit.cpp +++ b/src/designer/src/lib/shared/propertylineedit.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/propertylineedit_p.h b/src/designer/src/lib/shared/propertylineedit_p.h index b968b18bf..2a5930d5f 100644 --- a/src/designer/src/lib/shared/propertylineedit_p.h +++ b/src/designer/src/lib/shared/propertylineedit_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_command.cpp b/src/designer/src/lib/shared/qdesigner_command.cpp index f4e250d89..6f9d45dc5 100644 --- a/src/designer/src/lib/shared/qdesigner_command.cpp +++ b/src/designer/src/lib/shared/qdesigner_command.cpp @@ -67,22 +67,22 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include Q_DECLARE_METATYPE(QWidgetList) diff --git a/src/designer/src/lib/shared/qdesigner_command2.cpp b/src/designer/src/lib/shared/qdesigner_command2.cpp index 2b0a5a21a..e69edb710 100644 --- a/src/designer/src/lib/shared/qdesigner_command2.cpp +++ b/src/designer/src/lib/shared/qdesigner_command2.cpp @@ -49,8 +49,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_command2_p.h b/src/designer/src/lib/shared/qdesigner_command2_p.h index 0a6cce88e..d83a7f88c 100644 --- a/src/designer/src/lib/shared/qdesigner_command2_p.h +++ b/src/designer/src/lib/shared/qdesigner_command2_p.h @@ -56,7 +56,7 @@ #include "shared_global_p.h" #include "qdesigner_formwindowcommand_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_command_p.h b/src/designer/src/lib/shared/qdesigner_command_p.h index 323cec5e5..3b40a3b3b 100644 --- a/src/designer/src/lib/shared/qdesigner_command_p.h +++ b/src/designer/src/lib/shared/qdesigner_command_p.h @@ -62,7 +62,7 @@ #include -#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_dnditem.cpp b/src/designer/src/lib/shared/qdesigner_dnditem.cpp index 83218026a..2b726c427 100644 --- a/src/designer/src/lib/shared/qdesigner_dnditem.cpp +++ b/src/designer/src/lib/shared/qdesigner_dnditem.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_dockwidget.cpp b/src/designer/src/lib/shared/qdesigner_dockwidget.cpp index 8aad4579c..f3e98b059 100644 --- a/src/designer/src/lib/shared/qdesigner_dockwidget.cpp +++ b/src/designer/src/lib/shared/qdesigner_dockwidget.cpp @@ -48,8 +48,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_dockwidget_p.h b/src/designer/src/lib/shared/qdesigner_dockwidget_p.h index 106ed1fb6..4587b5f54 100644 --- a/src/designer/src/lib/shared/qdesigner_dockwidget_p.h +++ b/src/designer/src/lib/shared/qdesigner_dockwidget_p.h @@ -54,7 +54,7 @@ #define QDESIGNER_DOCKWIDGET_H #include "shared_global_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp index a11514734..8c63ac990 100644 --- a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp +++ b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp @@ -65,16 +65,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h b/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h index 7b88be9e6..54ff39fa9 100644 --- a/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h +++ b/src/designer/src/lib/shared/qdesigner_formeditorcommand_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp index 3efc82994..0c9e58188 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp @@ -54,8 +54,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h b/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h index 7c98559e3..ed34d2b00 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h +++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand_p.h @@ -56,7 +56,7 @@ #include "shared_global_p.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_membersheet.cpp b/src/designer/src/lib/shared/qdesigner_membersheet.cpp index f70fc389b..688c999a9 100644 --- a/src/designer/src/lib/shared/qdesigner_membersheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_membersheet.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include namespace { diff --git a/src/designer/src/lib/shared/qdesigner_menu.cpp b/src/designer/src/lib/shared/qdesigner_menu.cpp index e9abf30cd..4abe68718 100644 --- a/src/designer/src/lib/shared/qdesigner_menu.cpp +++ b/src/designer/src/lib/shared/qdesigner_menu.cpp @@ -58,13 +58,14 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include +#include #include Q_DECLARE_METATYPE(QAction*) diff --git a/src/designer/src/lib/shared/qdesigner_menu_p.h b/src/designer/src/lib/shared/qdesigner_menu_p.h index b88af7aac..03c6f0ff3 100644 --- a/src/designer/src/lib/shared/qdesigner_menu_p.h +++ b/src/designer/src/lib/shared/qdesigner_menu_p.h @@ -55,8 +55,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_menubar.cpp b/src/designer/src/lib/shared/qdesigner_menubar.cpp index 534cf0cda..4c850012a 100644 --- a/src/designer/src/lib/shared/qdesigner_menubar.cpp +++ b/src/designer/src/lib/shared/qdesigner_menubar.cpp @@ -59,9 +59,9 @@ #include -#include +#include #include -#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_menubar_p.h b/src/designer/src/lib/shared/qdesigner_menubar_p.h index 8ca538559..3c65a24bf 100644 --- a/src/designer/src/lib/shared/qdesigner_menubar_p.h +++ b/src/designer/src/lib/shared/qdesigner_menubar_p.h @@ -55,8 +55,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp index 6463016b1..730c8cc2f 100644 --- a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp +++ b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp @@ -53,23 +53,23 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h b/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h index 73cf7ad50..65d3dc1b1 100644 --- a/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h +++ b/src/designer/src/lib/shared/qdesigner_promotiondialog_p.h @@ -53,8 +53,8 @@ #ifndef PROMOTIONEDITORDIALOG_H #define PROMOTIONEDITORDIALOG_H -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp index c145f0d2d..56f93a1d1 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -60,12 +60,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp index e3a92e289..c1c7c4b95 100644 --- a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -44,9 +44,9 @@ #include #include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp index 4d9c65a29..771306e9f 100644 --- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -54,16 +54,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_stackedbox.cpp b/src/designer/src/lib/shared/qdesigner_stackedbox.cpp index 0206e9709..9c65a605f 100644 --- a/src/designer/src/lib/shared/qdesigner_stackedbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_stackedbox.cpp @@ -48,11 +48,11 @@ #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp index 6110deaba..393a18e7a 100644 --- a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp +++ b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp @@ -47,13 +47,14 @@ #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget_p.h b/src/designer/src/lib/shared/qdesigner_tabwidget_p.h index 23140a600..6fd503128 100644 --- a/src/designer/src/lib/shared/qdesigner_tabwidget_p.h +++ b/src/designer/src/lib/shared/qdesigner_tabwidget_p.h @@ -58,7 +58,7 @@ #include "qdesigner_utils_p.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp index d6aef71ef..717217294 100644 --- a/src/designer/src/lib/shared/qdesigner_taskmenu.cpp +++ b/src/designer/src/lib/shared/qdesigner_taskmenu.cpp @@ -75,16 +75,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_toolbar.cpp b/src/designer/src/lib/shared/qdesigner_toolbar.cpp index 0fe730384..73da5a677 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbar.cpp +++ b/src/designer/src/lib/shared/qdesigner_toolbar.cpp @@ -54,13 +54,14 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include +#include #include Q_DECLARE_METATYPE(QAction*) diff --git a/src/designer/src/lib/shared/qdesigner_toolbar_p.h b/src/designer/src/lib/shared/qdesigner_toolbar_p.h index 7a38ec773..f16647f14 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbar_p.h +++ b/src/designer/src/lib/shared/qdesigner_toolbar_p.h @@ -55,8 +55,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_toolbox.cpp b/src/designer/src/lib/shared/qdesigner_toolbox.cpp index 675e98c36..1143a57a8 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_toolbox.cpp @@ -48,11 +48,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp index a7c11bd82..f54c6b515 100644 --- a/src/designer/src/lib/shared/qdesigner_utils.cpp +++ b/src/designer/src/lib/shared/qdesigner_utils.cpp @@ -58,13 +58,13 @@ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_utils_p.h b/src/designer/src/lib/shared/qdesigner_utils_p.h index 1c915e036..5506765c6 100644 --- a/src/designer/src/lib/shared/qdesigner_utils_p.h +++ b/src/designer/src/lib/shared/qdesigner_utils_p.h @@ -60,8 +60,8 @@ #include #include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_widget.cpp b/src/designer/src/lib/shared/qdesigner_widget.cpp index 0368d5337..8392744ba 100644 --- a/src/designer/src/lib/shared/qdesigner_widget.cpp +++ b/src/designer/src/lib/shared/qdesigner_widget.cpp @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_widget_p.h b/src/designer/src/lib/shared/qdesigner_widget_p.h index bb511ae4b..f27056ce7 100644 --- a/src/designer/src/lib/shared/qdesigner_widget_p.h +++ b/src/designer/src/lib/shared/qdesigner_widget_p.h @@ -54,8 +54,8 @@ #define QDESIGNER_WIDGET_H #include "shared_global_p.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_widgetitem.cpp b/src/designer/src/lib/shared/qdesigner_widgetitem.cpp index c58822957..a0d8e6489 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetitem.cpp +++ b/src/designer/src/lib/shared/qdesigner_widgetitem.cpp @@ -49,11 +49,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qdesigner_widgetitem_p.h b/src/designer/src/lib/shared/qdesigner_widgetitem_p.h index f79dbc5a1..5eb8297ab 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetitem_p.h +++ b/src/designer/src/lib/shared/qdesigner_widgetitem_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp index 66e7a795b..d1a3b55ae 100644 --- a/src/designer/src/lib/shared/qlayout_widget.cpp +++ b/src/designer/src/lib/shared/qlayout_widget.cpp @@ -53,10 +53,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qlayout_widget_p.h b/src/designer/src/lib/shared/qlayout_widget_p.h index a87679e75..24f883521 100644 --- a/src/designer/src/lib/shared/qlayout_widget_p.h +++ b/src/designer/src/lib/shared/qlayout_widget_p.h @@ -59,8 +59,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qsimpleresource.cpp b/src/designer/src/lib/shared/qsimpleresource.cpp index cced5954e..9fc513e4b 100644 --- a/src/designer/src/lib/shared/qsimpleresource.cpp +++ b/src/designer/src/lib/shared/qsimpleresource.cpp @@ -54,9 +54,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp index 1f6838eb0..3aa49a260 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -53,12 +53,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qtresourceeditordialog_p.h b/src/designer/src/lib/shared/qtresourceeditordialog_p.h index eef3bf540..030d45e6e 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog_p.h +++ b/src/designer/src/lib/shared/qtresourceeditordialog_p.h @@ -54,7 +54,7 @@ #define QTRESOURCEEDITOR_H #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp index c6addf09f..34bf1bd3e 100644 --- a/src/designer/src/lib/shared/qtresourceview.cpp +++ b/src/designer/src/lib/shared/qtresourceview.cpp @@ -48,24 +48,24 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/qtresourceview_p.h b/src/designer/src/lib/shared/qtresourceview_p.h index 947df64e4..82fa438d9 100644 --- a/src/designer/src/lib/shared/qtresourceview_p.h +++ b/src/designer/src/lib/shared/qtresourceview_p.h @@ -54,8 +54,8 @@ #define QTRESOURCEVIEW_H #include "shared_global_p.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/richtexteditor.cpp b/src/designer/src/lib/shared/richtexteditor.cpp index fa23baf8d..70b3fd30d 100644 --- a/src/designer/src/lib/shared/richtexteditor.cpp +++ b/src/designer/src/lib/shared/richtexteditor.cpp @@ -56,24 +56,24 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/richtexteditor_p.h b/src/designer/src/lib/shared/richtexteditor_p.h index 086c5d518..e88f21381 100644 --- a/src/designer/src/lib/shared/richtexteditor_p.h +++ b/src/designer/src/lib/shared/richtexteditor_p.h @@ -53,8 +53,8 @@ #ifndef RICHTEXTEDITOR_H #define RICHTEXTEDITOR_H -#include -#include +#include +#include #include "shared_global_p.h" QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/scriptdialog.cpp b/src/designer/src/lib/shared/scriptdialog.cpp index e2c1c7460..82aea7355 100644 --- a/src/designer/src/lib/shared/scriptdialog.cpp +++ b/src/designer/src/lib/shared/scriptdialog.cpp @@ -44,11 +44,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifdef QT_SCRIPT_LIB #include #endif diff --git a/src/designer/src/lib/shared/scriptdialog_p.h b/src/designer/src/lib/shared/scriptdialog_p.h index bb1881d00..f0b3baaea 100644 --- a/src/designer/src/lib/shared/scriptdialog_p.h +++ b/src/designer/src/lib/shared/scriptdialog_p.h @@ -55,7 +55,7 @@ #include "shared_global_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/scripterrordialog.cpp b/src/designer/src/lib/shared/scripterrordialog.cpp index 30d57342b..2cce8bfb2 100644 --- a/src/designer/src/lib/shared/scripterrordialog.cpp +++ b/src/designer/src/lib/shared/scripterrordialog.cpp @@ -41,11 +41,11 @@ #include "scripterrordialog_p.h" -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/scripterrordialog_p.h b/src/designer/src/lib/shared/scripterrordialog_p.h index 24ead6f4b..0e5638732 100644 --- a/src/designer/src/lib/shared/scripterrordialog_p.h +++ b/src/designer/src/lib/shared/scripterrordialog_p.h @@ -56,7 +56,7 @@ #include "shared_global_p.h" #include "formscriptrunner_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/sheet_delegate.cpp b/src/designer/src/lib/shared/sheet_delegate.cpp index 896ed5b83..1dcf6b2e6 100644 --- a/src/designer/src/lib/shared/sheet_delegate.cpp +++ b/src/designer/src/lib/shared/sheet_delegate.cpp @@ -42,8 +42,8 @@ #include "sheet_delegate_p.h" #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/sheet_delegate_p.h b/src/designer/src/lib/shared/sheet_delegate_p.h index 887cc6619..835eada2b 100644 --- a/src/designer/src/lib/shared/sheet_delegate_p.h +++ b/src/designer/src/lib/shared/sheet_delegate_p.h @@ -56,8 +56,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/signalslotdialog.cpp b/src/designer/src/lib/shared/signalslotdialog.cpp index a65aafade..2b0af64ef 100644 --- a/src/designer/src/lib/shared/signalslotdialog.cpp +++ b/src/designer/src/lib/shared/signalslotdialog.cpp @@ -54,12 +54,12 @@ #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/signalslotdialog_p.h b/src/designer/src/lib/shared/signalslotdialog_p.h index 1bfeecece..498f76fc9 100644 --- a/src/designer/src/lib/shared/signalslotdialog_p.h +++ b/src/designer/src/lib/shared/signalslotdialog_p.h @@ -55,8 +55,8 @@ #include "shared_global_p.h" #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/spacer_widget.cpp b/src/designer/src/lib/shared/spacer_widget.cpp index 528a4f427..959f73371 100644 --- a/src/designer/src/lib/shared/spacer_widget.cpp +++ b/src/designer/src/lib/shared/spacer_widget.cpp @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/spacer_widget_p.h b/src/designer/src/lib/shared/spacer_widget_p.h index dd9288d24..58945b1d1 100644 --- a/src/designer/src/lib/shared/spacer_widget_p.h +++ b/src/designer/src/lib/shared/spacer_widget_p.h @@ -56,8 +56,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/stylesheeteditor.cpp b/src/designer/src/lib/shared/stylesheeteditor.cpp index d96fe55f4..955db272a 100644 --- a/src/designer/src/lib/shared/stylesheeteditor.cpp +++ b/src/designer/src/lib/shared/stylesheeteditor.cpp @@ -56,16 +56,16 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include "private/qcssparser_p.h" +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/stylesheeteditor_p.h b/src/designer/src/lib/shared/stylesheeteditor_p.h index ce735c71b..5a1afd895 100644 --- a/src/designer/src/lib/shared/stylesheeteditor_p.h +++ b/src/designer/src/lib/shared/stylesheeteditor_p.h @@ -53,9 +53,9 @@ #ifndef STYLESHEETEDITOR_H #define STYLESHEETEDITOR_H -#include -#include -#include +#include +#include +#include #include "shared_global_p.h" QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/textpropertyeditor.cpp b/src/designer/src/lib/shared/textpropertyeditor.cpp index bc6cbeac7..b1e633824 100644 --- a/src/designer/src/lib/shared/textpropertyeditor.cpp +++ b/src/designer/src/lib/shared/textpropertyeditor.cpp @@ -43,11 +43,11 @@ #include "propertylineedit_p.h" #include "stylesheeteditor_p.h" -#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/textpropertyeditor_p.h b/src/designer/src/lib/shared/textpropertyeditor_p.h index da92e8e82..b3e71c528 100644 --- a/src/designer/src/lib/shared/textpropertyeditor_p.h +++ b/src/designer/src/lib/shared/textpropertyeditor_p.h @@ -56,7 +56,7 @@ #include "shared_global_p.h" #include "shared_enums_p.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/shared/widgetdatabase_p.h b/src/designer/src/lib/shared/widgetdatabase_p.h index eb89cb139..4300dbe5a 100644 --- a/src/designer/src/lib/shared/widgetdatabase_p.h +++ b/src/designer/src/lib/shared/widgetdatabase_p.h @@ -58,7 +58,7 @@ #include -#include +#include #include #include #include diff --git a/src/designer/src/lib/shared/widgetfactory.cpp b/src/designer/src/lib/shared/widgetfactory.cpp index 400e5b9ef..dcfc445e4 100644 --- a/src/designer/src/lib/shared/widgetfactory.cpp +++ b/src/designer/src/lib/shared/widgetfactory.cpp @@ -70,15 +70,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/designer/src/lib/shared/zoomwidget.cpp b/src/designer/src/lib/shared/zoomwidget.cpp index c77a518fe..91b991373 100644 --- a/src/designer/src/lib/shared/zoomwidget.cpp +++ b/src/designer/src/lib/shared/zoomwidget.cpp @@ -41,13 +41,13 @@ #include "zoomwidget_p.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/designer/src/lib/shared/zoomwidget_p.h b/src/designer/src/lib/shared/zoomwidget_p.h index 4b2a05077..142512487 100644 --- a/src/designer/src/lib/shared/zoomwidget_p.h +++ b/src/designer/src/lib/shared/zoomwidget_p.h @@ -55,8 +55,8 @@ #include "shared_global_p.h" -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp b/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp index 019ada2f5..813c2bb28 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetplugin.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp b/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp index d49f369d3..18f8962c0 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp b/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp index cadbc1dd6..09f316fc9 100644 --- a/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp +++ b/src/designer/src/plugins/activeqt/qdesigneraxwidget.cpp @@ -43,9 +43,9 @@ #include #include -#include +#include #include -#include +#include #include diff --git a/src/designer/src/plugins/activeqt/qdesigneraxwidget.h b/src/designer/src/plugins/activeqt/qdesigneraxwidget.h index 88d49e1b0..7aeba9e51 100644 --- a/src/designer/src/plugins/activeqt/qdesigneraxwidget.h +++ b/src/designer/src/plugins/activeqt/qdesigneraxwidget.h @@ -44,7 +44,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/plugins/phononwidgets/phononwidgets.pro b/src/designer/src/plugins/phononwidgets/phononwidgets.pro index 9cabfd761..1da3f5bf8 100644 --- a/src/designer/src/plugins/phononwidgets/phononwidgets.pro +++ b/src/designer/src/plugins/phononwidgets/phononwidgets.pro @@ -1,7 +1,7 @@ TEMPLATE = lib TARGET = phononwidgets CONFIG += qt warn_on plugin -QT += phonon designer-private +QT += widgets phonon designer-private include(../plugins.pri) build_all:!build_pass { diff --git a/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp b/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp index 90cc96ffa..fd4a6ac7a 100644 --- a/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp +++ b/src/designer/src/plugins/phononwidgets/videoplayertaskmenu.cpp @@ -49,12 +49,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro b/src/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro index b8abe8741..a677f0f18 100644 --- a/src/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro +++ b/src/designer/src/plugins/qdeclarativeview/qdeclarativeview.pro @@ -1,7 +1,7 @@ TEMPLATE = lib TARGET = qdeclarativeview CONFIG += qt warn_on plugin designer -QT += declarative +QT += widgets declarative include(../plugins.pri) build_all:!build_pass { diff --git a/src/designer/src/plugins/qwebview/qwebview.pro b/src/designer/src/plugins/qwebview/qwebview.pro index b1f6371d1..cbbc37d2d 100644 --- a/src/designer/src/plugins/qwebview/qwebview.pro +++ b/src/designer/src/plugins/qwebview/qwebview.pro @@ -1,7 +1,7 @@ TEMPLATE = lib TARGET = qwebview CONFIG += qt warn_on plugin -QT += webkit +QT += widgets webkit include(../plugins.pri) build_all:!build_pass { diff --git a/src/designer/src/plugins/tools/view3d/view3d.h b/src/designer/src/plugins/tools/view3d/view3d.h index 43e2ae9eb..ec19ec915 100644 --- a/src/designer/src/plugins/tools/view3d/view3d.h +++ b/src/designer/src/plugins/tools/view3d/view3d.h @@ -43,7 +43,7 @@ #define VIEW3D_H #include "view3d_global.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp b/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp index 62b7868e7..f66fdeff6 100644 --- a/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp +++ b/src/designer/src/plugins/tools/view3d/view3d_plugin.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include "view3d_plugin.h" #include "view3d_tool.h" diff --git a/src/designer/src/plugins/tools/view3d/view3d_tool.cpp b/src/designer/src/plugins/tools/view3d/view3d_tool.cpp index e92a58bc9..f241a7c27 100644 --- a/src/designer/src/plugins/tools/view3d/view3d_tool.cpp +++ b/src/designer/src/plugins/tools/view3d/view3d_tool.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "view3d_tool.h" QView3DTool::QView3DTool(QDesignerFormWindowInterface *formWindow, QObject *parent) diff --git a/src/linguist/linguist/batchtranslationdialog.cpp b/src/linguist/linguist/batchtranslationdialog.cpp index e58316ff0..decccadfa 100644 --- a/src/linguist/linguist/batchtranslationdialog.cpp +++ b/src/linguist/linguist/batchtranslationdialog.cpp @@ -43,8 +43,8 @@ #include "phrase.h" #include "messagemodel.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/batchtranslationdialog.h b/src/linguist/linguist/batchtranslationdialog.h index 16d70cafe..fa35a4d15 100644 --- a/src/linguist/linguist/batchtranslationdialog.h +++ b/src/linguist/linguist/batchtranslationdialog.h @@ -45,8 +45,8 @@ #include "ui_batchtranslation.h" #include "phrase.h" -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/errorsview.cpp b/src/linguist/linguist/errorsview.cpp index f24b3bede..8aa94858b 100644 --- a/src/linguist/linguist/errorsview.cpp +++ b/src/linguist/linguist/errorsview.cpp @@ -47,11 +47,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/formpreviewview.cpp b/src/linguist/linguist/formpreviewview.cpp index a2a600257..7ad28454a 100644 --- a/src/linguist/linguist/formpreviewview.cpp +++ b/src/linguist/linguist/formpreviewview.cpp @@ -48,19 +48,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/formpreviewview.h b/src/linguist/linguist/formpreviewview.h index e30160670..15fafc4b7 100644 --- a/src/linguist/linguist/formpreviewview.h +++ b/src/linguist/linguist/formpreviewview.h @@ -47,7 +47,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/linguist.pro b/src/linguist/linguist/linguist.pro index 46aad5f07..db68e9130 100644 --- a/src/linguist/linguist/linguist.pro +++ b/src/linguist/linguist/linguist.pro @@ -4,7 +4,7 @@ TEMPLATE = app LANGUAGE = C++ DESTDIR = $$QT.designer.bins -QT += core-private xml designer +QT += core-private widgets xml designer CONFIG += qt \ warn_on \ diff --git a/src/linguist/linguist/main.cpp b/src/linguist/linguist/main.cpp index c1388e198..07e4768d3 100644 --- a/src/linguist/linguist/main.cpp +++ b/src/linguist/linguist/main.cpp @@ -49,10 +49,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include QT_USE_NAMESPACE diff --git a/src/linguist/linguist/mainwindow.h b/src/linguist/linguist/mainwindow.h index fe9daf264..1c90c42e6 100644 --- a/src/linguist/linguist/mainwindow.h +++ b/src/linguist/linguist/mainwindow.h @@ -50,7 +50,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/messageeditor.h b/src/linguist/linguist/messageeditor.h index 875ef3303..410f253f3 100644 --- a/src/linguist/linguist/messageeditor.h +++ b/src/linguist/linguist/messageeditor.h @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/linguist/messagehighlighter.cpp b/src/linguist/linguist/messagehighlighter.cpp index bef2d6221..0191d4cab 100644 --- a/src/linguist/linguist/messagehighlighter.cpp +++ b/src/linguist/linguist/messagehighlighter.cpp @@ -42,11 +42,12 @@ #include "messagehighlighter.h" #include +#include QT_BEGIN_NAMESPACE MessageHighlighter::MessageHighlighter(QTextEdit *textEdit) - : QSyntaxHighlighter(textEdit) + : QSyntaxHighlighter(textEdit->document()) { QTextCharFormat entityFormat; entityFormat.setForeground(Qt::red); diff --git a/src/linguist/linguist/messagehighlighter.h b/src/linguist/linguist/messagehighlighter.h index 455140f61..f041ac7fd 100644 --- a/src/linguist/linguist/messagehighlighter.h +++ b/src/linguist/linguist/messagehighlighter.h @@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE +class QTextEdit; + /* Message highlighter based on HtmlSyntaxHighlighter from designer */ class MessageHighlighter : public QSyntaxHighlighter { diff --git a/src/linguist/linguist/messagemodel.cpp b/src/linguist/linguist/messagemodel.cpp index 2d126577c..f90a3167f 100644 --- a/src/linguist/linguist/messagemodel.cpp +++ b/src/linguist/linguist/messagemodel.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/linguist/linguist/translationsettingsdialog.h b/src/linguist/linguist/translationsettingsdialog.h index 9eee406fa..083bc8ebd 100644 --- a/src/linguist/linguist/translationsettingsdialog.h +++ b/src/linguist/linguist/translationsettingsdialog.h @@ -45,7 +45,7 @@ #include "ui_translationsettings.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/pixeltool/pixeltool.pro b/src/pixeltool/pixeltool.pro index 60cd6d3ec..aa2804078 100644 --- a/src/pixeltool/pixeltool.pro +++ b/src/pixeltool/pixeltool.pro @@ -1,6 +1,6 @@ TEMPLATE = app CONFIG += qt warn_on -QT += network +QT += widgets network build_all:!build_pass { CONFIG -= build_all diff --git a/src/qdbus/qdbusviewer/main.cpp b/src/qdbus/qdbusviewer/main.cpp index f3726204c..72e5e8a1c 100644 --- a/src/qdbus/qdbusviewer/main.cpp +++ b/src/qdbus/qdbusviewer/main.cpp @@ -39,9 +39,12 @@ ** ****************************************************************************/ -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "qdbusviewer.h" diff --git a/src/qdbus/qdbusviewer/qdbusviewer.cpp b/src/qdbus/qdbusviewer/qdbusviewer.cpp index cab109386..3e2335e64 100644 --- a/src/qdbus/qdbusviewer/qdbusviewer.cpp +++ b/src/qdbus/qdbusviewer/qdbusviewer.cpp @@ -44,7 +44,22 @@ #include "propertydialog.h" #include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include class QDBusViewModel: public QDBusModel { diff --git a/src/qdbus/qdbusviewer/qdbusviewer.h b/src/qdbus/qdbusviewer/qdbusviewer.h index 19777882c..50e5120b8 100644 --- a/src/qdbus/qdbusviewer/qdbusviewer.h +++ b/src/qdbus/qdbusviewer/qdbusviewer.h @@ -42,12 +42,18 @@ #ifndef QDBUSVIEWER_H #define QDBUSVIEWER_H -#include +#include #include -QT_FORWARD_DECLARE_CLASS(QTreeView); -QT_FORWARD_DECLARE_CLASS(QDomDocument); -QT_FORWARD_DECLARE_CLASS(QDomElement); +QT_FORWARD_DECLARE_CLASS(QTreeView) +QT_FORWARD_DECLARE_CLASS(QTreeWidget) +QT_FORWARD_DECLARE_CLASS(QStringListModel) +QT_FORWARD_DECLARE_CLASS(QSortFilterProxyModel) +QT_FORWARD_DECLARE_CLASS(QLineEdit) +QT_FORWARD_DECLARE_CLASS(QListView) +QT_FORWARD_DECLARE_CLASS(QTextBrowser) +QT_FORWARD_DECLARE_CLASS(QDomDocument) +QT_FORWARD_DECLARE_CLASS(QDomElement) struct BusSignature { diff --git a/src/qdbus/qdbusviewer/qdbusviewer.pro b/src/qdbus/qdbusviewer/qdbusviewer.pro index 42c6d1998..2c6476cd7 100644 --- a/src/qdbus/qdbusviewer/qdbusviewer.pro +++ b/src/qdbus/qdbusviewer/qdbusviewer.pro @@ -14,7 +14,7 @@ RESOURCES += qdbusviewer.qrc DESTDIR = $$QT.designer.bins -QT += dbus-private xml +QT += widgets dbus-private xml target.path=$$[QT_INSTALL_BINS] INSTALLS += target diff --git a/src/qmeegographicssystemhelper/qmeegoruntime.cpp b/src/qmeegographicssystemhelper/qmeegoruntime.cpp index 928d01a4a..141ad082c 100644 --- a/src/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/src/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -43,8 +43,8 @@ #include "qmeegoswitchevent.h" -#include -#include +#include +#include #include #include diff --git a/src/qtconfig/mainwindow.cpp b/src/qtconfig/mainwindow.cpp index 059adb307..a46bd2090 100644 --- a/src/qtconfig/mainwindow.cpp +++ b/src/qtconfig/mainwindow.cpp @@ -75,7 +75,7 @@ #include #endif -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/qtconfig/mainwindow.h b/src/qtconfig/mainwindow.h index 6f4c8a52e..d451bdaf3 100644 --- a/src/qtconfig/mainwindow.h +++ b/src/qtconfig/mainwindow.h @@ -42,7 +42,7 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/qtconfig/paletteeditoradvanced.h b/src/qtconfig/paletteeditoradvanced.h index 4f6167670..cb6b619a9 100644 --- a/src/qtconfig/paletteeditoradvanced.h +++ b/src/qtconfig/paletteeditoradvanced.h @@ -42,7 +42,7 @@ #ifndef PALETTEEDITORADVANCED_H #define PALETTEEDITORADVANCED_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/qtconfig/previewwidget.h b/src/qtconfig/previewwidget.h index d39fd7540..a3f418d29 100644 --- a/src/qtconfig/previewwidget.h +++ b/src/qtconfig/previewwidget.h @@ -42,7 +42,7 @@ #ifndef PREVIEWWIDGET_H #define PREVIEWWIDGET_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/qttracereplay/main.cpp b/src/qttracereplay/main.cpp index 771801362..c3ea29478 100644 --- a/src/qttracereplay/main.cpp +++ b/src/qttracereplay/main.cpp @@ -39,8 +39,13 @@ ** ****************************************************************************/ -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/qttracereplay/qttracereplay.pro b/src/qttracereplay/qttracereplay.pro index ca9956848..e7e0394f3 100644 --- a/src/qttracereplay/qttracereplay.pro +++ b/src/qttracereplay/qttracereplay.pro @@ -7,7 +7,7 @@ DESTDIR = $$QT.designer.bins DEPENDPATH += . INCLUDEPATH += . $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src TARGET = qttracereplay -QT += core-private gui-private +QT += core-private gui-private widgets widgets-private # Input SOURCES += main.cpp diff --git a/src/runonphone/symbianutils/bluetoothlistener_gui.cpp b/src/runonphone/symbianutils/bluetoothlistener_gui.cpp index c3f36b23a..85457f8ff 100644 --- a/src/runonphone/symbianutils/bluetoothlistener_gui.cpp +++ b/src/runonphone/symbianutils/bluetoothlistener_gui.cpp @@ -43,8 +43,8 @@ #include "bluetoothlistener.h" #include "communicationstarter.h" -#include -#include +#include +#include #include #include diff --git a/src/shared/deviceskin/deviceskin.cpp b/src/shared/deviceskin/deviceskin.cpp index 1e3748fe8..2afb830e0 100644 --- a/src/shared/deviceskin/deviceskin.cpp +++ b/src/shared/deviceskin/deviceskin.cpp @@ -42,7 +42,7 @@ #include "deviceskin.h" #include -#include +#include #include #include #include diff --git a/src/shared/deviceskin/deviceskin.h b/src/shared/deviceskin/deviceskin.h index 8a53acffd..e4fb87e3c 100644 --- a/src/shared/deviceskin/deviceskin.h +++ b/src/shared/deviceskin/deviceskin.h @@ -42,7 +42,7 @@ #ifndef SKIN_H #define SKIN_H -#include +#include #include #include #include diff --git a/src/shared/findwidget/abstractfindwidget.cpp b/src/shared/findwidget/abstractfindwidget.cpp index b9f7a811e..44f83ca58 100644 --- a/src/shared/findwidget/abstractfindwidget.cpp +++ b/src/shared/findwidget/abstractfindwidget.cpp @@ -59,13 +59,13 @@ #include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/findwidget/abstractfindwidget.h b/src/shared/findwidget/abstractfindwidget.h index 6592911a8..2dd9b96df 100644 --- a/src/shared/findwidget/abstractfindwidget.h +++ b/src/shared/findwidget/abstractfindwidget.h @@ -42,8 +42,8 @@ #ifndef ABSTRACTFINDWIDGET_H #define ABSTRACTFINDWIDGET_H -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/findwidget/itemviewfindwidget.cpp b/src/shared/findwidget/itemviewfindwidget.cpp index 9249ed5f7..2fff115c4 100644 --- a/src/shared/findwidget/itemviewfindwidget.cpp +++ b/src/shared/findwidget/itemviewfindwidget.cpp @@ -64,9 +64,9 @@ #include "itemviewfindwidget.h" -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/findwidget/texteditfindwidget.cpp b/src/shared/findwidget/texteditfindwidget.cpp index f02bdcc33..68174b6ed 100644 --- a/src/shared/findwidget/texteditfindwidget.cpp +++ b/src/shared/findwidget/texteditfindwidget.cpp @@ -60,9 +60,9 @@ #include "texteditfindwidget.h" -#include +#include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/fontpanel/fontpanel.cpp b/src/shared/fontpanel/fontpanel.cpp index 9bcef2a4b..b7f2b6173 100644 --- a/src/shared/fontpanel/fontpanel.cpp +++ b/src/shared/fontpanel/fontpanel.cpp @@ -41,13 +41,13 @@ #include "fontpanel.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/fontpanel/fontpanel.h b/src/shared/fontpanel/fontpanel.h index 204ff7d4a..27ff1bc31 100644 --- a/src/shared/fontpanel/fontpanel.h +++ b/src/shared/fontpanel/fontpanel.h @@ -53,7 +53,7 @@ #ifndef FONTPANEL_H #define FONTPANEL_H -#include +#include #include #include diff --git a/src/shared/qtgradienteditor/qtcolorbutton.cpp b/src/shared/qtgradienteditor/qtcolorbutton.cpp index 96a8b26ca..b7cd29cc8 100644 --- a/src/shared/qtgradienteditor/qtcolorbutton.cpp +++ b/src/shared/qtgradienteditor/qtcolorbutton.cpp @@ -40,11 +40,12 @@ ****************************************************************************/ #include "qtcolorbutton.h" -#include +#include #include #include #include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtcolorbutton.h b/src/shared/qtgradienteditor/qtcolorbutton.h index 42fcfc113..733bccbbd 100644 --- a/src/shared/qtgradienteditor/qtcolorbutton.h +++ b/src/shared/qtgradienteditor/qtcolorbutton.h @@ -42,7 +42,7 @@ #ifndef QTCOLORBUTTON_H #define QTCOLORBUTTON_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtcolorline.cpp b/src/shared/qtgradienteditor/qtcolorline.cpp index f4eda3f9b..2f241f82d 100644 --- a/src/shared/qtgradienteditor/qtcolorline.cpp +++ b/src/shared/qtgradienteditor/qtcolorline.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtcolorline.h b/src/shared/qtgradienteditor/qtcolorline.h index 8d04a7ca7..7c852ee68 100644 --- a/src/shared/qtgradienteditor/qtcolorline.h +++ b/src/shared/qtgradienteditor/qtcolorline.h @@ -42,7 +42,7 @@ #ifndef QTCOLORLINE_H #define QTCOLORLINE_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientdialog.cpp b/src/shared/qtgradienteditor/qtgradientdialog.cpp index dbeeb1f20..322ac33f1 100644 --- a/src/shared/qtgradienteditor/qtgradientdialog.cpp +++ b/src/shared/qtgradienteditor/qtgradientdialog.cpp @@ -41,7 +41,7 @@ #include "qtgradientdialog.h" #include "ui_qtgradientdialog.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientdialog.h b/src/shared/qtgradienteditor/qtgradientdialog.h index c6330d164..c73efcb35 100644 --- a/src/shared/qtgradienteditor/qtgradientdialog.h +++ b/src/shared/qtgradienteditor/qtgradientdialog.h @@ -42,7 +42,7 @@ #ifndef QTGRADIENTDIALOG_H #define QTGRADIENTDIALOG_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradienteditor.h b/src/shared/qtgradienteditor/qtgradienteditor.h index 77e1d3470..3544e4959 100644 --- a/src/shared/qtgradienteditor/qtgradienteditor.h +++ b/src/shared/qtgradienteditor/qtgradienteditor.h @@ -42,7 +42,7 @@ #ifndef QTGRADIENTEDITOR_H #define QTGRADIENTEDITOR_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientstopscontroller.h b/src/shared/qtgradienteditor/qtgradientstopscontroller.h index 1ae96aafe..631ccdf9f 100644 --- a/src/shared/qtgradienteditor/qtgradientstopscontroller.h +++ b/src/shared/qtgradienteditor/qtgradientstopscontroller.h @@ -42,7 +42,7 @@ #ifndef QTGRADIENTSTOPSCONTROLLER_H #define QTGRADIENTSTOPSCONTROLLER_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientstopswidget.cpp b/src/shared/qtgradienteditor/qtgradientstopswidget.cpp index a4104327b..b3dc2fd6d 100644 --- a/src/shared/qtgradienteditor/qtgradientstopswidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientstopswidget.cpp @@ -45,10 +45,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientstopswidget.h b/src/shared/qtgradienteditor/qtgradientstopswidget.h index a6893c07b..50e91cac4 100644 --- a/src/shared/qtgradienteditor/qtgradientstopswidget.h +++ b/src/shared/qtgradienteditor/qtgradientstopswidget.h @@ -42,7 +42,7 @@ #ifndef QTGRADIENTSTOPSWIDGET_H #define QTGRADIENTSTOPSWIDGET_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientview.cpp b/src/shared/qtgradienteditor/qtgradientview.cpp index a3d17950d..d7b9caf0a 100644 --- a/src/shared/qtgradienteditor/qtgradientview.cpp +++ b/src/shared/qtgradienteditor/qtgradientview.cpp @@ -44,7 +44,7 @@ #include "qtgradientdialog.h" #include "qtgradientutils.h" #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientview.h b/src/shared/qtgradienteditor/qtgradientview.h index 8a45ecfcb..3ce27020b 100644 --- a/src/shared/qtgradienteditor/qtgradientview.h +++ b/src/shared/qtgradienteditor/qtgradientview.h @@ -42,7 +42,7 @@ #ifndef GRADIENTVIEW_H #define GRADIENTVIEW_H -#include +#include #include #include "ui_qtgradientview.h" diff --git a/src/shared/qtgradienteditor/qtgradientviewdialog.cpp b/src/shared/qtgradienteditor/qtgradientviewdialog.cpp index 260641d32..a1bbace35 100644 --- a/src/shared/qtgradienteditor/qtgradientviewdialog.cpp +++ b/src/shared/qtgradienteditor/qtgradientviewdialog.cpp @@ -41,7 +41,7 @@ #include "qtgradientviewdialog.h" #include "qtgradientmanager.h" -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtgradienteditor/qtgradientviewdialog.h b/src/shared/qtgradienteditor/qtgradientviewdialog.h index 66cfeea40..b85060b28 100644 --- a/src/shared/qtgradienteditor/qtgradientviewdialog.h +++ b/src/shared/qtgradienteditor/qtgradientviewdialog.h @@ -42,7 +42,7 @@ #ifndef GRADIENTVIEWDIALOG_H #define GRADIENTVIEWDIALOG_H -#include +#include #include #include "ui_qtgradientviewdialog.h" diff --git a/src/shared/qtgradienteditor/qtgradientwidget.cpp b/src/shared/qtgradienteditor/qtgradientwidget.cpp index d9056a703..bf9ea0da6 100644 --- a/src/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientwidget.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #define _USE_MATH_DEFINES diff --git a/src/shared/qtgradienteditor/qtgradientwidget.h b/src/shared/qtgradienteditor/qtgradientwidget.h index ee866feb9..de6a0272a 100644 --- a/src/shared/qtgradienteditor/qtgradientwidget.h +++ b/src/shared/qtgradienteditor/qtgradientwidget.h @@ -42,7 +42,7 @@ #ifndef QTGRADIENTWIDGET_H #define QTGRADIENTWIDGET_H -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp index 09571243f..e4b352ebf 100644 --- a/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp @@ -41,12 +41,12 @@ #include "qtbuttonpropertybrowser.h" #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtpropertybrowser/qteditorfactory.cpp b/src/shared/qtpropertybrowser/qteditorfactory.cpp index 90ba3d3a2..5cad97938 100644 --- a/src/shared/qtpropertybrowser/qteditorfactory.cpp +++ b/src/shared/qtpropertybrowser/qteditorfactory.cpp @@ -41,21 +41,21 @@ #include "qteditorfactory.h" #include "qtpropertybrowserutils_p.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #if defined(Q_CC_MSVC) diff --git a/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp index 0633aa4f6..61462fe03 100644 --- a/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp @@ -41,9 +41,9 @@ #include "qtgroupboxpropertybrowser.h" #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp index 3771ef686..cf307caa1 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp @@ -42,7 +42,7 @@ #include "qtpropertybrowser.h" #include #include -#include +#include #if defined(Q_CC_MSVC) # pragma warning(disable: 4786) /* MS VS 6: truncating debug info after 255 characters */ diff --git a/src/shared/qtpropertybrowser/qtpropertybrowser.h b/src/shared/qtpropertybrowser/qtpropertybrowser.h index 619f43501..3e1cf78ab 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowser.h +++ b/src/shared/qtpropertybrowser/qtpropertybrowser.h @@ -42,7 +42,7 @@ #ifndef QTPROPERTYBROWSER_H #define QTPROPERTYBROWSER_H -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp b/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp index 0b57cff88..06a04faeb 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp +++ b/src/shared/qtpropertybrowser/qtpropertybrowserutils.cpp @@ -40,13 +40,13 @@ ****************************************************************************/ #include "qtpropertybrowserutils_p.h" -#include +#include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtpropertybrowser/qtpropertybrowserutils_p.h b/src/shared/qtpropertybrowser/qtpropertybrowserutils_p.h index 440ec9a11..64fc9de21 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowserutils_p.h +++ b/src/shared/qtpropertybrowser/qtpropertybrowserutils_p.h @@ -54,8 +54,8 @@ #define QTPROPERTYBROWSERUTILS_H #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtpropertybrowser/qtpropertymanager.cpp b/src/shared/qtpropertybrowser/qtpropertymanager.cpp index 962e35727..d380695bc 100644 --- a/src/shared/qtpropertybrowser/qtpropertymanager.cpp +++ b/src/shared/qtpropertybrowser/qtpropertymanager.cpp @@ -45,14 +45,14 @@ #include #include #include -#include +#include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include diff --git a/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp b/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp index 58a29e0e2..90337e9df 100644 --- a/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qttreepropertybrowser.cpp @@ -41,15 +41,15 @@ #include "qttreepropertybrowser.h" #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include +#include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/shared/qtpropertybrowser/qtvariantproperty.cpp b/src/shared/qtpropertybrowser/qtvariantproperty.cpp index 9647b3ac7..cbaecf7ec 100644 --- a/src/shared/qtpropertybrowser/qtvariantproperty.cpp +++ b/src/shared/qtpropertybrowser/qtvariantproperty.cpp @@ -43,7 +43,7 @@ #include "qtpropertymanager.h" #include "qteditorfactory.h" #include -#include +#include #include #include diff --git a/src/shared/qtpropertybrowser/qtvariantproperty.h b/src/shared/qtpropertybrowser/qtvariantproperty.h index b5fe1f928..959a19392 100644 --- a/src/shared/qtpropertybrowser/qtvariantproperty.h +++ b/src/shared/qtpropertybrowser/qtvariantproperty.h @@ -44,7 +44,7 @@ #include "qtpropertybrowser.h" #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qttoolbardialog/qttoolbardialog.cpp b/src/shared/qttoolbardialog/qttoolbardialog.cpp index b45bef290..fae5cb548 100644 --- a/src/shared/qttoolbardialog/qttoolbardialog.cpp +++ b/src/shared/qttoolbardialog/qttoolbardialog.cpp @@ -44,11 +44,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/shared/qttoolbardialog/qttoolbardialog.h b/src/shared/qttoolbardialog/qttoolbardialog.h index 925662e4b..fb372e67a 100644 --- a/src/shared/qttoolbardialog/qttoolbardialog.h +++ b/src/shared/qttoolbardialog/qttoolbardialog.h @@ -53,7 +53,7 @@ #ifndef QTTOOLBARDIALOG_H #define QTTOOLBARDIALOG_H -#include +#include QT_BEGIN_NAMESPACE -- cgit v1.2.1 From 7d0a7adede5166cf64ceb7b7826d2817d9f86e7d Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 12 Sep 2011 22:29:32 +0200 Subject: Get assistant to compile against refactor Give the source code a somewhat saner structure while I'm at it. Change-Id: I99766405debe231a0562dd623ba1d17f19333656 Reviewed-on: http://codereview.qt-project.org/4829 Reviewed-by: Lars Knoll --- 3rdparty/clucene/APACHE.license | 201 - 3rdparty/clucene/AUTHORS | 22 - 3rdparty/clucene/COPYING | 30 - 3rdparty/clucene/ChangeLog | 0 3rdparty/clucene/LGPL.license | 475 - 3rdparty/clucene/README | 92 - 3rdparty/clucene/src/CLucene.h | 38 - 3rdparty/clucene/src/CLucene/CLBackwards.h | 87 - 3rdparty/clucene/src/CLucene/CLConfig.h | 304 - 3rdparty/clucene/src/CLucene/CLMonolithic.cpp | 115 - 3rdparty/clucene/src/CLucene/LuceneThreads.h | 72 - 3rdparty/clucene/src/CLucene/StdHeader.cpp | 134 - 3rdparty/clucene/src/CLucene/StdHeader.h | 501 - .../src/CLucene/analysis/AnalysisHeader.cpp | 200 - .../clucene/src/CLucene/analysis/AnalysisHeader.h | 234 - .../clucene/src/CLucene/analysis/Analyzers.cpp | 389 - 3rdparty/clucene/src/CLucene/analysis/Analyzers.h | 309 - .../CLucene/analysis/standard/StandardAnalyzer.cpp | 46 - .../CLucene/analysis/standard/StandardAnalyzer.h | 47 - .../CLucene/analysis/standard/StandardFilter.cpp | 58 - .../src/CLucene/analysis/standard/StandardFilter.h | 37 - .../analysis/standard/StandardTokenizer.cpp | 446 - .../CLucene/analysis/standard/StandardTokenizer.h | 88 - .../analysis/standard/StandardTokenizerConstants.h | 30 - 3rdparty/clucene/src/CLucene/config/CompilerAcc.h | 166 - 3rdparty/clucene/src/CLucene/config/CompilerBcb.h | 68 - 3rdparty/clucene/src/CLucene/config/CompilerGcc.h | 175 - 3rdparty/clucene/src/CLucene/config/CompilerMsvc.h | 136 - 3rdparty/clucene/src/CLucene/config/PlatformMac.h | 19 - 3rdparty/clucene/src/CLucene/config/PlatformUnix.h | 12 - .../clucene/src/CLucene/config/PlatformWin32.h | 11 - 3rdparty/clucene/src/CLucene/config/compiler.h | 259 - 3rdparty/clucene/src/CLucene/config/define_std.h | 113 - .../clucene/src/CLucene/config/gunichartables.cpp | 386 - .../clucene/src/CLucene/config/gunichartables.h | 11264 ------------------- 3rdparty/clucene/src/CLucene/config/repl_lltot.cpp | 47 - 3rdparty/clucene/src/CLucene/config/repl_tchar.h | 126 - .../clucene/src/CLucene/config/repl_tcscasecmp.cpp | 21 - .../clucene/src/CLucene/config/repl_tcslwr.cpp | 15 - .../clucene/src/CLucene/config/repl_tcstod.cpp | 23 - .../clucene/src/CLucene/config/repl_tcstoll.cpp | 46 - .../clucene/src/CLucene/config/repl_tprintf.cpp | 149 - 3rdparty/clucene/src/CLucene/config/repl_wchar.h | 121 - .../clucene/src/CLucene/config/threadCSection.h | 71 - .../clucene/src/CLucene/config/threadPthread.h | 59 - 3rdparty/clucene/src/CLucene/config/threads.cpp | 162 - 3rdparty/clucene/src/CLucene/config/utf8.cpp | 237 - 3rdparty/clucene/src/CLucene/debug/condition.cpp | 80 - 3rdparty/clucene/src/CLucene/debug/condition.h | 64 - 3rdparty/clucene/src/CLucene/debug/error.cpp | 73 - 3rdparty/clucene/src/CLucene/debug/error.h | 74 - 3rdparty/clucene/src/CLucene/debug/lucenebase.h | 75 - 3rdparty/clucene/src/CLucene/debug/mem.h | 130 - 3rdparty/clucene/src/CLucene/debug/memtracking.cpp | 371 - .../clucene/src/CLucene/document/DateField.cpp | 60 - 3rdparty/clucene/src/CLucene/document/DateField.h | 64 - 3rdparty/clucene/src/CLucene/document/Document.cpp | 237 - 3rdparty/clucene/src/CLucene/document/Document.h | 158 - 3rdparty/clucene/src/CLucene/document/Field.cpp | 315 - 3rdparty/clucene/src/CLucene/document/Field.h | 261 - .../clucene/src/CLucene/index/CompoundFile.cpp | 380 - 3rdparty/clucene/src/CLucene/index/CompoundFile.h | 219 - .../clucene/src/CLucene/index/DocumentWriter.cpp | 571 - .../clucene/src/CLucene/index/DocumentWriter.h | 107 - 3rdparty/clucene/src/CLucene/index/FieldInfo.h | 16 - 3rdparty/clucene/src/CLucene/index/FieldInfos.cpp | 236 - 3rdparty/clucene/src/CLucene/index/FieldInfos.h | 171 - .../clucene/src/CLucene/index/FieldsReader.cpp | 231 - 3rdparty/clucene/src/CLucene/index/FieldsReader.h | 60 - .../clucene/src/CLucene/index/FieldsWriter.cpp | 186 - 3rdparty/clucene/src/CLucene/index/FieldsWriter.h | 49 - .../clucene/src/CLucene/index/IndexModifier.cpp | 254 - 3rdparty/clucene/src/CLucene/index/IndexModifier.h | 316 - 3rdparty/clucene/src/CLucene/index/IndexReader.cpp | 668 -- 3rdparty/clucene/src/CLucene/index/IndexReader.h | 485 - 3rdparty/clucene/src/CLucene/index/IndexWriter.cpp | 697 -- 3rdparty/clucene/src/CLucene/index/IndexWriter.h | 425 - 3rdparty/clucene/src/CLucene/index/MultiReader.cpp | 722 -- 3rdparty/clucene/src/CLucene/index/MultiReader.h | 202 - 3rdparty/clucene/src/CLucene/index/SegmentHeader.h | 314 - .../clucene/src/CLucene/index/SegmentInfos.cpp | 259 - 3rdparty/clucene/src/CLucene/index/SegmentInfos.h | 128 - .../clucene/src/CLucene/index/SegmentMergeInfo.cpp | 104 - .../clucene/src/CLucene/index/SegmentMergeInfo.h | 47 - .../src/CLucene/index/SegmentMergeQueue.cpp | 74 - .../clucene/src/CLucene/index/SegmentMergeQueue.h | 38 - .../clucene/src/CLucene/index/SegmentMerger.cpp | 723 -- 3rdparty/clucene/src/CLucene/index/SegmentMerger.h | 169 - .../clucene/src/CLucene/index/SegmentReader.cpp | 816 -- .../clucene/src/CLucene/index/SegmentTermDocs.cpp | 216 - .../clucene/src/CLucene/index/SegmentTermEnum.cpp | 389 - .../clucene/src/CLucene/index/SegmentTermEnum.h | 138 - .../src/CLucene/index/SegmentTermPositions.cpp | 101 - .../src/CLucene/index/SegmentTermVector.cpp | 188 - 3rdparty/clucene/src/CLucene/index/Term.cpp | 182 - 3rdparty/clucene/src/CLucene/index/Term.h | 146 - 3rdparty/clucene/src/CLucene/index/TermInfo.cpp | 53 - 3rdparty/clucene/src/CLucene/index/TermInfo.h | 61 - .../clucene/src/CLucene/index/TermInfosReader.cpp | 443 - .../clucene/src/CLucene/index/TermInfosReader.h | 106 - .../clucene/src/CLucene/index/TermInfosWriter.cpp | 185 - .../clucene/src/CLucene/index/TermInfosWriter.h | 89 - 3rdparty/clucene/src/CLucene/index/TermVector.h | 418 - .../clucene/src/CLucene/index/TermVectorReader.cpp | 393 - .../clucene/src/CLucene/index/TermVectorWriter.cpp | 349 - 3rdparty/clucene/src/CLucene/index/Terms.h | 174 - 3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp | 371 - 3rdparty/clucene/src/CLucene/queryParser/Lexer.h | 67 - .../CLucene/queryParser/MultiFieldQueryParser.cpp | 215 - .../CLucene/queryParser/MultiFieldQueryParser.h | 136 - .../src/CLucene/queryParser/QueryParser.cpp | 509 - .../clucene/src/CLucene/queryParser/QueryParser.h | 165 - .../src/CLucene/queryParser/QueryParserBase.cpp | 369 - .../src/CLucene/queryParser/QueryParserBase.h | 204 - .../clucene/src/CLucene/queryParser/QueryToken.cpp | 73 - .../clucene/src/CLucene/queryParser/QueryToken.h | 76 - .../clucene/src/CLucene/queryParser/TokenList.cpp | 79 - .../clucene/src/CLucene/queryParser/TokenList.h | 38 - .../clucene/src/CLucene/search/BooleanClause.h | 90 - .../clucene/src/CLucene/search/BooleanQuery.cpp | 363 - 3rdparty/clucene/src/CLucene/search/BooleanQuery.h | 126 - .../clucene/src/CLucene/search/BooleanScorer.cpp | 248 - .../clucene/src/CLucene/search/BooleanScorer.h | 99 - .../src/CLucene/search/CachingWrapperFilter.cpp | 86 - .../src/CLucene/search/CachingWrapperFilter.h | 80 - .../clucene/src/CLucene/search/ChainedFilter.cpp | 213 - .../clucene/src/CLucene/search/ChainedFilter.h | 86 - 3rdparty/clucene/src/CLucene/search/Compare.h | 161 - .../src/CLucene/search/ConjunctionScorer.cpp | 144 - .../clucene/src/CLucene/search/ConjunctionScorer.h | 50 - 3rdparty/clucene/src/CLucene/search/DateFilter.cpp | 93 - 3rdparty/clucene/src/CLucene/search/DateFilter.h | 59 - .../src/CLucene/search/ExactPhraseScorer.cpp | 85 - .../clucene/src/CLucene/search/ExactPhraseScorer.h | 31 - .../clucene/src/CLucene/search/Explanation.cpp | 133 - 3rdparty/clucene/src/CLucene/search/Explanation.h | 66 - 3rdparty/clucene/src/CLucene/search/FieldCache.cpp | 55 - 3rdparty/clucene/src/CLucene/search/FieldCache.h | 182 - .../clucene/src/CLucene/search/FieldCacheImpl.cpp | 529 - .../clucene/src/CLucene/search/FieldCacheImpl.h | 144 - 3rdparty/clucene/src/CLucene/search/FieldDoc.h | 70 - .../src/CLucene/search/FieldDocSortedHitQueue.cpp | 171 - .../src/CLucene/search/FieldDocSortedHitQueue.h | 159 - .../src/CLucene/search/FieldSortedHitQueue.cpp | 212 - .../src/CLucene/search/FieldSortedHitQueue.h | 216 - 3rdparty/clucene/src/CLucene/search/Filter.h | 46 - .../src/CLucene/search/FilteredTermEnum.cpp | 136 - .../clucene/src/CLucene/search/FilteredTermEnum.h | 61 - 3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp | 357 - 3rdparty/clucene/src/CLucene/search/FuzzyQuery.h | 156 - 3rdparty/clucene/src/CLucene/search/HitQueue.cpp | 107 - 3rdparty/clucene/src/CLucene/search/HitQueue.h | 55 - 3rdparty/clucene/src/CLucene/search/Hits.cpp | 174 - .../clucene/src/CLucene/search/IndexSearcher.cpp | 362 - .../clucene/src/CLucene/search/IndexSearcher.h | 73 - .../clucene/src/CLucene/search/MultiSearcher.cpp | 227 - .../clucene/src/CLucene/search/MultiSearcher.h | 95 - .../clucene/src/CLucene/search/MultiTermQuery.cpp | 98 - .../clucene/src/CLucene/search/MultiTermQuery.h | 62 - .../clucene/src/CLucene/search/PhrasePositions.cpp | 116 - .../clucene/src/CLucene/search/PhrasePositions.h | 41 - .../clucene/src/CLucene/search/PhraseQuery.cpp | 463 - 3rdparty/clucene/src/CLucene/search/PhraseQuery.h | 127 - 3rdparty/clucene/src/CLucene/search/PhraseQueue.h | 36 - .../clucene/src/CLucene/search/PhraseScorer.cpp | 225 - 3rdparty/clucene/src/CLucene/search/PhraseScorer.h | 65 - .../clucene/src/CLucene/search/PrefixQuery.cpp | 273 - 3rdparty/clucene/src/CLucene/search/PrefixQuery.h | 75 - .../clucene/src/CLucene/search/QueryFilter.cpp | 73 - 3rdparty/clucene/src/CLucene/search/QueryFilter.h | 44 - .../clucene/src/CLucene/search/RangeFilter.cpp | 150 - 3rdparty/clucene/src/CLucene/search/RangeFilter.h | 51 - 3rdparty/clucene/src/CLucene/search/RangeQuery.cpp | 204 - 3rdparty/clucene/src/CLucene/search/RangeQuery.h | 71 - 3rdparty/clucene/src/CLucene/search/Scorer.h | 80 - .../clucene/src/CLucene/search/SearchHeader.cpp | 141 - 3rdparty/clucene/src/CLucene/search/SearchHeader.h | 456 - 3rdparty/clucene/src/CLucene/search/Similarity.cpp | 233 - 3rdparty/clucene/src/CLucene/search/Similarity.h | 268 - .../src/CLucene/search/SloppyPhraseScorer.cpp | 106 - .../src/CLucene/search/SloppyPhraseScorer.h | 34 - 3rdparty/clucene/src/CLucene/search/Sort.cpp | 345 - 3rdparty/clucene/src/CLucene/search/Sort.h | 356 - 3rdparty/clucene/src/CLucene/search/TermQuery.cpp | 213 - 3rdparty/clucene/src/CLucene/search/TermQuery.h | 81 - 3rdparty/clucene/src/CLucene/search/TermScorer.cpp | 120 - 3rdparty/clucene/src/CLucene/search/TermScorer.h | 53 - .../clucene/src/CLucene/search/WildcardQuery.cpp | 147 - .../clucene/src/CLucene/search/WildcardQuery.h | 69 - .../src/CLucene/search/WildcardTermEnum.cpp | 150 - .../clucene/src/CLucene/search/WildcardTermEnum.h | 67 - 3rdparty/clucene/src/CLucene/store/Directory.h | 108 - 3rdparty/clucene/src/CLucene/store/FSDirectory.cpp | 662 -- 3rdparty/clucene/src/CLucene/store/FSDirectory.h | 216 - 3rdparty/clucene/src/CLucene/store/IndexInput.cpp | 233 - 3rdparty/clucene/src/CLucene/store/IndexInput.h | 190 - 3rdparty/clucene/src/CLucene/store/IndexOutput.cpp | 163 - 3rdparty/clucene/src/CLucene/store/IndexOutput.h | 152 - 3rdparty/clucene/src/CLucene/store/InputStream.h | 21 - 3rdparty/clucene/src/CLucene/store/Lock.cpp | 27 - 3rdparty/clucene/src/CLucene/store/Lock.h | 106 - 3rdparty/clucene/src/CLucene/store/MMapInput.cpp | 203 - 3rdparty/clucene/src/CLucene/store/OutputStream.h | 23 - .../clucene/src/CLucene/store/RAMDirectory.cpp | 446 - 3rdparty/clucene/src/CLucene/store/RAMDirectory.h | 195 - .../CLucene/store/TransactionalRAMDirectory.cpp | 212 - .../src/CLucene/store/TransactionalRAMDirectory.h | 76 - 3rdparty/clucene/src/CLucene/util/Arrays.h | 164 - 3rdparty/clucene/src/CLucene/util/BitSet.cpp | 119 - 3rdparty/clucene/src/CLucene/util/BitSet.h | 62 - 3rdparty/clucene/src/CLucene/util/Equators.cpp | 180 - 3rdparty/clucene/src/CLucene/util/Equators.h | 274 - .../clucene/src/CLucene/util/FastCharStream.cpp | 107 - 3rdparty/clucene/src/CLucene/util/FastCharStream.h | 55 - 3rdparty/clucene/src/CLucene/util/Misc.cpp | 295 - 3rdparty/clucene/src/CLucene/util/Misc.h | 75 - 3rdparty/clucene/src/CLucene/util/PriorityQueue.h | 177 - 3rdparty/clucene/src/CLucene/util/Reader.cpp | 186 - 3rdparty/clucene/src/CLucene/util/Reader.h | 138 - 3rdparty/clucene/src/CLucene/util/StringBuffer.cpp | 335 - 3rdparty/clucene/src/CLucene/util/StringBuffer.h | 77 - 3rdparty/clucene/src/CLucene/util/StringIntern.cpp | 158 - 3rdparty/clucene/src/CLucene/util/StringIntern.h | 61 - 3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp | 55 - 3rdparty/clucene/src/CLucene/util/ThreadLocal.h | 143 - 3rdparty/clucene/src/CLucene/util/VoidList.h | 175 - 3rdparty/clucene/src/CLucene/util/VoidMap.h | 270 - 3rdparty/clucene/src/CLucene/util/bufferedstream.h | 157 - 3rdparty/clucene/src/CLucene/util/dirent.cpp | 221 - 3rdparty/clucene/src/CLucene/util/dirent.h | 105 - .../clucene/src/CLucene/util/fileinputstream.cpp | 103 - .../clucene/src/CLucene/util/fileinputstream.h | 38 - .../clucene/src/CLucene/util/inputstreambuffer.h | 126 - 3rdparty/clucene/src/CLucene/util/jstreamsconfig.h | 9 - 3rdparty/clucene/src/CLucene/util/streambase.h | 148 - 3rdparty/clucene/src/CLucene/util/stringreader.h | 124 - 3rdparty/clucene/src/CLucene/util/subinputstream.h | 141 - modules/qt_clucene.pri | 5 +- modules/qt_help.pri | 6 +- src/assistant/3rdparty/clucene/APACHE.license | 201 + src/assistant/3rdparty/clucene/AUTHORS | 22 + src/assistant/3rdparty/clucene/COPYING | 30 + src/assistant/3rdparty/clucene/ChangeLog | 0 src/assistant/3rdparty/clucene/LGPL.license | 475 + src/assistant/3rdparty/clucene/README | 92 + src/assistant/3rdparty/clucene/src/CLucene.h | 38 + .../3rdparty/clucene/src/CLucene/CLBackwards.h | 87 + .../3rdparty/clucene/src/CLucene/CLConfig.h | 304 + .../3rdparty/clucene/src/CLucene/CLMonolithic.cpp | 115 + .../3rdparty/clucene/src/CLucene/LuceneThreads.h | 72 + .../3rdparty/clucene/src/CLucene/StdHeader.cpp | 134 + .../3rdparty/clucene/src/CLucene/StdHeader.h | 501 + .../src/CLucene/analysis/AnalysisHeader.cpp | 200 + .../clucene/src/CLucene/analysis/AnalysisHeader.h | 234 + .../clucene/src/CLucene/analysis/Analyzers.cpp | 389 + .../clucene/src/CLucene/analysis/Analyzers.h | 309 + .../CLucene/analysis/standard/StandardAnalyzer.cpp | 46 + .../CLucene/analysis/standard/StandardAnalyzer.h | 47 + .../CLucene/analysis/standard/StandardFilter.cpp | 58 + .../src/CLucene/analysis/standard/StandardFilter.h | 37 + .../analysis/standard/StandardTokenizer.cpp | 446 + .../CLucene/analysis/standard/StandardTokenizer.h | 88 + .../analysis/standard/StandardTokenizerConstants.h | 30 + .../clucene/src/CLucene/config/CompilerAcc.h | 166 + .../clucene/src/CLucene/config/CompilerBcb.h | 68 + .../clucene/src/CLucene/config/CompilerGcc.h | 175 + .../clucene/src/CLucene/config/CompilerMsvc.h | 136 + .../clucene/src/CLucene/config/PlatformMac.h | 19 + .../clucene/src/CLucene/config/PlatformUnix.h | 12 + .../clucene/src/CLucene/config/PlatformWin32.h | 11 + .../3rdparty/clucene/src/CLucene/config/compiler.h | 259 + .../clucene/src/CLucene/config/define_std.h | 113 + .../clucene/src/CLucene/config/gunichartables.cpp | 386 + .../clucene/src/CLucene/config/gunichartables.h | 11264 +++++++++++++++++++ .../clucene/src/CLucene/config/repl_lltot.cpp | 47 + .../clucene/src/CLucene/config/repl_tchar.h | 126 + .../clucene/src/CLucene/config/repl_tcscasecmp.cpp | 21 + .../clucene/src/CLucene/config/repl_tcslwr.cpp | 15 + .../clucene/src/CLucene/config/repl_tcstod.cpp | 23 + .../clucene/src/CLucene/config/repl_tcstoll.cpp | 46 + .../clucene/src/CLucene/config/repl_tprintf.cpp | 149 + .../clucene/src/CLucene/config/repl_wchar.h | 121 + .../clucene/src/CLucene/config/threadCSection.h | 71 + .../clucene/src/CLucene/config/threadPthread.h | 59 + .../clucene/src/CLucene/config/threads.cpp | 162 + .../3rdparty/clucene/src/CLucene/config/utf8.cpp | 237 + .../clucene/src/CLucene/debug/condition.cpp | 80 + .../3rdparty/clucene/src/CLucene/debug/condition.h | 64 + .../3rdparty/clucene/src/CLucene/debug/error.cpp | 73 + .../3rdparty/clucene/src/CLucene/debug/error.h | 74 + .../clucene/src/CLucene/debug/lucenebase.h | 75 + .../3rdparty/clucene/src/CLucene/debug/mem.h | 130 + .../clucene/src/CLucene/debug/memtracking.cpp | 371 + .../clucene/src/CLucene/document/DateField.cpp | 60 + .../clucene/src/CLucene/document/DateField.h | 64 + .../clucene/src/CLucene/document/Document.cpp | 237 + .../clucene/src/CLucene/document/Document.h | 158 + .../clucene/src/CLucene/document/Field.cpp | 315 + .../3rdparty/clucene/src/CLucene/document/Field.h | 261 + .../clucene/src/CLucene/index/CompoundFile.cpp | 380 + .../clucene/src/CLucene/index/CompoundFile.h | 219 + .../clucene/src/CLucene/index/DocumentWriter.cpp | 571 + .../clucene/src/CLucene/index/DocumentWriter.h | 107 + .../3rdparty/clucene/src/CLucene/index/FieldInfo.h | 16 + .../clucene/src/CLucene/index/FieldInfos.cpp | 236 + .../clucene/src/CLucene/index/FieldInfos.h | 171 + .../clucene/src/CLucene/index/FieldsReader.cpp | 231 + .../clucene/src/CLucene/index/FieldsReader.h | 60 + .../clucene/src/CLucene/index/FieldsWriter.cpp | 186 + .../clucene/src/CLucene/index/FieldsWriter.h | 49 + .../clucene/src/CLucene/index/IndexModifier.cpp | 254 + .../clucene/src/CLucene/index/IndexModifier.h | 316 + .../clucene/src/CLucene/index/IndexReader.cpp | 668 ++ .../clucene/src/CLucene/index/IndexReader.h | 485 + .../clucene/src/CLucene/index/IndexWriter.cpp | 697 ++ .../clucene/src/CLucene/index/IndexWriter.h | 425 + .../clucene/src/CLucene/index/MultiReader.cpp | 722 ++ .../clucene/src/CLucene/index/MultiReader.h | 202 + .../clucene/src/CLucene/index/SegmentHeader.h | 314 + .../clucene/src/CLucene/index/SegmentInfos.cpp | 259 + .../clucene/src/CLucene/index/SegmentInfos.h | 128 + .../clucene/src/CLucene/index/SegmentMergeInfo.cpp | 104 + .../clucene/src/CLucene/index/SegmentMergeInfo.h | 47 + .../src/CLucene/index/SegmentMergeQueue.cpp | 74 + .../clucene/src/CLucene/index/SegmentMergeQueue.h | 38 + .../clucene/src/CLucene/index/SegmentMerger.cpp | 723 ++ .../clucene/src/CLucene/index/SegmentMerger.h | 169 + .../clucene/src/CLucene/index/SegmentReader.cpp | 816 ++ .../clucene/src/CLucene/index/SegmentTermDocs.cpp | 216 + .../clucene/src/CLucene/index/SegmentTermEnum.cpp | 389 + .../clucene/src/CLucene/index/SegmentTermEnum.h | 138 + .../src/CLucene/index/SegmentTermPositions.cpp | 101 + .../src/CLucene/index/SegmentTermVector.cpp | 188 + .../3rdparty/clucene/src/CLucene/index/Term.cpp | 182 + .../3rdparty/clucene/src/CLucene/index/Term.h | 146 + .../clucene/src/CLucene/index/TermInfo.cpp | 53 + .../3rdparty/clucene/src/CLucene/index/TermInfo.h | 61 + .../clucene/src/CLucene/index/TermInfosReader.cpp | 443 + .../clucene/src/CLucene/index/TermInfosReader.h | 106 + .../clucene/src/CLucene/index/TermInfosWriter.cpp | 185 + .../clucene/src/CLucene/index/TermInfosWriter.h | 89 + .../clucene/src/CLucene/index/TermVector.h | 418 + .../clucene/src/CLucene/index/TermVectorReader.cpp | 393 + .../clucene/src/CLucene/index/TermVectorWriter.cpp | 349 + .../3rdparty/clucene/src/CLucene/index/Terms.h | 174 + .../clucene/src/CLucene/queryParser/Lexer.cpp | 371 + .../clucene/src/CLucene/queryParser/Lexer.h | 67 + .../CLucene/queryParser/MultiFieldQueryParser.cpp | 215 + .../CLucene/queryParser/MultiFieldQueryParser.h | 136 + .../src/CLucene/queryParser/QueryParser.cpp | 509 + .../clucene/src/CLucene/queryParser/QueryParser.h | 165 + .../src/CLucene/queryParser/QueryParserBase.cpp | 369 + .../src/CLucene/queryParser/QueryParserBase.h | 204 + .../clucene/src/CLucene/queryParser/QueryToken.cpp | 73 + .../clucene/src/CLucene/queryParser/QueryToken.h | 76 + .../clucene/src/CLucene/queryParser/TokenList.cpp | 79 + .../clucene/src/CLucene/queryParser/TokenList.h | 38 + .../clucene/src/CLucene/search/BooleanClause.h | 90 + .../clucene/src/CLucene/search/BooleanQuery.cpp | 363 + .../clucene/src/CLucene/search/BooleanQuery.h | 126 + .../clucene/src/CLucene/search/BooleanScorer.cpp | 248 + .../clucene/src/CLucene/search/BooleanScorer.h | 99 + .../src/CLucene/search/CachingWrapperFilter.cpp | 86 + .../src/CLucene/search/CachingWrapperFilter.h | 80 + .../clucene/src/CLucene/search/ChainedFilter.cpp | 213 + .../clucene/src/CLucene/search/ChainedFilter.h | 86 + .../3rdparty/clucene/src/CLucene/search/Compare.h | 161 + .../src/CLucene/search/ConjunctionScorer.cpp | 144 + .../clucene/src/CLucene/search/ConjunctionScorer.h | 50 + .../clucene/src/CLucene/search/DateFilter.cpp | 93 + .../clucene/src/CLucene/search/DateFilter.h | 59 + .../src/CLucene/search/ExactPhraseScorer.cpp | 85 + .../clucene/src/CLucene/search/ExactPhraseScorer.h | 31 + .../clucene/src/CLucene/search/Explanation.cpp | 133 + .../clucene/src/CLucene/search/Explanation.h | 66 + .../clucene/src/CLucene/search/FieldCache.cpp | 55 + .../clucene/src/CLucene/search/FieldCache.h | 182 + .../clucene/src/CLucene/search/FieldCacheImpl.cpp | 529 + .../clucene/src/CLucene/search/FieldCacheImpl.h | 144 + .../3rdparty/clucene/src/CLucene/search/FieldDoc.h | 70 + .../src/CLucene/search/FieldDocSortedHitQueue.cpp | 171 + .../src/CLucene/search/FieldDocSortedHitQueue.h | 159 + .../src/CLucene/search/FieldSortedHitQueue.cpp | 212 + .../src/CLucene/search/FieldSortedHitQueue.h | 216 + .../3rdparty/clucene/src/CLucene/search/Filter.h | 46 + .../src/CLucene/search/FilteredTermEnum.cpp | 136 + .../clucene/src/CLucene/search/FilteredTermEnum.h | 61 + .../clucene/src/CLucene/search/FuzzyQuery.cpp | 357 + .../clucene/src/CLucene/search/FuzzyQuery.h | 156 + .../clucene/src/CLucene/search/HitQueue.cpp | 107 + .../3rdparty/clucene/src/CLucene/search/HitQueue.h | 55 + .../3rdparty/clucene/src/CLucene/search/Hits.cpp | 174 + .../clucene/src/CLucene/search/IndexSearcher.cpp | 362 + .../clucene/src/CLucene/search/IndexSearcher.h | 73 + .../clucene/src/CLucene/search/MultiSearcher.cpp | 227 + .../clucene/src/CLucene/search/MultiSearcher.h | 95 + .../clucene/src/CLucene/search/MultiTermQuery.cpp | 98 + .../clucene/src/CLucene/search/MultiTermQuery.h | 62 + .../clucene/src/CLucene/search/PhrasePositions.cpp | 116 + .../clucene/src/CLucene/search/PhrasePositions.h | 41 + .../clucene/src/CLucene/search/PhraseQuery.cpp | 463 + .../clucene/src/CLucene/search/PhraseQuery.h | 127 + .../clucene/src/CLucene/search/PhraseQueue.h | 36 + .../clucene/src/CLucene/search/PhraseScorer.cpp | 225 + .../clucene/src/CLucene/search/PhraseScorer.h | 65 + .../clucene/src/CLucene/search/PrefixQuery.cpp | 273 + .../clucene/src/CLucene/search/PrefixQuery.h | 75 + .../clucene/src/CLucene/search/QueryFilter.cpp | 73 + .../clucene/src/CLucene/search/QueryFilter.h | 44 + .../clucene/src/CLucene/search/RangeFilter.cpp | 150 + .../clucene/src/CLucene/search/RangeFilter.h | 51 + .../clucene/src/CLucene/search/RangeQuery.cpp | 204 + .../clucene/src/CLucene/search/RangeQuery.h | 71 + .../3rdparty/clucene/src/CLucene/search/Scorer.h | 80 + .../clucene/src/CLucene/search/SearchHeader.cpp | 141 + .../clucene/src/CLucene/search/SearchHeader.h | 456 + .../clucene/src/CLucene/search/Similarity.cpp | 233 + .../clucene/src/CLucene/search/Similarity.h | 268 + .../src/CLucene/search/SloppyPhraseScorer.cpp | 106 + .../src/CLucene/search/SloppyPhraseScorer.h | 34 + .../3rdparty/clucene/src/CLucene/search/Sort.cpp | 345 + .../3rdparty/clucene/src/CLucene/search/Sort.h | 356 + .../clucene/src/CLucene/search/TermQuery.cpp | 213 + .../clucene/src/CLucene/search/TermQuery.h | 81 + .../clucene/src/CLucene/search/TermScorer.cpp | 120 + .../clucene/src/CLucene/search/TermScorer.h | 53 + .../clucene/src/CLucene/search/WildcardQuery.cpp | 147 + .../clucene/src/CLucene/search/WildcardQuery.h | 69 + .../src/CLucene/search/WildcardTermEnum.cpp | 150 + .../clucene/src/CLucene/search/WildcardTermEnum.h | 67 + .../3rdparty/clucene/src/CLucene/store/Directory.h | 108 + .../clucene/src/CLucene/store/FSDirectory.cpp | 662 ++ .../clucene/src/CLucene/store/FSDirectory.h | 216 + .../clucene/src/CLucene/store/IndexInput.cpp | 233 + .../clucene/src/CLucene/store/IndexInput.h | 190 + .../clucene/src/CLucene/store/IndexOutput.cpp | 163 + .../clucene/src/CLucene/store/IndexOutput.h | 152 + .../clucene/src/CLucene/store/InputStream.h | 21 + .../3rdparty/clucene/src/CLucene/store/Lock.cpp | 27 + .../3rdparty/clucene/src/CLucene/store/Lock.h | 106 + .../clucene/src/CLucene/store/MMapInput.cpp | 203 + .../clucene/src/CLucene/store/OutputStream.h | 23 + .../clucene/src/CLucene/store/RAMDirectory.cpp | 446 + .../clucene/src/CLucene/store/RAMDirectory.h | 195 + .../CLucene/store/TransactionalRAMDirectory.cpp | 212 + .../src/CLucene/store/TransactionalRAMDirectory.h | 76 + .../3rdparty/clucene/src/CLucene/util/Arrays.h | 164 + .../3rdparty/clucene/src/CLucene/util/BitSet.cpp | 119 + .../3rdparty/clucene/src/CLucene/util/BitSet.h | 62 + .../3rdparty/clucene/src/CLucene/util/Equators.cpp | 180 + .../3rdparty/clucene/src/CLucene/util/Equators.h | 274 + .../clucene/src/CLucene/util/FastCharStream.cpp | 107 + .../clucene/src/CLucene/util/FastCharStream.h | 55 + .../3rdparty/clucene/src/CLucene/util/Misc.cpp | 295 + .../3rdparty/clucene/src/CLucene/util/Misc.h | 75 + .../clucene/src/CLucene/util/PriorityQueue.h | 177 + .../3rdparty/clucene/src/CLucene/util/Reader.cpp | 186 + .../3rdparty/clucene/src/CLucene/util/Reader.h | 138 + .../clucene/src/CLucene/util/StringBuffer.cpp | 335 + .../clucene/src/CLucene/util/StringBuffer.h | 77 + .../clucene/src/CLucene/util/StringIntern.cpp | 158 + .../clucene/src/CLucene/util/StringIntern.h | 61 + .../clucene/src/CLucene/util/ThreadLocal.cpp | 55 + .../clucene/src/CLucene/util/ThreadLocal.h | 143 + .../3rdparty/clucene/src/CLucene/util/VoidList.h | 175 + .../3rdparty/clucene/src/CLucene/util/VoidMap.h | 270 + .../clucene/src/CLucene/util/bufferedstream.h | 157 + .../3rdparty/clucene/src/CLucene/util/dirent.cpp | 221 + .../3rdparty/clucene/src/CLucene/util/dirent.h | 105 + .../clucene/src/CLucene/util/fileinputstream.cpp | 103 + .../clucene/src/CLucene/util/fileinputstream.h | 38 + .../clucene/src/CLucene/util/inputstreambuffer.h | 126 + .../clucene/src/CLucene/util/jstreamsconfig.h | 9 + .../3rdparty/clucene/src/CLucene/util/streambase.h | 148 + .../clucene/src/CLucene/util/stringreader.h | 124 + .../clucene/src/CLucene/util/subinputstream.h | 141 + src/assistant/assistant.pro | 10 +- src/assistant/assistant/Info_mac.plist | 18 + src/assistant/assistant/aboutdialog.cpp | 184 + src/assistant/assistant/aboutdialog.h | 91 + src/assistant/assistant/assistant.icns | Bin 0 -> 162568 bytes src/assistant/assistant/assistant.ico | Bin 0 -> 355574 bytes src/assistant/assistant/assistant.pro | 119 + src/assistant/assistant/assistant.qch | Bin 0 -> 364544 bytes src/assistant/assistant/assistant.qrc | 5 + src/assistant/assistant/assistant.rc | 32 + src/assistant/assistant/assistant_images.qrc | 37 + src/assistant/assistant/bookmarkdialog.cpp | 237 + src/assistant/assistant/bookmarkdialog.h | 89 + src/assistant/assistant/bookmarkdialog.ui | 156 + src/assistant/assistant/bookmarkfiltermodel.cpp | 321 + src/assistant/assistant/bookmarkfiltermodel.h | 118 + src/assistant/assistant/bookmarkitem.cpp | 184 + src/assistant/assistant/bookmarkitem.h | 91 + src/assistant/assistant/bookmarkmanager.cpp | 559 + src/assistant/assistant/bookmarkmanager.h | 160 + src/assistant/assistant/bookmarkmanagerwidget.cpp | 321 + src/assistant/assistant/bookmarkmanagerwidget.h | 103 + src/assistant/assistant/bookmarkmanagerwidget.ui | 137 + src/assistant/assistant/bookmarkmodel.cpp | 461 + src/assistant/assistant/bookmarkmodel.h | 117 + src/assistant/assistant/bookmarkwidget.ui | 85 + src/assistant/assistant/centralwidget.cpp | 636 ++ src/assistant/assistant/centralwidget.h | 173 + src/assistant/assistant/cmdlineparser.cpp | 376 + src/assistant/assistant/cmdlineparser.h | 117 + src/assistant/assistant/contentwindow.cpp | 204 + src/assistant/assistant/contentwindow.h | 86 + src/assistant/assistant/doc/HOWTO | 16 + src/assistant/assistant/doc/assistant.qdoc | 461 + src/assistant/assistant/doc/assistant.qdocconf | 16 + src/assistant/assistant/doc/assistant.qhp | 22 + src/assistant/assistant/doc/classic.css | 92 + .../doc/images/assistant-address-toolbar.png | Bin 0 -> 2899 bytes .../assistant/doc/images/assistant-assistant.png | Bin 0 -> 205326 bytes .../assistant/doc/images/assistant-dockwidgets.png | Bin 0 -> 50554 bytes .../assistant/doc/images/assistant-docwindow.png | Bin 0 -> 55582 bytes .../assistant/doc/images/assistant-examples.png | Bin 0 -> 9799 bytes .../doc/images/assistant-filter-toolbar.png | Bin 0 -> 1767 bytes .../images/assistant-preferences-documentation.png | Bin 0 -> 13417 bytes .../doc/images/assistant-preferences-filters.png | Bin 0 -> 15561 bytes .../doc/images/assistant-preferences-fonts.png | Bin 0 -> 13139 bytes .../doc/images/assistant-preferences-options.png | Bin 0 -> 14255 bytes .../assistant/doc/images/assistant-search.png | Bin 0 -> 59254 bytes .../assistant/doc/images/assistant-toolbar.png | Bin 0 -> 6532 bytes src/assistant/assistant/filternamedialog.cpp | 77 + src/assistant/assistant/filternamedialog.h | 67 + src/assistant/assistant/filternamedialog.ui | 67 + src/assistant/assistant/findwidget.cpp | 234 + src/assistant/assistant/findwidget.h | 100 + src/assistant/assistant/globalactions.cpp | 246 + src/assistant/assistant/globalactions.h | 105 + src/assistant/assistant/helpenginewrapper.cpp | 844 ++ src/assistant/assistant/helpenginewrapper.h | 218 + src/assistant/assistant/helpviewer.cpp | 221 + src/assistant/assistant/helpviewer.h | 158 + src/assistant/assistant/helpviewer_p.h | 123 + src/assistant/assistant/helpviewer_qtb.cpp | 384 + src/assistant/assistant/helpviewer_qwv.cpp | 495 + src/assistant/assistant/images/assistant-128.png | Bin 0 -> 6448 bytes src/assistant/assistant/images/assistant.png | Bin 0 -> 2034 bytes src/assistant/assistant/images/bookmark.png | Bin 0 -> 1266 bytes src/assistant/assistant/images/closebutton.png | Bin 0 -> 288 bytes src/assistant/assistant/images/darkclosebutton.png | Bin 0 -> 319 bytes src/assistant/assistant/images/mac/addtab.png | Bin 0 -> 469 bytes src/assistant/assistant/images/mac/book.png | Bin 0 -> 1477 bytes src/assistant/assistant/images/mac/closetab.png | Bin 0 -> 516 bytes src/assistant/assistant/images/mac/editcopy.png | Bin 0 -> 1468 bytes src/assistant/assistant/images/mac/find.png | Bin 0 -> 1836 bytes src/assistant/assistant/images/mac/home.png | Bin 0 -> 1807 bytes src/assistant/assistant/images/mac/next.png | Bin 0 -> 1310 bytes src/assistant/assistant/images/mac/previous.png | Bin 0 -> 1080 bytes src/assistant/assistant/images/mac/print.png | Bin 0 -> 2087 bytes src/assistant/assistant/images/mac/resetzoom.png | Bin 0 -> 1567 bytes src/assistant/assistant/images/mac/synctoc.png | Bin 0 -> 1838 bytes src/assistant/assistant/images/mac/zoomin.png | Bin 0 -> 1696 bytes src/assistant/assistant/images/mac/zoomout.png | Bin 0 -> 1662 bytes src/assistant/assistant/images/trolltech-logo.png | Bin 0 -> 10096 bytes src/assistant/assistant/images/win/addtab.png | Bin 0 -> 314 bytes src/assistant/assistant/images/win/book.png | Bin 0 -> 1109 bytes src/assistant/assistant/images/win/closetab.png | Bin 0 -> 375 bytes src/assistant/assistant/images/win/editcopy.png | Bin 0 -> 1325 bytes src/assistant/assistant/images/win/find.png | Bin 0 -> 1944 bytes src/assistant/assistant/images/win/home.png | Bin 0 -> 1414 bytes src/assistant/assistant/images/win/next.png | Bin 0 -> 1038 bytes src/assistant/assistant/images/win/previous.png | Bin 0 -> 898 bytes src/assistant/assistant/images/win/print.png | Bin 0 -> 1456 bytes src/assistant/assistant/images/win/resetzoom.png | Bin 0 -> 1134 bytes src/assistant/assistant/images/win/synctoc.png | Bin 0 -> 1235 bytes src/assistant/assistant/images/win/zoomin.png | Bin 0 -> 1208 bytes src/assistant/assistant/images/win/zoomout.png | Bin 0 -> 1226 bytes src/assistant/assistant/images/wrap.png | Bin 0 -> 500 bytes src/assistant/assistant/indexwindow.cpp | 231 + src/assistant/assistant/indexwindow.h | 90 + src/assistant/assistant/installdialog.cpp | 355 + src/assistant/assistant/installdialog.h | 105 + src/assistant/assistant/installdialog.ui | 118 + src/assistant/assistant/main.cpp | 440 + src/assistant/assistant/mainwindow.cpp | 1099 ++ src/assistant/assistant/mainwindow.h | 172 + src/assistant/assistant/openpagesmanager.cpp | 378 + src/assistant/assistant/openpagesmanager.h | 115 + src/assistant/assistant/openpagesmodel.cpp | 119 + src/assistant/assistant/openpagesmodel.h | 76 + src/assistant/assistant/openpagesswitcher.cpp | 194 + src/assistant/assistant/openpagesswitcher.h | 85 + src/assistant/assistant/openpageswidget.cpp | 237 + src/assistant/assistant/openpageswidget.h | 92 + src/assistant/assistant/preferencesdialog.cpp | 507 + src/assistant/assistant/preferencesdialog.h | 110 + src/assistant/assistant/preferencesdialog.ui | 400 + src/assistant/assistant/qtdocinstaller.cpp | 128 + src/assistant/assistant/qtdocinstaller.h | 84 + src/assistant/assistant/remotecontrol.cpp | 388 + src/assistant/assistant/remotecontrol.h | 96 + src/assistant/assistant/remotecontrol_win.h | 68 + src/assistant/assistant/searchwidget.cpp | 237 + src/assistant/assistant/searchwidget.h | 90 + src/assistant/assistant/topicchooser.cpp | 87 + src/assistant/assistant/topicchooser.h | 73 + src/assistant/assistant/topicchooser.ui | 116 + src/assistant/assistant/tracer.h | 75 + src/assistant/assistant/xbelsupport.cpp | 233 + src/assistant/assistant/xbelsupport.h | 87 + src/assistant/clucene/clucene.pro | 49 + src/assistant/clucene/fulltextsearch.pri | 161 + src/assistant/clucene/license.txt | 503 + src/assistant/clucene/qanalyzer.cpp | 219 + src/assistant/clucene/qanalyzer_p.h | 152 + src/assistant/clucene/qclucene-config_p.h | 557 + src/assistant/clucene/qclucene_global_p.h | 134 + src/assistant/clucene/qdocument.cpp | 180 + src/assistant/clucene/qdocument_p.h | 100 + src/assistant/clucene/qfield.cpp | 171 + src/assistant/clucene/qfield_p.h | 119 + src/assistant/clucene/qfilter.cpp | 57 + src/assistant/clucene/qfilter_p.h | 75 + src/assistant/clucene/qhits.cpp | 94 + src/assistant/clucene/qhits_p.h | 86 + src/assistant/clucene/qindexreader.cpp | 169 + src/assistant/clucene/qindexreader_p.h | 115 + src/assistant/clucene/qindexwriter.cpp | 191 + src/assistant/clucene/qindexwriter_p.h | 124 + src/assistant/clucene/qquery.cpp | 358 + src/assistant/clucene/qquery_p.h | 188 + src/assistant/clucene/qqueryparser.cpp | 176 + src/assistant/clucene/qqueryparser_p.h | 109 + src/assistant/clucene/qreader.cpp | 101 + src/assistant/clucene/qreader_p.h | 104 + src/assistant/clucene/qsearchable.cpp | 203 + src/assistant/clucene/qsearchable_p.h | 135 + src/assistant/clucene/qsort.cpp | 97 + src/assistant/clucene/qsort_p.h | 84 + src/assistant/clucene/qterm.cpp | 134 + src/assistant/clucene/qterm_p.h | 100 + src/assistant/clucene/qtoken.cpp | 150 + src/assistant/clucene/qtoken_p.h | 112 + src/assistant/clucene/qtokenizer.cpp | 117 + src/assistant/clucene/qtokenizer_p.h | 97 + src/assistant/clucene/qtokenstream.cpp | 67 + src/assistant/clucene/qtokenstream_p.h | 95 + src/assistant/help/help.pro | 72 + src/assistant/help/helpsystem.qrc | 8 + src/assistant/help/images/1leftarrow.png | Bin 0 -> 669 bytes src/assistant/help/images/1rightarrow.png | Bin 0 -> 706 bytes src/assistant/help/images/3leftarrow.png | Bin 0 -> 832 bytes src/assistant/help/images/3rightarrow.png | Bin 0 -> 820 bytes src/assistant/help/qclucenefieldnames.cpp | 57 + src/assistant/help/qclucenefieldnames_p.h | 63 + src/assistant/help/qhelp_global.cpp | 114 + src/assistant/help/qhelp_global.h | 78 + src/assistant/help/qhelpcollectionhandler.cpp | 603 + src/assistant/help/qhelpcollectionhandler_p.h | 124 + src/assistant/help/qhelpcontentwidget.cpp | 586 + src/assistant/help/qhelpcontentwidget.h | 146 + src/assistant/help/qhelpdatainterface.cpp | 273 + src/assistant/help/qhelpdatainterface_p.h | 155 + src/assistant/help/qhelpdbreader.cpp | 583 + src/assistant/help/qhelpdbreader_p.h | 128 + src/assistant/help/qhelpengine.cpp | 213 + src/assistant/help/qhelpengine.h | 84 + src/assistant/help/qhelpengine_p.h | 144 + src/assistant/help/qhelpenginecore.cpp | 737 ++ src/assistant/help/qhelpenginecore.h | 136 + src/assistant/help/qhelpgenerator.cpp | 909 ++ src/assistant/help/qhelpgenerator_p.h | 118 + src/assistant/help/qhelpindexwidget.cpp | 444 + src/assistant/help/qhelpindexwidget.h | 114 + src/assistant/help/qhelpprojectdata.cpp | 450 + src/assistant/help/qhelpprojectdata_p.h | 89 + src/assistant/help/qhelpsearchengine.cpp | 450 + src/assistant/help/qhelpsearchengine.h | 125 + src/assistant/help/qhelpsearchindex_default.cpp | 60 + src/assistant/help/qhelpsearchindex_default_p.h | 149 + src/assistant/help/qhelpsearchindexreader.cpp | 104 + .../help/qhelpsearchindexreader_clucene.cpp | 481 + .../help/qhelpsearchindexreader_clucene_p.h | 114 + .../help/qhelpsearchindexreader_default.cpp | 612 + .../help/qhelpsearchindexreader_default_p.h | 131 + src/assistant/help/qhelpsearchindexreader_p.h | 106 + .../help/qhelpsearchindexwriter_clucene.cpp | 898 ++ .../help/qhelpsearchindexwriter_clucene_p.h | 124 + .../help/qhelpsearchindexwriter_default.cpp | 384 + .../help/qhelpsearchindexwriter_default_p.h | 130 + src/assistant/help/qhelpsearchquerywidget.cpp | 587 + src/assistant/help/qhelpsearchquerywidget.h | 92 + src/assistant/help/qhelpsearchresultwidget.cpp | 447 + src/assistant/help/qhelpsearchresultwidget.h | 85 + .../lib/fulltextsearch/fulltextsearch.pri | 161 - .../lib/fulltextsearch/fulltextsearch.pro | 54 - src/assistant/lib/fulltextsearch/license.txt | 503 - src/assistant/lib/fulltextsearch/qanalyzer.cpp | 219 - src/assistant/lib/fulltextsearch/qanalyzer_p.h | 152 - .../lib/fulltextsearch/qclucene-config_p.h | 557 - .../lib/fulltextsearch/qclucene_global_p.h | 134 - src/assistant/lib/fulltextsearch/qdocument.cpp | 180 - src/assistant/lib/fulltextsearch/qdocument_p.h | 100 - src/assistant/lib/fulltextsearch/qfield.cpp | 171 - src/assistant/lib/fulltextsearch/qfield_p.h | 119 - src/assistant/lib/fulltextsearch/qfilter.cpp | 57 - src/assistant/lib/fulltextsearch/qfilter_p.h | 75 - src/assistant/lib/fulltextsearch/qhits.cpp | 94 - src/assistant/lib/fulltextsearch/qhits_p.h | 86 - src/assistant/lib/fulltextsearch/qindexreader.cpp | 169 - src/assistant/lib/fulltextsearch/qindexreader_p.h | 115 - src/assistant/lib/fulltextsearch/qindexwriter.cpp | 191 - src/assistant/lib/fulltextsearch/qindexwriter_p.h | 124 - src/assistant/lib/fulltextsearch/qquery.cpp | 358 - src/assistant/lib/fulltextsearch/qquery_p.h | 188 - src/assistant/lib/fulltextsearch/qqueryparser.cpp | 176 - src/assistant/lib/fulltextsearch/qqueryparser_p.h | 109 - src/assistant/lib/fulltextsearch/qreader.cpp | 101 - src/assistant/lib/fulltextsearch/qreader_p.h | 104 - src/assistant/lib/fulltextsearch/qsearchable.cpp | 203 - src/assistant/lib/fulltextsearch/qsearchable_p.h | 135 - src/assistant/lib/fulltextsearch/qsort.cpp | 97 - src/assistant/lib/fulltextsearch/qsort_p.h | 84 - src/assistant/lib/fulltextsearch/qterm.cpp | 134 - src/assistant/lib/fulltextsearch/qterm_p.h | 100 - src/assistant/lib/fulltextsearch/qtoken.cpp | 150 - src/assistant/lib/fulltextsearch/qtoken_p.h | 112 - src/assistant/lib/fulltextsearch/qtokenizer.cpp | 117 - src/assistant/lib/fulltextsearch/qtokenizer_p.h | 97 - src/assistant/lib/fulltextsearch/qtokenstream.cpp | 67 - src/assistant/lib/fulltextsearch/qtokenstream_p.h | 95 - src/assistant/lib/helpsystem.qrc | 8 - src/assistant/lib/images/1leftarrow.png | Bin 669 -> 0 bytes src/assistant/lib/images/1rightarrow.png | Bin 706 -> 0 bytes src/assistant/lib/images/3leftarrow.png | Bin 832 -> 0 bytes src/assistant/lib/images/3rightarrow.png | Bin 820 -> 0 bytes src/assistant/lib/lib.pro | 83 - src/assistant/lib/qclucenefieldnames.cpp | 57 - src/assistant/lib/qclucenefieldnames_p.h | 63 - src/assistant/lib/qhelp_global.cpp | 114 - src/assistant/lib/qhelp_global.h | 78 - src/assistant/lib/qhelpcollectionhandler.cpp | 603 - src/assistant/lib/qhelpcollectionhandler_p.h | 124 - src/assistant/lib/qhelpcontentwidget.cpp | 586 - src/assistant/lib/qhelpcontentwidget.h | 146 - src/assistant/lib/qhelpdatainterface.cpp | 273 - src/assistant/lib/qhelpdatainterface_p.h | 155 - src/assistant/lib/qhelpdbreader.cpp | 583 - src/assistant/lib/qhelpdbreader_p.h | 128 - src/assistant/lib/qhelpengine.cpp | 213 - src/assistant/lib/qhelpengine.h | 84 - src/assistant/lib/qhelpengine_p.h | 144 - src/assistant/lib/qhelpenginecore.cpp | 737 -- src/assistant/lib/qhelpenginecore.h | 136 - src/assistant/lib/qhelpgenerator.cpp | 909 -- src/assistant/lib/qhelpgenerator_p.h | 118 - src/assistant/lib/qhelpindexwidget.cpp | 444 - src/assistant/lib/qhelpindexwidget.h | 114 - src/assistant/lib/qhelpprojectdata.cpp | 450 - src/assistant/lib/qhelpprojectdata_p.h | 89 - src/assistant/lib/qhelpsearchengine.cpp | 450 - src/assistant/lib/qhelpsearchengine.h | 125 - src/assistant/lib/qhelpsearchindex_default.cpp | 60 - src/assistant/lib/qhelpsearchindex_default_p.h | 149 - src/assistant/lib/qhelpsearchindexreader.cpp | 104 - .../lib/qhelpsearchindexreader_clucene.cpp | 481 - .../lib/qhelpsearchindexreader_clucene_p.h | 114 - .../lib/qhelpsearchindexreader_default.cpp | 612 - .../lib/qhelpsearchindexreader_default_p.h | 131 - src/assistant/lib/qhelpsearchindexreader_p.h | 106 - .../lib/qhelpsearchindexwriter_clucene.cpp | 898 -- .../lib/qhelpsearchindexwriter_clucene_p.h | 124 - .../lib/qhelpsearchindexwriter_default.cpp | 384 - .../lib/qhelpsearchindexwriter_default_p.h | 130 - src/assistant/lib/qhelpsearchquerywidget.cpp | 587 - src/assistant/lib/qhelpsearchquerywidget.h | 92 - src/assistant/lib/qhelpsearchresultwidget.cpp | 447 - src/assistant/lib/qhelpsearchresultwidget.h | 85 - src/assistant/qcollectiongenerator/main.cpp | 615 + .../qcollectiongenerator/qcollectiongenerator.pro | 16 + src/assistant/qhelpconverter/adpreader.cpp | 179 + src/assistant/qhelpconverter/adpreader.h | 90 + src/assistant/qhelpconverter/assistant-128.png | Bin 0 -> 6448 bytes src/assistant/qhelpconverter/assistant.png | Bin 0 -> 2034 bytes src/assistant/qhelpconverter/conversionwizard.cpp | 265 + src/assistant/qhelpconverter/conversionwizard.h | 96 + src/assistant/qhelpconverter/doc/filespage.html | 8 + src/assistant/qhelpconverter/doc/filterpage.html | 13 + src/assistant/qhelpconverter/doc/generalpage.html | 10 + .../qhelpconverter/doc/identifierpage.html | 17 + src/assistant/qhelpconverter/doc/inputpage.html | 7 + src/assistant/qhelpconverter/doc/outputpage.html | 7 + src/assistant/qhelpconverter/doc/pathpage.html | 8 + src/assistant/qhelpconverter/filespage.cpp | 112 + src/assistant/qhelpconverter/filespage.h | 73 + src/assistant/qhelpconverter/filespage.ui | 79 + src/assistant/qhelpconverter/filterpage.cpp | 147 + src/assistant/qhelpconverter/filterpage.h | 79 + src/assistant/qhelpconverter/filterpage.ui | 125 + src/assistant/qhelpconverter/finishpage.cpp | 75 + src/assistant/qhelpconverter/finishpage.h | 65 + src/assistant/qhelpconverter/generalpage.cpp | 92 + src/assistant/qhelpconverter/generalpage.h | 66 + src/assistant/qhelpconverter/generalpage.ui | 69 + src/assistant/qhelpconverter/helpwindow.cpp | 84 + src/assistant/qhelpconverter/helpwindow.h | 65 + src/assistant/qhelpconverter/identifierpage.cpp | 71 + src/assistant/qhelpconverter/identifierpage.h | 66 + src/assistant/qhelpconverter/identifierpage.ui | 132 + src/assistant/qhelpconverter/inputpage.cpp | 103 + src/assistant/qhelpconverter/inputpage.h | 71 + src/assistant/qhelpconverter/inputpage.ui | 79 + src/assistant/qhelpconverter/main.cpp | 77 + src/assistant/qhelpconverter/outputpage.cpp | 110 + src/assistant/qhelpconverter/outputpage.h | 71 + src/assistant/qhelpconverter/outputpage.ui | 95 + src/assistant/qhelpconverter/pathpage.cpp | 112 + src/assistant/qhelpconverter/pathpage.h | 71 + src/assistant/qhelpconverter/pathpage.ui | 114 + src/assistant/qhelpconverter/qhcpwriter.cpp | 145 + src/assistant/qhelpconverter/qhcpwriter.h | 70 + src/assistant/qhelpconverter/qhelpconverter.pro | 47 + src/assistant/qhelpconverter/qhelpconverter.qrc | 13 + src/assistant/qhelpconverter/qhpwriter.cpp | 184 + src/assistant/qhelpconverter/qhpwriter.h | 85 + src/assistant/qhelpgenerator/main.cpp | 178 + src/assistant/qhelpgenerator/qhelpgenerator.pro | 14 + src/assistant/shared/collectionconfiguration.cpp | 327 + src/assistant/shared/collectionconfiguration.h | 149 + src/assistant/shared/helpgenerator.cpp | 84 + src/assistant/shared/helpgenerator.h | 73 + src/assistant/tools/assistant/Info_mac.plist | 18 - src/assistant/tools/assistant/aboutdialog.cpp | 184 - src/assistant/tools/assistant/aboutdialog.h | 91 - src/assistant/tools/assistant/assistant.icns | Bin 162568 -> 0 bytes src/assistant/tools/assistant/assistant.ico | Bin 355574 -> 0 bytes src/assistant/tools/assistant/assistant.pro | 121 - src/assistant/tools/assistant/assistant.qch | Bin 364544 -> 0 bytes src/assistant/tools/assistant/assistant.qrc | 5 - src/assistant/tools/assistant/assistant.rc | 32 - src/assistant/tools/assistant/assistant_images.qrc | 37 - src/assistant/tools/assistant/bookmarkdialog.cpp | 237 - src/assistant/tools/assistant/bookmarkdialog.h | 89 - src/assistant/tools/assistant/bookmarkdialog.ui | 156 - .../tools/assistant/bookmarkfiltermodel.cpp | 321 - .../tools/assistant/bookmarkfiltermodel.h | 118 - src/assistant/tools/assistant/bookmarkitem.cpp | 184 - src/assistant/tools/assistant/bookmarkitem.h | 91 - src/assistant/tools/assistant/bookmarkmanager.cpp | 559 - src/assistant/tools/assistant/bookmarkmanager.h | 160 - .../tools/assistant/bookmarkmanagerwidget.cpp | 321 - .../tools/assistant/bookmarkmanagerwidget.h | 103 - .../tools/assistant/bookmarkmanagerwidget.ui | 137 - src/assistant/tools/assistant/bookmarkmodel.cpp | 461 - src/assistant/tools/assistant/bookmarkmodel.h | 117 - src/assistant/tools/assistant/bookmarkwidget.ui | 85 - src/assistant/tools/assistant/centralwidget.cpp | 636 -- src/assistant/tools/assistant/centralwidget.h | 172 - src/assistant/tools/assistant/cmdlineparser.cpp | 376 - src/assistant/tools/assistant/cmdlineparser.h | 117 - src/assistant/tools/assistant/contentwindow.cpp | 204 - src/assistant/tools/assistant/contentwindow.h | 86 - src/assistant/tools/assistant/doc/HOWTO | 16 - src/assistant/tools/assistant/doc/assistant.qdoc | 461 - .../tools/assistant/doc/assistant.qdocconf | 16 - src/assistant/tools/assistant/doc/assistant.qhp | 22 - src/assistant/tools/assistant/doc/classic.css | 92 - .../doc/images/assistant-address-toolbar.png | Bin 2899 -> 0 bytes .../assistant/doc/images/assistant-assistant.png | Bin 205326 -> 0 bytes .../assistant/doc/images/assistant-dockwidgets.png | Bin 50554 -> 0 bytes .../assistant/doc/images/assistant-docwindow.png | Bin 55582 -> 0 bytes .../assistant/doc/images/assistant-examples.png | Bin 9799 -> 0 bytes .../doc/images/assistant-filter-toolbar.png | Bin 1767 -> 0 bytes .../images/assistant-preferences-documentation.png | Bin 13417 -> 0 bytes .../doc/images/assistant-preferences-filters.png | Bin 15561 -> 0 bytes .../doc/images/assistant-preferences-fonts.png | Bin 13139 -> 0 bytes .../doc/images/assistant-preferences-options.png | Bin 14255 -> 0 bytes .../assistant/doc/images/assistant-search.png | Bin 59254 -> 0 bytes .../assistant/doc/images/assistant-toolbar.png | Bin 6532 -> 0 bytes src/assistant/tools/assistant/filternamedialog.cpp | 77 - src/assistant/tools/assistant/filternamedialog.h | 67 - src/assistant/tools/assistant/filternamedialog.ui | 67 - src/assistant/tools/assistant/findwidget.cpp | 234 - src/assistant/tools/assistant/findwidget.h | 100 - src/assistant/tools/assistant/globalactions.cpp | 246 - src/assistant/tools/assistant/globalactions.h | 105 - .../tools/assistant/helpenginewrapper.cpp | 844 -- src/assistant/tools/assistant/helpenginewrapper.h | 218 - src/assistant/tools/assistant/helpviewer.cpp | 221 - src/assistant/tools/assistant/helpviewer.h | 158 - src/assistant/tools/assistant/helpviewer_p.h | 123 - src/assistant/tools/assistant/helpviewer_qtb.cpp | 384 - src/assistant/tools/assistant/helpviewer_qwv.cpp | 495 - .../tools/assistant/images/assistant-128.png | Bin 6448 -> 0 bytes src/assistant/tools/assistant/images/assistant.png | Bin 2034 -> 0 bytes src/assistant/tools/assistant/images/bookmark.png | Bin 1266 -> 0 bytes .../tools/assistant/images/closebutton.png | Bin 288 -> 0 bytes .../tools/assistant/images/darkclosebutton.png | Bin 319 -> 0 bytes .../tools/assistant/images/mac/addtab.png | Bin 469 -> 0 bytes src/assistant/tools/assistant/images/mac/book.png | Bin 1477 -> 0 bytes .../tools/assistant/images/mac/closetab.png | Bin 516 -> 0 bytes .../tools/assistant/images/mac/editcopy.png | Bin 1468 -> 0 bytes src/assistant/tools/assistant/images/mac/find.png | Bin 1836 -> 0 bytes src/assistant/tools/assistant/images/mac/home.png | Bin 1807 -> 0 bytes src/assistant/tools/assistant/images/mac/next.png | Bin 1310 -> 0 bytes .../tools/assistant/images/mac/previous.png | Bin 1080 -> 0 bytes src/assistant/tools/assistant/images/mac/print.png | Bin 2087 -> 0 bytes .../tools/assistant/images/mac/resetzoom.png | Bin 1567 -> 0 bytes .../tools/assistant/images/mac/synctoc.png | Bin 1838 -> 0 bytes .../tools/assistant/images/mac/zoomin.png | Bin 1696 -> 0 bytes .../tools/assistant/images/mac/zoomout.png | Bin 1662 -> 0 bytes .../tools/assistant/images/trolltech-logo.png | Bin 10096 -> 0 bytes .../tools/assistant/images/win/addtab.png | Bin 314 -> 0 bytes src/assistant/tools/assistant/images/win/book.png | Bin 1109 -> 0 bytes .../tools/assistant/images/win/closetab.png | Bin 375 -> 0 bytes .../tools/assistant/images/win/editcopy.png | Bin 1325 -> 0 bytes src/assistant/tools/assistant/images/win/find.png | Bin 1944 -> 0 bytes src/assistant/tools/assistant/images/win/home.png | Bin 1414 -> 0 bytes src/assistant/tools/assistant/images/win/next.png | Bin 1038 -> 0 bytes .../tools/assistant/images/win/previous.png | Bin 898 -> 0 bytes src/assistant/tools/assistant/images/win/print.png | Bin 1456 -> 0 bytes .../tools/assistant/images/win/resetzoom.png | Bin 1134 -> 0 bytes .../tools/assistant/images/win/synctoc.png | Bin 1235 -> 0 bytes .../tools/assistant/images/win/zoomin.png | Bin 1208 -> 0 bytes .../tools/assistant/images/win/zoomout.png | Bin 1226 -> 0 bytes src/assistant/tools/assistant/images/wrap.png | Bin 500 -> 0 bytes src/assistant/tools/assistant/indexwindow.cpp | 231 - src/assistant/tools/assistant/indexwindow.h | 90 - src/assistant/tools/assistant/installdialog.cpp | 355 - src/assistant/tools/assistant/installdialog.h | 105 - src/assistant/tools/assistant/installdialog.ui | 118 - src/assistant/tools/assistant/main.cpp | 440 - src/assistant/tools/assistant/mainwindow.cpp | 1099 -- src/assistant/tools/assistant/mainwindow.h | 172 - src/assistant/tools/assistant/openpagesmanager.cpp | 378 - src/assistant/tools/assistant/openpagesmanager.h | 115 - src/assistant/tools/assistant/openpagesmodel.cpp | 119 - src/assistant/tools/assistant/openpagesmodel.h | 76 - .../tools/assistant/openpagesswitcher.cpp | 194 - src/assistant/tools/assistant/openpagesswitcher.h | 85 - src/assistant/tools/assistant/openpageswidget.cpp | 237 - src/assistant/tools/assistant/openpageswidget.h | 92 - .../tools/assistant/preferencesdialog.cpp | 507 - src/assistant/tools/assistant/preferencesdialog.h | 110 - src/assistant/tools/assistant/preferencesdialog.ui | 400 - src/assistant/tools/assistant/qtdocinstaller.cpp | 128 - src/assistant/tools/assistant/qtdocinstaller.h | 84 - src/assistant/tools/assistant/remotecontrol.cpp | 388 - src/assistant/tools/assistant/remotecontrol.h | 96 - src/assistant/tools/assistant/remotecontrol_win.h | 68 - src/assistant/tools/assistant/searchwidget.cpp | 237 - src/assistant/tools/assistant/searchwidget.h | 90 - src/assistant/tools/assistant/topicchooser.cpp | 87 - src/assistant/tools/assistant/topicchooser.h | 73 - src/assistant/tools/assistant/topicchooser.ui | 116 - src/assistant/tools/assistant/tracer.h | 75 - src/assistant/tools/assistant/xbelsupport.cpp | 233 - src/assistant/tools/assistant/xbelsupport.h | 87 - src/assistant/tools/qcollectiongenerator/main.cpp | 615 - .../qcollectiongenerator/qcollectiongenerator.pro | 18 - src/assistant/tools/qhelpconverter/adpreader.cpp | 179 - src/assistant/tools/qhelpconverter/adpreader.h | 90 - .../tools/qhelpconverter/assistant-128.png | Bin 6448 -> 0 bytes src/assistant/tools/qhelpconverter/assistant.png | Bin 2034 -> 0 bytes .../tools/qhelpconverter/conversionwizard.cpp | 265 - .../tools/qhelpconverter/conversionwizard.h | 96 - .../tools/qhelpconverter/doc/filespage.html | 8 - .../tools/qhelpconverter/doc/filterpage.html | 13 - .../tools/qhelpconverter/doc/generalpage.html | 10 - .../tools/qhelpconverter/doc/identifierpage.html | 17 - .../tools/qhelpconverter/doc/inputpage.html | 7 - .../tools/qhelpconverter/doc/outputpage.html | 7 - .../tools/qhelpconverter/doc/pathpage.html | 8 - src/assistant/tools/qhelpconverter/filespage.cpp | 112 - src/assistant/tools/qhelpconverter/filespage.h | 73 - src/assistant/tools/qhelpconverter/filespage.ui | 79 - src/assistant/tools/qhelpconverter/filterpage.cpp | 147 - src/assistant/tools/qhelpconverter/filterpage.h | 79 - src/assistant/tools/qhelpconverter/filterpage.ui | 125 - src/assistant/tools/qhelpconverter/finishpage.cpp | 75 - src/assistant/tools/qhelpconverter/finishpage.h | 65 - src/assistant/tools/qhelpconverter/generalpage.cpp | 92 - src/assistant/tools/qhelpconverter/generalpage.h | 66 - src/assistant/tools/qhelpconverter/generalpage.ui | 69 - src/assistant/tools/qhelpconverter/helpwindow.cpp | 84 - src/assistant/tools/qhelpconverter/helpwindow.h | 65 - .../tools/qhelpconverter/identifierpage.cpp | 71 - .../tools/qhelpconverter/identifierpage.h | 66 - .../tools/qhelpconverter/identifierpage.ui | 132 - src/assistant/tools/qhelpconverter/inputpage.cpp | 103 - src/assistant/tools/qhelpconverter/inputpage.h | 71 - src/assistant/tools/qhelpconverter/inputpage.ui | 79 - src/assistant/tools/qhelpconverter/main.cpp | 77 - src/assistant/tools/qhelpconverter/outputpage.cpp | 110 - src/assistant/tools/qhelpconverter/outputpage.h | 71 - src/assistant/tools/qhelpconverter/outputpage.ui | 95 - src/assistant/tools/qhelpconverter/pathpage.cpp | 112 - src/assistant/tools/qhelpconverter/pathpage.h | 71 - src/assistant/tools/qhelpconverter/pathpage.ui | 114 - src/assistant/tools/qhelpconverter/qhcpwriter.cpp | 145 - src/assistant/tools/qhelpconverter/qhcpwriter.h | 70 - .../tools/qhelpconverter/qhelpconverter.pro | 47 - .../tools/qhelpconverter/qhelpconverter.qrc | 13 - src/assistant/tools/qhelpconverter/qhpwriter.cpp | 184 - src/assistant/tools/qhelpconverter/qhpwriter.h | 85 - src/assistant/tools/qhelpgenerator/main.cpp | 178 - .../tools/qhelpgenerator/qhelpgenerator.pro | 14 - .../tools/shared/collectionconfiguration.cpp | 327 - .../tools/shared/collectionconfiguration.h | 149 - src/assistant/tools/shared/helpgenerator.cpp | 84 - src/assistant/tools/shared/helpgenerator.h | 73 - src/assistant/tools/tools.pro | 8 - .../src/lib/extension/default_extensionfactory.cpp | 2 +- .../src/lib/extension/default_extensionfactory.h | 2 +- src/designer/src/lib/extension/qextensionmanager.h | 2 +- src/designer/src/lib/lib.pro | 71 +- .../src/lib/shared/qdesigner_formbuilder.cpp | 2 +- .../src/lib/shared/qdesigner_propertysheet.cpp | 2 +- src/designer/src/lib/shared/shared.pri | 2 +- src/shared/qtgradienteditor/qtcolorline.cpp | 21 +- src/shared/qtgradienteditor/qtgradientwidget.cpp | 7 +- sync.profile | 50 +- 1016 files changed, 90522 insertions(+), 90583 deletions(-) delete mode 100644 3rdparty/clucene/APACHE.license delete mode 100644 3rdparty/clucene/AUTHORS delete mode 100644 3rdparty/clucene/COPYING delete mode 100644 3rdparty/clucene/ChangeLog delete mode 100644 3rdparty/clucene/LGPL.license delete mode 100644 3rdparty/clucene/README delete mode 100644 3rdparty/clucene/src/CLucene.h delete mode 100644 3rdparty/clucene/src/CLucene/CLBackwards.h delete mode 100644 3rdparty/clucene/src/CLucene/CLConfig.h delete mode 100644 3rdparty/clucene/src/CLucene/CLMonolithic.cpp delete mode 100644 3rdparty/clucene/src/CLucene/LuceneThreads.h delete mode 100644 3rdparty/clucene/src/CLucene/StdHeader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/StdHeader.h delete mode 100644 3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h delete mode 100644 3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp delete mode 100644 3rdparty/clucene/src/CLucene/analysis/Analyzers.h delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.h delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h delete mode 100644 3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h delete mode 100644 3rdparty/clucene/src/CLucene/config/CompilerAcc.h delete mode 100644 3rdparty/clucene/src/CLucene/config/CompilerBcb.h delete mode 100644 3rdparty/clucene/src/CLucene/config/CompilerGcc.h delete mode 100644 3rdparty/clucene/src/CLucene/config/CompilerMsvc.h delete mode 100644 3rdparty/clucene/src/CLucene/config/PlatformMac.h delete mode 100644 3rdparty/clucene/src/CLucene/config/PlatformUnix.h delete mode 100644 3rdparty/clucene/src/CLucene/config/PlatformWin32.h delete mode 100644 3rdparty/clucene/src/CLucene/config/compiler.h delete mode 100644 3rdparty/clucene/src/CLucene/config/define_std.h delete mode 100644 3rdparty/clucene/src/CLucene/config/gunichartables.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/gunichartables.h delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_lltot.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_tchar.h delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/repl_wchar.h delete mode 100644 3rdparty/clucene/src/CLucene/config/threadCSection.h delete mode 100644 3rdparty/clucene/src/CLucene/config/threadPthread.h delete mode 100644 3rdparty/clucene/src/CLucene/config/threads.cpp delete mode 100644 3rdparty/clucene/src/CLucene/config/utf8.cpp delete mode 100644 3rdparty/clucene/src/CLucene/debug/condition.cpp delete mode 100644 3rdparty/clucene/src/CLucene/debug/condition.h delete mode 100644 3rdparty/clucene/src/CLucene/debug/error.cpp delete mode 100644 3rdparty/clucene/src/CLucene/debug/error.h delete mode 100644 3rdparty/clucene/src/CLucene/debug/lucenebase.h delete mode 100644 3rdparty/clucene/src/CLucene/debug/mem.h delete mode 100644 3rdparty/clucene/src/CLucene/debug/memtracking.cpp delete mode 100644 3rdparty/clucene/src/CLucene/document/DateField.cpp delete mode 100644 3rdparty/clucene/src/CLucene/document/DateField.h delete mode 100644 3rdparty/clucene/src/CLucene/document/Document.cpp delete mode 100644 3rdparty/clucene/src/CLucene/document/Document.h delete mode 100644 3rdparty/clucene/src/CLucene/document/Field.cpp delete mode 100644 3rdparty/clucene/src/CLucene/document/Field.h delete mode 100644 3rdparty/clucene/src/CLucene/index/CompoundFile.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/CompoundFile.h delete mode 100644 3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/DocumentWriter.h delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldInfo.h delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldInfos.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldInfos.h delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldsReader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldsReader.h delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/FieldsWriter.h delete mode 100644 3rdparty/clucene/src/CLucene/index/IndexModifier.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/IndexModifier.h delete mode 100644 3rdparty/clucene/src/CLucene/index/IndexReader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/IndexReader.h delete mode 100644 3rdparty/clucene/src/CLucene/index/IndexWriter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/IndexWriter.h delete mode 100644 3rdparty/clucene/src/CLucene/index/MultiReader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/MultiReader.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentHeader.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentInfos.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentMerger.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentReader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/Term.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/Term.h delete mode 100644 3rdparty/clucene/src/CLucene/index/TermInfo.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/TermInfo.h delete mode 100644 3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/TermInfosReader.h delete mode 100644 3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/TermInfosWriter.h delete mode 100644 3rdparty/clucene/src/CLucene/index/TermVector.h delete mode 100644 3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/index/Terms.h delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/Lexer.h delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/QueryParser.h delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/QueryToken.h delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp delete mode 100644 3rdparty/clucene/src/CLucene/queryParser/TokenList.h delete mode 100644 3rdparty/clucene/src/CLucene/search/BooleanClause.h delete mode 100644 3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/BooleanQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/BooleanScorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h delete mode 100644 3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/ChainedFilter.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Compare.h delete mode 100644 3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/DateFilter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/DateFilter.h delete mode 100644 3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Explanation.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/Explanation.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldCache.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldCache.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldDoc.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Filter.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h delete mode 100644 3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/FuzzyQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/HitQueue.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/HitQueue.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Hits.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/IndexSearcher.h delete mode 100644 3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/MultiSearcher.h delete mode 100644 3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/MultiTermQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/PhrasePositions.h delete mode 100644 3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/PhraseQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/PhraseQueue.h delete mode 100644 3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/PhraseScorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/PrefixQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/QueryFilter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/QueryFilter.h delete mode 100644 3rdparty/clucene/src/CLucene/search/RangeFilter.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/RangeFilter.h delete mode 100644 3rdparty/clucene/src/CLucene/search/RangeQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/RangeQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Scorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/SearchHeader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/SearchHeader.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Similarity.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/Similarity.h delete mode 100644 3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/Sort.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/Sort.h delete mode 100644 3rdparty/clucene/src/CLucene/search/TermQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/TermQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/TermScorer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/TermScorer.h delete mode 100644 3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/WildcardQuery.h delete mode 100644 3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp delete mode 100644 3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h delete mode 100644 3rdparty/clucene/src/CLucene/store/Directory.h delete mode 100644 3rdparty/clucene/src/CLucene/store/FSDirectory.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/FSDirectory.h delete mode 100644 3rdparty/clucene/src/CLucene/store/IndexInput.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/IndexInput.h delete mode 100644 3rdparty/clucene/src/CLucene/store/IndexOutput.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/IndexOutput.h delete mode 100644 3rdparty/clucene/src/CLucene/store/InputStream.h delete mode 100644 3rdparty/clucene/src/CLucene/store/Lock.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/Lock.h delete mode 100644 3rdparty/clucene/src/CLucene/store/MMapInput.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/OutputStream.h delete mode 100644 3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/RAMDirectory.h delete mode 100644 3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp delete mode 100644 3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h delete mode 100644 3rdparty/clucene/src/CLucene/util/Arrays.h delete mode 100644 3rdparty/clucene/src/CLucene/util/BitSet.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/BitSet.h delete mode 100644 3rdparty/clucene/src/CLucene/util/Equators.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/Equators.h delete mode 100644 3rdparty/clucene/src/CLucene/util/FastCharStream.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/FastCharStream.h delete mode 100644 3rdparty/clucene/src/CLucene/util/Misc.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/Misc.h delete mode 100644 3rdparty/clucene/src/CLucene/util/PriorityQueue.h delete mode 100644 3rdparty/clucene/src/CLucene/util/Reader.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/Reader.h delete mode 100644 3rdparty/clucene/src/CLucene/util/StringBuffer.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/StringBuffer.h delete mode 100644 3rdparty/clucene/src/CLucene/util/StringIntern.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/StringIntern.h delete mode 100644 3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/ThreadLocal.h delete mode 100644 3rdparty/clucene/src/CLucene/util/VoidList.h delete mode 100644 3rdparty/clucene/src/CLucene/util/VoidMap.h delete mode 100644 3rdparty/clucene/src/CLucene/util/bufferedstream.h delete mode 100644 3rdparty/clucene/src/CLucene/util/dirent.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/dirent.h delete mode 100644 3rdparty/clucene/src/CLucene/util/fileinputstream.cpp delete mode 100644 3rdparty/clucene/src/CLucene/util/fileinputstream.h delete mode 100644 3rdparty/clucene/src/CLucene/util/inputstreambuffer.h delete mode 100644 3rdparty/clucene/src/CLucene/util/jstreamsconfig.h delete mode 100644 3rdparty/clucene/src/CLucene/util/streambase.h delete mode 100644 3rdparty/clucene/src/CLucene/util/stringreader.h delete mode 100644 3rdparty/clucene/src/CLucene/util/subinputstream.h create mode 100644 src/assistant/3rdparty/clucene/APACHE.license create mode 100644 src/assistant/3rdparty/clucene/AUTHORS create mode 100644 src/assistant/3rdparty/clucene/COPYING create mode 100644 src/assistant/3rdparty/clucene/ChangeLog create mode 100644 src/assistant/3rdparty/clucene/LGPL.license create mode 100644 src/assistant/3rdparty/clucene/README create mode 100644 src/assistant/3rdparty/clucene/src/CLucene.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/CLBackwards.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/CLConfig.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/CLMonolithic.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/LuceneThreads.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/StdHeader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/CompilerAcc.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/CompilerBcb.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/PlatformMac.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/PlatformUnix.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/PlatformWin32.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/compiler.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/define_std.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_tchar.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/repl_wchar.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/threadCSection.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/threadPthread.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/threads.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/config/utf8.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/condition.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/error.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/error.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/lucenebase.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/mem.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/debug/memtracking.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/document/DateField.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/document/DateField.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/document/Document.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/document/Document.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/document/Field.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/document/Field.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfo.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentHeader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/Term.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/Term.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermVector.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/index/Terms.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/BooleanClause.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Compare.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldCache.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldCache.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldDoc.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Filter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Hits.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQueue.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Scorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Sort.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/Sort.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/Directory.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/InputStream.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/Lock.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/Lock.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/MMapInput.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/OutputStream.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Arrays.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Equators.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Equators.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Misc.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Misc.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/PriorityQueue.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Reader.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/Reader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/StringBuffer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/StringIntern.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/StringIntern.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/bufferedstream.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/dirent.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/dirent.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/streambase.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/stringreader.h create mode 100644 src/assistant/3rdparty/clucene/src/CLucene/util/subinputstream.h create mode 100644 src/assistant/assistant/Info_mac.plist create mode 100644 src/assistant/assistant/aboutdialog.cpp create mode 100644 src/assistant/assistant/aboutdialog.h create mode 100644 src/assistant/assistant/assistant.icns create mode 100644 src/assistant/assistant/assistant.ico create mode 100644 src/assistant/assistant/assistant.pro create mode 100644 src/assistant/assistant/assistant.qch create mode 100644 src/assistant/assistant/assistant.qrc create mode 100644 src/assistant/assistant/assistant.rc create mode 100644 src/assistant/assistant/assistant_images.qrc create mode 100644 src/assistant/assistant/bookmarkdialog.cpp create mode 100644 src/assistant/assistant/bookmarkdialog.h create mode 100644 src/assistant/assistant/bookmarkdialog.ui create mode 100644 src/assistant/assistant/bookmarkfiltermodel.cpp create mode 100644 src/assistant/assistant/bookmarkfiltermodel.h create mode 100644 src/assistant/assistant/bookmarkitem.cpp create mode 100644 src/assistant/assistant/bookmarkitem.h create mode 100644 src/assistant/assistant/bookmarkmanager.cpp create mode 100644 src/assistant/assistant/bookmarkmanager.h create mode 100644 src/assistant/assistant/bookmarkmanagerwidget.cpp create mode 100644 src/assistant/assistant/bookmarkmanagerwidget.h create mode 100644 src/assistant/assistant/bookmarkmanagerwidget.ui create mode 100644 src/assistant/assistant/bookmarkmodel.cpp create mode 100644 src/assistant/assistant/bookmarkmodel.h create mode 100644 src/assistant/assistant/bookmarkwidget.ui create mode 100644 src/assistant/assistant/centralwidget.cpp create mode 100644 src/assistant/assistant/centralwidget.h create mode 100644 src/assistant/assistant/cmdlineparser.cpp create mode 100644 src/assistant/assistant/cmdlineparser.h create mode 100644 src/assistant/assistant/contentwindow.cpp create mode 100644 src/assistant/assistant/contentwindow.h create mode 100644 src/assistant/assistant/doc/HOWTO create mode 100644 src/assistant/assistant/doc/assistant.qdoc create mode 100644 src/assistant/assistant/doc/assistant.qdocconf create mode 100644 src/assistant/assistant/doc/assistant.qhp create mode 100644 src/assistant/assistant/doc/classic.css create mode 100644 src/assistant/assistant/doc/images/assistant-address-toolbar.png create mode 100644 src/assistant/assistant/doc/images/assistant-assistant.png create mode 100644 src/assistant/assistant/doc/images/assistant-dockwidgets.png create mode 100644 src/assistant/assistant/doc/images/assistant-docwindow.png create mode 100644 src/assistant/assistant/doc/images/assistant-examples.png create mode 100644 src/assistant/assistant/doc/images/assistant-filter-toolbar.png create mode 100644 src/assistant/assistant/doc/images/assistant-preferences-documentation.png create mode 100644 src/assistant/assistant/doc/images/assistant-preferences-filters.png create mode 100644 src/assistant/assistant/doc/images/assistant-preferences-fonts.png create mode 100644 src/assistant/assistant/doc/images/assistant-preferences-options.png create mode 100644 src/assistant/assistant/doc/images/assistant-search.png create mode 100644 src/assistant/assistant/doc/images/assistant-toolbar.png create mode 100644 src/assistant/assistant/filternamedialog.cpp create mode 100644 src/assistant/assistant/filternamedialog.h create mode 100644 src/assistant/assistant/filternamedialog.ui create mode 100644 src/assistant/assistant/findwidget.cpp create mode 100644 src/assistant/assistant/findwidget.h create mode 100644 src/assistant/assistant/globalactions.cpp create mode 100644 src/assistant/assistant/globalactions.h create mode 100644 src/assistant/assistant/helpenginewrapper.cpp create mode 100644 src/assistant/assistant/helpenginewrapper.h create mode 100644 src/assistant/assistant/helpviewer.cpp create mode 100644 src/assistant/assistant/helpviewer.h create mode 100644 src/assistant/assistant/helpviewer_p.h create mode 100644 src/assistant/assistant/helpviewer_qtb.cpp create mode 100644 src/assistant/assistant/helpviewer_qwv.cpp create mode 100644 src/assistant/assistant/images/assistant-128.png create mode 100644 src/assistant/assistant/images/assistant.png create mode 100644 src/assistant/assistant/images/bookmark.png create mode 100644 src/assistant/assistant/images/closebutton.png create mode 100644 src/assistant/assistant/images/darkclosebutton.png create mode 100644 src/assistant/assistant/images/mac/addtab.png create mode 100644 src/assistant/assistant/images/mac/book.png create mode 100644 src/assistant/assistant/images/mac/closetab.png create mode 100644 src/assistant/assistant/images/mac/editcopy.png create mode 100644 src/assistant/assistant/images/mac/find.png create mode 100644 src/assistant/assistant/images/mac/home.png create mode 100644 src/assistant/assistant/images/mac/next.png create mode 100644 src/assistant/assistant/images/mac/previous.png create mode 100644 src/assistant/assistant/images/mac/print.png create mode 100644 src/assistant/assistant/images/mac/resetzoom.png create mode 100644 src/assistant/assistant/images/mac/synctoc.png create mode 100644 src/assistant/assistant/images/mac/zoomin.png create mode 100644 src/assistant/assistant/images/mac/zoomout.png create mode 100644 src/assistant/assistant/images/trolltech-logo.png create mode 100644 src/assistant/assistant/images/win/addtab.png create mode 100644 src/assistant/assistant/images/win/book.png create mode 100644 src/assistant/assistant/images/win/closetab.png create mode 100644 src/assistant/assistant/images/win/editcopy.png create mode 100644 src/assistant/assistant/images/win/find.png create mode 100644 src/assistant/assistant/images/win/home.png create mode 100644 src/assistant/assistant/images/win/next.png create mode 100644 src/assistant/assistant/images/win/previous.png create mode 100644 src/assistant/assistant/images/win/print.png create mode 100644 src/assistant/assistant/images/win/resetzoom.png create mode 100644 src/assistant/assistant/images/win/synctoc.png create mode 100644 src/assistant/assistant/images/win/zoomin.png create mode 100644 src/assistant/assistant/images/win/zoomout.png create mode 100644 src/assistant/assistant/images/wrap.png create mode 100644 src/assistant/assistant/indexwindow.cpp create mode 100644 src/assistant/assistant/indexwindow.h create mode 100644 src/assistant/assistant/installdialog.cpp create mode 100644 src/assistant/assistant/installdialog.h create mode 100644 src/assistant/assistant/installdialog.ui create mode 100644 src/assistant/assistant/main.cpp create mode 100644 src/assistant/assistant/mainwindow.cpp create mode 100644 src/assistant/assistant/mainwindow.h create mode 100644 src/assistant/assistant/openpagesmanager.cpp create mode 100644 src/assistant/assistant/openpagesmanager.h create mode 100644 src/assistant/assistant/openpagesmodel.cpp create mode 100644 src/assistant/assistant/openpagesmodel.h create mode 100644 src/assistant/assistant/openpagesswitcher.cpp create mode 100644 src/assistant/assistant/openpagesswitcher.h create mode 100644 src/assistant/assistant/openpageswidget.cpp create mode 100644 src/assistant/assistant/openpageswidget.h create mode 100644 src/assistant/assistant/preferencesdialog.cpp create mode 100644 src/assistant/assistant/preferencesdialog.h create mode 100644 src/assistant/assistant/preferencesdialog.ui create mode 100644 src/assistant/assistant/qtdocinstaller.cpp create mode 100644 src/assistant/assistant/qtdocinstaller.h create mode 100644 src/assistant/assistant/remotecontrol.cpp create mode 100644 src/assistant/assistant/remotecontrol.h create mode 100644 src/assistant/assistant/remotecontrol_win.h create mode 100644 src/assistant/assistant/searchwidget.cpp create mode 100644 src/assistant/assistant/searchwidget.h create mode 100644 src/assistant/assistant/topicchooser.cpp create mode 100644 src/assistant/assistant/topicchooser.h create mode 100644 src/assistant/assistant/topicchooser.ui create mode 100644 src/assistant/assistant/tracer.h create mode 100644 src/assistant/assistant/xbelsupport.cpp create mode 100644 src/assistant/assistant/xbelsupport.h create mode 100644 src/assistant/clucene/clucene.pro create mode 100644 src/assistant/clucene/fulltextsearch.pri create mode 100644 src/assistant/clucene/license.txt create mode 100644 src/assistant/clucene/qanalyzer.cpp create mode 100644 src/assistant/clucene/qanalyzer_p.h create mode 100644 src/assistant/clucene/qclucene-config_p.h create mode 100644 src/assistant/clucene/qclucene_global_p.h create mode 100644 src/assistant/clucene/qdocument.cpp create mode 100644 src/assistant/clucene/qdocument_p.h create mode 100644 src/assistant/clucene/qfield.cpp create mode 100644 src/assistant/clucene/qfield_p.h create mode 100644 src/assistant/clucene/qfilter.cpp create mode 100644 src/assistant/clucene/qfilter_p.h create mode 100644 src/assistant/clucene/qhits.cpp create mode 100644 src/assistant/clucene/qhits_p.h create mode 100644 src/assistant/clucene/qindexreader.cpp create mode 100644 src/assistant/clucene/qindexreader_p.h create mode 100644 src/assistant/clucene/qindexwriter.cpp create mode 100644 src/assistant/clucene/qindexwriter_p.h create mode 100644 src/assistant/clucene/qquery.cpp create mode 100644 src/assistant/clucene/qquery_p.h create mode 100644 src/assistant/clucene/qqueryparser.cpp create mode 100644 src/assistant/clucene/qqueryparser_p.h create mode 100644 src/assistant/clucene/qreader.cpp create mode 100644 src/assistant/clucene/qreader_p.h create mode 100644 src/assistant/clucene/qsearchable.cpp create mode 100644 src/assistant/clucene/qsearchable_p.h create mode 100644 src/assistant/clucene/qsort.cpp create mode 100644 src/assistant/clucene/qsort_p.h create mode 100644 src/assistant/clucene/qterm.cpp create mode 100644 src/assistant/clucene/qterm_p.h create mode 100644 src/assistant/clucene/qtoken.cpp create mode 100644 src/assistant/clucene/qtoken_p.h create mode 100644 src/assistant/clucene/qtokenizer.cpp create mode 100644 src/assistant/clucene/qtokenizer_p.h create mode 100644 src/assistant/clucene/qtokenstream.cpp create mode 100644 src/assistant/clucene/qtokenstream_p.h create mode 100644 src/assistant/help/help.pro create mode 100644 src/assistant/help/helpsystem.qrc create mode 100644 src/assistant/help/images/1leftarrow.png create mode 100644 src/assistant/help/images/1rightarrow.png create mode 100644 src/assistant/help/images/3leftarrow.png create mode 100644 src/assistant/help/images/3rightarrow.png create mode 100644 src/assistant/help/qclucenefieldnames.cpp create mode 100644 src/assistant/help/qclucenefieldnames_p.h create mode 100644 src/assistant/help/qhelp_global.cpp create mode 100644 src/assistant/help/qhelp_global.h create mode 100644 src/assistant/help/qhelpcollectionhandler.cpp create mode 100644 src/assistant/help/qhelpcollectionhandler_p.h create mode 100644 src/assistant/help/qhelpcontentwidget.cpp create mode 100644 src/assistant/help/qhelpcontentwidget.h create mode 100644 src/assistant/help/qhelpdatainterface.cpp create mode 100644 src/assistant/help/qhelpdatainterface_p.h create mode 100644 src/assistant/help/qhelpdbreader.cpp create mode 100644 src/assistant/help/qhelpdbreader_p.h create mode 100644 src/assistant/help/qhelpengine.cpp create mode 100644 src/assistant/help/qhelpengine.h create mode 100644 src/assistant/help/qhelpengine_p.h create mode 100644 src/assistant/help/qhelpenginecore.cpp create mode 100644 src/assistant/help/qhelpenginecore.h create mode 100644 src/assistant/help/qhelpgenerator.cpp create mode 100644 src/assistant/help/qhelpgenerator_p.h create mode 100644 src/assistant/help/qhelpindexwidget.cpp create mode 100644 src/assistant/help/qhelpindexwidget.h create mode 100644 src/assistant/help/qhelpprojectdata.cpp create mode 100644 src/assistant/help/qhelpprojectdata_p.h create mode 100644 src/assistant/help/qhelpsearchengine.cpp create mode 100644 src/assistant/help/qhelpsearchengine.h create mode 100644 src/assistant/help/qhelpsearchindex_default.cpp create mode 100644 src/assistant/help/qhelpsearchindex_default_p.h create mode 100644 src/assistant/help/qhelpsearchindexreader.cpp create mode 100644 src/assistant/help/qhelpsearchindexreader_clucene.cpp create mode 100644 src/assistant/help/qhelpsearchindexreader_clucene_p.h create mode 100644 src/assistant/help/qhelpsearchindexreader_default.cpp create mode 100644 src/assistant/help/qhelpsearchindexreader_default_p.h create mode 100644 src/assistant/help/qhelpsearchindexreader_p.h create mode 100644 src/assistant/help/qhelpsearchindexwriter_clucene.cpp create mode 100644 src/assistant/help/qhelpsearchindexwriter_clucene_p.h create mode 100644 src/assistant/help/qhelpsearchindexwriter_default.cpp create mode 100644 src/assistant/help/qhelpsearchindexwriter_default_p.h create mode 100644 src/assistant/help/qhelpsearchquerywidget.cpp create mode 100644 src/assistant/help/qhelpsearchquerywidget.h create mode 100644 src/assistant/help/qhelpsearchresultwidget.cpp create mode 100644 src/assistant/help/qhelpsearchresultwidget.h delete mode 100644 src/assistant/lib/fulltextsearch/fulltextsearch.pri delete mode 100644 src/assistant/lib/fulltextsearch/fulltextsearch.pro delete mode 100644 src/assistant/lib/fulltextsearch/license.txt delete mode 100644 src/assistant/lib/fulltextsearch/qanalyzer.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qanalyzer_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qclucene-config_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qclucene_global_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qdocument.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qdocument_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qfield.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qfield_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qfilter.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qfilter_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qhits.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qhits_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qindexreader.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qindexreader_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qindexwriter.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qindexwriter_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qquery.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qquery_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qqueryparser.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qqueryparser_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qreader.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qreader_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qsearchable.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qsearchable_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qsort.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qsort_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qterm.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qterm_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qtoken.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qtoken_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qtokenizer.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qtokenizer_p.h delete mode 100644 src/assistant/lib/fulltextsearch/qtokenstream.cpp delete mode 100644 src/assistant/lib/fulltextsearch/qtokenstream_p.h delete mode 100644 src/assistant/lib/helpsystem.qrc delete mode 100644 src/assistant/lib/images/1leftarrow.png delete mode 100644 src/assistant/lib/images/1rightarrow.png delete mode 100644 src/assistant/lib/images/3leftarrow.png delete mode 100644 src/assistant/lib/images/3rightarrow.png delete mode 100644 src/assistant/lib/lib.pro delete mode 100644 src/assistant/lib/qclucenefieldnames.cpp delete mode 100644 src/assistant/lib/qclucenefieldnames_p.h delete mode 100644 src/assistant/lib/qhelp_global.cpp delete mode 100644 src/assistant/lib/qhelp_global.h delete mode 100644 src/assistant/lib/qhelpcollectionhandler.cpp delete mode 100644 src/assistant/lib/qhelpcollectionhandler_p.h delete mode 100644 src/assistant/lib/qhelpcontentwidget.cpp delete mode 100644 src/assistant/lib/qhelpcontentwidget.h delete mode 100644 src/assistant/lib/qhelpdatainterface.cpp delete mode 100644 src/assistant/lib/qhelpdatainterface_p.h delete mode 100644 src/assistant/lib/qhelpdbreader.cpp delete mode 100644 src/assistant/lib/qhelpdbreader_p.h delete mode 100644 src/assistant/lib/qhelpengine.cpp delete mode 100644 src/assistant/lib/qhelpengine.h delete mode 100644 src/assistant/lib/qhelpengine_p.h delete mode 100644 src/assistant/lib/qhelpenginecore.cpp delete mode 100644 src/assistant/lib/qhelpenginecore.h delete mode 100644 src/assistant/lib/qhelpgenerator.cpp delete mode 100644 src/assistant/lib/qhelpgenerator_p.h delete mode 100644 src/assistant/lib/qhelpindexwidget.cpp delete mode 100644 src/assistant/lib/qhelpindexwidget.h delete mode 100644 src/assistant/lib/qhelpprojectdata.cpp delete mode 100644 src/assistant/lib/qhelpprojectdata_p.h delete mode 100644 src/assistant/lib/qhelpsearchengine.cpp delete mode 100644 src/assistant/lib/qhelpsearchengine.h delete mode 100644 src/assistant/lib/qhelpsearchindex_default.cpp delete mode 100644 src/assistant/lib/qhelpsearchindex_default_p.h delete mode 100644 src/assistant/lib/qhelpsearchindexreader.cpp delete mode 100644 src/assistant/lib/qhelpsearchindexreader_clucene.cpp delete mode 100644 src/assistant/lib/qhelpsearchindexreader_clucene_p.h delete mode 100644 src/assistant/lib/qhelpsearchindexreader_default.cpp delete mode 100644 src/assistant/lib/qhelpsearchindexreader_default_p.h delete mode 100644 src/assistant/lib/qhelpsearchindexreader_p.h delete mode 100644 src/assistant/lib/qhelpsearchindexwriter_clucene.cpp delete mode 100644 src/assistant/lib/qhelpsearchindexwriter_clucene_p.h delete mode 100644 src/assistant/lib/qhelpsearchindexwriter_default.cpp delete mode 100644 src/assistant/lib/qhelpsearchindexwriter_default_p.h delete mode 100644 src/assistant/lib/qhelpsearchquerywidget.cpp delete mode 100644 src/assistant/lib/qhelpsearchquerywidget.h delete mode 100644 src/assistant/lib/qhelpsearchresultwidget.cpp delete mode 100644 src/assistant/lib/qhelpsearchresultwidget.h create mode 100644 src/assistant/qcollectiongenerator/main.cpp create mode 100644 src/assistant/qcollectiongenerator/qcollectiongenerator.pro create mode 100644 src/assistant/qhelpconverter/adpreader.cpp create mode 100644 src/assistant/qhelpconverter/adpreader.h create mode 100644 src/assistant/qhelpconverter/assistant-128.png create mode 100644 src/assistant/qhelpconverter/assistant.png create mode 100644 src/assistant/qhelpconverter/conversionwizard.cpp create mode 100644 src/assistant/qhelpconverter/conversionwizard.h create mode 100644 src/assistant/qhelpconverter/doc/filespage.html create mode 100644 src/assistant/qhelpconverter/doc/filterpage.html create mode 100644 src/assistant/qhelpconverter/doc/generalpage.html create mode 100644 src/assistant/qhelpconverter/doc/identifierpage.html create mode 100644 src/assistant/qhelpconverter/doc/inputpage.html create mode 100644 src/assistant/qhelpconverter/doc/outputpage.html create mode 100644 src/assistant/qhelpconverter/doc/pathpage.html create mode 100644 src/assistant/qhelpconverter/filespage.cpp create mode 100644 src/assistant/qhelpconverter/filespage.h create mode 100644 src/assistant/qhelpconverter/filespage.ui create mode 100644 src/assistant/qhelpconverter/filterpage.cpp create mode 100644 src/assistant/qhelpconverter/filterpage.h create mode 100644 src/assistant/qhelpconverter/filterpage.ui create mode 100644 src/assistant/qhelpconverter/finishpage.cpp create mode 100644 src/assistant/qhelpconverter/finishpage.h create mode 100644 src/assistant/qhelpconverter/generalpage.cpp create mode 100644 src/assistant/qhelpconverter/generalpage.h create mode 100644 src/assistant/qhelpconverter/generalpage.ui create mode 100644 src/assistant/qhelpconverter/helpwindow.cpp create mode 100644 src/assistant/qhelpconverter/helpwindow.h create mode 100644 src/assistant/qhelpconverter/identifierpage.cpp create mode 100644 src/assistant/qhelpconverter/identifierpage.h create mode 100644 src/assistant/qhelpconverter/identifierpage.ui create mode 100644 src/assistant/qhelpconverter/inputpage.cpp create mode 100644 src/assistant/qhelpconverter/inputpage.h create mode 100644 src/assistant/qhelpconverter/inputpage.ui create mode 100644 src/assistant/qhelpconverter/main.cpp create mode 100644 src/assistant/qhelpconverter/outputpage.cpp create mode 100644 src/assistant/qhelpconverter/outputpage.h create mode 100644 src/assistant/qhelpconverter/outputpage.ui create mode 100644 src/assistant/qhelpconverter/pathpage.cpp create mode 100644 src/assistant/qhelpconverter/pathpage.h create mode 100644 src/assistant/qhelpconverter/pathpage.ui create mode 100644 src/assistant/qhelpconverter/qhcpwriter.cpp create mode 100644 src/assistant/qhelpconverter/qhcpwriter.h create mode 100644 src/assistant/qhelpconverter/qhelpconverter.pro create mode 100644 src/assistant/qhelpconverter/qhelpconverter.qrc create mode 100644 src/assistant/qhelpconverter/qhpwriter.cpp create mode 100644 src/assistant/qhelpconverter/qhpwriter.h create mode 100644 src/assistant/qhelpgenerator/main.cpp create mode 100644 src/assistant/qhelpgenerator/qhelpgenerator.pro create mode 100644 src/assistant/shared/collectionconfiguration.cpp create mode 100644 src/assistant/shared/collectionconfiguration.h create mode 100644 src/assistant/shared/helpgenerator.cpp create mode 100644 src/assistant/shared/helpgenerator.h delete mode 100644 src/assistant/tools/assistant/Info_mac.plist delete mode 100644 src/assistant/tools/assistant/aboutdialog.cpp delete mode 100644 src/assistant/tools/assistant/aboutdialog.h delete mode 100644 src/assistant/tools/assistant/assistant.icns delete mode 100644 src/assistant/tools/assistant/assistant.ico delete mode 100644 src/assistant/tools/assistant/assistant.pro delete mode 100644 src/assistant/tools/assistant/assistant.qch delete mode 100644 src/assistant/tools/assistant/assistant.qrc delete mode 100644 src/assistant/tools/assistant/assistant.rc delete mode 100644 src/assistant/tools/assistant/assistant_images.qrc delete mode 100644 src/assistant/tools/assistant/bookmarkdialog.cpp delete mode 100644 src/assistant/tools/assistant/bookmarkdialog.h delete mode 100644 src/assistant/tools/assistant/bookmarkdialog.ui delete mode 100644 src/assistant/tools/assistant/bookmarkfiltermodel.cpp delete mode 100644 src/assistant/tools/assistant/bookmarkfiltermodel.h delete mode 100644 src/assistant/tools/assistant/bookmarkitem.cpp delete mode 100644 src/assistant/tools/assistant/bookmarkitem.h delete mode 100644 src/assistant/tools/assistant/bookmarkmanager.cpp delete mode 100644 src/assistant/tools/assistant/bookmarkmanager.h delete mode 100644 src/assistant/tools/assistant/bookmarkmanagerwidget.cpp delete mode 100644 src/assistant/tools/assistant/bookmarkmanagerwidget.h delete mode 100644 src/assistant/tools/assistant/bookmarkmanagerwidget.ui delete mode 100644 src/assistant/tools/assistant/bookmarkmodel.cpp delete mode 100644 src/assistant/tools/assistant/bookmarkmodel.h delete mode 100644 src/assistant/tools/assistant/bookmarkwidget.ui delete mode 100644 src/assistant/tools/assistant/centralwidget.cpp delete mode 100644 src/assistant/tools/assistant/centralwidget.h delete mode 100644 src/assistant/tools/assistant/cmdlineparser.cpp delete mode 100644 src/assistant/tools/assistant/cmdlineparser.h delete mode 100644 src/assistant/tools/assistant/contentwindow.cpp delete mode 100644 src/assistant/tools/assistant/contentwindow.h delete mode 100644 src/assistant/tools/assistant/doc/HOWTO delete mode 100644 src/assistant/tools/assistant/doc/assistant.qdoc delete mode 100644 src/assistant/tools/assistant/doc/assistant.qdocconf delete mode 100644 src/assistant/tools/assistant/doc/assistant.qhp delete mode 100644 src/assistant/tools/assistant/doc/classic.css delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-address-toolbar.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-assistant.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-dockwidgets.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-docwindow.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-examples.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-filter-toolbar.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-preferences-documentation.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-preferences-filters.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-preferences-fonts.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-preferences-options.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-search.png delete mode 100644 src/assistant/tools/assistant/doc/images/assistant-toolbar.png delete mode 100644 src/assistant/tools/assistant/filternamedialog.cpp delete mode 100644 src/assistant/tools/assistant/filternamedialog.h delete mode 100644 src/assistant/tools/assistant/filternamedialog.ui delete mode 100644 src/assistant/tools/assistant/findwidget.cpp delete mode 100644 src/assistant/tools/assistant/findwidget.h delete mode 100644 src/assistant/tools/assistant/globalactions.cpp delete mode 100644 src/assistant/tools/assistant/globalactions.h delete mode 100644 src/assistant/tools/assistant/helpenginewrapper.cpp delete mode 100644 src/assistant/tools/assistant/helpenginewrapper.h delete mode 100644 src/assistant/tools/assistant/helpviewer.cpp delete mode 100644 src/assistant/tools/assistant/helpviewer.h delete mode 100644 src/assistant/tools/assistant/helpviewer_p.h delete mode 100644 src/assistant/tools/assistant/helpviewer_qtb.cpp delete mode 100644 src/assistant/tools/assistant/helpviewer_qwv.cpp delete mode 100644 src/assistant/tools/assistant/images/assistant-128.png delete mode 100644 src/assistant/tools/assistant/images/assistant.png delete mode 100644 src/assistant/tools/assistant/images/bookmark.png delete mode 100644 src/assistant/tools/assistant/images/closebutton.png delete mode 100644 src/assistant/tools/assistant/images/darkclosebutton.png delete mode 100644 src/assistant/tools/assistant/images/mac/addtab.png delete mode 100644 src/assistant/tools/assistant/images/mac/book.png delete mode 100644 src/assistant/tools/assistant/images/mac/closetab.png delete mode 100644 src/assistant/tools/assistant/images/mac/editcopy.png delete mode 100644 src/assistant/tools/assistant/images/mac/find.png delete mode 100644 src/assistant/tools/assistant/images/mac/home.png delete mode 100644 src/assistant/tools/assistant/images/mac/next.png delete mode 100644 src/assistant/tools/assistant/images/mac/previous.png delete mode 100644 src/assistant/tools/assistant/images/mac/print.png delete mode 100644 src/assistant/tools/assistant/images/mac/resetzoom.png delete mode 100644 src/assistant/tools/assistant/images/mac/synctoc.png delete mode 100644 src/assistant/tools/assistant/images/mac/zoomin.png delete mode 100644 src/assistant/tools/assistant/images/mac/zoomout.png delete mode 100644 src/assistant/tools/assistant/images/trolltech-logo.png delete mode 100644 src/assistant/tools/assistant/images/win/addtab.png delete mode 100644 src/assistant/tools/assistant/images/win/book.png delete mode 100644 src/assistant/tools/assistant/images/win/closetab.png delete mode 100644 src/assistant/tools/assistant/images/win/editcopy.png delete mode 100644 src/assistant/tools/assistant/images/win/find.png delete mode 100644 src/assistant/tools/assistant/images/win/home.png delete mode 100644 src/assistant/tools/assistant/images/win/next.png delete mode 100644 src/assistant/tools/assistant/images/win/previous.png delete mode 100644 src/assistant/tools/assistant/images/win/print.png delete mode 100644 src/assistant/tools/assistant/images/win/resetzoom.png delete mode 100644 src/assistant/tools/assistant/images/win/synctoc.png delete mode 100644 src/assistant/tools/assistant/images/win/zoomin.png delete mode 100644 src/assistant/tools/assistant/images/win/zoomout.png delete mode 100644 src/assistant/tools/assistant/images/wrap.png delete mode 100644 src/assistant/tools/assistant/indexwindow.cpp delete mode 100644 src/assistant/tools/assistant/indexwindow.h delete mode 100644 src/assistant/tools/assistant/installdialog.cpp delete mode 100644 src/assistant/tools/assistant/installdialog.h delete mode 100644 src/assistant/tools/assistant/installdialog.ui delete mode 100644 src/assistant/tools/assistant/main.cpp delete mode 100644 src/assistant/tools/assistant/mainwindow.cpp delete mode 100644 src/assistant/tools/assistant/mainwindow.h delete mode 100644 src/assistant/tools/assistant/openpagesmanager.cpp delete mode 100644 src/assistant/tools/assistant/openpagesmanager.h delete mode 100644 src/assistant/tools/assistant/openpagesmodel.cpp delete mode 100644 src/assistant/tools/assistant/openpagesmodel.h delete mode 100644 src/assistant/tools/assistant/openpagesswitcher.cpp delete mode 100644 src/assistant/tools/assistant/openpagesswitcher.h delete mode 100644 src/assistant/tools/assistant/openpageswidget.cpp delete mode 100644 src/assistant/tools/assistant/openpageswidget.h delete mode 100644 src/assistant/tools/assistant/preferencesdialog.cpp delete mode 100644 src/assistant/tools/assistant/preferencesdialog.h delete mode 100644 src/assistant/tools/assistant/preferencesdialog.ui delete mode 100644 src/assistant/tools/assistant/qtdocinstaller.cpp delete mode 100644 src/assistant/tools/assistant/qtdocinstaller.h delete mode 100644 src/assistant/tools/assistant/remotecontrol.cpp delete mode 100644 src/assistant/tools/assistant/remotecontrol.h delete mode 100644 src/assistant/tools/assistant/remotecontrol_win.h delete mode 100644 src/assistant/tools/assistant/searchwidget.cpp delete mode 100644 src/assistant/tools/assistant/searchwidget.h delete mode 100644 src/assistant/tools/assistant/topicchooser.cpp delete mode 100644 src/assistant/tools/assistant/topicchooser.h delete mode 100644 src/assistant/tools/assistant/topicchooser.ui delete mode 100644 src/assistant/tools/assistant/tracer.h delete mode 100644 src/assistant/tools/assistant/xbelsupport.cpp delete mode 100644 src/assistant/tools/assistant/xbelsupport.h delete mode 100644 src/assistant/tools/qcollectiongenerator/main.cpp delete mode 100644 src/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro delete mode 100644 src/assistant/tools/qhelpconverter/adpreader.cpp delete mode 100644 src/assistant/tools/qhelpconverter/adpreader.h delete mode 100644 src/assistant/tools/qhelpconverter/assistant-128.png delete mode 100644 src/assistant/tools/qhelpconverter/assistant.png delete mode 100644 src/assistant/tools/qhelpconverter/conversionwizard.cpp delete mode 100644 src/assistant/tools/qhelpconverter/conversionwizard.h delete mode 100644 src/assistant/tools/qhelpconverter/doc/filespage.html delete mode 100644 src/assistant/tools/qhelpconverter/doc/filterpage.html delete mode 100644 src/assistant/tools/qhelpconverter/doc/generalpage.html delete mode 100644 src/assistant/tools/qhelpconverter/doc/identifierpage.html delete mode 100644 src/assistant/tools/qhelpconverter/doc/inputpage.html delete mode 100644 src/assistant/tools/qhelpconverter/doc/outputpage.html delete mode 100644 src/assistant/tools/qhelpconverter/doc/pathpage.html delete mode 100644 src/assistant/tools/qhelpconverter/filespage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/filespage.h delete mode 100644 src/assistant/tools/qhelpconverter/filespage.ui delete mode 100644 src/assistant/tools/qhelpconverter/filterpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/filterpage.h delete mode 100644 src/assistant/tools/qhelpconverter/filterpage.ui delete mode 100644 src/assistant/tools/qhelpconverter/finishpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/finishpage.h delete mode 100644 src/assistant/tools/qhelpconverter/generalpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/generalpage.h delete mode 100644 src/assistant/tools/qhelpconverter/generalpage.ui delete mode 100644 src/assistant/tools/qhelpconverter/helpwindow.cpp delete mode 100644 src/assistant/tools/qhelpconverter/helpwindow.h delete mode 100644 src/assistant/tools/qhelpconverter/identifierpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/identifierpage.h delete mode 100644 src/assistant/tools/qhelpconverter/identifierpage.ui delete mode 100644 src/assistant/tools/qhelpconverter/inputpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/inputpage.h delete mode 100644 src/assistant/tools/qhelpconverter/inputpage.ui delete mode 100644 src/assistant/tools/qhelpconverter/main.cpp delete mode 100644 src/assistant/tools/qhelpconverter/outputpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/outputpage.h delete mode 100644 src/assistant/tools/qhelpconverter/outputpage.ui delete mode 100644 src/assistant/tools/qhelpconverter/pathpage.cpp delete mode 100644 src/assistant/tools/qhelpconverter/pathpage.h delete mode 100644 src/assistant/tools/qhelpconverter/pathpage.ui delete mode 100644 src/assistant/tools/qhelpconverter/qhcpwriter.cpp delete mode 100644 src/assistant/tools/qhelpconverter/qhcpwriter.h delete mode 100644 src/assistant/tools/qhelpconverter/qhelpconverter.pro delete mode 100644 src/assistant/tools/qhelpconverter/qhelpconverter.qrc delete mode 100644 src/assistant/tools/qhelpconverter/qhpwriter.cpp delete mode 100644 src/assistant/tools/qhelpconverter/qhpwriter.h delete mode 100644 src/assistant/tools/qhelpgenerator/main.cpp delete mode 100644 src/assistant/tools/qhelpgenerator/qhelpgenerator.pro delete mode 100644 src/assistant/tools/shared/collectionconfiguration.cpp delete mode 100644 src/assistant/tools/shared/collectionconfiguration.h delete mode 100644 src/assistant/tools/shared/helpgenerator.cpp delete mode 100644 src/assistant/tools/shared/helpgenerator.h delete mode 100644 src/assistant/tools/tools.pro diff --git a/3rdparty/clucene/APACHE.license b/3rdparty/clucene/APACHE.license deleted file mode 100644 index 261eeb9e9..000000000 --- a/3rdparty/clucene/APACHE.license +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/3rdparty/clucene/AUTHORS b/3rdparty/clucene/AUTHORS deleted file mode 100644 index 4a7904b6d..000000000 --- a/3rdparty/clucene/AUTHORS +++ /dev/null @@ -1,22 +0,0 @@ -As with most development projects, contributions come from many people and in -many forms. The CLucene project would like to thank it's many contributors. -Omissions are merely accidental, please e-mail ustramooner@users.sourceforge.net -if you have been left out or a contribution is not mentioned. - -CLucene was originally ported to C++ by Ben van Klinken (ustramooner@users.sourceforge.net) -from Doug Cutting's popular java search engine, Lucene (see http://lucene.apache.org). - -Here is a list of contributors. Please send me an email at ustramooner@users.sourceforge.net -if I have left you out. - -Doug Cutting cutting@users.sourceforge.net -John Wheeler j_wheeler@users.sourceforge.net -Robert G. Ristroph rgristroph@users.sourceforge.net -David Rushby woodsplitter@users.sourceforge.net -Jimmy Pritts jpritts@sdf.lonestar.org -Peter Edwards peter@dragonstaff.co.uk -Jorge Sabater Redondo jsabater@elderecho.com -Daniel Glassey danglassey@ntlworld.com -Peter Gladkikh batyi@mail.ru -Pedja amigo@max3d.com -Peter Hodges hodges.peter@gmail.com diff --git a/3rdparty/clucene/COPYING b/3rdparty/clucene/COPYING deleted file mode 100644 index 0e32bb4f3..000000000 --- a/3rdparty/clucene/COPYING +++ /dev/null @@ -1,30 +0,0 @@ -License - -The CLucene Core Library uses a dual license strategy for the source code. -These licenses are the GNU Lesser General Public License (LGPL) and the Apache -License (Version 2.0). Users can choose the license they wish to distribute -their software under. This means that you do not need to abide by *both* -licenses, but rather than you can choose the license which most suits your -needs. - -To rephrase this and to make it perfectly clear: -CLucene is distributed under the GNU Lesser General Public License (LGPL) - *or* -the Apache License, Version 2.0 - -However, we are an open source project, and we encourage users to use the LGPL -license and participate fully in the free software community. Dual licensing -of the CLucene source code provides open and free access to the technology both -for the GPL community and for other developers or companies that cannot use the -GPL. - -You can freely modify, extend, and improve the CLucene source code. The only -question is whether or not you must provide the source code and contribute -modifications to the community. The GNU and Apache licenses allow different -ranges of flexibility in this regard, but in the end, regardless of the license -used, we highly recommend that you submit any bugs, incompatibilities or -added features. - -Note that this same license does *not* apply to the CLucene Contributions -package. You should read the COPYING file in that directory or package for -more information. \ No newline at end of file diff --git a/3rdparty/clucene/ChangeLog b/3rdparty/clucene/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/3rdparty/clucene/LGPL.license b/3rdparty/clucene/LGPL.license deleted file mode 100644 index 422c76072..000000000 --- a/3rdparty/clucene/LGPL.license +++ /dev/null @@ -1,475 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - -------------------------------------------------------------------------------- - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - -------------------------------------------------------------------------------- - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - -------------------------------------------------------------------------------- - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - -------------------------------------------------------------------------------- - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - -------------------------------------------------------------------------------- - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - -------------------------------------------------------------------------------- - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - -------------------------------------------------------------------------------- - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - -------------------------------------------------------------------------------- - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - diff --git a/3rdparty/clucene/README b/3rdparty/clucene/README deleted file mode 100644 index ee4f49369..000000000 --- a/3rdparty/clucene/README +++ /dev/null @@ -1,92 +0,0 @@ -CLucene README -============== - ------------------------------------------------------- -CLucene is a C++ port of Lucene. -It is a high-performance, full-featured text search -engine written in C++. CLucene is faster than lucene -as it is written in C++. ------------------------------------------------------- - -CLucene has contributions from many, see AUTHORS - -CLucene is distributed under the GNU Lesser General Public License (LGPL) - *or* -the Apache License, Version 2.0 -See the LGPL.license and APACHE.license for the respective license information. -Read COPYING for more about the license. - -Installation ------------- -* For Linux, MacOSX, cygwin and MinGW build information, read INSTALL. -* Boost.Jam files are provided in the root directory and subdirectories. -* Microsoft Visual Studio (6&7) are provided in the win32 folder. - -Mailing List ------------- -Questions and discussion should be directed to the CLucene mailing list - at clucene-developers@lists.sourceforge.net -Find subscription instructions at - http://lists.sourceforge.net/lists/listinfo/clucene-developers -Suggestions and bug reports can be made on our bug tracking database - (http://sourceforge.net/tracker/?group_id=80013&atid=558446) - -The latest version ------------------- -Details of the latest version can be found on the CLucene sourceforge project -web site: http://www.sourceforge.net/projects/clucene - -Documentation -------------- -Documentation is provided at http://clucene.sourceforge.net/doc/doxygen/html/ -You can also build your own documentation by running doxygen from the root directory -of clucene. -CLucene is a very close port of Java Lucene, so you can also try looking at the -Java Docs on http://lucene.apache.org/java/ - - -Performance ------------ -Very little benchmarking has been done on clucene. Andi Vajda posted some -limited statistics on the clucene list a while ago with the following results. - -There are 250 HTML files under $JAVA_HOME/docs/api/java/util for about -6108kb of HTML text. -org.apache.lucene.demo.IndexFiles with java and gcj: -on mac os x 10.3.1 (panther) powerbook g4 1ghz 1gb: - . running with java 1.4.1_01-99 : 20379 ms - . running with gcj 3.3.2 -O2 : 17842 ms - . running clucene 0.8.9's demo : 9930 ms - -I recently did some more tests and came up with these rough tests: -663mb (797 files) of Guttenberg texts -on a Pentium 4 running Windows XP with 1 GB of RAM. Indexing max 100,000 fields -• Jlucene: 646453ms. peak mem usage ~72mb, avg ~14mb ram -• Clucene: 232141. peak mem usage ~60, avg ~4mb ram - -Searching indexing using 10,000 single word queries -• Jlucene: ~60078ms and used ~13mb ram -• Clucene: ~48359ms and used ~4.2mb ram - -Platform notes --------------- - -'Too many open files' -Some platforms don't provide enough file handles to run CLucene properly. -To solve this, increase the open file limit: - -On Solaris: -ulimit -n 1024 -set rlim_fd_cur=1024 - -Acknowledgments ----------------- - -The Apache Lucene project is the basis for this software, so the biggest -acknoledgment goes to that project. - -We wish to acknowledge the following copyrighted works that -make up portions of the CLucene software: - -CLucene relies heavily on the use of autoconf and libtool to provide -a build environment. diff --git a/3rdparty/clucene/src/CLucene.h b/3rdparty/clucene/src/CLucene.h deleted file mode 100644 index 1eac800fd..000000000 --- a/3rdparty/clucene/src/CLucene.h +++ /dev/null @@ -1,38 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -//Includes some standard headers for searching and indexing. -#ifndef _lucene_CLucene_ -#define _lucene_CLucene_ - -#include "CLucene/StdHeader.h" -#include "CLucene/debug/condition.h" -#include "CLucene/debug/mem.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/IndexWriter.h" -#include "CLucene/index/MultiReader.h" -#include "CLucene/index/Term.h" -#include "CLucene/search/IndexSearcher.h" -#include "CLucene/search/MultiSearcher.h" -#include "CLucene/search/DateFilter.h" -#include "CLucene/search/WildcardQuery.h" -#include "CLucene/search/FuzzyQuery.h" -#include "CLucene/search/PhraseQuery.h" -#include "CLucene/search/PrefixQuery.h" -#include "CLucene/search/RangeQuery.h" -#include "CLucene/search/BooleanQuery.h" -#include "CLucene/document/Document.h" -#include "CLucene/document/Field.h" -#include "CLucene/document/DateField.h" -#include "CLucene/store/Directory.h" -#include "CLucene/store/FSDirectory.h" -#include "CLucene/queryParser/QueryParser.h" -#include "CLucene/queryParser/MultiFieldQueryParser.h" -#include "CLucene/analysis/standard/StandardAnalyzer.h" -#include "CLucene/analysis/Analyzers.h" -#include "CLucene/util/Reader.h" - -#endif diff --git a/3rdparty/clucene/src/CLucene/CLBackwards.h b/3rdparty/clucene/src/CLucene/CLBackwards.h deleted file mode 100644 index ffaf42824..000000000 --- a/3rdparty/clucene/src/CLucene/CLBackwards.h +++ /dev/null @@ -1,87 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _clucene_backwards_h -#define _clucene_backwards_h - -//In light of the recent major changes to clucene, -//this file should help to maintain some backwards compatibility -//include it after including StdHeader.h -// -//Note: I haven't tested this much, so please send me your changes - -//dirent is one of the most major changes that won't easily port. -//you can use the TCHAR copying macros, STRCPY_TtoA and STRCPY_AtoT -//to copy between different character types. - -//If you use stringPrintF, you will need to add the target string -//size parameter, because it is using _sntprintf... Change this if you -//want, but _sntprintf is much safer - -#define char_t TCHAR -#define uchar_t TCHAR -#define l_byte_t byte_t - -//#define stringSpn _tcsspn //not used in clucene anymore -#define stringCSpn _tcscspn -#define stringLength _tcslen -//#define stringToInteger _ttoi //not used in clucene anymore, use integer w/ base -#define stringFind _tcsstr -#define stringFindChar _tcschr -#define stringCompare _tcscmp -#define stringNCopy _tcsncpy -#define stringCopy _tcscpy -#define stringCat _tcscat -//#define stringToken _tcstok //not used in clucene anymore -#define stringPrintF _sntprintf //you will have errors, because now we used printf w/ bufferlen count -#define printFormatted _tprintf - -//conversion functions -#define integerToString _i64tot -#define stringToIntegerBase _tcstoi64 -#define stringToFloat _tcstod - -//file find structures -#define Cmd_Stat fileStat -#define Struct_Stat fileStat -#define stringICompare _tcsicmp -#define stringNCompare _tcsncmp -#define stringDifference _tcscmp - -//character conversion functions -#define isSpace _istspace -#define isDigit _istwdigit -#define isAlNum _istwalnum -#define toLower _totlower -#define stringUpper _tcsupr -//#define stringLower _tcslwr //not used in clucene anymore - -#define _THROWX(y) _THROWT(y) -#define _THROWC(y) _THROWA(y) - -//file naming stuff - remember we have changed all names to file naming lower case -#define fileRename _rename -#define fileFullName(abs,rel) _realpath(rel,abs) -#define makeDirectory _tmkdir -#define unlinkFile _unlink - -//no longer supported definitions -#ifdef _UNICODE - #define TO_CHAR_T STRDUP_AtoT - #define _cout wcout - #define _cin wcin - #define _cerr wcerr -#else - #define TO_CHAR_T STRDUP_WtoT - #define _cout cout - #define _cin cin - #define _cerr cerr -#endif - -//some headers that used to be automatically included: -#include "CLucene/util/dirent.h" //if we have dirent, then the native one will be used - -#endif diff --git a/3rdparty/clucene/src/CLucene/CLConfig.h b/3rdparty/clucene/src/CLucene/CLConfig.h deleted file mode 100644 index c63c083ff..000000000 --- a/3rdparty/clucene/src/CLucene/CLConfig.h +++ /dev/null @@ -1,304 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_Config_ -#define _lucene_Config_ - - -//////////////////////////////////////////////////////////////////// -// this settings should be set up in the compiler, -// but are put here for reference as to what could be defined -//////////////////////////////////////////////////////////////////// -// -//define this if you want debugging code to be enabled -//#define _DEBUG -// -//define this if you want condition debugging to be enabled -#if defined(_DEBUG) && !defined(_CL__CND_DEBUG) - #define _CL__CND_DEBUG -#endif -// -//define this to print out lots of information about merges, etc -//requires __CL__CND_DEBUG to be defined -//#define _CL_DEBUG_INFO stdout -// -//to disable namespaces define this -//#define DISABLE_NAMESPACE -// -//This is mostly for windows. If you have put the google sparse -//map code in your include path somewhere, then define this -//to use it. -//However, for msvc, there are no significant gains since there -//is already a compatible hashmap available. -//#define _CL_HAVE_GOOGLE_DENSE_HASH_MAP -// -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// These options can be set depending on the particular needs of -// Your application -//////////////////////////////////////////////////////////////////// -// -//define this to force the build into ascii mode -//#define _ASCII -// -//define this to force the build into ucs2 mode -//#define _UCS2 -// -//if a wide character is being converted to a ascii character and it -//cannot fit, this character is used instead. Required. -#define LUCENE_OOR_CHAR(c) ((char)(((unsigned short)c)&0xFF)) -// -//define if you would like to force clucene to use the internal -//character functions. -//Tests may display unpredictable behaviour if this is not defined. -#define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS -// -//define this to enable mmap support in the fsdirectory IndexInput -//todo: only available for windows so far...need to add MMapInput.cpp to project -//EXPERIMENTAL -//#define LUCENE_FS_MMAP -// -//LOCK_DIR implementation: -//define this to set an exact directory for the lock dir (not recommended) -//all other methods of getting the temporary directory will be ignored -//#define LUCENE_LOCK_DIR "/tmp" -// -//define this to try and load the lock dir from this specified environment variable -#define LUCENE_LOCK_DIR_ENV_1 "TEMP" -//define this if you want to have look up this environment variable if the first one fails -#define LUCENE_LOCK_DIR_ENV_2 "TMP" -//define this if you want to have a fallback directory, if not defined then -//the lockdirectory will be the index directory -#define LUCENE_LOCK_DIR_ENV_FALLBACK "/tmp" -// -//////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////// -// The following are search query options -// THe NO_* options can make CLucene faster and/or smaller -// special queries sometime require longer search times or may -// not be required -//////////////////////////////////////////////////////////////////// -// -//Define this to remove fuzzy query and sloppy scoring -//#define NO_FUZZY_QUERY -// -//Define to remove wildcard t*m or te?m to match term -//#define NO_WILDCARD_QUERY -// -//Define to remove prefix term query - ter* to match term or terms -//#define NO_PREFIX_QUERY -// -//Define to remove range (exlusive and inclusive) -//#define NO_RANGE_QUERY -// -//This must always be defined. They can be adjusted if required. But -//general Wildcard string would be '*' and Wildcard Char would be '?' -//Both are Required. -#define LUCENE_WILDCARDTERMENUM_WILDCARD_STRING '*' -#define LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR '?' -// -//////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////// -// memory handling configurations -//////////////////////////////////////////////////////////////////// -// -//If this is defined, lucene's configurations are changed -//to use less memory, but may run slower. -//todo: i dont think this actualy changes speed much, just memory -#define LUCENE_OPTIMIZE_FOR_MEMORY -// -//define this if you want the pointer tracking to be enabled -//this is a useful tool for memory leak tracking -//The LuceneBase can slow down the code a *lot* -#if defined(_DEBUG) - #if !defined(LUCENE_DISABLE_MEMTRACKING) && !defined(LUCENE_ENABLE_MEMLEAKTRACKING) - #define LUCENE_ENABLE_MEMLEAKTRACKING - #endif -#endif -// -//enable use of rich file/line tracking. use CL_FILELINE to pass -//to functions like stringDuplicate (or use CL_STRDUP* functions instead) and -//CLStringIntern::x. -#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) - #define LUCENE_ENABLE_FILELINEINFO -#endif -// -//enable creation of clucene.log file. Logs every -//call to new operator. Must have LUCENE_ENABLE_MEMLEAKTRACKING enabled. -//writes log in this format. -//action,file name,file line,allocation size -//logging can be disabled by setting _lucene_disable_debuglogging to true -#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) && defined(_DEBUG) -//#define LUCENE_ENABLE_CONSTRUCTOR_LOG -#endif -// -// -//enable this if you want to enable reference counting. This is -//not necessary or useful in most cases except when implementing wrappers -//which have reference counting. If the wrapper wraps a StringReader, -//for example, it should expect that the wrapped StringReader should not -//be deleted. However, when the stringreader is added into a Field, -//the Field usually takes over the stringReader and deletes it on completion. -//If reference counting is enabled, the wrapper can add a reference to any class -//and when _CLDECDELETE is called, the reference is decremented and only deleted -//if the refcount is zero. -#define LUCENE_ENABLE_REFCOUNT - - -//////////////////////////////////////////////////////////////////// -// These options allow you to remove certain implementations -// out of clucene so that they can be implemented in the client -// application -//////////////////////////////////////////////////////////////////// -// -//define this to your own setting if you would like to implement your own -//threading locking code. it should have the same sort of functions as -//mutex_default. If not defined, clucene will try and use posix,win32 critical -//sections, or a timer based mutex hack. -//#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_default -// -//define this if you want to implement the _Cnd_OutDebug routine yourself -//you can then easily customise in your own application how to handle debug messages -//#define _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG -// -//define this if you want to implement your own namespace macros -//#define _LUCENE_DONTIMPLEMENT_NS_MACROS -// -//define this if you do not want clucene to include any standard libraries. -//this could be useful if you want to use alternate libraries -//#define LUCENE_DISABLE_INCLUDES -// -//////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////// -// These options will be changed depending on your compiler/platform -// but can also be changed here if required -//////////////////////////////////////////////////////////////////// -// -//define this if multi-threading support is not required -//if not defined, multi-thread locking will -//occur (and its related processing overhead) -//note: it is recommended to disable multithreading if you do not need it -//there is a lot of overhead that can be avoided. -//#define _CL_DISABLE_MULTITHREADING -// -//if you want to define your own default file encoding. specify it -//here - normally defined in the platform specific headers -//#define PLATFORM_DEFAULT_READER_ENCODING CL_NS(util)::FileReader::ENCODING_ASCII -// -//disable hash implementations (if available) -//#define LUCENE_DISABLE_HASHING -//////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////// -// These options should not be changed. But you can experiment with -// them to optimize performance -//////////////////////////////////////////////////////////////////// -// -//some defaults, wouldn't usually need to be changed -//Buffer size for input/output streams. Required. -#define LUCENE_STREAM_BUFFER_SIZE 1024 -// -// DSR:2004.08.19: -// Formerly, StringBuffer used 1024 as the default size of its internal buffer. -// However, StringBuffer is used primarily for token- and term-oriented -// processing, e.g. in StandardTokenizer. I've calculated that the average -// token (as produced by StandardTokenizer) in all .txt files distributed in -// the Project Gutenberg CD Image (August 2003 release) has only 6 characters. -// Although most languages are likely to have a longer average word length than -// English due to the popularity of "non-atomized" conjugation and declension -// mechanisms, 1024 is still vastly excessive. -// I made two changes intended to deliver better overall performance: -// a) Switched to a default StringBuffer character capacity of 32. Though 32 -// is longer than the average token, the high cost of realloc makes a -// slightly liberal default size optimal. I chose the default size of 32 -// after fairly extensive experimentation on the Gutenberg e-texts. The -// results are summarized in the following table: -// ------------------------------------------------------------------------ -// LUCENE_DEFAULT_TOKEN_BUFFER_SIZE value | % faster than default size 1024 -// ------------------------------------------------------------------------ -// 8 : 4% -// 16 : 7% -// 32 : 6% -// 64 : 3% -// A default size of 32 is actually slightly slower than 16, but I was -// experimenting on English text; I expect that 32 will maintain decent -// performance in languages such as German, and in technical documents -// with long tokens. -// -// b) To offset the switch to a smaller default buffer size, I implemented a -// more aggressive growth strategy. A StringBuffer now [at least] doubles -// the size of its internal buffer every time it needs to grow, rather -// than [at least] increasing by LUCENE_DEFAULT_TOKEN_BUFFER_SIZE no -// matter how many times it has already grown. -//Required. -#define LUCENE_DEFAULT_TOKEN_BUFFER_SIZE 32 -//todo: should implement a similar strategy in analysis/token -// -//Expert: The fraction of {@link TermDocs} entries stored in skip tables, -//used to accellerate {@link TermDocs#skipTo(int)}. Larger values result in -//smaller indices, greater acceleration, but fewer accelerable cases, while -//smaller values result in bigger indices, less acceleration and more -//accelerable cases. More detailed experiments would be useful here. */ -#define LUCENE_DEFAULT_TERMDOCS_SKIP_INTERVAL 16 -// -//Size of TermScore cache. Required. -#define LUCENE_SCORE_CACHE_SIZE 32 -// -//analysis options -//maximum length that the CharTokenizer uses. Required. -//By adjusting this value, you can greatly improve the performance of searching -//and especially indexing. Default is 255, but smaller numbers will decrease -//the amount of memory used as well as increasing the speed. -#define LUCENE_MAX_WORD_LEN 255 -//Maximum length of a token word. -//Should be the same or more than LUCENE_MAX_WORD_LEN -//if not defined, then no token limit, but may be slower -//if defined will be faster (up to 15% in some cases), but will use more memory -#ifndef LUCENE_OPTIMIZE_FOR_MEMORY - #define LUCENE_TOKEN_WORD_LENGTH LUCENE_MAX_WORD_LEN -#endif -// -//maximum field length. some optimisation can be done if a maximum field -//length is given... The smaller the better -#define LUCENE_MAX_FIELD_LEN 100 -// -//The initial value set to BooleanQuery::maxClauseCount. Default is 1024 -#define LUCENE_BOOLEANQUERY_MAXCLAUSECOUNT 1024 -// -//bvk: 12.3.2005 -//============================================================================== -//Previously the way the tokenizer has worked has been changed to optionally -//use a a fixed word length. I have implemented this in the Term class as well. -//It seems that by predefining the text length instead of using new TCHAR[x] -//in the constructor greatly improves the performance by 20-30% for certain -//operations. -//Maximum length of a term text. -//Should be the same or more than LUCENE_MAX_WORD_LEN -//if not defined, then no term text limit, but may be slower -//if defined will be faster (up to 30% in some cases), but will use more memory -#ifndef LUCENE_OPTIMIZE_FOR_MEMORY - #define LUCENE_TERM_TEXT_LENGTH LUCENE_MAX_WORD_LEN -#endif -// -//Size of the CharTokenizer buffersize. Required. -#define LUCENE_IO_BUFFER_SIZE 1024 -// -//the minimum amount the segment term enum should grow by. Must be at least 1 -#define LUCENE_SEGMENTTERMENUM_GROWSIZE 8 -// -//////////////////////////////////////////////////////////////////// - -#endif - diff --git a/3rdparty/clucene/src/CLucene/CLMonolithic.cpp b/3rdparty/clucene/src/CLucene/CLMonolithic.cpp deleted file mode 100644 index e3c279876..000000000 --- a/3rdparty/clucene/src/CLucene/CLMonolithic.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -/* -* this is a monolithic file that can be used to compile clucene using one source file. -* it simplifies some build processes by avoiding static & dynamic compalation pitfalls. -* -* note: when creating a project add either this file, or all the other .cpp files, not both! -*/ -#include "CLucene/StdHeader.cpp" -#include "CLucene/analysis/Analyzers.cpp" -#include "CLucene/analysis/AnalysisHeader.cpp" -#include "CLucene/analysis/standard/StandardAnalyzer.cpp" -#include "CLucene/analysis/standard/StandardFilter.cpp" -#include "CLucene/analysis/standard/StandardTokenizer.cpp" -#include "CLucene/config/gunichartables.cpp" -#include "CLucene/config/repl_tcscasecmp.cpp" -#include "CLucene/config/repl_tcslwr.cpp" -#include "CLucene/config/repl_tcstod.cpp" -#include "CLucene/config/repl_lltot.cpp" -#include "CLucene/config/repl_tcstoll.cpp" -#include "CLucene/config/repl_tprintf.cpp" -#include "CLucene/config/threads.cpp" -#include "CLucene/config/utf8.cpp" -#include "CLucene/debug/condition.cpp" -#include "CLucene/debug/error.cpp" -#include "CLucene/debug/memtracking.cpp" -#include "CLucene/document/DateField.cpp" -#include "CLucene/document/Document.cpp" -#include "CLucene/document/Field.cpp" -#include "CLucene/index/CompoundFile.cpp" -#include "CLucene/index/DocumentWriter.cpp" -#include "CLucene/index/FieldInfos.cpp" -#include "CLucene/index/FieldsReader.cpp" -#include "CLucene/index/FieldsWriter.cpp" -#include "CLucene/index/IndexWriter.cpp" -#include "CLucene/index/IndexReader.cpp" -#include "CLucene/index/MultiReader.cpp" -#include "CLucene/index/SegmentInfos.cpp" -#include "CLucene/index/SegmentMergeInfo.cpp" -#include "CLucene/index/SegmentMergeQueue.cpp" -#include "CLucene/index/SegmentMerger.cpp" -#include "CLucene/index/SegmentReader.cpp" -#include "CLucene/index/SegmentTermDocs.cpp" -#include "CLucene/index/SegmentTermEnum.cpp" -#include "CLucene/index/SegmentTermPositions.cpp" -#include "CLucene/index/SegmentTermVector.cpp" -#include "CLucene/index/Term.cpp" -#include "CLucene/index/TermInfo.cpp" -#include "CLucene/index/TermInfosReader.cpp" -#include "CLucene/index/TermInfosWriter.cpp" -#include "CLucene/index/TermVectorReader.cpp" -#include "CLucene/index/TermVectorWriter.cpp" -#include "CLucene/queryParser/Lexer.cpp" -#include "CLucene/queryParser/MultiFieldQueryParser.cpp" -#include "CLucene/queryParser/QueryParser.cpp" -#include "CLucene/queryParser/QueryParserBase.cpp" -#include "CLucene/queryParser/QueryToken.cpp" -#include "CLucene/queryParser/TokenList.cpp" -#include "CLucene/search/BooleanQuery.cpp" -#include "CLucene/search/BooleanScorer.cpp" -#include "CLucene/search/CachingWrapperFilter.cpp" -#include "CLucene/search/ChainedFilter.cpp" -#include "CLucene/search/DateFilter.cpp" -#include "CLucene/search/ConjunctionScorer.cpp" -#include "CLucene/search/ExactPhraseScorer.cpp" -#include "CLucene/search/Explanation.cpp" -#include "CLucene/search/FieldCache.cpp" -#include "CLucene/search/FieldCacheImpl.cpp" -#include "CLucene/search/FieldDocSortedHitQueue.cpp" -#include "CLucene/search/FieldSortedHitQueue.cpp" -#include "CLucene/search/FilteredTermEnum.cpp" -#include "CLucene/search/FuzzyQuery.cpp" -#include "CLucene/search/Hits.cpp" -#include "CLucene/search/HitQueue.cpp" -#include "CLucene/search/IndexSearcher.cpp" -#include "CLucene/search/MultiSearcher.cpp" -#include "CLucene/search/MultiTermQuery.cpp" -#include "CLucene/search/PhrasePositions.cpp" -#include "CLucene/search/PhraseQuery.cpp" -#include "CLucene/search/PhraseScorer.cpp" -#include "CLucene/search/PrefixQuery.cpp" -#include "CLucene/search/QueryFilter.cpp" -#include "CLucene/search/RangeQuery.cpp" -#include "CLucene/search/RangeFilter.cpp" -#include "CLucene/search/SearchHeader.cpp" -#include "CLucene/search/Similarity.cpp" -#include "CLucene/search/SloppyPhraseScorer.cpp" -#include "CLucene/search/Sort.cpp" -#include "CLucene/search/TermQuery.cpp" -#include "CLucene/search/TermScorer.cpp" -#include "CLucene/search/WildcardQuery.cpp" -#include "CLucene/search/WildcardTermEnum.cpp" -#include "CLucene/store/FSDirectory.cpp" -#include "CLucene/store/IndexInput.cpp" -#include "CLucene/store/Lock.cpp" -#include "CLucene/store/MMapInput.cpp" -#include "CLucene/store/IndexOutput.cpp" -#include "CLucene/store/RAMDirectory.cpp" -#include "CLucene/store/TransactionalRAMDirectory.cpp" -#include "CLucene/util/BitSet.cpp" -#include "CLucene/util/Equators.cpp" -#include "CLucene/util/FastCharStream.cpp" -#include "CLucene/util/fileinputstream.cpp" -#include "CLucene/util/Misc.cpp" -#include "CLucene/util/Reader.cpp" -#include "CLucene/util/StringBuffer.cpp" -#include "CLucene/util/StringIntern.cpp" -#include "CLucene/util/dirent.cpp" -#include "CLucene/util/ThreadLocal.cpp" diff --git a/3rdparty/clucene/src/CLucene/LuceneThreads.h b/3rdparty/clucene/src/CLucene/LuceneThreads.h deleted file mode 100644 index cad07869f..000000000 --- a/3rdparty/clucene/src/CLucene/LuceneThreads.h +++ /dev/null @@ -1,72 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _LuceneThreads_h -#define _LuceneThreads_h -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#if defined(_CL_DISABLE_MULTITHREADING) - #define SCOPED_LOCK_MUTEX(theMutex) - #define DEFINE_MUTEX(x) - #define STATIC_DEFINE_MUTEX(x) - #define _LUCENE_SLEEP(x) - #define _LUCENE_CURRTHREADID 1 - #define _LUCENE_THREADID_TYPE char - - CL_NS_DEF(util) - class CLuceneThreadIdCompare - { - public: - enum - { // parameters for hash table - bucket_size = 4, // 0 < bucket_size - min_buckets = 8 - }; // min_buckets = 2 ^^ N, 0 < N - - bool operator()( char t1, char t2 ) const{ - return t1 < t2; - } - }; - CL_NS_END -#else - - #if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX) - //do nothing - #elif defined(_CL_HAVE_PTHREAD) - #include "CLucene/config/threadPthread.h" - #elif defined(_CL_HAVE_WIN32_THREADS) || defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) //note that mingw32 could have pthreads, so put this after. - #if !defined(_CL_HAVE_WIN32_THREADS) - #define _CL_HAVE_WIN32_THREADS - #endif - #include "CLucene/config/threadCSection.h" - #else - #error A valid thread library was not found - #endif //mutex types - - CL_NS_DEF(util) - /** @internal */ - class mutexGuard - { - private: - _LUCENE_THREADMUTEX* mrMutex; - mutexGuard(const mutexGuard& clone); - public: - mutexGuard( _LUCENE_THREADMUTEX& rMutex ); - ~mutexGuard(); - }; - CL_NS_END - - #define SCOPED_LOCK_MUTEX(theMutex) CL_NS(util)::mutexGuard theMutexGuard(theMutex); - #define DEFINE_MUTEX(theMutex) _LUCENE_THREADMUTEX theMutex; - #define STATIC_DEFINE_MUTEX(theMutex) static _LUCENE_THREADMUTEX theMutex; - -#endif //_CL_DISABLE_MULTITHREADING - - - -#endif diff --git a/3rdparty/clucene/src/CLucene/StdHeader.cpp b/3rdparty/clucene/src/CLucene/StdHeader.cpp deleted file mode 100644 index d64c51f77..000000000 --- a/3rdparty/clucene/src/CLucene/StdHeader.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CLucene/util/Misc.h" - -#include "CLucene/search/Sort.h" -#include "CLucene/search/Similarity.h" -#include "CLucene/search/FieldCache.h" -#include "CLucene/search/FieldSortedHitQueue.h" - -#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG) -# define CRTDBG_MAP_ALLOC -# include -#ifndef UNDER_CE -# include -#endif -#endif - -CL_NS_USE(util) - -TCHAR* _LUCENE_BLANK_STRING = _T(""); -char* _LUCENE_BLANK_ASTRING = ""; - -#ifndef Q_CC_MIPS -#if defined(_LUCENE_THREADMUTEX_USINGDEFAULT) -# if defined(_LUCENE_PRAGMA_WARNINGS) -# pragma message ("==================Using clunky thread mutex!!!==================") -# else -# if !defined(Q_OS_SOLARIS) -# warning "==================Using clunky thread mutex!!!==================" -# endif -# endif -#endif - -#if defined(_ASCII) -# if defined(_LUCENE_PRAGMA_WARNINGS) -# pragma message ("==================Using ascii mode!!!==================") -# else -# if !defined(Q_OS_SOLARIS) -# warning "==================Using ascii mode!!!==================" -# endif -# endif -#endif - -//This causes confusion, because CLucene doesn't really need hashed maps/sets. My experience with the -//hash maps on linux are that there are no significant improvements in using them (infact it adversely -//affected performance... therefore we'll just silently ignore -/*#if defined(LUCENE_DISABLE_HASHING) -# if defined(_LUCENE_PRAGMA_WARNINGS) -# pragma message ("==================Hashing not available or is disabled! CLucene may run slower than optimal ==================") -# else -# if !defined(Q_OS_SOLARIS) -# warning "==================Hashing not available or is disabled! CLucene may run slower than optimal ==================" -# endif -# endif -#endif*/ -#endif - -//clears all static memory. do not attempt to do anything else -//in clucene after calling this function -void _lucene_shutdown(){ - CL_NS(search)::FieldSortedHitQueue::Comparators.clear(); - _CLDELETE(CL_NS(search)::Sort::RELEVANCE); - _CLDELETE(CL_NS(search)::Sort::INDEXORDER); - _CLDELETE(CL_NS(search)::ScoreDocComparator::INDEXORDER); - _CLDELETE(CL_NS(search)::ScoreDocComparator::RELEVANCE); - _CLDELETE(CL_NS(search)::SortField::FIELD_SCORE); - _CLDELETE(CL_NS(search)::SortField::FIELD_DOC); - _CLDELETE(CL_NS(search)::FieldCache::DEFAULT); - - _CLLDELETE(CL_NS(search)::Similarity::getDefault()); - - CL_NS(util)::CLStringIntern::shutdown(); -} - -void CLDebugBreak(){ - //can be used for debug breaking... -#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG) - _CrtDbgBreak(); -#else - int i=0; //a line to put breakpoint on -#endif -} - -//these are functions that lucene uses which -//are not replacement functions -char* lucenestrdup(const char* v CL_FILELINEPARAM){ - size_t len = strlen(v); - char* ret = new char[len+1]; - strncpy(ret,v,len+1); -#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) -# if defined(LUCENE_ENABLE_FILELINEINFO) - CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,file,line,len); -# else - CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,__FILE__,__LINE__,len); -# endif -#endif - return ret; -} - -#ifdef _UCS2 -wchar_t* lucenewcsdup(const wchar_t* v CL_FILELINEPARAM){ - size_t len = _tcslen(v); - wchar_t* ret = new wchar_t[len+1]; - _tcsncpy(ret,v,len+1); -#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) -# if defined(LUCENE_ENABLE_FILELINEINFO) - CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,file,line,len); -# else - CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,__FILE__,__LINE__,len); -# endif -#endif - return ret; -} -#endif //ucs2 - - -//ok, these are the exceptions, but these never -//exist on non-msvc platform, so lets put it here -#ifndef _CL_HAVE_FILELENGTH -int64_t lucene_filelength(int filehandle) -{ - struct fileStat info; - if (fileHandleStat(filehandle, &info) == -1) - _CLTHROWA( CL_ERR_IO,"fileStat error" ); - return info.st_size; -} -#endif diff --git a/3rdparty/clucene/src/CLucene/StdHeader.h b/3rdparty/clucene/src/CLucene/StdHeader.h deleted file mode 100644 index fbb3fd949..000000000 --- a/3rdparty/clucene/src/CLucene/StdHeader.h +++ /dev/null @@ -1,501 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#ifndef lucene_stdheader_h -#define lucene_stdheader_h - -#if defined(OVERRIDE_DEFAULT_CLCONFIG) - #include "AltCLConfig.h" -#else - #include "CLucene/CLConfig.h" -#endif - -//first inclusion of compiler.h (it will be called again later) -#include "CLucene/config/compiler.h" - -extern void _lucene_shutdown(); -extern int _lucene_counter_break; //can set a watch on this -#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) - extern bool _lucene_disable_debuglogging; //if LUCENE_ENABLE_CONSTRUCTOR_LOG is on, dont do log if this is true -#endif - -//////////////////////////////////////////////////////// -// default includes -//////////////////////////////////////////////////////// -#ifndef LUCENE_DISABLE_INCLUDES - -#include - -#if defined(_CL_STDC_HEADERS) - #include - #include -#else - #if defined(_CL_HAVE_STDLIB_H) - #include - #endif -#endif - -#if defined(_CL_HAVE_STRING_H) - #if !defined(_CL_STDC_HEADERS) && defined(_CL_HAVE_MEMORY_H) - #include - #endif - #include -#elif defined(_CL_HAVE_STRINGS_H) - //note: as a side note, strtok is not thread-safe.. so be careful where you use it! - #error "strtok replacement for BSD has not been implemented" - #include - #if !defined(_CL_HAVE_STRCHR) - #define strchr index - #define strrchr rindex - #endif -#endif - -#if defined(_CL_HAVE_UNISTD_H) - #include -#elif defined(_CL_HAVE_IO_H) && defined(_CL_HAVE_DIRECT_H) -#ifndef UNDER_CE - #include - #include -#endif -#else - #error "Neither unistd.h or (io.h & direct.h) were available" -#endif - -#ifndef _CL_DISABLE_NATIVE_EXCEPTIONS - #ifdef _CL_HAVE_STDEXCEPT - #include - #else - #error "CLucene can't compile with exception handling on because header is not available" - #endif -#endif - -#if defined(_CL_STAT_MACROS_BROKEN) - #error "Haven't implemented STAT_MACROS_BROKEN fix yet" -#elif defined(_CL_HAVE_SYS_STAT_H) -#ifdef UNDER_CE - #include -#else - #include -#endif -#else - #error "Haven't implemented platforms with no sys/stat.h" -#endif - -#if defined(_CL_HAVE_STDARG_H) - #include -#else - #error "CLucene can compile, but some extras may not work" -#endif - -#if defined(_CL_HAVE_MATH_H) - #include -#else - #error "CLucene can't compile without " -#endif - -#if defined(_CL_HAVE_MAP) - #include -#else - #error "CLucene can't compile without the map header" -#endif - -#if defined(_CL_HAVE_LIST) - #include -#else - #error "CLucene can't compile without the list header" -#endif - -#if defined(_CL_HAVE_SET) - #include -#else - #error "CLucene can't compile without the set header" -#endif - -#if defined(_CL_HAVE_VECTOR) - #include -#else - #error "CLucene can't compile without the vector header" -#endif - -#if !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) - //hashing is all or nothing! - #include - #include -#elif !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_EXT_HASH_MAP) && defined(_CL_HAVE_EXT_HASH_SET) - #include - #include -#elif !defined(LUCENE_DISABLE_HASHING) - #define LUCENE_DISABLE_HASHING -#endif -#if !defined(LUCENE_DISABLE_HASHING) && !defined(CL_NS_HASHING) - #define CL_NS_HASHING(func) std::func -#endif - -#if defined(_CL_HAVE_ALGORITHM) -# include -#else -# error "Can't compile clucene without " -#endif - -#if defined(_CL_HAVE_FUNCTIONAL) -# include -#else -# error "Can't compile clucene without " -#endif - -#if !defined(_CL_HAVE_PRINTF) - #error "CLucene can't compile without printf, replacements have not been implemented" -#endif - -#if !defined(_CL_HAVE_SNPRINTF) && !defined(_CL_HAVE__SNPRINTF) - #error "CLucene can't compile without snprintf, replacements have not been implemented" -#elif !defined(_CL_HAVE__SNPRINTF)&& defined(_CL_HAVE_SVNPRINTF) - #define _snprintf snprintf -#endif - -#if defined(_UCS2) - #if defined(_CL_HAVE_WCHAR_H) - #include - #else - //actually the repl_wchar.h replacements header will - //always be included. It replaces some functions - //that are missing in some wchar.h headers. - #endif -#endif - -#if defined(_UCS2) && defined(_CL_HAVE_WCTYPE_H) - #include -#elif defined(_ASCII) && defined(_CL_HAVE_CTYPE_H) - #include - #undef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS -#elif defined(_UCS2) - //must be in _UCS2 to use internal char functions - #undef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS - #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS -#else - #error "Cannot compile in _ASCII without ctype.h" -#endif - -//always include replacement, some missing tchar defines -#include "CLucene/config/repl_tchar.h" - -#if defined(_CL_HAVE_ERRNO_H) -#ifndef UNDER_CE - #include -#endif -#else - #error "Haven't implemented platforms with no errno.h" -#endif - -#if defined(_CL_HAVE_FCNTL_H) -#ifndef UNDER_CE - #include -#endif -#else - #error "Haven't implemented platforms with no fcntl.h" -#endif - -#if defined(_CL_HAVE_WINDOWS_H) - #include -#endif - -#endif //LUCENE_DISABLE_INCLUDES -// -//////////////////////////////////////////////////////// - -//second inclusion of compiler.h -//this gives CompilerXXX.h a chance to include other headers -#include "CLucene/config/compiler.h" -// -//////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////// -// Character functions. -// Here we decide whose character functions to use -//////////////////////////////////////////////////////// -#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) - #define stringCaseFold cl_tcscasefold - #define stringCaseFoldCmp cl_tcscasefoldcmp - - #undef _istspace - #undef _istdigit - #undef _istalnum - #undef _istalpha - #undef _totlower - #undef _totupper - #define _istalnum cl_isalnum - #define _istalpha cl_isletter - #define _istspace cl_isspace - #define _istdigit cl_isdigit - #define _totlower cl_tolower - #define _totupper cl_toupper - - //here are some functions to help deal with utf8/ucs2 conversions - //lets let the user decide what mb functions to use... we provide pure utf8 ones no matter what. - /*#undef _mbtowc - #undef _mbstowcs - #undef _wctomb - #undef _wcstombs - #define _mbtowc lucene_mbstowc - #define _mbsstowcs lucene_mbstowcs - #define _wctomb lucene_wcto_mb - #define _wcstombs lucene_wcstombs*/ -#else - //we are using native functions - //here are some functions to help deal with utf8/ucs2 conversions - /*#define _mbtowc mbtowc - #define _wctomb wctomb - #define _mbstowcs mbstowcs - #define _wcstombs wcstombs*/ - - //we are using native character functions - #if defined(_ASCII) - #undef _istspace - #undef _istdigit - #undef _istalnum - #undef _istalpha - #undef _totlower - #undef _totupper - #define _istspace(x) isspace((unsigned char)x) - #define _istdigit(x) isdigit((unsigned char)x) - #define _istalnum(x) isalnum((unsigned char)x) - #define _istalpha(x) isalpha((unsigned char)x) - #define _totlower(x) tolower((unsigned char)x) - #define _totupper(x) toupper((unsigned char)x) - #endif -#endif - -//the methods contained in gunichartables.h -typedef unsigned long clunichar; -bool cl_isletter(clunichar c); -bool cl_isalnum(clunichar c); -bool cl_isdigit(clunichar c); -bool cl_isspace (clunichar c); -TCHAR cl_tolower (TCHAR c); -TCHAR cl_toupper (TCHAR c); - -int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src); -TCHAR* cl_tcscasefold( TCHAR * str, int len=-1 ); - -//we provide utf8 conversion functions -size_t lucene_utf8towc (wchar_t *ret, const char *s, size_t n); -size_t lucene_utf8towcs(wchar_t *, const char *, size_t maxslen); -size_t lucene_wctoutf8 (char * ret, const wchar_t str); -size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); -size_t lucene_utf8charlen(const char *p); - -///a blank string... -extern TCHAR* _LUCENE_BLANK_STRING; -#define LUCENE_BLANK_STRING _LUCENE_BLANK_STRING -extern char* _LUCENE_BLANK_ASTRING; -#define LUCENE_BLANK_ASTRING _LUCENE_BLANK_ASTRING - -/* Converts a string into a form that is independent of case. The - * result will not correspond to any particular case, but can be - * compared for equality or ordered with the results of calling - * stringCaseFold() on other strings. - * - * If we did not define this elsewhere, then just convert to lower case - */ -#ifndef stringCaseFold - #define stringCaseFold _tcslwr -#endif -/* Compares 2 strings using case folding (if available) - * If we did not define this elsewhere, then just compare - * using normal method - */ -#ifndef stringCaseFoldCmp - #define stringCaseFoldCmp _tcsicmp -#endif - -//now that all the character routines are completed, include the -//wchar.h replacements. -#include "CLucene/config/repl_wchar.h" //always include replacements - -//a replacement for _tcsdup. This uses new TCHAR[] instead of malloc, so that we can use delete[] to free -#if defined(LUCENE_ENABLE_FILELINEINFO) - #define CL_FILELINE ,__FILE__,__LINE__ - #define CL_FILELINEREF ,file,line /// StringArray; -typedef CL_NS(util)::CLVector StringArrayWithDeletor; -typedef CL_NS(util)::CLVector StringArrayConst; -typedef CL_NS(util)::CLVector StringArrayConstWithDeletor; - -typedef CL_NS(util)::CLVector AStringArray; -typedef CL_NS(util)::CLVector AStringArrayWithDeletor; -typedef CL_NS(util)::CLVector AStringArrayConst; -typedef CL_NS(util)::CLVector AStringArrayConstWithDeletor; -CL_NS_END - -// -//////////////////////////////////////////////////////// - -#endif // STDHEADER_H diff --git a/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp b/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp deleted file mode 100644 index 03f61a038..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "AnalysisHeader.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(analysis) - -const TCHAR* Token::defaultType=_T("word"); - -Token::Token(): - _startOffset (0), - _endOffset (0), - _type ( defaultType ), - positionIncrement (1) -{ - _termTextLen = 0; -#ifndef LUCENE_TOKEN_WORD_LENGTH - _termText = NULL; - bufferTextLen = 0; -#else - _termText[0] = 0; //make sure null terminated - bufferTextLen = LUCENE_TOKEN_WORD_LENGTH+1; -#endif -} - -Token::~Token(){ -#ifndef LUCENE_TOKEN_WORD_LENGTH - free(_termText); -#endif -} - -Token::Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ): - _startOffset (start), - _endOffset (end), - _type ( typ ), - positionIncrement (1) -{ - _termTextLen = 0; -#ifndef LUCENE_TOKEN_WORD_LENGTH - _termText = NULL; - bufferTextLen = 0; -#else - _termText[0] = 0; //make sure null terminated - bufferTextLen = LUCENE_TOKEN_WORD_LENGTH+1; -#endif - setText(text); -} - -void Token::set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ){ - _startOffset = start; - _endOffset = end; - _type = typ; - positionIncrement = 1; - setText(text); -} - -void Token::setText(const TCHAR* text){ - _termTextLen = _tcslen(text); - -#ifndef LUCENE_TOKEN_WORD_LENGTH - growBuffer(_termTextLen+1); - _tcsncpy(_termText,text,_termTextLen+1); -#else - if ( _termTextLen > LUCENE_TOKEN_WORD_LENGTH ){ - //in the case where this occurs, we will leave the endOffset as it is - //since the actual word still occupies that space. - _termTextLen=LUCENE_TOKEN_WORD_LENGTH; - } - _tcsncpy(_termText,text,_termTextLen+1); -#endif - _termText[_termTextLen] = 0; //make sure null terminated -} - -void Token::growBuffer(size_t size){ - if(bufferTextLen>=size) - return; -#ifndef LUCENE_TOKEN_WORD_LENGTH - if ( _termText == NULL ) - _termText = (TCHAR*)malloc( size * sizeof(TCHAR) ); - else - _termText = (TCHAR*)realloc( _termText, size * sizeof(TCHAR) ); - bufferTextLen = size; -#else - _CLTHROWA(CL_ERR_TokenMgr,"Couldn't grow Token buffer"); -#endif -} - -void Token::setPositionIncrement(int32_t posIncr) { - if (posIncr < 0) { - _CLTHROWA(CL_ERR_IllegalArgument,"positionIncrement must be >= 0"); - } - positionIncrement = posIncr; -} - -int32_t Token::getPositionIncrement() const { return positionIncrement; } - -// Returns the Token's term text. -const TCHAR* Token::termText() const{ - return (const TCHAR*) _termText; -} -size_t Token::termTextLength() { - if ( _termTextLen == -1 ) //it was invalidated by growBuffer - _termTextLen = _tcslen(_termText); - return _termTextLen; -} -void Token::resetTermTextLen(){ - _termTextLen=-1; -} -bool Token::OrderCompare::operator()( Token* t1, Token* t2 ) const{ - if(t1->startOffset()>t2->startOffset()) - return false; - if(t1->startOffset()startOffset()) - return true; - return true; -} -TCHAR* Token::toString() const{ - StringBuffer sb; - sb.append(_T("(")); - sb.append( _termText ); - sb.append(_T(",")); - sb.appendInt( _startOffset ); - sb.append(_T(",")); - sb.appendInt( _endOffset ); - - if (!_tcscmp( _type, _T("word")) == 0 ){ - sb.append(_T(",type=")); - sb.append(_type); - } - if (positionIncrement != 1){ - sb.append(_T(",posIncr=")); - sb.appendInt(positionIncrement); - } - sb.append(_T(")")); - - return sb.toString(); -} - - -Token* TokenStream::next(){ - Token* t = _CLNEW Token; //deprecated - if ( !next(t) ) - _CLDELETE(t); - return t; -} - - -TokenFilter::TokenFilter(TokenStream* in, bool deleteTS): - input(in), - deleteTokenStream(deleteTS) -{ -} -TokenFilter::~TokenFilter(){ - close(); -} - -// Close the input TokenStream. -void TokenFilter::close() { - if ( input != NULL ){ - input->close(); - if ( deleteTokenStream ) - _CLDELETE( input ); - } - input = NULL; -} - - - -Tokenizer::Tokenizer() { - input = NULL; -} - -Tokenizer::Tokenizer(CL_NS(util)::Reader* _input): - input(_input) -{ -} - -void Tokenizer::close(){ - if (input != NULL) { - // ? delete input; - input = NULL; - } -} - -Tokenizer::~Tokenizer(){ - close(); -} - - -int32_t Analyzer::getPositionIncrementGap(const TCHAR* fieldName) -{ - return 0; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h b/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h deleted file mode 100644 index 0cfd9c684..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h +++ /dev/null @@ -1,234 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_analysis_AnalysisHeader_ -#define _lucene_analysis_AnalysisHeader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/Reader.h" - -CL_NS_DEF(analysis) - - -/** A Token is an occurence of a term from the text of a field. It consists of -* a term's text, the start and end offset of the term in the text of the field, -* and a type string. -* -* The start and end offsets permit applications to re-associate a token with -* its source text, e.g., to display highlighted query terms in a document -* browser, or to show matching text fragments in a KWIC (KeyWord In Context) -* display, etc. -* -* The type is an interned string, assigned by a lexical analyzer -* (a.k.a. tokenizer), naming the lexical or syntactic class that the token -* belongs to. For example an end of sentence marker token might be implemented -* with type "eos". The default token type is "word". -*/ -class Token:LUCENE_BASE{ -private: - int32_t _startOffset; // start in source text - int32_t _endOffset; // end in source text - const TCHAR* _type; // lexical type - int32_t positionIncrement; - size_t bufferTextLen; - -public: - #ifndef LUCENE_TOKEN_WORD_LENGTH - TCHAR* _termText; // the text of the term - #else - TCHAR _termText[LUCENE_TOKEN_WORD_LENGTH+1]; // the text of the term - #endif - int32_t _termTextLen; - static const TCHAR* defaultType; - - Token(); - ~Token(); - // Constructs a Token with the given text, start and end offsets, & type. - Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=defaultType); - void set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=defaultType); - - size_t bufferLength(){ return bufferTextLen; } - void growBuffer(size_t size); - - /* Set the position increment. This determines the position of this - * token relative to the previous Token in a TokenStream, used in - * phrase searching. - * - * The default value is 1. - * - * Some common uses for this are: - * - * - Set it to zero to put multiple terms in the same position. This is - * useful if, e.g., a word has multiple stems. Searches for phrases - * including either stem will match. In this case, all but the first stem's - * increment should be set to zero: the increment of the first instance - * should be one. Repeating a token with an increment of zero can also be - * used to boost the scores of matches on that token. - * - * - Set it to values greater than one to inhibit exact phrase matches. - * If, for example, one does not want phrases to match across removed stop - * words, then one could build a stop word filter that removes stop words and - * also sets the increment to the number of stop words removed before each - * non-stop word. Then exact phrase queries will only match when the terms - * occur with no intervening stop words. - */ - void setPositionIncrement(int32_t posIncr); - int32_t getPositionIncrement() const; - const TCHAR* termText() const; - size_t termTextLength(); - void resetTermTextLen(); - void setText(const TCHAR* txt); - - /** - * Returns this Token's starting offset, the position of the first character - * corresponding to this token in the source text. - * - * Note that the difference between endOffset() and startOffset() may not be - * equal to termText.length(), as the term text may have been altered by a - * stemmer or some other filter. - */ - int32_t startOffset() const { return _startOffset; } - void setStartOffset(int32_t val){ _startOffset =val; } - - /** - * Returns this Token's ending offset, one greater than the position of the - * last character corresponding to this token in the source text. - */ - int32_t endOffset() const { return _endOffset; } - void setEndOffset(int32_t val){ _endOffset =val; } - - // Returns this Token's lexical type. Defaults to "word". - const TCHAR* type() const { return _type; } /// - { - public: - bool operator()( Token* t1, Token* t2 ) const; - }; -}; - -/** -* A TokenStream enumerates the sequence of tokens, either from -* fields of a document or from query text. -*

-* This is an abstract class. Concrete subclasses are: -*

    -*
  • {@link Tokenizer}, a TokenStream -* whose input is a Reader; and -*
  • {@link TokenFilter}, a TokenStream -* whose input is another TokenStream. -*
-*/ -class TokenStream:LUCENE_BASE { -public: - /** Sets token to the next token in the stream, returns false at the EOS. */ - virtual bool next(Token* token) = 0; - - /** Releases resources associated with this stream. */ - virtual void close() = 0; - - virtual ~TokenStream(){ - } - - /* This is for backwards compatibility only. You should pass the token you want to fill - * to next(), this will save a lot of object construction and destructions. - * @deprecated. use next(token). Kept only to avoid breaking existing code. - */ - _CL_DEPRECATED(next(Token)) Token* next(); -}; - - -/** An Analyzer builds TokenStreams, which analyze text. It thus represents a - * policy for extracting index terms from text. - *

- * Typical implementations first build a Tokenizer, which breaks the stream of - * characters from the Reader into raw Tokens. One or more TokenFilters may - * then be applied to the output of the Tokenizer. - *

- * WARNING: You must override one of the methods defined by this class in your - * subclass or the Analyzer will enter an infinite loop. - */ -class Analyzer:LUCENE_BASE{ -public: - /** Creates a TokenStream which tokenizes all the text in the provided - Reader. Default implementation forwards to tokenStream(Reader) for - compatibility with older version. Override to allow Analyzer to choose - strategy based on document and/or field. Must be able to handle null - field name for backward compatibility. */ - virtual TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader)=0; - - virtual ~Analyzer(){ - } - - /** - * Invoked before indexing a Field instance if - * terms have already been added to that field. This allows custom - * analyzers to place an automatic position increment gap between - * Field instances using the same field name. The default value - * position increment gap is 0. With a 0 position increment gap and - * the typical default token position increment of 1, all terms in a field, - * including across Field instances, are in successive positions, allowing - * exact PhraseQuery matches, for instance, across Field instance boundaries. - * - * @param fieldName Field name being indexed. - * @return position increment gap, added to the next token emitted from {@link #tokenStream(TCHAR*, Reader*)} - */ - virtual int32_t getPositionIncrementGap(const TCHAR* fieldName); -}; - - -/** A Tokenizer is a TokenStream whose input is a Reader. -

-This is an abstract class. -*/ -class Tokenizer:public TokenStream { -protected: - /** The text source for this Tokenizer. */ - CL_NS(util)::Reader* input; - -public: - /** Construct a tokenizer with null input. */ - Tokenizer(); - /** Construct a token stream processing the given input. */ - Tokenizer(CL_NS(util)::Reader* _input); - - // ** By default, closes the input Reader. */ - virtual void close(); - virtual ~Tokenizer(); -}; - -/** A TokenFilter is a TokenStream whose input is another token stream. -

-This is an abstract class. -*/ -class TokenFilter:public TokenStream { -protected: - /** The source of tokens for this filter. */ - TokenStream* input; - /** If true then input will be deleted in the destructor */ - bool deleteTokenStream; - - /** Construct a token stream filtering the given input. - * - * @param in The TokenStream to filter from - * @param deleteTS If true, input will be deleted in the destructor - */ - TokenFilter(TokenStream* in, bool deleteTS=false); - virtual ~TokenFilter(); -public: - /** Close the input TokenStream. */ - void close(); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp b/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp deleted file mode 100644 index 142bbfb63..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Analyzers.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(analysis) - -CharTokenizer::CharTokenizer(Reader* in) : - Tokenizer(in), - offset(0), - bufferIndex(0), - dataLen(0), - ioBuffer(NULL) -{ - buffer[0]=0; -} - -TCHAR CharTokenizer::normalize(const TCHAR c) const -{ - return c; -} -bool CharTokenizer::next(Token* token){ - int32_t length = 0; - int32_t start = offset; - while (true) { - TCHAR c; - offset++; - if (bufferIndex >= dataLen) { - dataLen = input->read(ioBuffer, LUCENE_IO_BUFFER_SIZE); - if (dataLen == -1) - dataLen = 0; - bufferIndex = 0; - } - if (dataLen <= 0 ) { - if (length > 0) - break; - else - return false; - }else - c = ioBuffer[bufferIndex++]; - if (isTokenChar(c)) { // if it's a token TCHAR - - if (length == 0) // start of token - start = offset-1; - - buffer[length++] = normalize(c); // buffer it, normalized - - if (length == LUCENE_MAX_WORD_LEN) // buffer overflow! - break; - - } else if (length > 0) // at non-Letter w/ chars - break; // return 'em - - } - buffer[length]=0; - token->set( buffer, start, start+length); - return true; -} - -bool LetterTokenizer::isTokenChar(const TCHAR c) const { - return _istalpha(c)!=0; -} - - -TCHAR LowerCaseTokenizer::normalize(const TCHAR chr) const { - return _totlower(chr); -} - -bool WhitespaceTokenizer::isTokenChar(const TCHAR c) const{ - return _istspace(c)==0; //(return true if NOT a space) -} - -TokenStream* WhitespaceAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { - return _CLNEW WhitespaceTokenizer(reader); -} - -TokenStream* SimpleAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { - return _CLNEW LowerCaseTokenizer(reader); -} - -bool LowerCaseFilter::next(Token* t){ - if (!input->next(t)) - return false; - stringCaseFold( t->_termText ); - return true; -} - -StopFilter::StopFilter(TokenStream* in, bool deleteTokenStream, const TCHAR** stopWords): - TokenFilter(in, deleteTokenStream), - table(_CLNEW CLSetList(false)) -{ - fillStopTable( table,stopWords ); -} - -void StopFilter::fillStopTable(CLSetList* stopTable, - const TCHAR** stopWords) { - for (int32_t i = 0; stopWords[i]!=NULL; i++) - stopTable->insert(stopWords[i]); -} - -bool StopFilter::next(Token* token) { - // return the first non-stop word found - while (input->next(token)){ - if (table->find(token->_termText)==table->end()){ - return true; - } - } - - // reached EOS -- return nothing - return false; -} - -StopAnalyzer::StopAnalyzer():stopTable(false) -{ - StopFilter::fillStopTable(&stopTable,ENGLISH_STOP_WORDS); -} -StopAnalyzer::~StopAnalyzer() -{ -} -StopAnalyzer::StopAnalyzer( const TCHAR** stopWords) { - StopFilter::fillStopTable(&stopTable,stopWords); -} -TokenStream* StopAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { - return _CLNEW StopFilter(_CLNEW LowerCaseTokenizer(reader),true, &stopTable); -} - -const TCHAR* StopAnalyzer::ENGLISH_STOP_WORDS[] = -{ - _T("a"), _T("an"), _T("and"), _T("are"), _T("as"), _T("at"), _T("be"), _T("but"), _T("by"), - _T("for"), _T("if"), _T("in"), _T("into"), _T("is"), _T("it"), - _T("no"), _T("not"), _T("of"), _T("on"), _T("or"), _T("s"), _T("such"), - _T("t"), _T("that"), _T("the"), _T("their"), _T("then"), _T("there"), _T("these"), - _T("they"), _T("this"), _T("to"), _T("was"), _T("will"), _T("with"), NULL -}; - -PerFieldAnalyzerWrapper::PerFieldAnalyzerWrapper(Analyzer* defaultAnalyzer): - analyzerMap(true,true) -{ - this->defaultAnalyzer = defaultAnalyzer; -} -PerFieldAnalyzerWrapper::~PerFieldAnalyzerWrapper(){ - analyzerMap.clear(); - _CLDELETE(defaultAnalyzer); -} - -void PerFieldAnalyzerWrapper::addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer) { - analyzerMap.put(STRDUP_TtoT(fieldName), analyzer); -} - -TokenStream* PerFieldAnalyzerWrapper::tokenStream(const TCHAR* fieldName, Reader* reader) { - Analyzer* analyzer = (fieldName==NULL?defaultAnalyzer:analyzerMap.get(fieldName)); - if (analyzer == NULL) { - analyzer = defaultAnalyzer; - } - - return analyzer->tokenStream(fieldName, reader); -} - - - -bool ISOLatin1AccentFilter::next(Token* token){ - if ( input->next(token) ){ - int32_t l = token->termTextLength(); - const TCHAR* chars = token->termText(); - bool doProcess = false; - for (int32_t i = 0; i < l; ++i) { -#ifdef _UCS2 - if ( chars[i] >= 0xC0 && chars[i] <= 0x178 ) { -#else - if ( (chars[i] >= 0xC0 && chars[i] <= 0xFF) || chars[i] < 0 ) { -#endif - doProcess = true; - break; - } - } - if ( !doProcess ) { - return true; - } - - StringBuffer output(l*2); - for (int32_t j = 0; j < l; j++) { - #ifdef _UCS2 - TCHAR c = chars[j]; - #else - unsigned char c = chars[j]; - #endif - switch (c) { - case 0xC0 : - case 0xC1 : - case 0xC2 : - case 0xC3 : - case 0xC4 : - case 0xC5 : - output.appendChar('A'); - break; - case 0xC6 : - output.append(_T("AE")); - break; - case 0xC7 : - output.appendChar('C'); - break; - case 0xC8 : - case 0xC9 : - case 0xCA : - case 0xCB : - output.appendChar('E'); - break; - case 0xCC : - case 0xCD : - case 0xCE : - case 0xCF : - output.appendChar('I'); - break; - case 0xD0 : - output.appendChar('D'); - break; - case 0xD1 : - output.appendChar('N'); - break; - case 0xD2 : - case 0xD3 : - case 0xD4 : - case 0xD5 : - case 0xD6 : - case 0xD8 : - output.appendChar('O'); - break; - case 0xDE : - output.append(_T("TH")); - break; - case 0xD9 : - case 0xDA : - case 0xDB : - case 0xDC : - output.appendChar('U'); - break; - case 0xDD : - output.appendChar('Y'); - break; - case 0xE0 : - case 0xE1 : - case 0xE2 : - case 0xE3 : - case 0xE4 : - case 0xE5 : - output.appendChar('a'); - break; - case 0xE6 : - output.append(_T("ae")); - break; - case 0xE7 : - output.appendChar('c'); - break; - case 0xE8 : - case 0xE9 : - case 0xEA : - case 0xEB : - output.appendChar('e'); - break; - case 0xEC : - case 0xED : - case 0xEE : - case 0xEF : - output.appendChar('i'); - break; - case 0xF0 : - output.appendChar('d'); - break; - case 0xF1 : - output.appendChar('n'); - break; - case 0xF2 : - case 0xF3 : - case 0xF4 : - case 0xF5 : - case 0xF6 : - case 0xF8 : - output.appendChar('o'); - break; - case 0xDF : - output.append(_T("ss")); - break; - case 0xFE : - output.append(_T("th")); - break; - case 0xF9 : - case 0xFA : - case 0xFB : - case 0xFC : - output.appendChar('u'); - break; - case 0xFD : - case 0xFF : - output.appendChar('y'); - break; - - #ifdef _UCS2 - case 0x152 : - output.append(_T("OE")); - break; - case 0x153 : - output.append(_T("oe")); - break; - case 0x178 : - output.appendChar('Y'); - break; - #endif - default : - output.appendChar(c); - break; - } - } - token->setText(output.getBuffer()); - return true; - } - return false; -} - - -TokenStream* KeywordAnalyzer::tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader){ - return _CLNEW KeywordTokenizer(reader); -} - -KeywordTokenizer::KeywordTokenizer(CL_NS(util)::Reader* input, int bufferSize): - Tokenizer(input) -{ - this->done = false; - if ( bufferSize < 0 ) - this->bufferSize = DEFAULT_BUFFER_SIZE; -} -KeywordTokenizer::~KeywordTokenizer(){ -} - -bool KeywordTokenizer::next(Token* token){ - if (!done) { - done = true; - int32_t rd; - const TCHAR* buffer=0; - while (true) { - rd = input->read(buffer, bufferSize); - if (rd == -1) - break; - token->growBuffer(token->_termTextLen +rd+1); - - int32_t cp = rd; - if ( token->_termTextLen + cp > token->bufferLength() ) - cp = token->bufferLength() - token->_termTextLen; - _tcsncpy(token->_termText+token->_termTextLen,buffer,cp); - token->_termTextLen+=rd; - } - token->_termText[token->_termTextLen]=0; - token->set(token->_termText,0,token->_termTextLen); - return true; - } - return false; -} - - -LengthFilter::LengthFilter(TokenStream* in, int _min, int _max): - TokenFilter(in) -{ - this->_min = _min; - this->_max = _max; -} - -bool LengthFilter::next(Token* token) -{ - // return the first non-stop word found - while ( input->next(token) ) - { - size_t len = token->termTextLength(); - if (len >= _min && len <= _max) - return true; - // note: else we ignore it but should we index each part of it? - } - // reached EOS -- return null - return false; -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/analysis/Analyzers.h b/3rdparty/clucene/src/CLucene/analysis/Analyzers.h deleted file mode 100644 index a12bd653f..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/Analyzers.h +++ /dev/null @@ -1,309 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_analysis_Analyzers_ -#define _lucene_analysis_Analyzers_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/Reader.h" -#include "AnalysisHeader.h" -#include "CLucene/util/Misc.h" - -CL_NS_DEF(analysis) - -/** An abstract base class for simple, character-oriented tokenizers.*/ -class CharTokenizer:public Tokenizer { -private: - int32_t offset, bufferIndex, dataLen; - TCHAR buffer[LUCENE_MAX_WORD_LEN+1]; - const TCHAR* ioBuffer; -protected: - - /** Returns true iff a character should be included in a token. This - * tokenizer generates as tokens adjacent sequences of characters which - * satisfy this predicate. Characters for which this is false are used to - * define token boundaries and are not included in tokens. */ - virtual bool isTokenChar(const TCHAR c) const = 0; - - /** Called on each token character to normalize it before it is added to the - * token. The default implementation does nothing. Subclasses may use this - * to, e.g., lowercase tokens. */ - virtual TCHAR normalize(const TCHAR c) const; - -public: - CharTokenizer(CL_NS(util)::Reader* in); - virtual ~CharTokenizer(){ - } - bool next(Token* token); -}; - - -/** A LetterTokenizer is a tokenizer that divides text at non-letters. That's -to say, it defines tokens as maximal strings of adjacent letters, as defined -by java.lang.Character.isLetter() predicate. - -Note: this does a decent job for most European languages, but does a terrible -job for some Asian languages, where words are not separated by spaces. */ -class LetterTokenizer:public CharTokenizer { -public: - // Construct a new LetterTokenizer. - LetterTokenizer(CL_NS(util)::Reader* in): - CharTokenizer(in) {} - - ~LetterTokenizer(){} -protected: - /** Collects only characters which satisfy _istalpha.*/ - bool isTokenChar(const TCHAR c) const; -}; - - - -/** -* LowerCaseTokenizer performs the function of LetterTokenizer -* and LowerCaseFilter together. It divides text at non-letters and converts -* them to lower case. While it is functionally equivalent to the combination -* of LetterTokenizer and LowerCaseFilter, there is a performance advantage -* to doing the two tasks at once, hence this (redundant) implementation. -*

-* Note: this does a decent job for most European languages, but does a terrible -* job for some Asian languages, where words are not separated by spaces. -*/ -class LowerCaseTokenizer:public LetterTokenizer { -public: - /** Construct a new LowerCaseTokenizer. */ - LowerCaseTokenizer(CL_NS(util)::Reader* in): - LetterTokenizer(in) {} - - ~LowerCaseTokenizer(){} -protected: - /** Collects only characters which satisfy _totlower. */ - TCHAR normalize(const TCHAR chr) const; -}; - - -/** A WhitespaceTokenizer is a tokenizer that divides text at whitespace. - * Adjacent sequences of non-Whitespace characters form tokens. */ -class WhitespaceTokenizer: public CharTokenizer { -public: - /** Construct a new WhitespaceTokenizer. */ - WhitespaceTokenizer(CL_NS(util)::Reader* in):CharTokenizer(in) {} - ~WhitespaceTokenizer(){} -protected: - /** Collects only characters which do not satisfy _istspace. - */ - bool isTokenChar(const TCHAR c) const; -}; - - -/** An Analyzer that uses WhitespaceTokenizer. */ -class WhitespaceAnalyzer: public Analyzer { - public: - TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); - ~WhitespaceAnalyzer(){} -}; - -/** An Analyzer that filters LetterTokenizer with LowerCaseFilter. */ -class SimpleAnalyzer: public Analyzer { -public: - TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); - ~SimpleAnalyzer(){} -}; - - - -/** -* Normalizes token text to lower case. -*/ -class LowerCaseFilter: public TokenFilter { -public: - LowerCaseFilter(TokenStream* in, bool deleteTokenStream):TokenFilter(in,deleteTokenStream) {} - ~LowerCaseFilter(){} - bool next(Token* token); -}; - - -/** - * Removes stop words from a token stream. - */ -class StopFilter: public TokenFilter { -private: - //bvk: i found this to work faster with a non-hash table. the number of items - //in the stop table is not like to make it worth having hashing. - CL_NS(util)::CLSetList* table; -public: - // Constructs a filter which removes words from the input - // TokenStream that are named in the array of words. - StopFilter(TokenStream* in, bool deleteTokenStream, const TCHAR** stopWords); - - ~StopFilter(){} - - /** Constructs a filter which removes words from the input - * TokenStream that are named in the CLSetList. - */ - StopFilter(TokenStream* in, bool deleteTokenStream, CL_NS(util)::CLSetList* stopTable): - TokenFilter(in, deleteTokenStream), - table(stopTable) - {} - - - /** - * Builds a Hashtable from an array of stop words, appropriate for passing - * into the StopFilter constructor. This permits this table construction to - * be cached once when an Analyzer is constructed. - * Note: the stopWords list must be a static list because the strings are not copied - */ - static void fillStopTable(CL_NS(util)::CLSetList* stopTable, - const TCHAR** stopWords); - - /** - * Returns the next input Token whose termText() is not a stop word. - */ - bool next(Token* token); -}; - - - - -/** Filters LetterTokenizer with LowerCaseFilter and StopFilter. */ -class StopAnalyzer: public Analyzer { - CL_NS(util)::CLSetList stopTable; - -public: - /** Builds an analyzer which removes words in ENGLISH_STOP_WORDS. */ - StopAnalyzer(); - ~StopAnalyzer(); - - /** Builds an analyzer which removes words in the provided array. */ - StopAnalyzer( const TCHAR** stopWords ); - /** Filters LowerCaseTokenizer with StopFilter. */ - TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); - - /** An array containing some common English words that are not usually useful - for searching. */ - static const TCHAR* ENGLISH_STOP_WORDS[]; -}; - - - -/** - * This analyzer is used to facilitate scenarios where different - * fields require different analysis techniques. Use {@link #addAnalyzer} - * to add a non-default analyzer on a field name basis. - * - *

Example usage: - * - *

- *   PerFieldAnalyzerWrapper aWrapper =
- *      new PerFieldAnalyzerWrapper(new StandardAnalyzer());
- *   aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
- *   aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
- * 
- * - *

In this example, StandardAnalyzer will be used for all fields except "firstname" - * and "lastname", for which KeywordAnalyzer will be used. - * - *

A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing - * and query parsing. - */ -class PerFieldAnalyzerWrapper : public Analyzer { -private: - Analyzer* defaultAnalyzer; - CL_NS(util)::CLHashMap > analyzerMap; -public: - /** - * Constructs with default analyzer. - * - * @param defaultAnalyzer Any fields not specifically - * defined to use a different analyzer will use the one provided here. - */ - PerFieldAnalyzerWrapper(Analyzer* defaultAnalyzer); - ~PerFieldAnalyzerWrapper(); - - /** - * Defines an analyzer to use for the specified field. - * - * @param fieldName field name requiring a non-default analyzer - * @param analyzer non-default analyzer to use for field - */ - void addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer); - TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); -}; - - -/** - * A filter that replaces accented characters in the ISO Latin 1 character set - * (ISO-8859-1) by their unaccented equivalent. The case will not be altered. - *

- * For instance, 'à' will be replaced by 'a'. - *

- */ -class ISOLatin1AccentFilter: public TokenFilter { -public: - ISOLatin1AccentFilter(TokenStream* input, bool deleteTs): - TokenFilter(input,deleteTs) - { - } - - /** - * To replace accented characters in a String by unaccented equivalents. - */ - bool next(Token* token); -}; - - -/** - * Emits the entire input as a single token. - */ -class KeywordTokenizer: public Tokenizer { -private: - LUCENE_STATIC_CONSTANT(int, DEFAULT_BUFFER_SIZE = 256); - bool done; - int bufferSize; -public: - KeywordTokenizer(CL_NS(util)::Reader* input, int bufferSize=-1); - virtual ~KeywordTokenizer(); - bool next(Token* token); -}; - -/** - * "Tokenizes" the entire stream as a single token. This is useful - * for data like zip codes, ids, and some product names. - */ -class KeywordAnalyzer: public Analyzer { -public: - TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); - virtual ~KeywordAnalyzer(){} -}; - - -/** - * Removes words that are too long and too short from the stream. - * - */ -class LengthFilter: public TokenFilter { -private: - int _min; - int _max; -public: - /** - * Build a filter that removes words that are too long or too - * short from the text. - */ - LengthFilter(TokenStream* in, int _min, int _max); - - /** - * Returns the next input Token whose termText() is the right len - */ - bool next(Token* token); -}; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp b/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp deleted file mode 100644 index e0994c41a..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "StandardAnalyzer.h" - -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Reader.h" -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/analysis/Analyzers.h" -#include "StandardFilter.h" -#include "StandardTokenizer.h" - -CL_NS_USE(util) -CL_NS_USE(analysis) - -CL_NS_DEF2(analysis,standard) - - StandardAnalyzer::StandardAnalyzer(): - stopSet(false) - { - StopFilter::fillStopTable( &stopSet,CL_NS(analysis)::StopAnalyzer::ENGLISH_STOP_WORDS); - } - - StandardAnalyzer::StandardAnalyzer( const TCHAR** stopWords): - stopSet(false) - { - StopFilter::fillStopTable( &stopSet,stopWords ); - } - - StandardAnalyzer::~StandardAnalyzer(){ - } - - - TokenStream* StandardAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) - { - TokenStream* ret = _CLNEW StandardTokenizer(reader); - ret = _CLNEW StandardFilter(ret,true); - ret = _CLNEW LowerCaseFilter(ret,true); - ret = _CLNEW StopFilter(ret,true, &stopSet); - return ret; - } -CL_NS_END2 diff --git a/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h b/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h deleted file mode 100644 index 9cce041df..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h +++ /dev/null @@ -1,47 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_analysis_standard_StandardAnalyzer -#define _lucene_analysis_standard_StandardAnalyzer - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Reader.h" -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/analysis/Analyzers.h" -#include "StandardFilter.h" -#include "StandardTokenizer.h" - - -CL_NS_DEF2(analysis,standard) - - /** Represents a standard analyzer. */ - class StandardAnalyzer : public Analyzer - { - private: - CL_NS(util)::CLSetList stopSet; - public: - /** Builds an analyzer.*/ - StandardAnalyzer(); - - /** Builds an analyzer with the given stop words. */ - StandardAnalyzer( const TCHAR** stopWords); - - ~StandardAnalyzer(); - - - /** - * Constructs a StandardTokenizer filtered by a - * StandardFilter, a LowerCaseFilter and a StopFilter. - */ - TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader) - ; - }; -CL_NS_END2 -#endif diff --git a/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp b/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp deleted file mode 100644 index 9869d2592..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "StandardFilter.h" - -#include "../AnalysisHeader.h" -#include "../Analyzers.h" -#include "StandardTokenizerConstants.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(analysis) -CL_NS_USE(util) -CL_NS_DEF2(analysis,standard) - - StandardFilter::StandardFilter(TokenStream* in, bool deleteTokenStream): - TokenFilter(in, deleteTokenStream) - { - } - - StandardFilter::~StandardFilter(){ - } - - bool StandardFilter::next(Token* t) { - if (!input->next(t)) - return false; - - TCHAR* text = t->_termText; - const int32_t textLength = t->termTextLength(); - const TCHAR* type = t->type(); - - if ( type == tokenImage[APOSTROPHE] && //we can compare the type directy since the type should always come from the tokenImage - ( textLength >= 2 && _tcsicmp(text+textLength-2, _T("'s"))==0 ) ) - { - // remove 's - text[textLength-2]=0; - t->resetTermTextLen(); - - return true; - - } else if ( type == tokenImage[ACRONYM] ) { // remove dots - int32_t j = 0; - for ( int32_t i=0;iin. - StandardFilter(TokenStream* in, bool deleteTokenStream); - - ~StandardFilter(); - - - /** Returns the next token in the stream, or NULL at EOS. - *

Removes 's from the end of words. - *

Removes dots from acronyms. - */ - bool next(Token* token); - }; -CL_NS_END2 -#endif diff --git a/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp b/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp deleted file mode 100644 index 60f9a449c..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "StandardTokenizer.h" - -CL_NS_USE(analysis) -CL_NS_USE(util) -CL_NS_DEF2(analysis,standard) - - const static TCHAR* tokenImageArray[] = { - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T("") - }; - const TCHAR** tokenImage = tokenImageArray; - - /* A bunch of shortcut macros, many of which make assumptions about variable - ** names. These macros enhance readability, not just convenience! */ - #define EOS (ch==-1 || rd->Eos()) - #define SPACE (_istspace((TCHAR)ch) != 0) - #define ALPHA (_istalpha((TCHAR)ch) != 0) - #define ALNUM (_istalnum(ch) != 0) - #define DIGIT (_istdigit(ch) != 0) - #define UNDERSCORE (ch == '_') - - #define _CJK ( (ch>=0x3040 && ch<=0x318f) || \ - (ch>=0x3300 && ch<=0x337f) || \ - (ch>=0x3400 && ch<=0x3d2d) || \ - (ch>=0x4e00 && ch<=0x9fff) || \ - (ch>=0xf900 && ch<=0xfaff) || \ - (ch>=0xac00 && ch<=0xd7af) ) //korean - - - #define DASH (ch == '-') - #define NEGATIVE_SIGN_ DASH - //#define POSITIVE_SIGN_ (ch == '+') - //#define SIGN (NEGATIVE_SIGN_ || POSITIVE_SIGN_) - - #define DOT (ch == '.') - #define DECIMAL DOT - - - //freebsd seems to have a problem with defines over multiple lines, so this has to be one long line - #define _CONSUME_AS_LONG_AS(conditionFails) while (true) { ch = readChar(); if (ch==-1 || (!(conditionFails) || str.len >= LUCENE_MAX_WORD_LEN)) { break; } str.appendChar(ch);} - - #define CONSUME_ALPHAS _CONSUME_AS_LONG_AS(ALPHA) - - #define CONSUME_DIGITS _CONSUME_AS_LONG_AS(DIGIT) - - /* otherMatches is a condition (possibly compound) under which a character - ** that's not an ALNUM or UNDERSCORE can be considered not to break the - ** span. Callers should pass false if only ALNUM/UNDERSCORE are acceptable. */ - #define CONSUME_WORD _CONSUME_AS_LONG_AS(ALNUM || UNDERSCORE) - - /* - ** Consume CJK characters - */ - #define CONSUME_CJK _CONSUME_AS_LONG_AS(_CJK) - - - /* It is considered that "nothing of value" has been read if: - ** a) The "read head" hasn't moved since specialCharPos was established. - ** or - ** b) The "read head" has moved by one character, but that character was - ** either whitespace or not among the characters found in the body of - ** a token (deliberately doesn't include the likes of '@'/'&'). */ - #define CONSUMED_NOTHING_OF_VALUE (rdPos == specialCharPos || (rdPos == specialCharPos+1 && ( SPACE || !(ALNUM || DOT || DASH || UNDERSCORE) ))) - - #define RIGHTMOST(sb) (sb.getBuffer()[sb.len-1]) - #define RIGHTMOST_IS(sb, c) (RIGHTMOST(sb) == c) - /* To discard the last character in a StringBuffer, we decrement the buffer's - ** length indicator and move the terminator back by one character. */ - #define SHAVE_RIGHTMOST(sb) (sb.getBuffer()[--sb.len] = '\0') - - //#define REMOVE_TRAILING_CHARS(sb, charMatchesCondition) { TCHAR* sbBuf = sb.getBuffer(); for (int32_t i = sb.len-1; i >= 0; i--) { TCHAR c = sbBuf[i]; if (charMatchesCondition) { sbBuf[--sb.len] = '\0'; } else {break;}}} - - /* Does StringBuffer sb contain any of the characters in string ofThese? */ - #define CONTAINS_ANY(sb, ofThese) (_tcscspn(sb.getBuffer(), _T(ofThese)) != static_cast(sb.len)) - - - StandardTokenizer::StandardTokenizer(Reader* reader): - rd(_CLNEW FastCharStream(reader)), - /* rdPos is zero-based. It starts at -1, and will advance to the first - ** position when readChar() is first called. */ - rdPos(-1), - tokenStart(-1) - { - } - - StandardTokenizer::~StandardTokenizer() { - _CLDELETE(rd); - } - - int StandardTokenizer::readChar() { - /* Increment by 1 because we're speaking in terms of characters, not - ** necessarily bytes: */ - rdPos++; - return rd->GetNext(); - } - - void StandardTokenizer::unReadChar() { - rd->UnGet(); - rdPos--; - } - - inline bool StandardTokenizer::setToken(Token* t, StringBuffer* sb, TokenTypes tokenCode) { - t->setStartOffset(tokenStart); - t->setEndOffset(tokenStart+sb->length()); - t->setType(tokenImage[tokenCode]); - sb->getBuffer(); //null terminates the buffer - t->resetTermTextLen(); - return true; - } - - bool StandardTokenizer::next(Token* t) { - int ch=0; - while (!EOS) { - ch = readChar(); - - if ( ch == 0 || ch == -1 ){ - continue; - } else if (SPACE) { - continue; - } else if (ALPHA || UNDERSCORE) { - tokenStart = rdPos; - return ReadAlphaNum(ch,t); - } else if (DIGIT || NEGATIVE_SIGN_ || DECIMAL) { - tokenStart = rdPos; - /* ReadNumber returns NULL if it fails to extract a valid number; in - ** that case, we just continue. */ - if (ReadNumber(NULL, ch,t)) - return true; - } else if ( _CJK ){ - if ( ReadCJK(ch,t) ) - return true; - } - } - return false; - } - - bool StandardTokenizer::ReadNumber(const TCHAR* previousNumber, const TCHAR prev,Token* t) { - /* previousNumber is only non-NULL if this function already read a complete - ** number in a previous recursion, yet has been asked to read additional - ** numeric segments. For example, in the HOST "192.168.1.3", "192.168" is - ** a complete number, but this function will recurse to read the "1.3", - ** generating a single HOST token "192.168.1.3". */ - t->growBuffer(LUCENE_MAX_WORD_LEN+1);//make sure token can hold the next word - StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText - TokenTypes tokenType; - bool decExhausted; - if (previousNumber != NULL) { - str.prepend(previousNumber); - tokenType = CL_NS2(analysis,standard)::HOST; - decExhausted = false; - } else { - tokenType = CL_NS2(analysis,standard)::NUM; - decExhausted = (prev == '.'); - } - if ( str.len >= LUCENE_MAX_WORD_LEN ){ - //if a number is too long, i would say there is no point - //storing it, because its going to be the wrong number anyway? - //what do people think? - return false; - } - str.appendChar(prev); - - const bool signExhausted = (prev == '-'); - int ch = prev; - - CONSUME_DIGITS; - - if (str.len < 2 /* CONSUME_DIGITS didn't find any digits. */ - && ( - (signExhausted && !DECIMAL) - || (decExhausted /* && !DIGIT is implied, since CONSUME_DIGITS stopped on a non-digit. */) - ) - ) - { - /* We have either: - ** a) a negative sign that's not followed by either digit(s) or a decimal - ** b) a decimal that's not followed by digit(s) - ** so this is not a valid number. */ - if (!EOS) { - /* Unread the character that stopped CONSUME_DIGITS: */ - unReadChar(); - } - return false; - } - - /* We just read a group of digits. Is it followed by a decimal symbol, - ** implying that there might be another group of digits available? */ - if (!EOS) { - if (DECIMAL) { - if ( str.len >= LUCENE_MAX_WORD_LEN ) - return false; //read above for rationale - str.appendChar(ch); - } else { - unReadChar(); - goto SUCCESSFULLY_EXTRACTED_NUMBER; - } - - CONSUME_DIGITS; - if (!DIGIT && !DECIMAL) { - unReadChar(); - } else if (!EOS && DECIMAL && _istdigit(rd->Peek())) { - /* We just read the fractional digit group, but it's also followed by - ** a decimal symbol and at least one more digit, so this must be a - ** HOST rather than a real number. */ - return ReadNumber(str.getBuffer(), '.',t); - } - } - - SUCCESSFULLY_EXTRACTED_NUMBER: - TCHAR rightmost = RIGHTMOST(str); - /* Don't including a trailing decimal point. */ - if (rightmost == '.') { - SHAVE_RIGHTMOST(str); - unReadChar(); - rightmost = RIGHTMOST(str); - } - /* If all we have left is a negative sign, it's not a valid number. */ - if (rightmost == '-') { - CND_PRECONDITION (str.len == 1, "Number is invalid"); - return false; - } - - return setToken(t,&str,tokenType); - } - - bool StandardTokenizer::ReadAlphaNum(const TCHAR prev, Token* t) { - t->growBuffer(LUCENE_MAX_WORD_LEN+1);//make sure token can hold the next word - StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText - if ( str.len < LUCENE_MAX_WORD_LEN ){ - str.appendChar(prev); - int ch = prev; - - CONSUME_WORD; - if (!EOS && str.len < LUCENE_MAX_WORD_LEN-1 ) { //still have space for 1 more character? - switch(ch) { /* What follows the first alphanum segment? */ - case '.': - str.appendChar('.'); - return ReadDotted(&str, CL_NS2(analysis,standard)::UNKNOWN,t); - case '\'': - str.appendChar('\''); - return ReadApostrophe(&str,t); - case '@': - str.appendChar('@'); - return ReadAt(&str,t); - case '&': - str.appendChar('&'); - return ReadCompany(&str,t); - /* default: fall through to end of this function. */ - } - } - } - return setToken(t,&str,CL_NS2(analysis,standard)::ALPHANUM); - } - - bool StandardTokenizer::ReadCJK(const TCHAR prev, Token* t) { - t->growBuffer(LUCENE_MAX_WORD_LEN+1);//make sure token can hold the next word - StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText - if ( str.len < LUCENE_MAX_WORD_LEN ){ - str.appendChar(prev); - int ch = prev; - - CONSUME_CJK; - } - return setToken(t,&str,CL_NS2(analysis,standard)::CJK); - } - - - bool StandardTokenizer::ReadDotted(StringBuffer* _str, TokenTypes forcedType, Token* t) { - const int32_t specialCharPos = rdPos; - StringBuffer& str=*_str; - - /* A segment of a "dotted" is not allowed to begin with another dot or a dash. - ** Even though hosts, e-mail addresses, etc., could have a dotted-segment - ** that begins with a dot or a dash, it's far more common in source text - ** for a pattern like "abc.--def" to be intended as two tokens. */ - int ch = rd->Peek(); - if (!(DOT || DASH)) { - bool prevWasDot; - bool prevWasDash; - if (str.len == 0) { - prevWasDot = false; - prevWasDash = false; - } else { - prevWasDot = RIGHTMOST(str) == '.'; - prevWasDash = RIGHTMOST(str) == '-'; - } - while (!EOS && str.len < LUCENE_MAX_WORD_LEN-1 ) { - ch = readChar(); - const bool dot = ch == '.'; - const bool dash = ch == '-'; - - if (!(ALNUM || UNDERSCORE || dot || dash)) { - break; - } - /* Multiple dots or dashes in succession end the token. - ** Consider the following inputs: - ** "Visit windowsupdate.microsoft.com--update today!" - ** "In the U.S.A.--yes, even there!" */ - if ((dot || dash) && (prevWasDot || prevWasDash)) { - /* We're not going to append the character we just read, in any case. - ** As to the character before it (which is currently RIGHTMOST(str)): - ** Unless RIGHTMOST(str) is a dot, in which we need to save it so the - ** acronym-versus-host detection can work, we want to get rid of it. */ - if (!prevWasDot) { - SHAVE_RIGHTMOST(str); - } - break; - } - - str.appendChar(ch); - - prevWasDot = dot; - prevWasDash = dash; - } - } - - /* There's a potential StringBuffer.append call in the code above, which - ** could cause str to reallocate its internal buffer. We must wait to - ** obtain the optimization-oriented strBuf pointer until after the initial - ** potentially realloc-triggering operations on str. - ** Because there can be other such ops much later in this function, strBuf - ** is guarded within a block to prevent its use during or after the calls - ** that would potentially invalidate it. */ - { /* Begin block-guard of strBuf */ - TCHAR* strBuf = str.getBuffer(); - - bool rightmostIsDot = RIGHTMOST_IS(str, '.'); - if (CONSUMED_NOTHING_OF_VALUE) { - /* No more alphanums available for this token; shave trailing dot, if any. */ - if (rightmostIsDot) { - SHAVE_RIGHTMOST(str); - } - /* If there are no dots remaining, this is a generic ALPHANUM. */ - if (_tcschr(strBuf, '.') == NULL) { - forcedType = CL_NS2(analysis,standard)::ALPHANUM; - } - - /* Check the token to see if it's an acronym. An acronym must have a - ** letter in every even slot and a dot in every odd slot, including the - ** last slot (for example, "U.S.A."). */ - } else if (rightmostIsDot) { - bool isAcronym = true; - const int32_t upperCheckLimit = str.len - 1; /* -1 b/c we already checked the last slot. */ - - for (int32_t i = 0; i < upperCheckLimit; i++) { - const bool even = (i % 2 == 0); - ch = strBuf[i]; - if ( (even && !ALPHA) || (!even && !DOT) ) { - isAcronym = false; - break; - } - } - if (isAcronym) { - forcedType = CL_NS2(analysis,standard)::ACRONYM; - } else { - /* If it's not an acronym, we don't want the trailing dot. */ - SHAVE_RIGHTMOST(str); - /* If there are no dots remaining, this is a generic ALPHANUM. */ - if (_tcschr(strBuf, '.') == NULL) { - forcedType = CL_NS2(analysis,standard)::ALPHANUM; - } - } - } - } /* End block-guard of strBuf */ - - if (!EOS) { - if (ch == '@' && str.len < LUCENE_MAX_WORD_LEN-1) { - str.appendChar('@'); - return ReadAt(&str,t); - } else { - unReadChar(); - } - } - - return setToken(t,&str,CL_NS2(analysis,standard)::UNKNOWN - ? forcedType : CL_NS2(analysis,standard)::HOST); - } - - bool StandardTokenizer::ReadApostrophe(StringBuffer* _str, Token* t) { - StringBuffer& str=*_str; - - TokenTypes tokenType = CL_NS2(analysis,standard)::APOSTROPHE; - const int32_t specialCharPos = rdPos; - int ch=0; - - CONSUME_ALPHAS; - if (RIGHTMOST_IS(str, '\'') || CONSUMED_NOTHING_OF_VALUE) { - /* After the apostrophe, no more alphanums were available within this - ** token; shave trailing apostrophe and revert to generic ALPHANUM. */ - SHAVE_RIGHTMOST(str); - tokenType = CL_NS2(analysis,standard)::ALPHANUM; - } - if (!EOS) { - unReadChar(); - } - - return setToken(t,&str,tokenType); - } - - bool StandardTokenizer::ReadAt(StringBuffer* str, Token* t) { - ReadDotted(str, CL_NS2(analysis,standard)::EMAIL,t); - /* JLucene grammar indicates dots/digits not allowed in company name: */ - if (!CONTAINS_ANY((*str), ".0123456789")) { - setToken(t,str,CL_NS2(analysis,standard)::COMPANY); - } - return true; - } - - bool StandardTokenizer::ReadCompany(StringBuffer* _str, Token* t) { - StringBuffer& str = *_str; - const int32_t specialCharPos = rdPos; - int ch=0; - - CONSUME_WORD; - if (CONSUMED_NOTHING_OF_VALUE) { - /* After the ampersand, no more alphanums were available within this - ** token; shave trailing ampersand and revert to ALPHANUM. */ - CND_PRECONDITION(RIGHTMOST_IS(str, '&'),"ReadCompany failed"); - SHAVE_RIGHTMOST(str); - - - return setToken(t,&str,CL_NS2(analysis,standard)::ALPHANUM); - } - if (!EOS) { - unReadChar(); - } - - return setToken(t,&str,CL_NS2(analysis,standard)::COMPANY); - } - -CL_NS_END2 diff --git a/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h b/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h deleted file mode 100644 index d4195be81..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h +++ /dev/null @@ -1,88 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_analysis_standard_StandardTokenizer -#define _lucene_analysis_standard_StandardTokenizer - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "../AnalysisHeader.h" -#include "../Analyzers.h" -#include "StandardTokenizerConstants.h" -#include "CLucene/util/StringBuffer.h" -#include "CLucene/util/FastCharStream.h" -#include "CLucene/util/Reader.h" - - -CL_NS_DEF2(analysis,standard) - -/** A grammar-based tokenizer constructed with JavaCC. - * - *

This should be a good tokenizer for most European-language documents: - * - *

    - *
  • Splits words at punctuation characters, removing punctuation. However, a - * dot that's not followed by whitespace is considered part of a token. - *
  • Splits words at hyphens, unless there's a number in the token, in which case - * the whole token is interpreted as a product number and is not split. - *
  • Recognizes email addresses and internet hostnames as one token. - *
- * - *

Many applications have specific tokenizer needs. If this tokenizer does - * not suit your application, please consider copying this source code - * directory to your project and maintaining your own grammar-based tokenizer. - */ - class StandardTokenizer: public Tokenizer { - private: - int32_t rdPos; - int32_t tokenStart; - - // Advance by one character, incrementing rdPos and returning the character. - int readChar(); - // Retreat by one character, decrementing rdPos. - void unReadChar(); - - // createToken centralizes token creation for auditing purposes. - //Token* createToken(CL_NS(util)::StringBuffer* sb, TokenTypes tokenCode); - inline bool setToken(Token* t, CL_NS(util)::StringBuffer* sb, TokenTypes tokenCode); - - bool ReadDotted(CL_NS(util)::StringBuffer* str, TokenTypes forcedType,Token* t); - - public: - CL_NS(util)::FastCharStream* rd; - - // Constructs a tokenizer for this Reader. - StandardTokenizer(CL_NS(util)::Reader* reader); - - ~StandardTokenizer(); - - /** Returns the next token in the stream, or false at end-of-stream. - * The returned token's type is set to an element of - * StandardTokenizerConstants::tokenImage. */ - bool next(Token* token); - - // Reads for number like "1"/"1234.567", or IP address like "192.168.1.2". - bool ReadNumber(const TCHAR* previousNumber, const TCHAR prev, Token* t); - - bool ReadAlphaNum(const TCHAR prev, Token* t); - - // Reads for apostrophe-containing word. - bool ReadApostrophe(CL_NS(util)::StringBuffer* str, Token* t); - - // Reads for something@... it may be a COMPANY name or a EMAIL address - bool ReadAt(CL_NS(util)::StringBuffer* str, Token* t); - - // Reads for COMPANY name like AT&T. - bool ReadCompany(CL_NS(util)::StringBuffer* str, Token* t); - - // Reads CJK characters - bool ReadCJK(const TCHAR prev, Token* t); - }; - -CL_NS_END2 -#endif diff --git a/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h b/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h deleted file mode 100644 index 3c95af45a..000000000 --- a/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h +++ /dev/null @@ -1,30 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_analysis_standard_StandardTokenizerConstants -#define _lucene_analysis_standard_StandardTokenizerConstants - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF2(analysis,standard) - enum TokenTypes { - _EOF, - UNKNOWN, - ALPHANUM, - APOSTROPHE, - ACRONYM, - COMPANY, - EMAIL, - HOST, - NUM, - CJK - }; - extern const TCHAR** tokenImage; - - CL_NS_END2 -#endif diff --git a/3rdparty/clucene/src/CLucene/config/CompilerAcc.h b/3rdparty/clucene/src/CLucene/config/CompilerAcc.h deleted file mode 100644 index 6ecd142be..000000000 --- a/3rdparty/clucene/src/CLucene/config/CompilerAcc.h +++ /dev/null @@ -1,166 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#if !defined(_lucene_COMPILER_ACC) -#define _lucene_COMPILER_ACC - -// It is internal CLucene header - DO NOT include it directly -#if !defined(_SUPPRESS_MAKE_BASED_CONFIG) -#if defined(_BUILD_FOR_QT_) -#include "fulltextsearch/qclucene-config_p.h" -#else -#include "CLucene/clucene-config.h" //make clucene-config.h file -#endif -#endif - -#if defined(_ASCII) -#undef _UCS2 -#elif defined(_UCS2) -// -#else -#define CL_CHARSET_GUESS -#endif - -//dont allow FS_MMAP if mmap is not available -#if defined(LUCENE_FS_MMAP) && !defined(_CL_HAVE_MMAP) -#error "LUCENE_FS_MMAP is defined and MMap doesn't appear to be available" -#endif - -#ifdef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS -#undef _LUCENE_DISABLE_EXCEPTIONS -#define _LUCENE_DISABLE_EXCEPTIONS - -#error "this is bad if you made it here... your compiler seems not to have try/catch blocks." -#error "maybe you could implement an alternative solution for us? :)" -#endif - -#ifndef _CL_HAVE_NAMESPACES -#define DISABLE_NAMESPACE -#endif - -#define LUCENE_DISABLE_HASHING //we could enable this, but so far test show that the hashing is slower :( - -//define the file functions -#define fileSeek lseek -#define fileSize _filelength -#define fileStat stat -#define fileHandleStat fstat -#ifdef _CL_HAVE_TELL -#define fileTell tell -#else -//ftell (and probably soon ftell64) are POSIX standard functions, but tell and -//tell64 are not, so we define fileTell in terms of fileSeek. -#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR) -#endif - -//this is needed early on so that CL_MAX_PATH can be correctly determined -//in the StdHeader.h. This was earlier causing problems with macosx. -//:: crash was due to realpath() that expects an output arguments that -//has at least the size of PATH_MAX (even if the result has a lower size) -#include - -#ifndef _CL_HAVE_WCHAR_T - typedef unsigned short wchar_t; -#endif - -#if defined(__CYGWIN__) -//cygwin seems to incorrectly define that it has wprintf??? -#undef _CL_HAVE_WPRINTF -#elif defined(__MINGW32__) -# ifndef _CL_HAVE_WINDOWS_H -# define _CL_HAVE_WINDOWS_H -# endif -#endif - - -/////////////////////////////////////////////////////////////////////////////// -//end _lucene_COMPILER_ACC -#elif !defined(_lucene_COMPILER_ACC2) -#define _lucene_COMPILER_ACC2 -//second inclusion - - //types - #if defined(_CL_HAVE_SYS_TYPES_H) - #include - #endif - #if defined(_CL_HAVE_INTTYPES_H) - #include - #elif defined(_CL_HAVE_STDINT_H) - #include - #else - #if _CL_SIZEOF_UNSIGNED_LONG_LONG==8 - typedef unsigned long long uint64_t; - typedef long long int64_t; - #elif _CL_SIZEOF_UNSIGNED_LONG==8 - typedef unsigned long uint64_t; - typedef long int64_t; - #else - #error I do not know what to use for a uint64_t. - #endif - - /* Give us an unsigned 32-bit data type. */ - #if _CL_SIZEOF_UNSIGNED_LONG==4 - typedef unsigned long uint32_t; - typedef long int32_t; - #elif _CL_SIZEOF_UNSIGNED_INT==4 - typedef unsigned int uint32_t; - typedef int int32_t; - #else - #error I do not know what to use for a uint32_t. - #endif - - /* An unsigned 8-bit data type */ - #if _CL_SIZEOF_UNSIGNED_CHAR==1 - typedef unsigned char uint8_t; - #else - #error I do not know what to use for a uint8_t. - #endif - #endif - - //second chance to fix default settings - //this must be defined later, otherwise it messes up - //the standard libraries - #if !defined(__MINGW32__) - #define _close ::close - #define _read ::read - #endif - - //now that int64_t is defined, we can define this... - #ifndef _CL_HAVE_FILELENGTH - #undef fileSize - #define fileSize lucene_filelength - int64_t lucene_filelength(int handle); - #endif - -#elif !defined(_lucene_COMPILER_ACC3) -#define _lucene_COMPILER_ACC3 - //third inclusion - - #if !defined(__MINGW32__) - //define replacements - #define O_RANDOM 0 - #undef O_BINARY - #define O_BINARY 0 - #define _S_IREAD 0444 - #define _S_IWRITE 0333 // write and execute permissions - - //some functions that are needed - not charset dependent and not tchar type functions - #define _open open - #define _write write - #define _snprintf snprintf - - //clucene uses ascii for filename interactions - #define _realpath(rel,abs) realpath(rel,abs) - #define _mkdir(x) mkdir(x,0777) - #define _unlink unlink - #else - #define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) - #endif - //also required by mingw - #define _rename rename -#endif diff --git a/3rdparty/clucene/src/CLucene/config/CompilerBcb.h b/3rdparty/clucene/src/CLucene/config/CompilerBcb.h deleted file mode 100644 index f1b423b50..000000000 --- a/3rdparty/clucene/src/CLucene/config/CompilerBcb.h +++ /dev/null @@ -1,68 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#if !defined(_lucene_COMPILER_BCB) -#define _lucene_COMPILER_BCB - -// It is internal CLucene header - DO NOT include it directly - -#include "CLucene/config/define_std.h" -#undef _CL_HAVE_STRTOLL -#undef _CL_HAVE_WCSTOLL - -#define _LUCENE_PRAGMA_ONCE -#define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning -#define LUCENE_DISABLE_HASHING -#define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment } - -#undef LUCENE_ENABLE_MEMLEAKTRACKING //it has been reported that this causes problems - -#define fileSize filelength -#define fileSeek lseek -#define fileTell tell -#define fileStat stat -#define fileHandleStat fstat - -#define O_RANDOM 0 - -//java long type -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -//java int type -typedef int int32_t; -typedef unsigned int uint32_t; - -//java byte type -typedef unsigned char uint8_t; - -//floating point type -//we are going to use qreal now -//typedef double float_t; - -//required type -typedef int intptr_t; - -#define _CL_ILONG(x) x ## L -#define _ILONGLONG(x) x ## i64 - - -#elif !defined(_lucene_COMPILER_BCB2) -#define _lucene_COMPILER_BCB2 - //second inclusion - - #define _open open - #define _timeb timeb - #define _ftime ::ftime - #define _rename rename - - #define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) - -#elif !defined(_lucene_COMPILER_BCB3) -#define _lucene_COMPILER_BCB3 - //third inclusion - -#endif diff --git a/3rdparty/clucene/src/CLucene/config/CompilerGcc.h b/3rdparty/clucene/src/CLucene/config/CompilerGcc.h deleted file mode 100644 index a9120988b..000000000 --- a/3rdparty/clucene/src/CLucene/config/CompilerGcc.h +++ /dev/null @@ -1,175 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#if !defined(_lucene_COMPILER_GCC) -#define _lucene_COMPILER_GCC - -// It is internal CLucene header - DO NOT include it directly -#if !defined(_SUPPRESS_MAKE_BASED_CONFIG) - #if defined(_BUILD_FOR_QT_) - #include "fulltextsearch/qclucene-config_p.h" - #else - #include "CLucene/clucene-config.h" //make clucene-config.h file - #endif -#endif - -#if defined(_ASCII) - #undef _UCS2 -#elif defined(_UCS2) -// -#else - #define CL_CHARSET_GUESS -#endif - -//dont allow FS_MMAP if mmap is not available -#if defined(LUCENE_FS_MMAP) && !defined(_CL_HAVE_MMAP) - #error "LUCENE_FS_MMAP is defined and MMap doesn't appear to be available" -#endif - -#ifdef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS - #undef _LUCENE_DISABLE_EXCEPTIONS - #define _LUCENE_DISABLE_EXCEPTIONS - - #error "this is bad if you made it here... your compiler seems not to have try/catch blocks." - #error "maybe you could implement an alternative solution for us? :)" -#endif - -#ifndef _CL_HAVE_NAMESPACES - #define DISABLE_NAMESPACE -#endif - -#define CL_NS_HASHING(func) __gnu_cxx::func -#define LUCENE_DISABLE_HASHING //we could enable this, but so far test show that the hashing is slower :( - -//define the file functions -#define fileSeek lseek -#define fileSize _filelength -#define fileStat stat -#define fileHandleStat fstat -#ifdef _CL_HAVE_TELL - #define fileTell tell -#else - //ftell (and probably soon ftell64) are POSIX standard functions, but tell and - //tell64 are not, so we define fileTell in terms of fileSeek. - #define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR) -#endif - -//this is needed early on so that CL_MAX_PATH can be correctly determined -//in the StdHeader.h. This was earlier causing problems with macosx. -//:: crash was due to realpath() that expects an output arguments that -//has at least the size of PATH_MAX (even if the result has a lower size) -#include - -#ifndef _CL_HAVE_WCHAR_T - typedef unsigned short wchar_t; -#endif - -#if defined(__CYGWIN__) - //cygwin seems to incorrectly define that it has wprintf??? - #undef _CL_HAVE_WPRINTF -#elif defined(__MINGW32__) - #ifndef _CL_HAVE_WINDOWS_H - #define _CL_HAVE_WINDOWS_H - #endif -#endif - - -/////////////////////////////////////////////////////////////////////////////// -//end _lucene_COMPILER_GCC1 -#elif !defined(_lucene_COMPILER_GCC2) -#define _lucene_COMPILER_GCC2 - //second inclusion - - //types - #if defined(_CL_HAVE_SYS_TYPES_H) - #include - #endif - #if defined(_CL_HAVE_INTTYPES_H) - #include - #elif defined(_CL_HAVE_STDINT_H) - #include - #else - #if _CL_SIZEOF_UNSIGNED_LONG_LONG==8 - typedef unsigned long long uint64_t; - typedef long long int64_t; - #elif _CL_SIZEOF_UNSIGNED_LONG==8 - typedef unsigned long uint64_t; - typedef long int64_t; - #else - #error I do not know what to use for a uint64_t. - #endif - - /* Give us an unsigned 32-bit data type. */ - #if _CL_SIZEOF_UNSIGNED_LONG==4 - typedef unsigned long uint32_t; - typedef long int32_t; - #elif _CL_SIZEOF_UNSIGNED_INT==4 - typedef unsigned int uint32_t; - typedef int int32_t; - #else - #error I do not know what to use for a uint32_t. - #endif - - /* An unsigned 8-bit data type */ - #if _CL_SIZEOF_UNSIGNED_CHAR==1 - typedef unsigned char uint8_t; - #else - #error I do not know what to use for a uint8_t. - #endif - #endif - - //second chance to fix default settings - //this must be defined later, otherwise it messes up - //the standard libraries - #if !defined(__MINGW32__) - #define _close ::close - #define _read ::read - #endif - - //now that int64_t is defined, we can define this... - #ifndef _CL_HAVE_FILELENGTH - #undef fileSize - #define fileSize lucene_filelength - int64_t lucene_filelength(int handle); - #endif - -#elif !defined(_lucene_COMPILER_GCC3) -#define _lucene_COMPILER_GCC3 - //third inclusion - - #if !defined(__MINGW32__) - //define replacements - #define O_RANDOM 0 - #undef O_BINARY - #define O_BINARY 0 - #define _S_IREAD 0444 - #define _S_IWRITE 0333 // write and execute permissions - - //some functions that are needed - not charset dependent and not tchar type functions - #define _open open - #define _write write - #define _snprintf snprintf - - //clucene uses ascii for filename interactions - #define _realpath(rel,abs) realpath(rel,abs) - #define _mkdir(x) mkdir(x,0777) - #define _unlink unlink - #else - #define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) - #endif - //also required by mingw - #define _rename rename -#endif - -#if defined(__GNUC__) && (defined(__sgi) || (defined(Q_OS_SOLARIS) && Q_SOLARIS_VERSION < 10)) - #undef _CL_HAVE_FLOAT_T -#endif - -#if defined(__GNUC__) && defined(Q_OS_SOLARIS) && Q_SOLARIS_VERSION < 10 - #undef _CL_HAVE_WCSTOLL -#endif diff --git a/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h b/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h deleted file mode 100644 index 0021ea368..000000000 --- a/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h +++ /dev/null @@ -1,136 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#if !defined(_lucene_COMPILER_MSVC) -#define _lucene_COMPILER_MSVC - -// It is internal CLucene header - DO NOT include it directly - -#include "CLucene/config/define_std.h" - -#if (_MSC_VER >= 1300) -//>= 7.0 - #if defined(_BUILD_FOR_QT_) - # pragma warning(disable: 4100) // disable unreferenced formal parameter - # pragma warning(disable: 4189) // disable local variable is initialized but not referenced - #endif - # pragma warning(disable: 4512) // This would be very annoying - # pragma warning(disable: 4290) // Ignore exception specification warning - # pragma warning(disable: 4250) // Ignore 'class1' : inherits 'class2::member' via dominance (e.g. in MultiReader) - // Check for STLport presence - #include - #if (_MSC_VER < 1310) || defined(_STLPORT_VERSION) - #define CL_NS_HASHING(func) std::func //the namespace is different on VC 7.0 - #else - #define CL_NS_HASHING(func) stdext::func - #endif - #define LUCENE_STATIC_CONSTANT_SYNTAX 1 - - #if _MSC_FULL_VER >= 140050320 - #define _CL_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) - #else - #define _CL_DEPRECATE_TEXT(_Text) __declspec(deprecated) - #endif - -#elif (_MSC_VER >= 1200) -//6.0 -#ifdef LUCENE_ENABLE_MEMLEAKTRACKING - #define _CLDELETE_CARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(TCHAR*,x); x=NULL;} - #define _CLDELETE_CaARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(char*,x); x=NULL;} - #define _CLDELETE_LCARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(TCHAR*,x);} - #define _CLDELETE_LCaARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(char*,x);} -#else - #define _CLDELETE_CARRAY(x) if (x!=NULL){delete[] __CONST_CAST(TCHAR*,x); x=NULL;} - #define _CLDELETE_CaARRAY(x) if (x!=NULL){delete[] __CONST_CAST(char*,x); x=NULL;} - #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete[] __CONST_CAST(TCHAR*,x);} - #define _CLDELETE_LCaARRAY(x) if (x!=NULL){delete[] __CONST_CAST(char*,x);} - -#endif - #define LUCENE_STATIC_CONSTANT_SYNTAX 2 - - # pragma warning(disable: 4786) // This would be very annoying - namespace std{ - # undef min // just in case - # undef max // just in case - - #define min(a,b) (a>b?b:a) - #define max(a,b) (a>b?a:b) - } - - //only 7.0+ has these function - #undef _CL_HAVE_LLTOA - #undef _CL_HAVE_LLTOAW - #undef _CL_HAVE_INTPTR_T - #undef _CL_HAVE_WCSTOLL - #undef _CL_HAVE_STRTOLL - #undef _CL_HAVE_HASH_MAP - #undef _CL_HAVE_HASH_SET - -#else -# error "This version of MSVC has not been tested. Please uncomment this line to try anyway. Please send a report to the Clucene's administration if successful" -#endif - -#if _MSC_VER >= 1020 - #define _LUCENE_PRAGMA_ONCE -#endif -#define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning - -//if we are compiling using single-threaded libraries, we can disable multi-threading stuff -#if !defined(_MT) && !defined(_CL_DISABLE_MULTITHREADING) - #define _CL_DISABLE_MULTITHREADING -#endif - -//msvc supports large files -#ifdef _LARGE_FILES -# define fileSize _filelengthi64 -# define fileSeek _lseeki64 -# define fileTell _telli64 -# define fileStat _stati64 -# define fileHandleStat _fstati64 -#else -# define fileSize _filelength -# define fileSeek _lseek -# define fileTell _tell -# define fileStat _stat -# define fileHandleStat _fstat -#endif - -//_rename is not defined??? -#define _rename rename - -#define CL_MAX_PATH 260 //give the windef.h value for this... -#define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) - -//java long type -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -//java int type -typedef int int32_t; -typedef unsigned int uint32_t; - -//java byte type -typedef unsigned char uint8_t; - -//floating point type -//we are going to use qreal now -//typedef double float_t; - -#define _CL_ILONG(x) x ## L -#define _ILONGLONG(x) x ## i64 - - -#elif !defined(_lucene_COMPILER_MSVC2) -#define _lucene_COMPILER_MSVC2 - //second inclusion - - -#elif !defined(_lucene_COMPILER_MSVC3) -#define _lucene_COMPILER_MSVC3 - //third inclusion -#endif diff --git a/3rdparty/clucene/src/CLucene/config/PlatformMac.h b/3rdparty/clucene/src/CLucene/config/PlatformMac.h deleted file mode 100644 index 9f6d6f421..000000000 --- a/3rdparty/clucene/src/CLucene/config/PlatformMac.h +++ /dev/null @@ -1,19 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -// It is internal CLucene header - DO NOT include it directly - -# define PATH_DELIMITER _T("/") -# define PATH_DELIMITERA "/" -# define PATH_DELIMITERC '/' - -# if (__GNUC__ < 3) && !defined( __APPLE_CC__) -// GCC strange "ignore std" mode works better if you pretend everything -// is in the std namespace, for the most part. -# define LUCENE_NO_STDC_NAMESPACE -# endif - -#undef _T //apple has something else strange here... diff --git a/3rdparty/clucene/src/CLucene/config/PlatformUnix.h b/3rdparty/clucene/src/CLucene/config/PlatformUnix.h deleted file mode 100644 index 202a894bd..000000000 --- a/3rdparty/clucene/src/CLucene/config/PlatformUnix.h +++ /dev/null @@ -1,12 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -// It is internal CLucene header - DO NOT include it directly - -# define PATH_DELIMITER _T("/") -# define PATH_DELIMITERA "/" -# define PATH_DELIMITERC '/' - diff --git a/3rdparty/clucene/src/CLucene/config/PlatformWin32.h b/3rdparty/clucene/src/CLucene/config/PlatformWin32.h deleted file mode 100644 index 8b8a1132e..000000000 --- a/3rdparty/clucene/src/CLucene/config/PlatformWin32.h +++ /dev/null @@ -1,11 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -// It is internal CLucene header - DO NOT include it directly - -# define PATH_DELIMITER _T("\\") -# define PATH_DELIMITERA "\\" -# define PATH_DELIMITERC '\\' diff --git a/3rdparty/clucene/src/CLucene/config/compiler.h b/3rdparty/clucene/src/CLucene/config/compiler.h deleted file mode 100644 index 68f93b6e4..000000000 --- a/3rdparty/clucene/src/CLucene/config/compiler.h +++ /dev/null @@ -1,259 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#if !defined(lucene_compiler_h) -#define lucene_compiler_h - -#if defined(_MBCS) || defined(_ASCII) -#undef _ASCII -#undef _UCS2 -#define _ASCII -#elif defined(_UNICODE) -#define _UCS2 -#elif !defined(_UCS2) -#define _UCS2 -#endif - -//msvc needs unicode define so that it uses unicode library -#ifdef _UCS2 -#undef _UNICODE -#define _UNICODE -#undef _ASCII -#else -#undef _UNICODE -#undef _UCS2 -#endif - - -//////////////////////////////////////////////////////////////////// -// Figure out what compiler we are using -//////////////////////////////////////////////////////////////////// - -#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__COMO__) -#define _CLCOMPILER_MSVC _MSC_VER -#endif - -#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__) -#include "CLucene/config/CompilerGcc.h" - -#elif defined(_CLCOMPILER_MSVC) -/* Microsoft Visual C++ */ -#include "CLucene/config/CompilerMsvc.h" - -#elif defined (__BORLANDC__) -#include "CLucene/config/CompilerBcb.h" - -#elif defined (__HP_aCC) -#include "CLucene/config/CompilerAcc.h" - -#else - //Unable to identify the compiler, issue error diagnostic. - //Edit to set STLport up for your compiler. - //Uncomment this next line -#error "Unable to identify the compiler, issue error diagnostic. Edit to set Lucene up for your compiler." -#include "CLucene/config/LuceneMycomp.h" -#endif /* end of compiler choice */ -//////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////// -// Now include platform specific definitions -//////////////////////////////////////////////////////////////////// - -/* Operating system recognition (basic) */ -#if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__Lynx__) || defined(hpux) || defined(__hpux) -#undef _UNIX -#define _UNIX 1 -#include "CLucene/config/PlatformUnix.h" - -#elif defined(macintosh) || defined (_MAC) || defined(__APPLE__) -#undef _MAC -#define _MAC 1 -#include "CLucene/config/PlatformMac.h" - -#elif defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__) -#undef _WIN32 -#define _WIN32 -#include "CLucene/config/PlatformWin32.h" - -#elif defined (__WIN16) || defined (WIN16) || defined (_WIN16) -#undef _WIN16 -#define _WIN16 -#error "CLucene has not been tested on this platform. Please send a report to the lucene administrators if you are able to successfully compile" -#else -#error "CLucene could not identify the platform." -#endif /* platforms */ - - - -//////////////////////////////////////////////////////////////////// -// Now we take all that we have learnt, and define some things -//////////////////////////////////////////////////////////////////// - -//lets just say that we can always do unicode! :) -#ifdef CL_CHARSET_GUESS -#define _UCS2 -#endif - -#if defined(_ASCII) -#undef _UCS2 -#elif defined(_UCS2) -#undef _ASCII -#endif - -#ifndef _LUCENE_NO_NEW_STYLE_CASTS -#define __CONST_CAST(typ,var) const_cast(var) -#define __REINTERPRET_CAST(typ,var) reinterpret_cast(var) -#else -#define __CONST_CAST(typ,var) ((typ)(var)) -#define __REINTERPRET_CAST,var) ((typ)(var)) -#endif - -#ifndef _CL_DEPRECATE_TEXT -#define _CL_DEPRECATE_TEXT(_Text) -#endif -#define _CL_DEPRECATED(_NewItem) _CL_DEPRECATE_TEXT("This function or variable has been superceded by newer library or operating system functionality. Consider using" #_NewItem "instead. See online help for details.") - - -//cnd-debug exit command -#ifndef debugFatalExit -#define debugFatalExit(ret) exit(ret) -#endif - -#ifndef _CL_ILONG -#define _CL_ILONG(x) x ## L -#endif -#ifndef _ILONGLONG -#define _ILONGLONG(x) x ## LL -#endif - -//define whats the values of item intergers *should* be. we can check this in a test -#define LUCENE_INT64_MAX_SHOULDBE _ILONGLONG(0x7FFFFFFFFFFFFFFF) -#define LUCENE_INT32_MAX_SHOULDBE 0x7FFFFFFFL -#define LUCENE_UINT8_MAX_SHOULDBE 0xff - -//maximum path length. only used for buffers that use fullpath. -//anything else should use a dynamic length. -#if defined(CL_MAX_PATH) -//do nothing... -#elif defined(PATH_MAX) -#define CL_MAX_PATH PATH_MAX -#elif defined(MAX_PATH) -#define CL_MAX_PATH MAX_PATH -#elif defined(_MAX_PATH) -#define CL_MAX_PATH _MAX_PATH -#else - #error "CL_MAX_PATH could not be determined" -#endif - -//this is the max filename... for now its just the same, -//but this could change, so we use a different name -#define CL_MAX_NAME CL_MAX_PATH -//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb. -//the above logic for CL_MAX_NAME should be correct enough to handle all file names -#define CL_MAX_DIR CL_MAX_PATH - -#ifdef _LARGE_FILES -#define LUCENE_MAX_FILELENGTH LUCENE_INT64_MAX_SHOULDBE -#else -#define LUCENE_MAX_FILELENGTH LUCENE_INT32_MAX_SHOULDBE -#endif - -//use the LUCENE_STATIC_CONSTANT_SYNTAX to determine LUCENE_STATIC_CONSTANT -#ifndef LUCENE_STATIC_CONSTANT - //autoconf is not properly detecting the correct method for this, and since there's no real big - //harm in always using an enum, we'll probably just make this the default. - /*#if LUCENE_STATIC_CONSTANT_SYNTAX == 1 - #define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment - #elif LUCENE_STATIC_CONSTANT_SYNTAX == 2*/ - #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment } - /*#else - #error "LUCENE_STATIC_CONSTANT not defined, and/or LUCENE_STATIC_CONSTANT_SYNTAX is not defined to a valid value" - #endif*/ -#endif - -//end of lucene_compiler_h -#elif !defined(lucene_compiler_h2) -#define lucene_compiler_h2 -//here we include the compiler header again, this gives the header a -//second chance at including stuff, after the main inclusions are complete - -#if defined (__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__) -#include "CLucene/config/CompilerGcc.h" - -#elif defined(_CLCOMPILER_MSVC) -/* Microsoft Visual C++ */ -#include "CLucene/config/CompilerMsvc.h" - -#elif defined __BORLANDC__ -#include "CLucene/config/CompilerBcb.h" - -#elif defined (__HP_aCC) -#include "CLucene/config/CompilerAcc.h" - -#else -//Unable to identify the compiler, issue error diagnostic. -//Edit to set STLport up for your compiler. -//Uncomment this next line -#error "Unable to identify the compiler, issue error diagnostic. Edit to set Lucene up for your compiler." -#include "CLucene/config/LuceneMycomp.h" -#endif /* end of compiler choice */ - -#ifndef _CL_HAVE_FLOAT_T -//#ifdef _CL_HAVE_LONG_DOUBLE -// long double's are not working (reported by Mark Ashworth on Solaris 64) -// typedef long double float_t; /* `float' expressions are evaluated as `long double'. */ -//#else -// we are going to use qreal now -// typedef double float_t; -//#endif -#endif - -/*todo: but need to define SIZEOF_VOID_P #if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8) -#ifndef _CL_HAVE_INTPTR_T - typedef int64_t intptr_t; -#endif -#elif (SIZEOF_VOID_P > 2 && SIZEOF_VOID_P <= 4) -# ifndef _CL_HAVE_INTPTR_T - typedef int32_t intptr_t; -# endif -#else -#error "void * is either >8 bytes or <= 2. In either case, I am confused." -#endif*/ - -#ifndef _CL_HAVE_INTPTR_T - typedef int intptr_t; -#endif - -//end of lucene_compiler_h2 -#elif !defined(lucene_compiler_h3) -#define lucene_compiler_h3 -//here we include the compiler header again, this gives the header a -//third chance at including stuff, after the main inclusions are complete - -#if defined (__GNUC__ ) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__) -#include "CLucene/config/CompilerGcc.h" - -#elif defined(_CLCOMPILER_MSVC) -/* Microsoft Visual C++ */ -#include "CLucene/config/CompilerMsvc.h" - -#elif defined __BORLANDC__ -#include "CLucene/config/CompilerBcb.h" - -#elif defined (__HP_aCC) -#include "CLucene/config/CompilerAcc.h" - -#else -//Unable to identify the compiler, issue error diagnostic. -//Edit to set STLport up for your compiler. -//Uncomment this next line -#error "Unable to identify the compiler, issue error diagnostic. Edit to set Lucene up for your compiler." -#include "CLucene/config/LuceneMycomp.h" -#endif /* end of compiler choice */ - -#endif diff --git a/3rdparty/clucene/src/CLucene/config/define_std.h b/3rdparty/clucene/src/CLucene/config/define_std.h deleted file mode 100644 index 22a079053..000000000 --- a/3rdparty/clucene/src/CLucene/config/define_std.h +++ /dev/null @@ -1,113 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef lucene_define_std -#define lucene_define_std -//define a standard list of defines. -//These defines represents a fairly complete compiler. -//Of course it is preferable to use the autoconf generated -//list, but then not all systems can do this :) - -//we support long files - 64 bit file functions -#define _LARGE_FILES - -//support namespaces -#define _CL_HAVE_NAMESPACES - -//support try/catch blocks -#define _CL_HAVE_FUNCTION_TRY_BLOCKS - -//the normal headers -#define _CL_STDC_HEADERS -#define _CL_HAVE_STDARG_H -#define _CL_HAVE_ALGORITHM -#define _CL_HAVE_FUNCTIONAL -#define _CL_HAVE_MATH_H -#define _CL_HAVE_STL -#define _CL_HAVE_HASH_MAP -#define _CL_HAVE_HASH_SET -#define _CL_HAVE_MAP -#define _CL_HAVE_SET -#define _CL_HAVE_LIST -#define _CL_HAVE_VECTOR -#define _CL_HAVE_STDEXCEPT -#define _CL_HAVE_ERRNO_H -#define _CL_HAVE_SYS_STAT_H -#define _CL_HAVE_FCNTL_H - -//character & std tchar support -#define _CL_HAVE_TCHAR_H -#ifdef _UCS2 - #define _CL_HAVE_WCTYPE_H - - #define _CL_HAVE_WCSCPY - #define _CL_HAVE_WCSNCPY - #define _CL_HAVE_WCSCAT - #define _CL_HAVE_WCSCHR - #define _CL_HAVE_WCSSTR - #define _CL_HAVE_WCSLEN - #define _CL_HAVE_WCSCMP - #define _CL_HAVE_WCSNCMP - #define _CL_HAVE_WCSCSPN -#else - #define _CL_HAVE_CTYPE_H -#endif - -//already have the normal structures -#define _CL_HAVE_FLOAT_T -#define _CL_HAVE_INTPTR_T - -//system dependant: -#define _CL_HAVE_STRING_H //could be HAVE_STRINGS_H && HAVE_STRCHR -#define _CL_HAVE_SYS_TIMEB_H -#define _CL_HAVE_TIME_H - -#if defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__) - #define _CL_HAVE_IO_H - #define _CL_HAVE_DIRECT_H - #define _CL_HAVE_WINDOWS_H -#else - #define _CL_HAVE_UNISTD_H -#endif -#ifdef UNDER_CE -#undef _CL_HAVE_SYS_TIMEB_H -#endif - -//////////////////////////////////////////////// -//now for individual functions. some compilers -//miss these, so must individually define what -//we have -//////////////////////////////////////////////// - -//string functions -#define _CL_HAVE_STRLWR -#define _CL_HAVE_WCSLWR -#define _CL_HAVE_WCSCASECMP -#define _CL_HAVE_STRCASECMP - -//formatting functions -#define _CL_HAVE_SNWPRINTF -#define _CL_HAVE_VSNWPRINTF -#define _CL_HAVE_WPRINTF -#define _CL_HAVE_SNPRINTF -#define _CL_HAVE_PRINTF - - -//conversion functions -#define _CL_HAVE_STRTOLL -#define _CL_HAVE_WCSTOLL -#define _CL_HAVE_WCSTOD -#define _CL_HAVE_LLTOA -#define _CL_HAVE_LLTOW -#define _CL_HAVE_INTPTR_T - -//these ones are not standard (msvc) -//so you will probably need to undefine -//if you are not using msvc -#define _CL_HAVE_FILELENGTH - - -#endif diff --git a/3rdparty/clucene/src/CLucene/config/gunichartables.cpp b/3rdparty/clucene/src/CLucene/config/gunichartables.cpp deleted file mode 100644 index 5463936f6..000000000 --- a/3rdparty/clucene/src/CLucene/config/gunichartables.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (C) 1999 Tom Tromey - * Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * - ************************************************ - * Also licensed with permission from Tom Tromey - * and Owen Taylor under the Apache license. - * Original location: - * http://cvs.gnome.org/viewcvs/glib/glib/guniprop.c?view=log - ************************************************ - * - * Copyright 2003-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ - -#include "CLucene/StdHeader.h" - -typedef unsigned long gunichar; -typedef unsigned short guint16; -typedef short gint16; -typedef char gchar; -typedef unsigned char guchar; - -/* These are the possible character classifications. - * See http://www.unicode.org/Public/UNIDATA/UnicodeData.txt - or http://www.unicode.org/Public/UNIDATA/UCD.html. - - todo: i think there is a new version of the unicode, which we should use. - data is licensed like this: http://www.unicode.org/copyright.html... not sure but looks apache compatible - */ -typedef enum -{ - G_UNICODE_CONTROL, - G_UNICODE_FORMAT, - G_UNICODE_UNASSIGNED, - G_UNICODE_PRIVATE_USE, - G_UNICODE_SURROGATE, - G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_LETTER, - G_UNICODE_TITLECASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_COMBINING_MARK, - G_UNICODE_ENCLOSING_MARK, - G_UNICODE_NON_SPACING_MARK, - G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_LETTER_NUMBER, - G_UNICODE_OTHER_NUMBER, - G_UNICODE_CONNECT_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_FINAL_PUNCTUATION, - G_UNICODE_INITIAL_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_SYMBOL, - G_UNICODE_LINE_SEPARATOR, - G_UNICODE_PARAGRAPH_SEPARATOR, - G_UNICODE_SPACE_SEPARATOR -} GUnicodeType; - - -#include "gunichartables.h" - -#define ATTR_TABLE(Page) (((Page) <= G_UNICODE_LAST_PAGE_PART1) \ - ? attr_table_part1[Page] \ - : attr_table_part2[(Page) - 0xe00]) - -#define ATTTABLE(Page, Char) \ - ((ATTR_TABLE(Page) == G_UNICODE_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char])) - - -#define TTYPE_PART1(Page, Char) \ - ((type_table_part1[Page] >= G_UNICODE_MAX_TABLE_INDEX) \ - ? (type_table_part1[Page] - G_UNICODE_MAX_TABLE_INDEX) \ - : (type_data[type_table_part1[Page]][Char])) - -#define TTYPE_PART2(Page, Char) \ - ((type_table_part2[Page] >= G_UNICODE_MAX_TABLE_INDEX) \ - ? (type_table_part2[Page] - G_UNICODE_MAX_TABLE_INDEX) \ - : (type_data[type_table_part2[Page]][Char])) - -#define TYPE(Char) \ - (((Char) <= G_UNICODE_LAST_CHAR_PART1) \ - ? TTYPE_PART1 ((Char) >> 8, (Char) & 0xff) \ - : (((Char) >= 0xe0000 && (Char) <= G_UNICODE_LAST_CHAR) \ - ? TTYPE_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \ - : G_UNICODE_UNASSIGNED)) - -/* Count the number of elements in an array. The array must be defined - * as such; using this with a dynamically allocated array will give - * incorrect results. - */ -#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0])) - - - - -#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) -#ifdef _LUCENE_PRAGMA_WARNINGS - #pragma message ("===== Using internal character function =====") -#else -#if !(defined(Q_OS_SOLARIS) || defined(Q_CC_MIPS)) -#warning "===== Using internal character function =====" -#endif -#endif - -bool cl_isletter(gunichar c) -{ - int t = TYPE (c); - switch(t) - { - case G_UNICODE_LOWERCASE_LETTER: return true; - case G_UNICODE_TITLECASE_LETTER: return true; - case G_UNICODE_UPPERCASE_LETTER: return true; - case G_UNICODE_MODIFIER_LETTER: return true; - case G_UNICODE_OTHER_LETTER: return true; - default: return false; - } -} - -bool cl_isalnum(gunichar c) -{ - int t = TYPE (c); - switch(t) - { - case G_UNICODE_LOWERCASE_LETTER: return true; - case G_UNICODE_TITLECASE_LETTER: return true; - case G_UNICODE_UPPERCASE_LETTER: return true; - case G_UNICODE_MODIFIER_LETTER: return true; - case G_UNICODE_OTHER_LETTER: return true; - case G_UNICODE_DECIMAL_NUMBER: return true; - case G_UNICODE_LETTER_NUMBER: return true; - case G_UNICODE_OTHER_NUMBER: return true; - default: return false; - } -} - -bool cl_isdigit(gunichar c) -{ - int t = TYPE (c); - switch(t) - { - case G_UNICODE_DECIMAL_NUMBER: return true; - case G_UNICODE_LETTER_NUMBER: return true; - case G_UNICODE_OTHER_NUMBER: return true; - default: return false; - } -} - -/** - * cl_isspace: - * @c: a Unicode character - * - * Determines whether a character is a space, tab, or line separator - * (newline, carriage return, etc.). Given some UTF-8 text, obtain a - * character value with lucene_utf8towc(). - * - * (Note: don't use this to do word breaking; you have to use - * Pango or equivalent to get word breaking right, the algorithm - * is fairly complex.) - * - * Return value: %TRUE if @c is a punctuation character - **/ -bool cl_isspace (gunichar c) -{ - switch (c) - { - /* special-case these since Unicode thinks they are not spaces */ - case '\t': - case '\n': - case '\r': - case '\f': - return true; - - default: - { - int t = TYPE ((gunichar)c); - return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR - || t == G_UNICODE_PARAGRAPH_SEPARATOR); - } - } -} - - - -/** - * cl_tolower: - * @c: a Unicode character. - * - * Converts a character to lower case. - * - * Return value: the result of converting @c to lower case. - * If @c is not an upperlower or titlecase character, - * or has no lowercase equivalent @c is returned unchanged. - **/ -TCHAR cl_tolower (TCHAR ch) -{ - gunichar c=ch; - int t = TYPE ((gunichar)c); - if (t == G_UNICODE_UPPERCASE_LETTER) - { - gunichar val = ATTTABLE (c >> 8, c & 0xff); - if (val >= 0x1000000) - { - const gchar *p = special_case_table + val - 0x1000000; - int len=0; - wchar_t ret=0; - lucene_utf8towc(&ret,p,6); -#ifdef _UCS2 - return ret; -#else - return LUCENE_OOR_CHAR(ret); -#endif - //return cl_utf8_get_char (p, &len); - }else - return val ? val : c; - }else if (t == G_UNICODE_TITLECASE_LETTER){ - unsigned int i; - for (i = 0; i < G_N_ELEMENTS (title_table); ++i) - { - if (title_table[i][0] == c) - return title_table[i][2]; - } - } - return c; -} - -/** - * cl_toupper: - * @c: a Unicode character - * - * Converts a character to uppercase. - * - * Return value: the result of converting @c to uppercase. - * If @c is not an lowercase or titlecase character, - * or has no upper case equivalent @c is returned unchanged. - **/ -TCHAR cl_toupper (TCHAR ch) -{ - gunichar c=ch; - int t = TYPE (c); - if (t == G_UNICODE_LOWERCASE_LETTER) - { - gunichar val = ATTTABLE (c >> 8, c & 0xff); - if (val >= 0x1000000) - { - const gchar *p = special_case_table + val - 0x1000000; - - wchar_t ret=0; - lucene_utf8towc(&ret,p,6); -#ifdef _UCS2 - return ret; -#else - return LUCENE_OOR_CHAR(ret); -#endif - //return lucene_utf8towc (p); - } - else - return val ? val : c; - } - else if (t == G_UNICODE_TITLECASE_LETTER) - { - unsigned int i; - for (i = 0; i < G_N_ELEMENTS (title_table); ++i) - { - if (title_table[i][0] == c) - return title_table[i][1]; - } - } - return c; -} - - - -/** - * cl_tcasefold: - * @str: a unicode string - * - * Converts a string into a form that is independent of case. The - * result will not correspond to any particular case, but can be - * compared for equality or ordered with the results of calling - * cl_tcasefold() on other strings. - * - * Note that calling cl_tcasefold() followed by g_utf8_collate() is - * only an approximation to the correct linguistic case insensitive - * ordering, though it is a fairly good one. Getting this exactly - * right would require a more sophisticated collation function that - * takes case sensitivity into account. GLib does not currently - * provide such a function. - * - * Return value: a newly allocated string, that is a - * case independent form of @str. - **/ -TCHAR cl_tcasefold(const TCHAR ch){ - int start = 0; - int end = G_N_ELEMENTS (casefold_table); - - if (ch >= casefold_table[start].ch && - ch <= casefold_table[end - 1].ch) - { - while (1) - { - int half = (start + end) / 2; - if (ch == casefold_table[half].ch) - { - wchar_t ret=0; - lucene_utf8towc(&ret,casefold_table[half].data,6); - - #ifdef _UCS2 - return ret; - #else - LUCENE_OOR_CHAR(ret) - #endif - }else if (half == start){ - break; - }else if (ch > casefold_table[half].ch){ - start = half; - }else{ - end = half; - } - } - } - return cl_tolower(ch); - -} - - -//this function was not taken from gnome -TCHAR* cl_tcscasefold( TCHAR * str, int len ) //len default is -1 -{ - TCHAR *p = str; - while ((len < 0 || p < str + len) && *p) - { - *p = cl_tcasefold(*p); - p++; - } - return str; -} -//this function was not taken from gnome -int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src){ - TCHAR f,l; - - do{ - f = cl_tcasefold( (*(dst++)) ); - l = cl_tcasefold( (*(src++)) ); - } while ( (f) && (f == l) ); - - return (int)(f - l); -} - -#endif diff --git a/3rdparty/clucene/src/CLucene/config/gunichartables.h b/3rdparty/clucene/src/CLucene/config/gunichartables.h deleted file mode 100644 index 182a87054..000000000 --- a/3rdparty/clucene/src/CLucene/config/gunichartables.h +++ /dev/null @@ -1,11264 +0,0 @@ -/* This file is automatically generated. DO NOT EDIT! - Instead, edit gen-unicode-tables.pl and re-run. */ - -#ifndef CHARTABLES_H -#define CHARTABLES_H - -#define G_UNICODE_DATA_VERSION "4.0" - -#define G_UNICODE_LAST_CHAR 0x10ffff - -#define G_UNICODE_MAX_TABLE_INDEX 10000 - -#define G_UNICODE_LAST_CHAR_PART1 0x2FAFF - -#define G_UNICODE_LAST_PAGE_PART1 762 - -static const char type_data[][256] = { - { /* page 0, index 0 */ - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, - G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_MATH_SYMBOL, G_UNICODE_FORMAT, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_OTHER_NUMBER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_FINAL_PUNCTUATION, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER - }, - { /* page 1, index 1 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER - }, - { /* page 2, index 2 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL - }, - { /* page 3, index 3 */ - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 4, index 4 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 5, index 5 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 6, index 6 */ - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_FORMAT, G_UNICODE_ENCLOSING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_LETTER - }, - { /* page 7, index 7 */ - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 9, index 8 */ - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_LETTER, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 10, index 9 */ - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 11, index 10 */ - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 12, index 11 */ - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 13, index 12 */ - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 14, index 13 */ - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 15, index 14 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 16, index 15 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 17, index 16 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 18, index 17 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER - }, - { /* page 19, index 18 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 20, index 19 */ - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER - }, - { /* page 22, index 20 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 23, index 21 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 24, index 22 */ - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_UNASSIGNED, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 25, index 23 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL - }, - { /* page 29, index 24 */ - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 30, index 25 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 31, index 26 */ - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_TITLECASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_UNASSIGNED - }, - { /* page 32, index 27 */ - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_INITIAL_PUNCTUATION, - G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_INITIAL_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_LINE_SEPARATOR, G_UNICODE_PARAGRAPH_SEPARATOR, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_OTHER_NUMBER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, - G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_ENCLOSING_MARK, - G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 33, index 28 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL - }, - { /* page 35, index 29 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 36, index 30 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER - }, - { /* page 37, index 31 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL - }, - { /* page 38, index 32 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 39, index 33 */ - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL - }, - { /* page 41, index 34 */ - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL - }, - { /* page 43, index 35 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 46, index 36 */ - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 47, index 37 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 48, index 38 */ - G_UNICODE_SPACE_SEPARATOR, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_LETTER_NUMBER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_LETTER - }, - { /* page 49, index 39 */ - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER - }, - { /* page 50, index 40 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED - }, - { /* page 77, index 41 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL - }, - { /* page 159, index 42 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 164, index 43 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 215, index 44 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 250, index 45 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 251, index 46 */ - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER - }, - { /* page 253, index 47 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 254, index 48 */ - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_DASH_PUNCTUATION, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT - }, - { /* page 255, index 49 */ - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, - G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 256, index 50 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 257, index 51 */ - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 259, index 52 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, - G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_LETTER_NUMBER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 260, index 53 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 264, index 54 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 464, index 55 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 465, index 56 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, - G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 467, index 57 */ - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 468, index 58 */ - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER - }, - { /* page 469, index 59 */ - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER - }, - { /* page 470, index 60 */ - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER - }, - { /* page 471, index 61 */ - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, - G_UNICODE_UPPERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, - G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER - }, - { /* page 678, index 62 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 762, index 63 */ - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 3584, index 64 */ - G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED - }, - { /* page 3585, index 65 */ - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 4095, index 66 */ - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - }, - { /* page 4351, index 67 */ - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, - G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_UNASSIGNED, - G_UNICODE_UNASSIGNED - } -}; - -/* U+0000 through U+2FAFF */ -static const gint16 type_table_part1[763] = { - 0 /* page 0 */, - 1 /* page 1 */, - 2 /* page 2 */, - 3 /* page 3 */, - 4 /* page 4 */, - 5 /* page 5 */, - 6 /* page 6 */, - 7 /* page 7 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 8 /* page 9 */, - 9 /* page 10 */, - 10 /* page 11 */, - 11 /* page 12 */, - 12 /* page 13 */, - 13 /* page 14 */, - 14 /* page 15 */, - 15 /* page 16 */, - 16 /* page 17 */, - 17 /* page 18 */, - 18 /* page 19 */, - 19 /* page 20 */, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 20 /* page 22 */, - 21 /* page 23 */, - 22 /* page 24 */, - 23 /* page 25 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 24 /* page 29 */, - 25 /* page 30 */, - 26 /* page 31 */, - 27 /* page 32 */, - 28 /* page 33 */, - G_UNICODE_MATH_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, - 29 /* page 35 */, - 30 /* page 36 */, - 31 /* page 37 */, - 32 /* page 38 */, - 33 /* page 39 */, - G_UNICODE_OTHER_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, - 34 /* page 41 */, - G_UNICODE_MATH_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, - 35 /* page 43 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 36 /* page 46 */, - 37 /* page 47 */, - 38 /* page 48 */, - 39 /* page 49 */, - 40 /* page 50 */, - G_UNICODE_OTHER_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 41 /* page 77 */, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 42 /* page 159 */, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 43 /* page 164 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 44 /* page 215 */, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 45 /* page 250 */, - 46 /* page 251 */, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 47 /* page 253 */, - 48 /* page 254 */, - 49 /* page 255 */, - 50 /* page 256 */, - 51 /* page 257 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 52 /* page 259 */, - 53 /* page 260 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 54 /* page 264 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 55 /* page 464 */, - 56 /* page 465 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - 57 /* page 467 */, - 58 /* page 468 */, - 59 /* page 469 */, - 60 /* page 470 */, - 61 /* page 471 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 62 /* page 678 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, - 63 /* page 762 */ -}; - -/* U+E0000 through U+10FFFF */ -static const gint16 type_table_part2[768] = { - 64 /* page 3584 */, - 65 /* page 3585 */, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - 66 /* page 4095 */, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, - 67 /* page 4351 */ -}; - -static const gunichar attr_data[][256] = { - { /* page 0, index 0 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, - 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, - 0x007a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0041, 0x0042, - 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, - 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, - 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x039c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, - 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, - 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0000, - 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x1000000, - 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, - 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, - 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0000, 0x00d8, 0x00d9, 0x00da, - 0x00db, 0x00dc, 0x00dd, 0x00de, 0x0178 - }, - { /* page 1, index 1 */ - 0x0101, 0x0100, 0x0103, 0x0102, 0x0105, 0x0104, 0x0107, 0x0106, 0x0109, - 0x0108, 0x010b, 0x010a, 0x010d, 0x010c, 0x010f, 0x010e, 0x0111, 0x0110, - 0x0113, 0x0112, 0x0115, 0x0114, 0x0117, 0x0116, 0x0119, 0x0118, 0x011b, - 0x011a, 0x011d, 0x011c, 0x011f, 0x011e, 0x0121, 0x0120, 0x0123, 0x0122, - 0x0125, 0x0124, 0x0127, 0x0126, 0x0129, 0x0128, 0x012b, 0x012a, 0x012d, - 0x012c, 0x012f, 0x012e, 0x1000007, 0x0049, 0x0133, 0x0132, 0x0135, - 0x0134, 0x0137, 0x0136, 0x0000, 0x013a, 0x0139, 0x013c, 0x013b, 0x013e, - 0x013d, 0x0140, 0x013f, 0x0142, 0x0141, 0x0144, 0x0143, 0x0146, 0x0145, - 0x0148, 0x0147, 0x1000086, 0x014b, 0x014a, 0x014d, 0x014c, 0x014f, - 0x014e, 0x0151, 0x0150, 0x0153, 0x0152, 0x0155, 0x0154, 0x0157, 0x0156, - 0x0159, 0x0158, 0x015b, 0x015a, 0x015d, 0x015c, 0x015f, 0x015e, 0x0161, - 0x0160, 0x0163, 0x0162, 0x0165, 0x0164, 0x0167, 0x0166, 0x0169, 0x0168, - 0x016b, 0x016a, 0x016d, 0x016c, 0x016f, 0x016e, 0x0171, 0x0170, 0x0173, - 0x0172, 0x0175, 0x0174, 0x0177, 0x0176, 0x00ff, 0x017a, 0x0179, 0x017c, - 0x017b, 0x017e, 0x017d, 0x0053, 0x0000, 0x0253, 0x0183, 0x0182, 0x0185, - 0x0184, 0x0254, 0x0188, 0x0187, 0x0256, 0x0257, 0x018c, 0x018b, 0x0000, - 0x01dd, 0x0259, 0x025b, 0x0192, 0x0191, 0x0260, 0x0263, 0x01f6, 0x0269, - 0x0268, 0x0199, 0x0198, 0x0000, 0x0000, 0x026f, 0x0272, 0x0220, 0x0275, - 0x01a1, 0x01a0, 0x01a3, 0x01a2, 0x01a5, 0x01a4, 0x0280, 0x01a8, 0x01a7, - 0x0283, 0x0000, 0x0000, 0x01ad, 0x01ac, 0x0288, 0x01b0, 0x01af, 0x028a, - 0x028b, 0x01b4, 0x01b3, 0x01b6, 0x01b5, 0x0292, 0x01b9, 0x01b8, 0x0000, - 0x0000, 0x01bd, 0x01bc, 0x0000, 0x01f7, 0x0000, 0x0000, 0x0000, 0x0000, - 0x01c6, 0x0000, 0x01c4, 0x01c9, 0x0000, 0x01c7, 0x01cc, 0x0000, 0x01ca, - 0x01ce, 0x01cd, 0x01d0, 0x01cf, 0x01d2, 0x01d1, 0x01d4, 0x01d3, 0x01d6, - 0x01d5, 0x01d8, 0x01d7, 0x01da, 0x01d9, 0x01dc, 0x01db, 0x018e, 0x01df, - 0x01de, 0x01e1, 0x01e0, 0x01e3, 0x01e2, 0x01e5, 0x01e4, 0x01e7, 0x01e6, - 0x01e9, 0x01e8, 0x01eb, 0x01ea, 0x01ed, 0x01ec, 0x01ef, 0x01ee, - 0x10000ad, 0x01f3, 0x0000, 0x01f1, 0x01f5, 0x01f4, 0x0195, 0x01bf, - 0x01f9, 0x01f8, 0x01fb, 0x01fa, 0x01fd, 0x01fc, 0x01ff, 0x01fe - }, - { /* page 2, index 2 */ - 0x0201, 0x0200, 0x0203, 0x0202, 0x0205, 0x0204, 0x0207, 0x0206, 0x0209, - 0x0208, 0x020b, 0x020a, 0x020d, 0x020c, 0x020f, 0x020e, 0x0211, 0x0210, - 0x0213, 0x0212, 0x0215, 0x0214, 0x0217, 0x0216, 0x0219, 0x0218, 0x021b, - 0x021a, 0x021d, 0x021c, 0x021f, 0x021e, 0x019e, 0x0000, 0x0223, 0x0222, - 0x0225, 0x0224, 0x0227, 0x0226, 0x0229, 0x0228, 0x022b, 0x022a, 0x022d, - 0x022c, 0x022f, 0x022e, 0x0231, 0x0230, 0x0233, 0x0232, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0181, 0x0186, 0x0000, 0x0189, 0x018a, 0x0000, 0x018f, - 0x0000, 0x0190, 0x0000, 0x0000, 0x0000, 0x0000, 0x0193, 0x0000, 0x0000, - 0x0194, 0x0000, 0x0000, 0x0000, 0x0000, 0x0197, 0x0196, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x019c, 0x0000, 0x0000, 0x019d, 0x0000, 0x0000, - 0x019f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x01a6, 0x0000, 0x0000, 0x01a9, 0x0000, 0x0000, 0x0000, - 0x0000, 0x01ae, 0x0000, 0x01b1, 0x01b2, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x01b7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 3, index 3 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03ac, - 0x0000, 0x03ad, 0x03ae, 0x03af, 0x0000, 0x03cc, 0x0000, 0x03cd, 0x03ce, - 0x100008f, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, - 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, - 0x03c1, 0x0000, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, - 0x03ca, 0x03cb, 0x0386, 0x0388, 0x0389, 0x038a, 0x100009e, 0x0391, - 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, - 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a3, - 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x038c, - 0x038e, 0x038f, 0x0000, 0x0392, 0x0398, 0x0000, 0x0000, 0x0000, 0x03a6, - 0x03a0, 0x0000, 0x03d9, 0x03d8, 0x03db, 0x03da, 0x03dd, 0x03dc, 0x03df, - 0x03de, 0x03e1, 0x03e0, 0x03e3, 0x03e2, 0x03e5, 0x03e4, 0x03e7, 0x03e6, - 0x03e9, 0x03e8, 0x03eb, 0x03ea, 0x03ed, 0x03ec, 0x03ef, 0x03ee, 0x039a, - 0x03a1, 0x03f9, 0x0000, 0x03b8, 0x0395, 0x0000, 0x03f8, 0x03f7, 0x03f2, - 0x03fb, 0x03fa, 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 4, index 4 */ - 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, - 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f, 0x0430, 0x0431, - 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, - 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, - 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, - 0x044d, 0x044e, 0x044f, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, - 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, - 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0400, - 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, - 0x040a, 0x040b, 0x040c, 0x040d, 0x040e, 0x040f, 0x0461, 0x0460, 0x0463, - 0x0462, 0x0465, 0x0464, 0x0467, 0x0466, 0x0469, 0x0468, 0x046b, 0x046a, - 0x046d, 0x046c, 0x046f, 0x046e, 0x0471, 0x0470, 0x0473, 0x0472, 0x0475, - 0x0474, 0x0477, 0x0476, 0x0479, 0x0478, 0x047b, 0x047a, 0x047d, 0x047c, - 0x047f, 0x047e, 0x0481, 0x0480, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x048b, 0x048a, 0x048d, 0x048c, 0x048f, 0x048e, - 0x0491, 0x0490, 0x0493, 0x0492, 0x0495, 0x0494, 0x0497, 0x0496, 0x0499, - 0x0498, 0x049b, 0x049a, 0x049d, 0x049c, 0x049f, 0x049e, 0x04a1, 0x04a0, - 0x04a3, 0x04a2, 0x04a5, 0x04a4, 0x04a7, 0x04a6, 0x04a9, 0x04a8, 0x04ab, - 0x04aa, 0x04ad, 0x04ac, 0x04af, 0x04ae, 0x04b1, 0x04b0, 0x04b3, 0x04b2, - 0x04b5, 0x04b4, 0x04b7, 0x04b6, 0x04b9, 0x04b8, 0x04bb, 0x04ba, 0x04bd, - 0x04bc, 0x04bf, 0x04be, 0x0000, 0x04c2, 0x04c1, 0x04c4, 0x04c3, 0x04c6, - 0x04c5, 0x04c8, 0x04c7, 0x04ca, 0x04c9, 0x04cc, 0x04cb, 0x04ce, 0x04cd, - 0x0000, 0x04d1, 0x04d0, 0x04d3, 0x04d2, 0x04d5, 0x04d4, 0x04d7, 0x04d6, - 0x04d9, 0x04d8, 0x04db, 0x04da, 0x04dd, 0x04dc, 0x04df, 0x04de, 0x04e1, - 0x04e0, 0x04e3, 0x04e2, 0x04e5, 0x04e4, 0x04e7, 0x04e6, 0x04e9, 0x04e8, - 0x04eb, 0x04ea, 0x04ed, 0x04ec, 0x04ef, 0x04ee, 0x04f1, 0x04f0, 0x04f3, - 0x04f2, 0x04f5, 0x04f4, 0x0000, 0x0000, 0x04f9, 0x04f8, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 5, index 5 */ - 0x0501, 0x0500, 0x0503, 0x0502, 0x0505, 0x0504, 0x0507, 0x0506, 0x0509, - 0x0508, 0x050b, 0x050a, 0x050d, 0x050c, 0x050f, 0x050e, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, - 0x0566, 0x0567, 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, - 0x056f, 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, - 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f, 0x0580, - 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0531, 0x0532, - 0x0533, 0x0534, 0x0535, 0x0536, 0x0537, 0x0538, 0x0539, 0x053a, 0x053b, - 0x053c, 0x053d, 0x053e, 0x053f, 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, - 0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054a, 0x054b, 0x054c, 0x054d, - 0x054e, 0x054f, 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, 0x0556, - 0x1000044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 6, index 6 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, - 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 9, index 7 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 10, index 8 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 11, index 9 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 12, index 10 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 13, index 11 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 14, index 12 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 15, index 13 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 16, index 14 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 19, index 15 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, - 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 23, index 16 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 24, index 17 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, - 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 25, index 18 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, - 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 30, index 19 */ - 0x1e01, 0x1e00, 0x1e03, 0x1e02, 0x1e05, 0x1e04, 0x1e07, 0x1e06, 0x1e09, - 0x1e08, 0x1e0b, 0x1e0a, 0x1e0d, 0x1e0c, 0x1e0f, 0x1e0e, 0x1e11, 0x1e10, - 0x1e13, 0x1e12, 0x1e15, 0x1e14, 0x1e17, 0x1e16, 0x1e19, 0x1e18, 0x1e1b, - 0x1e1a, 0x1e1d, 0x1e1c, 0x1e1f, 0x1e1e, 0x1e21, 0x1e20, 0x1e23, 0x1e22, - 0x1e25, 0x1e24, 0x1e27, 0x1e26, 0x1e29, 0x1e28, 0x1e2b, 0x1e2a, 0x1e2d, - 0x1e2c, 0x1e2f, 0x1e2e, 0x1e31, 0x1e30, 0x1e33, 0x1e32, 0x1e35, 0x1e34, - 0x1e37, 0x1e36, 0x1e39, 0x1e38, 0x1e3b, 0x1e3a, 0x1e3d, 0x1e3c, 0x1e3f, - 0x1e3e, 0x1e41, 0x1e40, 0x1e43, 0x1e42, 0x1e45, 0x1e44, 0x1e47, 0x1e46, - 0x1e49, 0x1e48, 0x1e4b, 0x1e4a, 0x1e4d, 0x1e4c, 0x1e4f, 0x1e4e, 0x1e51, - 0x1e50, 0x1e53, 0x1e52, 0x1e55, 0x1e54, 0x1e57, 0x1e56, 0x1e59, 0x1e58, - 0x1e5b, 0x1e5a, 0x1e5d, 0x1e5c, 0x1e5f, 0x1e5e, 0x1e61, 0x1e60, 0x1e63, - 0x1e62, 0x1e65, 0x1e64, 0x1e67, 0x1e66, 0x1e69, 0x1e68, 0x1e6b, 0x1e6a, - 0x1e6d, 0x1e6c, 0x1e6f, 0x1e6e, 0x1e71, 0x1e70, 0x1e73, 0x1e72, 0x1e75, - 0x1e74, 0x1e77, 0x1e76, 0x1e79, 0x1e78, 0x1e7b, 0x1e7a, 0x1e7d, 0x1e7c, - 0x1e7f, 0x1e7e, 0x1e81, 0x1e80, 0x1e83, 0x1e82, 0x1e85, 0x1e84, 0x1e87, - 0x1e86, 0x1e89, 0x1e88, 0x1e8b, 0x1e8a, 0x1e8d, 0x1e8c, 0x1e8f, 0x1e8e, - 0x1e91, 0x1e90, 0x1e93, 0x1e92, 0x1e95, 0x1e94, 0x10000b6, 0x10000bf, - 0x10000c8, 0x10000d1, 0x10000da, 0x1e60, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1ea1, 0x1ea0, 0x1ea3, 0x1ea2, 0x1ea5, 0x1ea4, 0x1ea7, 0x1ea6, 0x1ea9, - 0x1ea8, 0x1eab, 0x1eaa, 0x1ead, 0x1eac, 0x1eaf, 0x1eae, 0x1eb1, 0x1eb0, - 0x1eb3, 0x1eb2, 0x1eb5, 0x1eb4, 0x1eb7, 0x1eb6, 0x1eb9, 0x1eb8, 0x1ebb, - 0x1eba, 0x1ebd, 0x1ebc, 0x1ebf, 0x1ebe, 0x1ec1, 0x1ec0, 0x1ec3, 0x1ec2, - 0x1ec5, 0x1ec4, 0x1ec7, 0x1ec6, 0x1ec9, 0x1ec8, 0x1ecb, 0x1eca, 0x1ecd, - 0x1ecc, 0x1ecf, 0x1ece, 0x1ed1, 0x1ed0, 0x1ed3, 0x1ed2, 0x1ed5, 0x1ed4, - 0x1ed7, 0x1ed6, 0x1ed9, 0x1ed8, 0x1edb, 0x1eda, 0x1edd, 0x1edc, 0x1edf, - 0x1ede, 0x1ee1, 0x1ee0, 0x1ee3, 0x1ee2, 0x1ee5, 0x1ee4, 0x1ee7, 0x1ee6, - 0x1ee9, 0x1ee8, 0x1eeb, 0x1eea, 0x1eed, 0x1eec, 0x1eef, 0x1eee, 0x1ef1, - 0x1ef0, 0x1ef3, 0x1ef2, 0x1ef5, 0x1ef4, 0x1ef7, 0x1ef6, 0x1ef9, 0x1ef8, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 31, index 20 */ - 0x1f08, 0x1f09, 0x1f0a, 0x1f0b, 0x1f0c, 0x1f0d, 0x1f0e, 0x1f0f, 0x1f00, - 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, 0x1f18, 0x1f19, - 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0x0000, 0x0000, 0x1f10, 0x1f11, 0x1f12, - 0x1f13, 0x1f14, 0x1f15, 0x0000, 0x0000, 0x1f28, 0x1f29, 0x1f2a, 0x1f2b, - 0x1f2c, 0x1f2d, 0x1f2e, 0x1f2f, 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, - 0x1f25, 0x1f26, 0x1f27, 0x1f38, 0x1f39, 0x1f3a, 0x1f3b, 0x1f3c, 0x1f3d, - 0x1f3e, 0x1f3f, 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, - 0x1f37, 0x1f48, 0x1f49, 0x1f4a, 0x1f4b, 0x1f4c, 0x1f4d, 0x0000, 0x0000, - 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x0000, 0x0000, - 0x10000e3, 0x1f59, 0x10000ee, 0x1f5b, 0x10000fd, 0x1f5d, 0x100010c, - 0x1f5f, 0x0000, 0x1f51, 0x0000, 0x1f53, 0x0000, 0x1f55, 0x0000, 0x1f57, - 0x1f68, 0x1f69, 0x1f6a, 0x1f6b, 0x1f6c, 0x1f6d, 0x1f6e, 0x1f6f, 0x1f60, - 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, 0x1fba, 0x1fbb, - 0x1fc8, 0x1fc9, 0x1fca, 0x1fcb, 0x1fda, 0x1fdb, 0x1ff8, 0x1ff9, 0x1fea, - 0x1feb, 0x1ffa, 0x1ffb, 0x0000, 0x0000, 0x10001b7, 0x10001c4, 0x10001d1, - 0x10001de, 0x10001eb, 0x10001f8, 0x1000205, 0x1000212, 0x100021f, - 0x1000229, 0x1000233, 0x100023d, 0x1000247, 0x1000251, 0x100025b, - 0x1000265, 0x100026f, 0x100027c, 0x1000289, 0x1000296, 0x10002a3, - 0x10002b0, 0x10002bd, 0x10002ca, 0x10002d7, 0x10002e1, 0x10002eb, - 0x10002f5, 0x10002ff, 0x1000309, 0x1000313, 0x100031d, 0x1000327, - 0x1000334, 0x1000341, 0x100034e, 0x100035b, 0x1000368, 0x1000375, - 0x1000382, 0x100038f, 0x1000399, 0x10003a3, 0x10003ad, 0x10003b7, - 0x10003c1, 0x10003cb, 0x10003d5, 0x1fb8, 0x1fb9, 0x100041e, 0x10003df, - 0x100042b, 0x0000, 0x100011b, 0x1000466, 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, - 0x10003eb, 0x0000, 0x0399, 0x0000, 0x0000, 0x0000, 0x1000436, 0x10003f4, - 0x1000443, 0x0000, 0x1000126, 0x1000475, 0x1f72, 0x1f73, 0x1f74, 0x1f75, - 0x1000400, 0x0000, 0x0000, 0x0000, 0x1fd8, 0x1fd9, 0x1000131, 0x1000140, - 0x0000, 0x0000, 0x100014f, 0x100015a, 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, - 0x0000, 0x0000, 0x0000, 0x0000, 0x1fe8, 0x1fe9, 0x1000169, 0x1000178, - 0x1000187, 0x1fec, 0x1000192, 0x100019d, 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, - 0x1fe5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x100044e, 0x1000409, - 0x100045b, 0x0000, 0x10001ac, 0x1000484, 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, - 0x1000415, 0x0000, 0x0000, 0x0000 - }, - { /* page 33, index 21 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x03c9, 0x0000, 0x0000, 0x0000, 0x006b, 0x00e5, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 251, index 22 */ - 0x100000f, 0x1000016, 0x100001d, 0x1000024, 0x100002d, 0x1000036, - 0x100003d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x100004f, 0x100005a, 0x1000065, - 0x1000070, 0x100007b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000 - }, - { /* page 255, index 23 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, - 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff41, 0xff42, 0xff43, - 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, - 0xff4d, 0xff4e, 0xff4f, 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, - 0xff56, 0xff57, 0xff58, 0xff59, 0xff5a, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, - 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, - 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, - 0xff3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 260, index 24 */ - 0x10428, 0x10429, 0x1042a, 0x1042b, 0x1042c, 0x1042d, 0x1042e, 0x1042f, - 0x10430, 0x10431, 0x10432, 0x10433, 0x10434, 0x10435, 0x10436, 0x10437, - 0x10438, 0x10439, 0x1043a, 0x1043b, 0x1043c, 0x1043d, 0x1043e, 0x1043f, - 0x10440, 0x10441, 0x10442, 0x10443, 0x10444, 0x10445, 0x10446, 0x10447, - 0x10448, 0x10449, 0x1044a, 0x1044b, 0x1044c, 0x1044d, 0x1044e, 0x1044f, - 0x10400, 0x10401, 0x10402, 0x10403, 0x10404, 0x10405, 0x10406, 0x10407, - 0x10408, 0x10409, 0x1040a, 0x1040b, 0x1040c, 0x1040d, 0x1040e, 0x1040f, - 0x10410, 0x10411, 0x10412, 0x10413, 0x10414, 0x10415, 0x10416, 0x10417, - 0x10418, 0x10419, 0x1041a, 0x1041b, 0x1041c, 0x1041d, 0x1041e, 0x1041f, - 0x10420, 0x10421, 0x10422, 0x10423, 0x10424, 0x10425, 0x10426, 0x10427, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - }, - { /* page 471, index 25 */ - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, - 0x0009, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, - 0x0007, 0x0008, 0x0009, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, - 0x0006, 0x0007, 0x0008, 0x0009 - } -}; - -/* U+0000 through U+2FAFF */ -static const gint16 attr_table_part1[763] = { - 0 /* page 0 */, - 1 /* page 1 */, - 2 /* page 2 */, - 3 /* page 3 */, - 4 /* page 4 */, - 5 /* page 5 */, - 6 /* page 6 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 7 /* page 9 */, - 8 /* page 10 */, - 9 /* page 11 */, - 10 /* page 12 */, - 11 /* page 13 */, - 12 /* page 14 */, - 13 /* page 15 */, - 14 /* page 16 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 15 /* page 19 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 16 /* page 23 */, - 17 /* page 24 */, - 18 /* page 25 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 19 /* page 30 */, - 20 /* page 31 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 21 /* page 33 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 22 /* page 251 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 23 /* page 255 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 24 /* page 260 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 25 /* page 471 */, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX -}; - -/* U+E0000 through U+10FFFF */ -static const gint16 attr_table_part2[768] = { - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX, - 0x0000 + G_UNICODE_MAX_TABLE_INDEX -}; - -static const gunichar title_table[][3] = { - { 0x01c5, 0x01c4, 0x01c6 }, - { 0x01c8, 0x01c7, 0x01c9 }, - { 0x01cb, 0x01ca, 0x01cc }, - { 0x01f2, 0x01f1, 0x01f3 }, - { 0x1f88, 0x0000, 0x1f80 }, - { 0x1f89, 0x0000, 0x1f81 }, - { 0x1f8a, 0x0000, 0x1f82 }, - { 0x1f8b, 0x0000, 0x1f83 }, - { 0x1f8c, 0x0000, 0x1f84 }, - { 0x1f8d, 0x0000, 0x1f85 }, - { 0x1f8e, 0x0000, 0x1f86 }, - { 0x1f8f, 0x0000, 0x1f87 }, - { 0x1f98, 0x0000, 0x1f90 }, - { 0x1f99, 0x0000, 0x1f91 }, - { 0x1f9a, 0x0000, 0x1f92 }, - { 0x1f9b, 0x0000, 0x1f93 }, - { 0x1f9c, 0x0000, 0x1f94 }, - { 0x1f9d, 0x0000, 0x1f95 }, - { 0x1f9e, 0x0000, 0x1f96 }, - { 0x1f9f, 0x0000, 0x1f97 }, - { 0x1fa8, 0x0000, 0x1fa0 }, - { 0x1fa9, 0x0000, 0x1fa1 }, - { 0x1faa, 0x0000, 0x1fa2 }, - { 0x1fab, 0x0000, 0x1fa3 }, - { 0x1fac, 0x0000, 0x1fa4 }, - { 0x1fad, 0x0000, 0x1fa5 }, - { 0x1fae, 0x0000, 0x1fa6 }, - { 0x1faf, 0x0000, 0x1fa7 }, - { 0x1fbc, 0x0000, 0x1fb3 }, - { 0x1fcc, 0x0000, 0x1fc3 }, - { 0x1ffc, 0x0000, 0x1ff3 } -}; - - -/* Table of special cases for case conversion; each record contains - * First, the best single character mapping to lowercase if Lu, - * and to uppercase if Ll, followed by the output mapping for the two cases - * other than the case of the codepoint, in the order [Ll],[Lu],[Lt], - * encoded in UTF-8, separated and terminated by a null character. - */ -static const gchar special_case_table[] = { - "\x00\x53\x53\x00\x53\x73\0" /* offset 0 */ - "\x69\x69\xcc\x87\x00\xc4\xb0\0" /* offset 7 */ - "\x00\x46\x46\x00\x46\x66\0" /* offset 15 */ - "\x00\x46\x49\x00\x46\x69\0" /* offset 22 */ - "\x00\x46\x4c\x00\x46\x6c\0" /* offset 29 */ - "\x00\x46\x46\x49\x00\x46\x66\x69\0" /* offset 36 */ - "\x00\x46\x46\x4c\x00\x46\x66\x6c\0" /* offset 45 */ - "\x00\x53\x54\x00\x53\x74\0" /* offset 54 */ - "\x00\x53\x54\x00\x53\x74\0" /* offset 61 */ - "\x00\xd4\xb5\xd5\x92\x00\xd4\xb5\xd6\x82\0" /* offset 68 */ - "\x00\xd5\x84\xd5\x86\x00\xd5\x84\xd5\xb6\0" /* offset 79 */ - "\x00\xd5\x84\xd4\xb5\x00\xd5\x84\xd5\xa5\0" /* offset 90 */ - "\x00\xd5\x84\xd4\xbb\x00\xd5\x84\xd5\xab\0" /* offset 101 */ - "\x00\xd5\x8e\xd5\x86\x00\xd5\x8e\xd5\xb6\0" /* offset 112 */ - "\x00\xd5\x84\xd4\xbd\x00\xd5\x84\xd5\xad\0" /* offset 123 */ - "\x00\xca\xbc\x4e\x00\xca\xbc\x4e\0" /* offset 134 */ - "\x00\xce\x99\xcc\x88\xcc\x81\x00\xce\x99\xcc\x88\xcc\x81\0" /* offset 143 */ - "\x00\xce\xa5\xcc\x88\xcc\x81\x00\xce\xa5\xcc\x88\xcc\x81\0" /* offset 158 */ - "\x00\x4a\xcc\x8c\x00\x4a\xcc\x8c\0" /* offset 173 */ - "\x00\x48\xcc\xb1\x00\x48\xcc\xb1\0" /* offset 182 */ - "\x00\x54\xcc\x88\x00\x54\xcc\x88\0" /* offset 191 */ - "\x00\x57\xcc\x8a\x00\x57\xcc\x8a\0" /* offset 200 */ - "\x00\x59\xcc\x8a\x00\x59\xcc\x8a\0" /* offset 209 */ - "\x00\x41\xca\xbe\x00\x41\xca\xbe\0" /* offset 218 */ - "\x00\xce\xa5\xcc\x93\x00\xce\xa5\xcc\x93\0" /* offset 227 */ - "\x00\xce\xa5\xcc\x93\xcc\x80\x00\xce\xa5\xcc\x93\xcc\x80\0" /* offset 238 */ - "\x00\xce\xa5\xcc\x93\xcc\x81\x00\xce\xa5\xcc\x93\xcc\x81\0" /* offset 253 */ - "\x00\xce\xa5\xcc\x93\xcd\x82\x00\xce\xa5\xcc\x93\xcd\x82\0" /* offset 268 */ - "\x00\xce\x91\xcd\x82\x00\xce\x91\xcd\x82\0" /* offset 283 */ - "\x00\xce\x97\xcd\x82\x00\xce\x97\xcd\x82\0" /* offset 294 */ - "\x00\xce\x99\xcc\x88\xcc\x80\x00\xce\x99\xcc\x88\xcc\x80\0" /* offset 305 */ - "\x00\xce\x99\xcc\x88\xcc\x81\x00\xce\x99\xcc\x88\xcc\x81\0" /* offset 320 */ - "\x00\xce\x99\xcd\x82\x00\xce\x99\xcd\x82\0" /* offset 335 */ - "\x00\xce\x99\xcc\x88\xcd\x82\x00\xce\x99\xcc\x88\xcd\x82\0" /* offset 346 */ - "\x00\xce\xa5\xcc\x88\xcc\x80\x00\xce\xa5\xcc\x88\xcc\x80\0" /* offset 361 */ - "\x00\xce\xa5\xcc\x88\xcc\x81\x00\xce\xa5\xcc\x88\xcc\x81\0" /* offset 376 */ - "\x00\xce\xa1\xcc\x93\x00\xce\xa1\xcc\x93\0" /* offset 391 */ - "\x00\xce\xa5\xcd\x82\x00\xce\xa5\xcd\x82\0" /* offset 402 */ - "\x00\xce\xa5\xcc\x88\xcd\x82\x00\xce\xa5\xcc\x88\xcd\x82\0" /* offset 413 */ - "\x00\xce\xa9\xcd\x82\x00\xce\xa9\xcd\x82\0" /* offset 428 */ - "\xe1\xbe\x88\xe1\xbc\x88\xce\x99\x00\xe1\xbe\x88\0" /* offset 439 */ - "\xe1\xbe\x89\xe1\xbc\x89\xce\x99\x00\xe1\xbe\x89\0" /* offset 452 */ - "\xe1\xbe\x8a\xe1\xbc\x8a\xce\x99\x00\xe1\xbe\x8a\0" /* offset 465 */ - "\xe1\xbe\x8b\xe1\xbc\x8b\xce\x99\x00\xe1\xbe\x8b\0" /* offset 478 */ - "\xe1\xbe\x8c\xe1\xbc\x8c\xce\x99\x00\xe1\xbe\x8c\0" /* offset 491 */ - "\xe1\xbe\x8d\xe1\xbc\x8d\xce\x99\x00\xe1\xbe\x8d\0" /* offset 504 */ - "\xe1\xbe\x8e\xe1\xbc\x8e\xce\x99\x00\xe1\xbe\x8e\0" /* offset 517 */ - "\xe1\xbe\x8f\xe1\xbc\x8f\xce\x99\x00\xe1\xbe\x8f\0" /* offset 530 */ - "\xe1\xbe\x80\x00\xe1\xbc\x88\xce\x99\0" /* offset 543 */ - "\xe1\xbe\x81\x00\xe1\xbc\x89\xce\x99\0" /* offset 553 */ - "\xe1\xbe\x82\x00\xe1\xbc\x8a\xce\x99\0" /* offset 563 */ - "\xe1\xbe\x83\x00\xe1\xbc\x8b\xce\x99\0" /* offset 573 */ - "\xe1\xbe\x84\x00\xe1\xbc\x8c\xce\x99\0" /* offset 583 */ - "\xe1\xbe\x85\x00\xe1\xbc\x8d\xce\x99\0" /* offset 593 */ - "\xe1\xbe\x86\x00\xe1\xbc\x8e\xce\x99\0" /* offset 603 */ - "\xe1\xbe\x87\x00\xe1\xbc\x8f\xce\x99\0" /* offset 613 */ - "\xe1\xbe\x98\xe1\xbc\xa8\xce\x99\x00\xe1\xbe\x98\0" /* offset 623 */ - "\xe1\xbe\x99\xe1\xbc\xa9\xce\x99\x00\xe1\xbe\x99\0" /* offset 636 */ - "\xe1\xbe\x9a\xe1\xbc\xaa\xce\x99\x00\xe1\xbe\x9a\0" /* offset 649 */ - "\xe1\xbe\x9b\xe1\xbc\xab\xce\x99\x00\xe1\xbe\x9b\0" /* offset 662 */ - "\xe1\xbe\x9c\xe1\xbc\xac\xce\x99\x00\xe1\xbe\x9c\0" /* offset 675 */ - "\xe1\xbe\x9d\xe1\xbc\xad\xce\x99\x00\xe1\xbe\x9d\0" /* offset 688 */ - "\xe1\xbe\x9e\xe1\xbc\xae\xce\x99\x00\xe1\xbe\x9e\0" /* offset 701 */ - "\xe1\xbe\x9f\xe1\xbc\xaf\xce\x99\x00\xe1\xbe\x9f\0" /* offset 714 */ - "\xe1\xbe\x90\x00\xe1\xbc\xa8\xce\x99\0" /* offset 727 */ - "\xe1\xbe\x91\x00\xe1\xbc\xa9\xce\x99\0" /* offset 737 */ - "\xe1\xbe\x92\x00\xe1\xbc\xaa\xce\x99\0" /* offset 747 */ - "\xe1\xbe\x93\x00\xe1\xbc\xab\xce\x99\0" /* offset 757 */ - "\xe1\xbe\x94\x00\xe1\xbc\xac\xce\x99\0" /* offset 767 */ - "\xe1\xbe\x95\x00\xe1\xbc\xad\xce\x99\0" /* offset 777 */ - "\xe1\xbe\x96\x00\xe1\xbc\xae\xce\x99\0" /* offset 787 */ - "\xe1\xbe\x97\x00\xe1\xbc\xaf\xce\x99\0" /* offset 797 */ - "\xe1\xbe\xa8\xe1\xbd\xa8\xce\x99\x00\xe1\xbe\xa8\0" /* offset 807 */ - "\xe1\xbe\xa9\xe1\xbd\xa9\xce\x99\x00\xe1\xbe\xa9\0" /* offset 820 */ - "\xe1\xbe\xaa\xe1\xbd\xaa\xce\x99\x00\xe1\xbe\xaa\0" /* offset 833 */ - "\xe1\xbe\xab\xe1\xbd\xab\xce\x99\x00\xe1\xbe\xab\0" /* offset 846 */ - "\xe1\xbe\xac\xe1\xbd\xac\xce\x99\x00\xe1\xbe\xac\0" /* offset 859 */ - "\xe1\xbe\xad\xe1\xbd\xad\xce\x99\x00\xe1\xbe\xad\0" /* offset 872 */ - "\xe1\xbe\xae\xe1\xbd\xae\xce\x99\x00\xe1\xbe\xae\0" /* offset 885 */ - "\xe1\xbe\xaf\xe1\xbd\xaf\xce\x99\x00\xe1\xbe\xaf\0" /* offset 898 */ - "\xe1\xbe\xa0\x00\xe1\xbd\xa8\xce\x99\0" /* offset 911 */ - "\xe1\xbe\xa1\x00\xe1\xbd\xa9\xce\x99\0" /* offset 921 */ - "\xe1\xbe\xa2\x00\xe1\xbd\xaa\xce\x99\0" /* offset 931 */ - "\xe1\xbe\xa3\x00\xe1\xbd\xab\xce\x99\0" /* offset 941 */ - "\xe1\xbe\xa4\x00\xe1\xbd\xac\xce\x99\0" /* offset 951 */ - "\xe1\xbe\xa5\x00\xe1\xbd\xad\xce\x99\0" /* offset 961 */ - "\xe1\xbe\xa6\x00\xe1\xbd\xae\xce\x99\0" /* offset 971 */ - "\xe1\xbe\xa7\x00\xe1\xbd\xaf\xce\x99\0" /* offset 981 */ - "\xe1\xbe\xbc\xce\x91\xce\x99\x00\xe1\xbe\xbc\0" /* offset 991 */ - "\xe1\xbe\xb3\x00\xce\x91\xce\x99\0" /* offset 1003 */ - "\xe1\xbf\x8c\xce\x97\xce\x99\x00\xe1\xbf\x8c\0" /* offset 1012 */ - "\xe1\xbf\x83\x00\xce\x97\xce\x99\0" /* offset 1024 */ - "\xe1\xbf\xbc\xce\xa9\xce\x99\x00\xe1\xbf\xbc\0" /* offset 1033 */ - "\xe1\xbf\xb3\x00\xce\xa9\xce\x99\0" /* offset 1045 */ - "\x00\xe1\xbe\xba\xce\x99\x00\xe1\xbe\xba\xcd\x85\0" /* offset 1054 */ - "\x00\xce\x86\xce\x99\x00\xce\x86\xcd\x85\0" /* offset 1067 */ - "\x00\xe1\xbf\x8a\xce\x99\x00\xe1\xbf\x8a\xcd\x85\0" /* offset 1078 */ - "\x00\xce\x89\xce\x99\x00\xce\x89\xcd\x85\0" /* offset 1091 */ - "\x00\xe1\xbf\xba\xce\x99\x00\xe1\xbf\xba\xcd\x85\0" /* offset 1102 */ - "\x00\xce\x8f\xce\x99\x00\xce\x8f\xcd\x85\0" /* offset 1115 */ - "\x00\xce\x91\xcd\x82\xce\x99\x00\xce\x91\xcd\x82\xcd\x85\0" /* offset 1126 */ - "\x00\xce\x97\xcd\x82\xce\x99\x00\xce\x97\xcd\x82\xcd\x85\0" /* offset 1141 */ - "\x00\xce\xa9\xcd\x82\xce\x99\x00\xce\xa9\xcd\x82\xcd\x85\0" /* offset 1156 */ -}; - - -/* Table of casefolding cases that can't be derived by lowercasing - */ -static const struct { - guint16 ch; - gchar data[7]; -} casefold_table[] = { - { 0x00b5, "\xce\xbc" }, - { 0x00df, "\x73\x73" }, - { 0x0130, "\x69\xcc\x87" }, - { 0x0149, "\xca\xbc\x6e" }, - { 0x017f, "\x73" }, - { 0x01f0, "\x6a\xcc\x8c" }, - { 0x0345, "\xce\xb9" }, - { 0x0390, "\xce\xb9\xcc\x88\xcc\x81" }, - { 0x03b0, "\xcf\x85\xcc\x88\xcc\x81" }, - { 0x03c2, "\xcf\x83" }, - { 0x03d0, "\xce\xb2" }, - { 0x03d1, "\xce\xb8" }, - { 0x03d5, "\xcf\x86" }, - { 0x03d6, "\xcf\x80" }, - { 0x03f0, "\xce\xba" }, - { 0x03f1, "\xcf\x81" }, - { 0x03f5, "\xce\xb5" }, - { 0x0587, "\xd5\xa5\xd6\x82" }, - { 0x1e96, "\x68\xcc\xb1" }, - { 0x1e97, "\x74\xcc\x88" }, - { 0x1e98, "\x77\xcc\x8a" }, - { 0x1e99, "\x79\xcc\x8a" }, - { 0x1e9a, "\x61\xca\xbe" }, - { 0x1e9b, "\xe1\xb9\xa1" }, - { 0x1f50, "\xcf\x85\xcc\x93" }, - { 0x1f52, "\xcf\x85\xcc\x93\xcc\x80" }, - { 0x1f54, "\xcf\x85\xcc\x93\xcc\x81" }, - { 0x1f56, "\xcf\x85\xcc\x93\xcd\x82" }, - { 0x1f80, "\xe1\xbc\x80\xce\xb9" }, - { 0x1f81, "\xe1\xbc\x81\xce\xb9" }, - { 0x1f82, "\xe1\xbc\x82\xce\xb9" }, - { 0x1f83, "\xe1\xbc\x83\xce\xb9" }, - { 0x1f84, "\xe1\xbc\x84\xce\xb9" }, - { 0x1f85, "\xe1\xbc\x85\xce\xb9" }, - { 0x1f86, "\xe1\xbc\x86\xce\xb9" }, - { 0x1f87, "\xe1\xbc\x87\xce\xb9" }, - { 0x1f88, "\xe1\xbc\x80\xce\xb9" }, - { 0x1f89, "\xe1\xbc\x81\xce\xb9" }, - { 0x1f8a, "\xe1\xbc\x82\xce\xb9" }, - { 0x1f8b, "\xe1\xbc\x83\xce\xb9" }, - { 0x1f8c, "\xe1\xbc\x84\xce\xb9" }, - { 0x1f8d, "\xe1\xbc\x85\xce\xb9" }, - { 0x1f8e, "\xe1\xbc\x86\xce\xb9" }, - { 0x1f8f, "\xe1\xbc\x87\xce\xb9" }, - { 0x1f90, "\xe1\xbc\xa0\xce\xb9" }, - { 0x1f91, "\xe1\xbc\xa1\xce\xb9" }, - { 0x1f92, "\xe1\xbc\xa2\xce\xb9" }, - { 0x1f93, "\xe1\xbc\xa3\xce\xb9" }, - { 0x1f94, "\xe1\xbc\xa4\xce\xb9" }, - { 0x1f95, "\xe1\xbc\xa5\xce\xb9" }, - { 0x1f96, "\xe1\xbc\xa6\xce\xb9" }, - { 0x1f97, "\xe1\xbc\xa7\xce\xb9" }, - { 0x1f98, "\xe1\xbc\xa0\xce\xb9" }, - { 0x1f99, "\xe1\xbc\xa1\xce\xb9" }, - { 0x1f9a, "\xe1\xbc\xa2\xce\xb9" }, - { 0x1f9b, "\xe1\xbc\xa3\xce\xb9" }, - { 0x1f9c, "\xe1\xbc\xa4\xce\xb9" }, - { 0x1f9d, "\xe1\xbc\xa5\xce\xb9" }, - { 0x1f9e, "\xe1\xbc\xa6\xce\xb9" }, - { 0x1f9f, "\xe1\xbc\xa7\xce\xb9" }, - { 0x1fa0, "\xe1\xbd\xa0\xce\xb9" }, - { 0x1fa1, "\xe1\xbd\xa1\xce\xb9" }, - { 0x1fa2, "\xe1\xbd\xa2\xce\xb9" }, - { 0x1fa3, "\xe1\xbd\xa3\xce\xb9" }, - { 0x1fa4, "\xe1\xbd\xa4\xce\xb9" }, - { 0x1fa5, "\xe1\xbd\xa5\xce\xb9" }, - { 0x1fa6, "\xe1\xbd\xa6\xce\xb9" }, - { 0x1fa7, "\xe1\xbd\xa7\xce\xb9" }, - { 0x1fa8, "\xe1\xbd\xa0\xce\xb9" }, - { 0x1fa9, "\xe1\xbd\xa1\xce\xb9" }, - { 0x1faa, "\xe1\xbd\xa2\xce\xb9" }, - { 0x1fab, "\xe1\xbd\xa3\xce\xb9" }, - { 0x1fac, "\xe1\xbd\xa4\xce\xb9" }, - { 0x1fad, "\xe1\xbd\xa5\xce\xb9" }, - { 0x1fae, "\xe1\xbd\xa6\xce\xb9" }, - { 0x1faf, "\xe1\xbd\xa7\xce\xb9" }, - { 0x1fb2, "\xe1\xbd\xb0\xce\xb9" }, - { 0x1fb3, "\xce\xb1\xce\xb9" }, - { 0x1fb4, "\xce\xac\xce\xb9" }, - { 0x1fb6, "\xce\xb1\xcd\x82" }, - { 0x1fb7, "\xce\xb1\xcd\x82\xce\xb9" }, - { 0x1fbc, "\xce\xb1\xce\xb9" }, - { 0x1fbe, "\xce\xb9" }, - { 0x1fc2, "\xe1\xbd\xb4\xce\xb9" }, - { 0x1fc3, "\xce\xb7\xce\xb9" }, - { 0x1fc4, "\xce\xae\xce\xb9" }, - { 0x1fc6, "\xce\xb7\xcd\x82" }, - { 0x1fc7, "\xce\xb7\xcd\x82\xce\xb9" }, - { 0x1fcc, "\xce\xb7\xce\xb9" }, - { 0x1fd2, "\xce\xb9\xcc\x88\xcc\x80" }, - { 0x1fd3, "\xce\xb9\xcc\x88\xcc\x81" }, - { 0x1fd6, "\xce\xb9\xcd\x82" }, - { 0x1fd7, "\xce\xb9\xcc\x88\xcd\x82" }, - { 0x1fe2, "\xcf\x85\xcc\x88\xcc\x80" }, - { 0x1fe3, "\xcf\x85\xcc\x88\xcc\x81" }, - { 0x1fe4, "\xcf\x81\xcc\x93" }, - { 0x1fe6, "\xcf\x85\xcd\x82" }, - { 0x1fe7, "\xcf\x85\xcc\x88\xcd\x82" }, - { 0x1ff2, "\xe1\xbd\xbc\xce\xb9" }, - { 0x1ff3, "\xcf\x89\xce\xb9" }, - { 0x1ff4, "\xcf\x8e\xce\xb9" }, - { 0x1ff6, "\xcf\x89\xcd\x82" }, - { 0x1ff7, "\xcf\x89\xcd\x82\xce\xb9" }, - { 0x1ffc, "\xcf\x89\xce\xb9" }, - { 0x2160, "\xe2\x85\xb0" }, - { 0x2161, "\xe2\x85\xb1" }, - { 0x2162, "\xe2\x85\xb2" }, - { 0x2163, "\xe2\x85\xb3" }, - { 0x2164, "\xe2\x85\xb4" }, - { 0x2165, "\xe2\x85\xb5" }, - { 0x2166, "\xe2\x85\xb6" }, - { 0x2167, "\xe2\x85\xb7" }, - { 0x2168, "\xe2\x85\xb8" }, - { 0x2169, "\xe2\x85\xb9" }, - { 0x216a, "\xe2\x85\xba" }, - { 0x216b, "\xe2\x85\xbb" }, - { 0x216c, "\xe2\x85\xbc" }, - { 0x216d, "\xe2\x85\xbd" }, - { 0x216e, "\xe2\x85\xbe" }, - { 0x216f, "\xe2\x85\xbf" }, - { 0x24b6, "\xe2\x93\x90" }, - { 0x24b7, "\xe2\x93\x91" }, - { 0x24b8, "\xe2\x93\x92" }, - { 0x24b9, "\xe2\x93\x93" }, - { 0x24ba, "\xe2\x93\x94" }, - { 0x24bb, "\xe2\x93\x95" }, - { 0x24bc, "\xe2\x93\x96" }, - { 0x24bd, "\xe2\x93\x97" }, - { 0x24be, "\xe2\x93\x98" }, - { 0x24bf, "\xe2\x93\x99" }, - { 0x24c0, "\xe2\x93\x9a" }, - { 0x24c1, "\xe2\x93\x9b" }, - { 0x24c2, "\xe2\x93\x9c" }, - { 0x24c3, "\xe2\x93\x9d" }, - { 0x24c4, "\xe2\x93\x9e" }, - { 0x24c5, "\xe2\x93\x9f" }, - { 0x24c6, "\xe2\x93\xa0" }, - { 0x24c7, "\xe2\x93\xa1" }, - { 0x24c8, "\xe2\x93\xa2" }, - { 0x24c9, "\xe2\x93\xa3" }, - { 0x24ca, "\xe2\x93\xa4" }, - { 0x24cb, "\xe2\x93\xa5" }, - { 0x24cc, "\xe2\x93\xa6" }, - { 0x24cd, "\xe2\x93\xa7" }, - { 0x24ce, "\xe2\x93\xa8" }, - { 0x24cf, "\xe2\x93\xa9" }, - { 0xfb00, "\x66\x66" }, - { 0xfb01, "\x66\x69" }, - { 0xfb02, "\x66\x6c" }, - { 0xfb03, "\x66\x66\x69" }, - { 0xfb04, "\x66\x66\x6c" }, - { 0xfb05, "\x73\x74" }, - { 0xfb06, "\x73\x74" }, - { 0xfb13, "\xd5\xb4\xd5\xb6" }, - { 0xfb14, "\xd5\xb4\xd5\xa5" }, - { 0xfb15, "\xd5\xb4\xd5\xab" }, - { 0xfb16, "\xd5\xbe\xd5\xb6" }, - { 0xfb17, "\xd5\xb4\xd5\xad" }, -}; - -static const struct { - gunichar ch; - gunichar mirrored_ch; -} bidi_mirroring_table[] = -{ - { 0x0028, 0x0029 }, - { 0x0029, 0x0028 }, - { 0x003c, 0x003e }, - { 0x003e, 0x003c }, - { 0x005b, 0x005d }, - { 0x005d, 0x005b }, - { 0x007b, 0x007d }, - { 0x007d, 0x007b }, - { 0x00ab, 0x00bb }, - { 0x00bb, 0x00ab }, - { 0x2039, 0x203a }, - { 0x203a, 0x2039 }, - { 0x2045, 0x2046 }, - { 0x2046, 0x2045 }, - { 0x207d, 0x207e }, - { 0x207e, 0x207d }, - { 0x208d, 0x208e }, - { 0x208e, 0x208d }, - { 0x2208, 0x220b }, - { 0x2209, 0x220c }, - { 0x220a, 0x220d }, - { 0x220b, 0x2208 }, - { 0x220c, 0x2209 }, - { 0x220d, 0x220a }, - { 0x2215, 0x29f5 }, - { 0x223c, 0x223d }, - { 0x223d, 0x223c }, - { 0x2243, 0x22cd }, - { 0x2252, 0x2253 }, - { 0x2253, 0x2252 }, - { 0x2254, 0x2255 }, - { 0x2255, 0x2254 }, - { 0x2264, 0x2265 }, - { 0x2265, 0x2264 }, - { 0x2266, 0x2267 }, - { 0x2267, 0x2266 }, - { 0x2268, 0x2269 }, - { 0x2269, 0x2268 }, - { 0x226a, 0x226b }, - { 0x226b, 0x226a }, - { 0x226e, 0x226f }, - { 0x226f, 0x226e }, - { 0x2270, 0x2271 }, - { 0x2271, 0x2270 }, - { 0x2272, 0x2273 }, - { 0x2273, 0x2272 }, - { 0x2274, 0x2275 }, - { 0x2275, 0x2274 }, - { 0x2276, 0x2277 }, - { 0x2277, 0x2276 }, - { 0x2278, 0x2279 }, - { 0x2279, 0x2278 }, - { 0x227a, 0x227b }, - { 0x227b, 0x227a }, - { 0x227c, 0x227d }, - { 0x227d, 0x227c }, - { 0x227e, 0x227f }, - { 0x227f, 0x227e }, - { 0x2280, 0x2281 }, - { 0x2281, 0x2280 }, - { 0x2282, 0x2283 }, - { 0x2283, 0x2282 }, - { 0x2284, 0x2285 }, - { 0x2285, 0x2284 }, - { 0x2286, 0x2287 }, - { 0x2287, 0x2286 }, - { 0x2288, 0x2289 }, - { 0x2289, 0x2288 }, - { 0x228a, 0x228b }, - { 0x228b, 0x228a }, - { 0x228f, 0x2290 }, - { 0x2290, 0x228f }, - { 0x2291, 0x2292 }, - { 0x2292, 0x2291 }, - { 0x2298, 0x29b8 }, - { 0x22a2, 0x22a3 }, - { 0x22a3, 0x22a2 }, - { 0x22a6, 0x2ade }, - { 0x22a8, 0x2ae4 }, - { 0x22a9, 0x2ae3 }, - { 0x22ab, 0x2ae5 }, - { 0x22b0, 0x22b1 }, - { 0x22b1, 0x22b0 }, - { 0x22b2, 0x22b3 }, - { 0x22b3, 0x22b2 }, - { 0x22b4, 0x22b5 }, - { 0x22b5, 0x22b4 }, - { 0x22b6, 0x22b7 }, - { 0x22b7, 0x22b6 }, - { 0x22c9, 0x22ca }, - { 0x22ca, 0x22c9 }, - { 0x22cb, 0x22cc }, - { 0x22cc, 0x22cb }, - { 0x22cd, 0x2243 }, - { 0x22d0, 0x22d1 }, - { 0x22d1, 0x22d0 }, - { 0x22d6, 0x22d7 }, - { 0x22d7, 0x22d6 }, - { 0x22d8, 0x22d9 }, - { 0x22d9, 0x22d8 }, - { 0x22da, 0x22db }, - { 0x22db, 0x22da }, - { 0x22dc, 0x22dd }, - { 0x22dd, 0x22dc }, - { 0x22de, 0x22df }, - { 0x22df, 0x22de }, - { 0x22e0, 0x22e1 }, - { 0x22e1, 0x22e0 }, - { 0x22e2, 0x22e3 }, - { 0x22e3, 0x22e2 }, - { 0x22e4, 0x22e5 }, - { 0x22e5, 0x22e4 }, - { 0x22e6, 0x22e7 }, - { 0x22e7, 0x22e6 }, - { 0x22e8, 0x22e9 }, - { 0x22e9, 0x22e8 }, - { 0x22ea, 0x22eb }, - { 0x22eb, 0x22ea }, - { 0x22ec, 0x22ed }, - { 0x22ed, 0x22ec }, - { 0x22f0, 0x22f1 }, - { 0x22f1, 0x22f0 }, - { 0x22f2, 0x22fa }, - { 0x22f3, 0x22fb }, - { 0x22f4, 0x22fc }, - { 0x22f6, 0x22fd }, - { 0x22f7, 0x22fe }, - { 0x22fa, 0x22f2 }, - { 0x22fb, 0x22f3 }, - { 0x22fc, 0x22f4 }, - { 0x22fd, 0x22f6 }, - { 0x22fe, 0x22f7 }, - { 0x2308, 0x2309 }, - { 0x2309, 0x2308 }, - { 0x230a, 0x230b }, - { 0x230b, 0x230a }, - { 0x2329, 0x232a }, - { 0x232a, 0x2329 }, - { 0x2768, 0x2769 }, - { 0x2769, 0x2768 }, - { 0x276a, 0x276b }, - { 0x276b, 0x276a }, - { 0x276c, 0x276d }, - { 0x276d, 0x276c }, - { 0x276e, 0x276f }, - { 0x276f, 0x276e }, - { 0x2770, 0x2771 }, - { 0x2771, 0x2770 }, - { 0x2772, 0x2773 }, - { 0x2773, 0x2772 }, - { 0x2774, 0x2775 }, - { 0x2775, 0x2774 }, - { 0x27d5, 0x27d6 }, - { 0x27d6, 0x27d5 }, - { 0x27dd, 0x27de }, - { 0x27de, 0x27dd }, - { 0x27e2, 0x27e3 }, - { 0x27e3, 0x27e2 }, - { 0x27e4, 0x27e5 }, - { 0x27e5, 0x27e4 }, - { 0x27e6, 0x27e7 }, - { 0x27e7, 0x27e6 }, - { 0x27e8, 0x27e9 }, - { 0x27e9, 0x27e8 }, - { 0x27ea, 0x27eb }, - { 0x27eb, 0x27ea }, - { 0x2983, 0x2984 }, - { 0x2984, 0x2983 }, - { 0x2985, 0x2986 }, - { 0x2986, 0x2985 }, - { 0x2987, 0x2988 }, - { 0x2988, 0x2987 }, - { 0x2989, 0x298a }, - { 0x298a, 0x2989 }, - { 0x298b, 0x298c }, - { 0x298c, 0x298b }, - { 0x298d, 0x2990 }, - { 0x298e, 0x298f }, - { 0x298f, 0x298e }, - { 0x2990, 0x298d }, - { 0x2991, 0x2992 }, - { 0x2992, 0x2991 }, - { 0x2993, 0x2994 }, - { 0x2994, 0x2993 }, - { 0x2995, 0x2996 }, - { 0x2996, 0x2995 }, - { 0x2997, 0x2998 }, - { 0x2998, 0x2997 }, - { 0x29b8, 0x2298 }, - { 0x29c0, 0x29c1 }, - { 0x29c1, 0x29c0 }, - { 0x29c4, 0x29c5 }, - { 0x29c5, 0x29c4 }, - { 0x29cf, 0x29d0 }, - { 0x29d0, 0x29cf }, - { 0x29d1, 0x29d2 }, - { 0x29d2, 0x29d1 }, - { 0x29d4, 0x29d5 }, - { 0x29d5, 0x29d4 }, - { 0x29d8, 0x29d9 }, - { 0x29d9, 0x29d8 }, - { 0x29da, 0x29db }, - { 0x29db, 0x29da }, - { 0x29f5, 0x2215 }, - { 0x29f8, 0x29f9 }, - { 0x29f9, 0x29f8 }, - { 0x29fc, 0x29fd }, - { 0x29fd, 0x29fc }, - { 0x2a2b, 0x2a2c }, - { 0x2a2c, 0x2a2b }, - { 0x2a2d, 0x2a2c }, - { 0x2a2e, 0x2a2d }, - { 0x2a34, 0x2a35 }, - { 0x2a35, 0x2a34 }, - { 0x2a3c, 0x2a3d }, - { 0x2a3d, 0x2a3c }, - { 0x2a64, 0x2a65 }, - { 0x2a65, 0x2a64 }, - { 0x2a79, 0x2a7a }, - { 0x2a7a, 0x2a79 }, - { 0x2a7d, 0x2a7e }, - { 0x2a7e, 0x2a7d }, - { 0x2a7f, 0x2a80 }, - { 0x2a80, 0x2a7f }, - { 0x2a81, 0x2a82 }, - { 0x2a82, 0x2a81 }, - { 0x2a83, 0x2a84 }, - { 0x2a84, 0x2a83 }, - { 0x2a8b, 0x2a8c }, - { 0x2a8c, 0x2a8b }, - { 0x2a91, 0x2a92 }, - { 0x2a92, 0x2a91 }, - { 0x2a93, 0x2a94 }, - { 0x2a94, 0x2a93 }, - { 0x2a95, 0x2a96 }, - { 0x2a96, 0x2a95 }, - { 0x2a97, 0x2a98 }, - { 0x2a98, 0x2a97 }, - { 0x2a99, 0x2a9a }, - { 0x2a9a, 0x2a99 }, - { 0x2a9b, 0x2a9c }, - { 0x2a9c, 0x2a9b }, - { 0x2aa1, 0x2aa2 }, - { 0x2aa2, 0x2aa1 }, - { 0x2aa6, 0x2aa7 }, - { 0x2aa7, 0x2aa6 }, - { 0x2aa8, 0x2aa9 }, - { 0x2aa9, 0x2aa8 }, - { 0x2aaa, 0x2aab }, - { 0x2aab, 0x2aaa }, - { 0x2aac, 0x2aad }, - { 0x2aad, 0x2aac }, - { 0x2aaf, 0x2ab0 }, - { 0x2ab0, 0x2aaf }, - { 0x2ab3, 0x2ab4 }, - { 0x2ab4, 0x2ab3 }, - { 0x2abb, 0x2abc }, - { 0x2abc, 0x2abb }, - { 0x2abd, 0x2abe }, - { 0x2abe, 0x2abd }, - { 0x2abf, 0x2ac0 }, - { 0x2ac0, 0x2abf }, - { 0x2ac1, 0x2ac2 }, - { 0x2ac2, 0x2ac1 }, - { 0x2ac3, 0x2ac4 }, - { 0x2ac4, 0x2ac3 }, - { 0x2ac5, 0x2ac6 }, - { 0x2ac6, 0x2ac5 }, - { 0x2acd, 0x2ace }, - { 0x2ace, 0x2acd }, - { 0x2acf, 0x2ad0 }, - { 0x2ad0, 0x2acf }, - { 0x2ad1, 0x2ad2 }, - { 0x2ad2, 0x2ad1 }, - { 0x2ad3, 0x2ad4 }, - { 0x2ad4, 0x2ad3 }, - { 0x2ad5, 0x2ad6 }, - { 0x2ad6, 0x2ad5 }, - { 0x2ade, 0x22a6 }, - { 0x2ae3, 0x22a9 }, - { 0x2ae4, 0x22a8 }, - { 0x2ae5, 0x22ab }, - { 0x2aec, 0x2aed }, - { 0x2aed, 0x2aec }, - { 0x2af7, 0x2af8 }, - { 0x2af8, 0x2af7 }, - { 0x2af9, 0x2afa }, - { 0x2afa, 0x2af9 }, - { 0x3008, 0x3009 }, - { 0x3009, 0x3008 }, - { 0x300a, 0x300b }, - { 0x300b, 0x300a }, - { 0x300c, 0x300d }, - { 0x300d, 0x300c }, - { 0x300e, 0x300f }, - { 0x300f, 0x300e }, - { 0x3010, 0x3011 }, - { 0x3011, 0x3010 }, - { 0x3014, 0x3015 }, - { 0x3015, 0x3014 }, - { 0x3016, 0x3017 }, - { 0x3017, 0x3016 }, - { 0x3018, 0x3019 }, - { 0x3019, 0x3018 }, - { 0x301a, 0x301b }, - { 0x301b, 0x301a }, - { 0xff08, 0xff09 }, - { 0xff09, 0xff08 }, - { 0xff1c, 0xff1e }, - { 0xff1e, 0xff1c }, - { 0xff3b, 0xff3d }, - { 0xff3d, 0xff3b }, - { 0xff5b, 0xff5d }, - { 0xff5d, 0xff5b }, - { 0xff5f, 0xff60 }, - { 0xff60, 0xff5f }, - { 0xff62, 0xff63 }, - { 0xff63, 0xff62 } -}; - -#endif /* CHARTABLES_H */ diff --git a/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp b/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp deleted file mode 100644 index 05a63b887..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -TCHAR* lucene_i64tot( - int64_t value, /* [I] Value to be converted */ - TCHAR* str, /* [O] Destination for the converted value */ - int radix) /* [I] Number base for conversion */ -{ - uint64_t val; - int negative; - TCHAR buffer[65]; - TCHAR* pos; - int digit; - - if (value < 0 && radix == 10) { - negative = 1; - val = -value; - } else { - negative = 0; - val = value; - } /* if */ - - pos = &buffer[64]; - *pos = '\0'; - - do { - digit = val % radix; - val = val / radix; - if (digit < 10) { - *--pos = '0' + digit; - } else { - *--pos = 'a' + digit - 10; - } /* if */ - } while (val != 0L); - - if (negative) { - *--pos = '-'; - } /* if */ - - _tcsncpy(str,pos,&buffer[64] - pos + 1); //needed for unicode to work - return str; -} diff --git a/3rdparty/clucene/src/CLucene/config/repl_tchar.h b/3rdparty/clucene/src/CLucene/config/repl_tchar.h deleted file mode 100644 index ba8aef5c6..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_tchar.h +++ /dev/null @@ -1,126 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _CL_HAVE_TCHAR_H -#if defined(_UCS2) - #define TCHAR wchar_t - - //note: descriptions with * in front have replacement functions - - //formatting functions - #define _sntprintf swprintf //* make a formatted a string - #define _tprintf wprintf //* print a formatted string - - //this one has no replacement functions yet, but it is only used in the tests - #define _vsntprintf vsnwprintf //* print a formatted string using variable arguments - - //we are using the internal functions of the compiler here - //if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse - //will be replaced by internal functions - #define _istalnum iswalnum //* alpha/numeric char check - #define _istalpha iswalpha //* alpha char check - #define _istspace iswspace //* space char check - #define _istdigit iswdigit //* digit char check - #define _totlower towlower //* convert char to lower case - #define _totupper towupper //* convert char to lower case - #define _tcslwr wcslwr //* convert string to lower case - - //these are the string handling functions - //we may need to create wide-character/multi-byte replacements for these - #define _tcscpy wcscpy //copy a string to another string - #define _tcsncpy wcsncpy //copy a specified amount of one string to another string. - #define _tcscat wcscat //copy a string onto the end of the other string - #define _tcschr wcschr //find location of one character - #define _tcsstr wcsstr //find location of a string - #define _tcslen wcslen //get length of a string - #define _tcscmp wcscmp //case sensitive compare two strings - #define _tcsncmp wcsncmp //case sensitive compare two strings - #define _tcscspn wcscspn //location of any of a set of character in a string - - #ifdef _CL_HAVE_WCSICMP - #define _tcsicmp wcsicmp //* case insensitive compare two string - #else - #define _tcsicmp wcscasecmp //* case insensitive compare two string - #endif - - //conversion functions - #define _tcstod wcstod //convert a string to a double - #ifdef _PA_RISC - #define _tcstoi64 __wcstoll //* convers a string to an 64bit bit integer - #else - #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer - #endif - #define _i64tot lltow //* converts a 64 bit integer to a string (with base) - -#else //if defined(_ASCII) - #define TCHAR char - - //formatting functions - #define _sntprintf snprintf - #define _tprintf printf - #define _vsntprintf vsnprintf - - //we are using the internal functions of the compiler here - //if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse - //will be replaced by internal functions - #define _istalnum isalnum - #define _istalpha isalpha - #define _istspace isspace - #define _istdigit isdigit - #define _totlower tolower - #define _totupper toupper - #define _tcslwr strlwr - - //these are the string handling functions - #define _tcscpy strcpy - #define _tcsncpy strncpy - #define _tcscat strcat - #define _tcschr strchr - #define _tcsstr strstr - #define _tcslen strlen - #define _tcscmp strcmp - #define _tcsncmp strncmp - #define _tcsicmp strcasecmp - #define _tcscspn strcspn - - //converstion methods - #define _tcstod strtod - #define _tcstoi64 strtoll - #define _i64tot lltoa -#endif -#else //HAVE_TCHAR_H - #include - -#ifdef UNDER_CE -#include -#define _i64tot i64tot -inline TCHAR* i64tot(__int64 value, TCHAR* str, int radix) -{ - QT_USE_NAMESPACE - _tcscpy(str, (TCHAR *) QString::number(value, radix).utf16()); - return str; -} - -#define _tcstoi64 tcstoi64 -inline __int64 tcstoi64(const TCHAR *nptr, TCHAR **endptr, int base) -{ - QT_USE_NAMESPACE - bool ok; - return QString::fromUtf16((ushort*) nptr).toInt(&ok, base); -} - -#endif - - //some tchar headers miss these... - #ifndef _tcstoi64 - #if defined(_UCS2) - #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer - #else - #define _tcstoi64 strtoll - #endif - #endif - -#endif //HAVE_TCHAR_H diff --git a/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp b/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp deleted file mode 100644 index 1bee7b7a6..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -#include "CLucene/StdHeader.h" - -int lucene_tcscasecmp(const TCHAR * sa, const TCHAR * sb){ - TCHAR ca,cb; - if (sa == sb) - return 0; - - do{ - ca = _totlower( (*(sa++)) ); - cb = _totlower( (*(sb++)) ); - } while ( ca != L'\0' && (ca == cb) ); - - return (int)(ca - cb); -} diff --git a/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp b/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp deleted file mode 100644 index 2ae6abca4..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -#include "CLucene/StdHeader.h" - -TCHAR* lucene_tcslwr( TCHAR* str ) -{ - TCHAR* ret = str; - for ( ; *str; str++) *str = _totlower(*str); - return ret; -} diff --git a/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp b/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp deleted file mode 100644 index 1fd4ca770..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -#include "CLucene/StdHeader.h" - -#ifndef _ASCII -double lucene_tcstod(const TCHAR *value, TCHAR **end){ - int32_t len = _tcslen(value)+1; - char* avalue=_CL_NEWARRAY(char,len); - char* aend=NULL; - STRCPY_TtoA(avalue,value,len); - - double ret = strtod(avalue,&aend); - *end=(TCHAR*)value+(aend-avalue); - _CLDELETE_CaARRAY(avalue); - - return ret; -} -#endif diff --git a/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp b/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp deleted file mode 100644 index 246d66c80..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -#include "CLucene/StdHeader.h" - -int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix){ - #define LUCENE_TCSTOI64_RADIX(x,r) ((x>=_T('0') && x<=_T('9'))?x-_T('0'):((x>=_T('a') && x<=_T('z'))?x-_T('a')+10:((x>=_T('A') && x<=_T('Z'))?x-_T('A')+10:1000))) - - if (radix < 2 || radix > 36) - return 0; - - /* Skip white space. */ - while (_istspace (*str)) - ++str; - - int sign=1; - if ( str[0] == _T('+') ) - str++; - else if ( str[0] == _T('-') ){ - sign = -1; - str++; - } - - *end=(TCHAR*)str; - long r = -1; - while ( (r=LUCENE_TCSTOI64_RADIX(*end[0],radix)) >=0 && r=str;p-- ){ - int i=LUCENE_TCSTOI64_RADIX(p[0],radix); - if ( pos == 0 ) - ret=i; - else - ret += (int64_t)pow((qreal)radix,(qreal)pos) * i; //todo: might be quicker with a different pow overload - - pos++; - } - return sign*ret; -} diff --git a/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp b/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp deleted file mode 100644 index 62cecb78b..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CLucene/util/StringBuffer.h" - -#ifdef __CL_INCLUDE_TPRINTF - -CL_NS_USE(util) - -//print a variable argument to a stream -//currently special number formatting is not supported. it is very minimalistic -void lucene_vfnwprintf(StringBuffer* buffer, size_t count, const wchar_t * format, va_list& valist){ - const wchar_t *iter = format; - StringBuffer* tmp = NULL; - if ( buffer == NULL ) - tmp = _CLNEW StringBuffer; - else - tmp = buffer; - - while (*iter) - { - while (*iter && *iter != '%') - { - tmp->appendChar(*iter++); - } - if (*iter == '%') - { - if (iter[1] == '%') - { - //just print a % - tmp->appendChar('%'); - iter += 2; - continue; - } - - iter++; - switch (*iter) - { - case 's': - { - //todo: this is faulty. it doesn't heed count - - //print a string or null - TCHAR *wstr = va_arg(valist, TCHAR *); - if ( !wstr ) - wstr = _T("(null)"); - - tmp->append(wstr); - iter++; - break; - } - - case 'c': - tmp->appendChar((TCHAR)va_arg(valist, int)); - iter++; - break; - - default: - { - //todo: this is faulty. it doesn't heed count - - if (*iter == 'p') - tmp->appendInt((int32_t)va_arg(valist, long)); - else - { - if (*iter == 'a' || *iter == 'A' || - *iter == 'e' || *iter == 'E' || - *iter == 'f' || *iter == 'F' || - *iter == 'g' || *iter == 'G') - tmp->appendFloat((qreal)va_arg(valist, double),8); - else if (*iter == 'd' || *iter == 'i' ){ - tmp->appendInt((int32_t)va_arg(valist, int)); - }else if (*iter == 'l' ){ - TCHAR b[100]; - _i64tot((int64_t)va_arg(valist, int64_t),b,10); - tmp->append(b); - }/*else{ - TCHAR b[100]; - _i64tot((int64_t)va_arg(valist, void*),b,10); - tmp->append(b); - }*/ - } - iter++; - break; - } - } - } - } - - - if ( buffer == NULL ){ - //we are supposed to be writing to the console -#ifdef _UCS2 - TCHAR* pointer = tmp->getBuffer(); - char ob[MB_LEN_MAX]; - size_t v; - size_t len = tmp->length(); - for (size_t i=0;i 0 ){ - ob[v]='\0'; - fputs(ob,stdout); - } - pointer++; - } - - -#else - fputs(tmp->getBuffer(),stdout); -#endif - _CLDELETE(tmp); - } -} - -//print a list of arguments to a string -int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...){ - va_list ap; - va_start(ap, format); - StringBuffer buffer; - lucene_vfnwprintf(&buffer,count,format,ap); - va_end(ap); - - size_t ret = min(count,(size_t)(buffer.length()+1)); - _tcsncpy(strbuf,buffer.getBuffer(),ret); - return ret; -} - -//print a list of arguments to the stdout -void lucene_wprintf(const wchar_t * format, ...){ - va_list ap; - va_start(ap, format); - lucene_vfnwprintf(NULL,LUCENE_INT32_MAX_SHOULDBE,format,ap); - va_end(ap); -} - -//print a variable argument to a string -int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap){ - StringBuffer buffer; - lucene_vfnwprintf(&buffer,count,format,ap); - int ret = min((int32_t)count,buffer.length()+1); - _tcsncpy(strbuf,buffer.getBuffer(),ret); - return ret; -} - -#endif //__CL_INCLUDE_TPRINTF diff --git a/3rdparty/clucene/src/CLucene/config/repl_wchar.h b/3rdparty/clucene/src/CLucene/config/repl_wchar.h deleted file mode 100644 index 3e05c311c..000000000 --- a/3rdparty/clucene/src/CLucene/config/repl_wchar.h +++ /dev/null @@ -1,121 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_repl_wchar_h -#define _lucene_repl_wchar_h - -#ifdef _UCS2 - -#ifndef _CL_HAVE_WCSCPY - //copy a string to another string - #error wcscpy is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSNCPY - //copy a specified amount of one string to another string. - #error wcsncpy is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSCAT - //copy a string onto the end of the other string - #error wcscat is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSCHR - //find location of one character - #error wcschr is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSSTR - //find location of a string - #error wcspy is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSLEN - //get length of a string - #error wcslen is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSCMP - //case sensitive compare two strings - #error wcscmp is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSNCMP - //case sensitive compare two strings of a specified length - #error wcsncmp is not defined, and a licensed replacement has not been written yet -#endif - -#ifndef _CL_HAVE_WCSCSPN - //Return the length of the maximum initial segment - //of WCS which contains only wide-characters not in REJECT. - #error wcscspn is not defined, and a licensed replacement has not been written yet -#endif - -#endif //_UCS2 - -//string function replacements -#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_WCSCASECMP)) || (defined(_ASCII) && !defined(_CL_HAVE_STRCASECMP)) - int lucene_tcscasecmp(const TCHAR *, const TCHAR *); - #undef _tcsicmp - #define _tcsicmp lucene_tcscasecmp -#endif -#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_WCSLWR)) || (defined(_ASCII) && !defined(_CL_HAVE_STRLWR)) - TCHAR* lucene_tcslwr( TCHAR* str ); - #undef _tcslwr - #define _tcslwr lucene_tcslwr -#endif - -//conversion functions -#if (defined(_ASCII) && !defined(_CL_HAVE_LLTOA)) || (defined(_UCS2) && !defined(_CL_HAVE_LLTOW)) - TCHAR* lucene_i64tot( int64_t value, TCHAR* str, int radix); - #undef _i64tot - #define _i64tot lucene_i64tot -#endif -#if (defined(_UCS2) && !defined(_CL_HAVE_WCSTOLL)) || (defined(_ASCII) && !defined(_CL_HAVE_STRTOLL)) - int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix); - #undef _tcstoi64 - #define _tcstoi64 lucene_tcstoi64 -#endif -#if defined(_UCS2) && !defined(_CL_HAVE_WCSTOD) - double lucene_tcstod(const TCHAR *value, TCHAR **end); - #undef _tcstod - #define _tcstod lucene_tcstod -#endif - -//printf functions -#if defined(_UCS2) && (!defined(_CL_HAVE_SNWPRINTF) || defined(_CL_HAVE_SWPRINTF_BUG) ) - #undef _sntprintf - #define _sntprintf lucene_snwprintf - int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...); - - #ifndef __CL_INCLUDE_TPRINTF - #define __CL_INCLUDE_TPRINTF - #endif -#endif -#if defined(_UCS2) && !defined(_CL_HAVE_WPRINTF) - #undef _tprintf - #define _tprintf lucene_wprintf - void lucene_wprintf(const wchar_t * format, ...); - - #ifndef __CL_INCLUDE_TPRINTF - #define __CL_INCLUDE_TPRINTF - #endif -#endif -#if defined(_UCS2) && (!defined(_CL_HAVE_VSNWPRINTF) || defined(_CL_HAVE_SWPRINTF_BUG) ) - #undef _vsntprintf - #define _vsntprintf lucene_vsnwprintf - int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap); - - #ifndef __CL_INCLUDE_TPRINTF - #define __CL_INCLUDE_TPRINTF - #endif -#endif - -//todo: if _CL_HAVE_SNPRINTF_BUG fails(snprintf overflow),we should use our own -//function. but we don't have it currently, and our functions are dubious anyway... - -#endif //end of _lucene_repl_wchar_h diff --git a/3rdparty/clucene/src/CLucene/config/threadCSection.h b/3rdparty/clucene/src/CLucene/config/threadCSection.h deleted file mode 100644 index ab1842051..000000000 --- a/3rdparty/clucene/src/CLucene/config/threadCSection.h +++ /dev/null @@ -1,71 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -//NOTE: do not include this file directly, it is included from lucene internally. - -#ifndef lucene_config_threadCSection_h -#define lucene_config_threadCSection_h -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(util) - - #if !defined(LUCENE_USE_WINDOWS_H) && !defined(_WINDOWS_) && !defined(__MINGW32__) - //we have not explicity included windows.h and windows.h has - //not been included (check _WINDOWS_), then we must define - //our own definitions to the thread locking functions: - struct CRITICAL_SECTION - { - struct critical_section_debug * DebugInfo; - long LockCount; - long RecursionCount; - void * OwningThread; - void * LockSemaphore; - #if defined(_WIN64) - unsigned __int64 SpinCount; - #else - unsigned long SpinCount; - #endif - }; - #endif - - ///a windows implementation of the lock mutex - ///todo: boost has a InterlockedExchange way of locking too. More backwards compatible/faster??? - class mutex_win32 - { - private: - CRITICAL_SECTION mtx; - public: - mutex_win32(const mutex_win32& clone); - mutex_win32(); - ~mutex_win32(); - void lock(); - void unlock(); - }; - - class CLuceneThreadIdCompare - { - public: - - enum - { // parameters for hash table - bucket_size = 4, // 0 < bucket_size - min_buckets = 8 - }; // min_buckets = 2 ^^ N, 0 < N - - bool operator()( DWORD t1, DWORD t2 ) const{ - return t1 < t2; - } - }; - - #define _LUCENE_SLEEP(x) Sleep(x) - #define _LUCENE_THREADMUTEX CL_NS(util)::mutex_win32 - #define _LUCENE_CURRTHREADID GetCurrentThreadId() - #define _LUCENE_THREADID_TYPE DWORD -CL_NS_END - -#endif //lucene_config_threadCSection_h diff --git a/3rdparty/clucene/src/CLucene/config/threadPthread.h b/3rdparty/clucene/src/CLucene/config/threadPthread.h deleted file mode 100644 index d0ed9c4c9..000000000 --- a/3rdparty/clucene/src/CLucene/config/threadPthread.h +++ /dev/null @@ -1,59 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -//NOTE: do not include this file directly, it is included from lucene internally. - -#ifndef lucene_config_threadPthread_h -#define lucene_config_threadPthread_h - -#include - -CL_NS_DEF(util) - -///a posix implementation of the lock mutex -///todo: we need a spinlock implemenation for usage in reference counting -class mutex_pthread -{ -private: - pthread_mutex_t mtx; - -public: - mutex_pthread(const mutex_pthread& clone); - mutex_pthread(); - ~mutex_pthread(); - void lock(); - void unlock(); - -private: - #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - pthread_t lockOwner; - unsigned int lockCount; - #endif -}; - -#define _LUCENE_SLEEP(x) usleep(x*1000) //_LUCENE_SLEEP should be in millis, usleep is in micros -#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_pthread -#define _LUCENE_CURRTHREADID pthread_self() -#define _LUCENE_THREADID_TYPE pthread_t - -class CLuceneThreadIdCompare -{ -public: - enum - { // parameters for hash table - bucket_size = 4, // 0 < bucket_size - min_buckets = 8 - }; // min_buckets = 2 ^^ N, 0 < N - - bool operator()( pthread_t t1, pthread_t t2 ) const{ - return t1 < t2; - } -}; - - -CL_NS_END - -#endif //lucene_config_threadPthread_h diff --git a/3rdparty/clucene/src/CLucene/config/threads.cpp b/3rdparty/clucene/src/CLucene/config/threads.cpp deleted file mode 100644 index 427e58092..000000000 --- a/3rdparty/clucene/src/CLucene/config/threads.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -#ifndef _CL_DISABLE_MULTITHREADING -CL_NS_DEF(util) - - -mutexGuard::mutexGuard(const mutexGuard& clone){ - //no autoclone - mrMutex = NULL; -} -mutexGuard::mutexGuard( _LUCENE_THREADMUTEX& rMutex ) : - mrMutex(&rMutex) -{ - mrMutex->lock(); -} -mutexGuard::~mutexGuard() -{ - mrMutex->unlock(); -} - -#if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX) - //do nothing - #if defined(_LUCENE_PRAGMA_WARNINGS) - #pragma message ("==================Not implementing any thread mutex==================") - #else - #warning "==================Not implementing any thread mutex==================" - #endif - - - -#elif defined(_CL_HAVE_WIN32_THREADS) - #include "CLucene/config/threadCSection.h" - - #if !defined(LUCENE_USE_WINDOWS_H) && !defined(_WINDOWS_) - //we have not explicity included windows.h and windows.h has - //not been included (check _WINDOWS_), then we must define - //our own definitions to the thread locking functions: - extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION *); - extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION *); - extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION *); - extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION *); - extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(); - #endif - - mutex_win32::mutex_win32(const mutex_win32& clone){ - InitializeCriticalSection(&mtx); - } - mutex_win32::mutex_win32() - { - InitializeCriticalSection(&mtx); - } - - mutex_win32::~mutex_win32() - { - DeleteCriticalSection(&mtx); - } - - void mutex_win32::lock() - { - EnterCriticalSection(&mtx); - } - - void mutex_win32::unlock() - { - LeaveCriticalSection(&mtx); - } - - - -#elif defined(_CL_HAVE_PTHREAD) - #include "CLucene/config/threadPthread.h" - - #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - bool mutex_pthread_attr_initd=false; - pthread_mutexattr_t mutex_pthread_attr; - #endif - - #ifdef _CL__CND_DEBUG - #define _CLPTHREAD_CHECK(c,m) CND_PRECONDITION(c==0,m) - #else - #define _CLPTHREAD_CHECK(c,m) c; - #endif - - mutex_pthread::mutex_pthread(const mutex_pthread& clone){ - #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, &mutex_pthread_attr), "mutex_pthread(clone) constructor failed") - #else - #if defined(__hpux) && defined(_DECTHREADS_) - _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, pthread_mutexattr_default), "mutex_pthread(clone) constructor failed") - #else - _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, 0), "mutex_pthread(clone) constructor failed") - #endif - lockCount=0; - lockOwner=0; - #endif - } - mutex_pthread::mutex_pthread() - { - #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - if ( mutex_pthread_attr_initd == false ){ - pthread_mutexattr_init(&mutex_pthread_attr); - pthread_mutexattr_settype(&mutex_pthread_attr, PTHREAD_MUTEX_RECURSIVE); - mutex_pthread_attr_initd = true; - } - _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, &mutex_pthread_attr), "mutex_pthread(clone) constructor failed") - #else - #if defined(__hpux) && defined(_DECTHREADS_) - _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, pthread_mutexattr_default), "mutex_pthread(clone) constructor failed") - #else - _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, 0), "mutex_pthread(clone) constructor failed") - #endif - lockCount=0; - lockOwner=0; - #endif - } - - mutex_pthread::~mutex_pthread() - { - _CLPTHREAD_CHECK(pthread_mutex_destroy(&mtx), "~mutex_pthread destructor failed") - } - - void mutex_pthread::lock() - { - #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - pthread_t currentThread = pthread_self(); - if( pthread_equal( lockOwner, currentThread ) ) { - ++lockCount; - } else { - _CLPTHREAD_CHECK(pthread_mutex_lock(&mtx), "mutex_pthread::lock") - lockOwner = currentThread; - lockCount = 1; - } - #else - _CLPTHREAD_CHECK(pthread_mutex_lock(&mtx), "mutex_pthread::lock") - #endif - } - - void mutex_pthread::unlock() - { - #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - --lockCount; - if( lockCount == 0 ) - { - lockOwner = 0; - _CLPTHREAD_CHECK(pthread_mutex_unlock(&mtx), "mutex_pthread::unlock") - } - #else - _CLPTHREAD_CHECK(pthread_mutex_unlock(&mtx), "mutex_pthread::unlock") - #endif - } - -#endif //thread impl choice - - -CL_NS_END -#endif //!_CL_DISABLE_MULTITHREADING diff --git a/3rdparty/clucene/src/CLucene/config/utf8.cpp b/3rdparty/clucene/src/CLucene/config/utf8.cpp deleted file mode 100644 index 14ccf5aa9..000000000 --- a/3rdparty/clucene/src/CLucene/config/utf8.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 1999 Tom Tromey - * Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * - ************************************************ - * Also licensed with permission from Tom Tromey - * and Owen Taylor under the Apache license. - * Original location: - * http://cvs.gnome.org/viewcvs/glib/glib/gutf8.c?rev=1.50&view=log - ************************************************ - * - * Copyright 2003-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - #include "CLucene/StdHeader.h" - -typedef unsigned long gunichar; -typedef unsigned char guchar; - -#define UTF8_COMPUTE(Char, Mask, Len) \ - if (Char < 128) \ - { \ - Len = 1; \ - Mask = 0x7f; \ - } \ - else if ((Char & 0xe0) == 0xc0) \ - { \ - Len = 2; \ - Mask = 0x1f; \ - } \ - else if ((Char & 0xf0) == 0xe0) \ - { \ - Len = 3; \ - Mask = 0x0f; \ - } \ - else if ((Char & 0xf8) == 0xf0) \ - { \ - Len = 4; \ - Mask = 0x07; \ - } \ - else if ((Char & 0xfc) == 0xf8) \ - { \ - Len = 5; \ - Mask = 0x03; \ - } \ - else if ((Char & 0xfe) == 0xfc) \ - { \ - Len = 6; \ - Mask = 0x01; \ - } \ - else \ - Len = -1; - -/*#define UTF8_LENGTH(Char) \ - ((Char) < 0x80 ? 1 : \ - ((Char) < 0x800 ? 2 : \ - ((Char) < 0x10000 ? 3 : \ - ((Char) < 0x200000 ? 4 : \ - ((Char) < 0x4000000 ? 5 : 6)))))*/ - - -#define UTF8_GET(Result, Chars, Count, Mask, Len) \ - (Result) = (Chars)[0] & (Mask); \ - for ((Count) = 1; (Count) < (Len); ++(Count)) \ - { \ - if (((Chars)[(Count)] & 0xc0) != 0x80) \ - { \ - (Result) = -1; \ - break; \ - } \ - (Result) <<= 6; \ - (Result) |= ((Chars)[(Count)] & 0x3f); \ - } - - -/** - * lucene_wctoutf8: - * @c: a ISO10646 character code - * @outbuf: output buffer, must have at least 6 bytes of space. - * If %NULL, the length will be computed and returned - * and nothing will be written to @outbuf. - * - * Converts a single character to UTF-8. - * - * Return value: number of bytes written - **/ -size_t lucene_wctoutf8(char * outbuf, const wchar_t ch) -{ - gunichar c = ch; - guchar len = 0; - int first; - int i; - - if (c < 0x80) - { - first = 0; - len = 1; - } - else if (c < 0x800) - { - first = 0xc0; - len = 2; - } - else if (c < 0x10000) - { - first = 0xe0; - len = 3; - } - else if (c < 0x200000) - { - first = 0xf0; - len = 4; - } - else if (c < 0x4000000) - { - first = 0xf8; - len = 5; - } - else - { - first = 0xfc; - len = 6; - } - - if (outbuf) - { - for (i = len - 1; i > 0; --i) - { - outbuf[i] = (char)((c & 0x3f) | 0x80); - c >>= 6; - } - outbuf[0] = c | first; - } - - return len; -} - - -/** - * lucene_utf8towc: - * @p: a pointer to Unicode character encoded as UTF-8 - * - * Converts a sequence of bytes encoded as UTF-8 to a Unicode character. - * If @p does not point to a valid UTF-8 encoded character, results are - * undefined. If you are not sure that the bytes are complete - * valid Unicode characters, you should use lucene_utf8towc_validated() - * instead. - * - * Return value: the resulting character - **/ -size_t lucene_utf8towc(wchar_t *pwc, const char *p, size_t n) -{ - int i, mask = 0; - int result; - unsigned char c = (unsigned char) *p; - int len=0; - - UTF8_COMPUTE (c, mask, len); - if (len == -1) - return 0; - UTF8_GET (result, p, i, mask, len); - - *pwc = result; - return len; -} - - -//this function was not taken from gnome -size_t lucene_wcstoutf8(char * result, const wchar_t * str, size_t result_length){ - char *p=result; - int i = 0; - - while (p < result + result_length-1 && str[i] != 0) - p += lucene_wctoutf8(p,str[i++]); - - *p = '\0'; - - return p-result; -} -//this function was not taken from gnome -size_t lucene_utf8towcs(wchar_t * result, const char * str, size_t result_length){ - char *sp = (char*)str; - wchar_t *rp = result; - int i = 0; - - while (rp < result + result_length && *sp!=0){ - size_t r = lucene_utf8towc(rp,sp,6); - if ( r == -1 ) - return 0; - sp += r; - rp++; - } - - if ( sp-str < result_length ) - *rp = '\0'; - - size_t ret = sp-str; - return ret; -} -//get the number of bytes that make up the utf8 character. -//this function was not taken from gnome -size_t lucene_utf8charlen(const char *p) -{ - int mask = 0; - int len=0; - unsigned char c = (unsigned char) *p; - - UTF8_COMPUTE (c, mask, len); - return len; -} diff --git a/3rdparty/clucene/src/CLucene/debug/condition.cpp b/3rdparty/clucene/src/CLucene/debug/condition.cpp deleted file mode 100644 index 855419451..000000000 --- a/3rdparty/clucene/src/CLucene/debug/condition.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "condition.h" -#include "CLucene/util/Misc.h" -#ifdef _CL__CND_DEBUG - -#define __CND_STR_PRECONDITION "PRECONDITION" -#define __CND_STR_CONDITION "CONDITION" -#define __CND_STR_WARNING "WARNING" -#define __CND_STR_MESSAGE "MESSAGE" -#define __CND_STR_DEBUGMESSAGE "DEBUG MESSAGE" -#define __CND_STR_EXIT "EXIT" - -#ifndef _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG -void _Cnd_OutDebug( const char* FormattedMsg, const char* StrTitle, const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ){ - #ifdef __WINDOWS_H - /*Display a standard messagebox*/ - MessageBox(NULL, FormattedMsg, StrTitle, (fatal==1 ? MB_ICONSTOP:MB_ICONEXCLAMATION) | MB_OK | MB_TASKMODAL); - #else - printf("%s\n",FormattedMsg); - #endif - - #if defined(_CND_DEBUG_WARN_DEBUGGER) /*attempt to signal windows debugger*/ - OutputDebugString(FormattedMsg); - DebugBreak(); /*Position debugger just before exit program*/ - #endif - - if ( fatal ) - debugFatalExit(1); -} -#endif - -void __cnd_FormatDebug( const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ) { - char M[512]; - char* StrTitle = NULL; - - if( Mes2 ) - _snprintf(M,512,"file:%s line:%d\n%s",File,Line,Mes2); - else - _snprintf(M,512,"file:%s line:%d",File,Line); - - /*Determine which title to use*/ - switch( Title ) { - case CND_STR_PRECONDITION: { - StrTitle = __CND_STR_PRECONDITION; - break; - } - case CND_STR_CONDITION: { - StrTitle = __CND_STR_CONDITION; - break; - } - case CND_STR_WARNING: { - StrTitle = __CND_STR_WARNING; - break; - } - case CND_STR_MESSAGE: { - StrTitle = __CND_STR_MESSAGE; - break; - } - case CND_STR_DEBUGMESSAGE: { - StrTitle = __CND_STR_DEBUGMESSAGE; - break; - } - case CND_STR_EXIT: { - StrTitle = __CND_STR_EXIT; - break; - } - default: - break; - }/*switch*/ - - _Cnd_OutDebug(M, StrTitle, File, Line, Title, Mes2, fatal); -} -#endif - diff --git a/3rdparty/clucene/src/CLucene/debug/condition.h b/3rdparty/clucene/src/CLucene/debug/condition.h deleted file mode 100644 index ab227e508..000000000 --- a/3rdparty/clucene/src/CLucene/debug/condition.h +++ /dev/null @@ -1,64 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef __CONDITION_H -#define __CONDITION_H - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -/* -To enable condition debugging uncomment _CND_DEBUG in CLConfig.h -*/ - -#ifdef _CL__CND_DEBUG /* Don't include the debug code */ - #ifndef CND_STR_DEFINES - #define CND_STR_DEFINES - #define CND_STR_PRECONDITION 1 - #define CND_STR_CONDITION 2 - #define CND_STR_WARNING 3 - #define CND_STR_MESSAGE 4 - #define CND_STR_DEBUGMESSAGE 5 - #define CND_STR_EXIT 6 - #endif - - /* _CL__CND_DEBUG defined, include debug code */ - - #ifdef _CND_NODEBUGTEXT - #define CND_PRECONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_PRECONDITION,NULL) - #define CND_CONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_CONDITION,NULL) - #define CND_WARNING(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_WARNING,NULL) - #define CND_MESSAGE(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_MESSAGE,NULL) - #define CND_DEBUGMESSAGE(usermessage) CND__MESSAGE(__FILE__,__LINE__,CND_STR_DEBUGMESSAGE,NULL) - #else - #define CND_PRECONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_PRECONDITION,usermessage) - #define CND_CONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_CONDITION,usermessage) - #define CND_WARNING(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_WARNING,usermessage) - #define CND_MESSAGE(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_MESSAGE,usermessage) - #define CND_DEBUGMESSAGE(usermessage) CND__MESSAGE(__FILE__,__LINE__,CND_STR_DEBUGMESSAGE,usermessage) - #endif - - //if _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG is defined, then you must implement - //this routine in the client application. The debug callback can then - //be better customised to the host application. - //Here is the default implementation: - void _Cnd_OutDebug( const char* FormattedMsg, const char* StrTitle, const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ); - - void __cnd_FormatDebug( const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ); - #define CND__EXIT(file,line,title,mes2) {__cnd_FormatDebug(file,line,title,mes2,1);} - #define CND__EXITCONDITION(cond,file,line,title,mes2) {if(!(cond)){__cnd_FormatDebug(file,line,title,mes2,1);}} - #define CND__CONDITION(cond,file,line,title,mes2) {if(!(cond)){__cnd_FormatDebug(file,line,title,mes2,0);}} - #define CND__MESSAGE(file,line,title,mes2) {__cnd_FormatDebug(file,line,title,mes2,0);} -#else - #define CND_PRECONDITION(cond, usermessage) - #define CND_CONDITION(cond, usermessage) - #define CND_WARNING(cond,usermessage) - #define CND_MESSAGE(cond,usermessage) - #define CND_DEBUGMESSAGE(usermessage) -#endif - -#endif diff --git a/3rdparty/clucene/src/CLucene/debug/error.cpp b/3rdparty/clucene/src/CLucene/debug/error.cpp deleted file mode 100644 index 53ea0e93b..000000000 --- a/3rdparty/clucene/src/CLucene/debug/error.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -CL_NS_USE(util) - - -#ifdef _LUCENE_DISABLE_EXCEPTIONS - #ifdef _LUCENE_PRAGMA_WARNINGS - #pragma message ("==================Lucene exceptions are disabled==================") - #else - #warning "==================Lucene exceptions are disabled==================" - #endif -#else - CLuceneError::CLuceneError(int num, const char* str, bool ownstr) - { - error_number = num; - _awhat=STRDUP_AtoA(str); - _twhat=NULL; - if ( ownstr ) - _CLDELETE_CaARRAY(str); - } - - CLuceneError::CLuceneError(const CLuceneError& clone) - { - this->error_number = clone.error_number; - this->_awhat = NULL; - this->_twhat = NULL; - - if ( clone._awhat != NULL ) - this->_awhat = STRDUP_AtoA(clone._awhat); - if ( clone._twhat != NULL ) - this->_twhat = STRDUP_TtoT(clone._twhat); - } - CLuceneError::~CLuceneError() throw(){ - _CLDELETE_CARRAY(_twhat); - _CLDELETE_CaARRAY(_awhat); - } - char* CLuceneError::what(){ -#ifdef _ASCII - if ( _twhat != NULL ) - return _twhat; -#endif - if ( _awhat == NULL ) - _awhat = STRDUP_TtoA(_twhat); - return _awhat; - } - TCHAR* CLuceneError::twhat(){ -#ifdef _ASCII - if ( _awhat != NULL ) - return _awhat; -#endif - if ( _twhat == NULL ) - _twhat = STRDUP_AtoT(_awhat); - return _twhat; - } - -#ifndef _ASCII - CLuceneError::CLuceneError(int num, const TCHAR* str, bool ownstr) - { - error_number = 0; - _awhat=NULL; - _twhat=STRDUP_TtoT(str); - if ( ownstr ) - _CLDELETE_CARRAY(str); - } -#endif - -#endif //_LUCENE_DISABLE_EXCEPTIONS diff --git a/3rdparty/clucene/src/CLucene/debug/error.h b/3rdparty/clucene/src/CLucene/debug/error.h deleted file mode 100644 index 5abcc802c..000000000 --- a/3rdparty/clucene/src/CLucene/debug/error.h +++ /dev/null @@ -1,74 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_debug_error_ -#define _lucene_debug_error_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#define CL_ERR_UNKNOWN -1 -#define CL_ERR_IO 1 -#define CL_ERR_NullPointer 2 -#define CL_ERR_Runtime 3 -#define CL_ERR_IllegalArgument 4 -#define CL_ERR_Parse 5 -#define CL_ERR_TokenMgr 6 -#define CL_ERR_UnsupportedOperation 7 -#define CL_ERR_InvalidState 8 -#define CL_ERR_IndexOutOfBounds 9 -#define CL_ERR_TooManyClauses 10 -#define CL_ERR_RAMTransaction 11 -#define CL_ERR_InvalidCast 12 -#define CL_ERR_IllegalState 13 - - - -//////////////////////////////////////////////////////// -//error try/throw/catch definitions -//////////////////////////////////////////////////////// -#ifdef _CL_DISABLE_NATIVE_EXCEPTIONS - /*#define try _jpr_Try - #define _CLCATCH _jpr_Catch - #define _CLFINALLY(x) xxxx - #define _CLTHROWA(y) _jpr_Throw - #define _THROWA_DEL(y) _jpr_Throw - #define _RETHROW(x) _jpr_Throw - #define _CLTHROWT(y) _jpr_Throw - - #define _THROWS ,_jpr_Throws*/ -#else - class CLuceneError - { - int error_number; - char* _awhat; - TCHAR* _twhat; - public: - CLuceneError(const CLuceneError& clone); - CLuceneError(int num, const char* str, bool ownstr); -#ifdef _UCS2 - CLuceneError(int num, const TCHAR* str, bool ownstr); -#endif - int number(){return error_number;} - char* what(); - TCHAR* twhat(); - ~CLuceneError() throw(); - }; - - //#define _THROWS //does nothing - #define _CLFINALLY(x) catch(...){ x; throw; } x //note: code x is not run if return is called - #define _CLTHROWA(number, str) throw CLuceneError(number, str,false) - #define _CLTHROWT(number, str) throw CLuceneError(number, str,false) - #define _CLTHROWA_DEL(number, str) throw CLuceneError(number, str,true) //throw a string ensures the value is deleted - #define _CLTHROWT_DEL(number, str) throw CLuceneError(number, str,true) //throw a string ensures the value is deleted - - -#endif //_LUCENE_DISABLE_EXCEPTIONS -// -//////////////////////////////////////////////////////// - -#endif diff --git a/3rdparty/clucene/src/CLucene/debug/lucenebase.h b/3rdparty/clucene/src/CLucene/debug/lucenebase.h deleted file mode 100644 index 86cdae1c5..000000000 --- a/3rdparty/clucene/src/CLucene/debug/lucenebase.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_debug_lucenebase_ -#define _lucene_debug_lucenebase_ - -#ifdef _LUCENE_PRAGMA_ONCE -# pragma once -#endif - -CL_NS_DEF(debug) - -//Lucenebase is the superclass of all clucene objects. It provides -//memory debugging tracking and/or reference counting -class LuceneBase{ -public: -#ifdef LUCENE_ENABLE_MEMLEAKTRACKING - static void* operator new (size_t size); - static void operator delete (void *p); - int32_t __cl_initnum; ///< The order that the object was created at. This is then used to do a lookup in the objects list - - static void* operator new (size_t size, char const * file, int32_t line); - static void operator delete (void *p, char const * file, int32_t line); - - static void* __cl_voidpadd(void* data, const char* file, int line, size_t size); ///dummy__see_mem_h_for_details -#endif -#define _CL_POINTER(x) (x==NULL?NULL:(x->__cl_addref()>=0?x:x)) //return a add-ref'd object -#define LUCENE_REFBASE public CL_NS(debug)::LuceneBase //this is the base of classes who *always* need refcounting - -#if defined(_DEBUG) - #if !defined(LUCENE_BASE_CHECK) - #define LUCENE_BASE_CHECK(x) - #endif -#else - #undef LUCENE_BASE_CHECK - #define LUCENE_BASE_CHECK(x) -#endif - -//Macro for creating new arrays -#ifdef LUCENE_ENABLE_MEMLEAKTRACKING - #define _CL_NEWARRAY(type,size) (type*)CL_NS(debug)::LuceneBase::__cl_voidpadd(new type[(size_t)size],__FILE__,__LINE__,(size_t)size); - #define _CLDELETE_ARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__); delete [] x; x=NULL;} - #define _CLDELETE_LARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__);delete [] x;} - #ifndef _CLDELETE_CARRAY - #define _CLDELETE_CARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__);delete [] x; x=NULL;} - #define _CLDELETE_LCARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__);delete [] x;} - #endif -#else - #define _CL_NEWARRAY(type,size) new type[size] - #define _CLDELETE_ARRAY(x) if (x!=NULL){delete [] x; x=NULL;} - #define _CLDELETE_LARRAY(x) if (x!=NULL){delete [] x;} - #ifndef _CLDELETE_CARRAY - #define _CLDELETE_CARRAY(x) if (x!=NULL){delete [] x; x=NULL;} - #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete [] x;} - #endif -#endif -//a shortcut for deleting a carray and all its contents -#define _CLDELETE_CARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE_CARRAY(x[xcda]);}_CLDELETE_ARRAY(x)}; -#define _CLDELETE_ARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE(x[xcda]);}_CLDELETE_ARRAY(x)}; -#ifndef _CLDELETE_CaARRAY - #define _CLDELETE_CaARRAY _CLDELETE_CARRAY - #define _CLDELETE_LCaARRAY _CLDELETE_LCARRAY -#endif - -//Macro for deleting -#ifdef LUCENE_ENABLE_REFCOUNT - #define _CLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } - #define _CLLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } -#else - #define _CLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; x=NULL; } - #define _CLLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; } -#endif - -//_CLDECDELETE deletes objects which are *always* refcounted -#define _CLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } -#define _CLLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } - -//_VDelete should be used for deleting non-clucene objects. -//when using reference counting, _CLDELETE casts the object -//into a LuceneBase*. -#define _CLVDELETE(x) if(x!=NULL){delete x; x=NULL;} - -template -class Array: LUCENE_BASE{ -public: - T* values; - size_t length; - - void deleteAll(){ - for (size_t i=0;ivalues = values; - this->length = length; - } - Array(size_t length){ - this->values = _CL_NEWARRAY(T,length); - this->length = length; - } - ~Array(){} - - const T operator[](size_t _Pos) const - { - if (length <= _Pos){ - _CLTHROWA(CL_ERR_IllegalArgument,"vector subscript out of range"); - } - return (*(values + _Pos)); - } - T operator[](size_t _Pos) - { - if (length <= _Pos){ - _CLTHROWA(CL_ERR_IllegalArgument,"vector subscript out of range"); - } - return (*(values + _Pos)); - } - -}; - -#endif //_lucene_debug_lucenebase_ diff --git a/3rdparty/clucene/src/CLucene/debug/memtracking.cpp b/3rdparty/clucene/src/CLucene/debug/memtracking.cpp deleted file mode 100644 index 544a125a5..000000000 --- a/3rdparty/clucene/src/CLucene/debug/memtracking.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CLucene/util/Misc.h" - -bool _lucene_disable_debuglogging = true; //if LUCENE_ENABLE_CONSTRUCTOR_LOG is on, dont do log if this is true -bool _lucene_run_objectcheck = false; //run a memory check before deleting objects -int _lucene_counter_break = -1; //to break at this item, change this - //and put break points at points below - -CL_NS_USE(util) -CL_NS_DEF(debug) - -#ifdef LUCENE_ENABLE_MEMLEAKTRACKING -int32_t _instance_counter = 0; //counter for initnumber - -struct _file{ - int32_t refcount; ///times this has been used - char* value; ///reference to the the basefile -}; //structure for name counting -struct _pointers{ - _file* file; - int32_t initline; - int32_t initnumber; -};//structure for pointer-filename references - -typedef CL_NS(util)::CLSet > defFile; -typedef CL_NS(util)::CLSet,Deletor::Dummy,Deletor::Void<_pointers> > defPointer; -typedef CL_NS(util)::CLSet,Deletor::Dummy,Deletor::Void<_pointers> > defVoid; - -DEFINE_MUTEX(memleak_lock) -defFile LuceneBase_Files(false,true); //list of filenames used -defPointer LuceneBase_Pointers(false,true); //list of pointers counted -defVoid LuceneBase_Voids(false,true); //list of arbitary data added - -//variables to trim filenames to just the base names -char _files_trim_string[CL_MAX_DIR]; -int32_t _files_trim_start=-1; - -//trim the filename and return the refcounted _file* structure -_file* get_file(const char* file){ - if ( _files_trim_start == -1 ){ - //this trims the start of the name file name so - //that the whole of the filename is not stored - more asthetic :) - //need to find the base - _files_trim_start = strlen(__FILE__) - 21; //(length of debug/memtracking.cpp) - strcpy(_files_trim_string,__FILE__); - _files_trim_string[_files_trim_start] = 0; - } - if ( strncmp(file,_files_trim_string,_files_trim_start) == 0 ){ - //this file should be within the same directory area as we found lucenebase.cpp - //to be, lets trim the start - file+=_files_trim_start; - } - - //now return an existing files structure (with refcount++) or create a new one - defFile::iterator itr = LuceneBase_Files.find((const char*)file); - if ( itr != LuceneBase_Files.end() ){ - _file* bf = itr->second; - bf->refcount++; - return bf; - }else{ - _file* ref = new _file; - ref->value = new char[strlen(file)+1]; //cannot use _CL_NEWARRAY otherwise recursion - strcpy(ref->value,file); - - ref->refcount = 1; - LuceneBase_Files.insert(pair(ref->value,ref)); - return ref; - } -} - -void remove_file(_file* bf){ - bf->refcount--; - if ( bf->refcount <= 0 ){ - defFile::iterator fi = LuceneBase_Files.find(bf->value); - CND_PRECONDITION(fi!=LuceneBase_Files.end(),"fi==NULL"); - delete[] bf->value; - LuceneBase_Files.removeitr(fi); - } -} - -#ifdef LUCENE_ENABLE_CONSTRUCTOR_LOG - void constructor_log(const char* type,const char* file,const int line, const int size){ - if ( _lucene_disable_debuglogging ){ - FILE* f = fopen("clucene.log","a"); - char buf[CL_MAX_DIR+5]; - sprintf(buf,"%s,%s,%d,%d\n",type,file,line,size); - fwrite(buf,sizeof(char),strlen(buf),f); - fclose(f); - } - } - #define CONSTRUCTOR_LOG(type,file,line,size) constructor_log(type,file,line,size) -#else - #define CONSTRUCTOR_LOG(type,file,line,size) -#endif - -//////////////////////////////////////////////////////////////////////////////// -// the _CLNEW&_CLDELETE new/delete operators -//////////////////////////////////////////////////////////////////////////////// -void* LuceneBase::operator new (size_t size, const char * file, int32_t line) -{ - SCOPED_LOCK_MUTEX(memleak_lock) - - void* p = malloc (size); - LuceneBase* lb = (LuceneBase*)p; - - //create the pointer struct - _file* br = get_file(file); - _pointers* bp = new _pointers; - bp->file = br; - bp->initnumber = _instance_counter++; - bp->initline = line; - - //associate this object with the pointer - lb->__cl_initnum = bp->initnumber; - - //break if necessary - if ( _lucene_counter_break == lb->__cl_initnum ) - CLDebugBreak(); //put break point here - - //add the pointer object - LuceneBase_Pointers.insert(pair(lb, bp)); - - CONSTRUCTOR_LOG("newobj",file,line,size); - return p; -} -void LuceneBase::operator delete (void *p, char const * file, int32_t line) -{ - SCOPED_LOCK_MUTEX(memleak_lock) - - LuceneBase* lb=(LuceneBase*)p; - - defPointer::iterator itr = LuceneBase_Pointers.find(lb); - if ( itr != LuceneBase_Pointers.end() ){ - _pointers* bp = itr->second; - remove_file(bp->file); - - LuceneBase_Pointers.removeitr(itr); - }else{ - //break - } - free(p); -} - -/////////////////////////////////////////////////////////////////////////// -// the generic new/delete operators -/////////////////////////////////////////////////////////////////////////// -void* LuceneBase::operator new (size_t size) -{ - SCOPED_LOCK_MUTEX(memleak_lock) - - void* p = malloc (size); - LuceneBase* lb = (LuceneBase*)p; - - //create the pointer struct - _file* br = get_file("undefined"); - _pointers* bp = new _pointers; - bp->file = br; - bp->initnumber = _instance_counter++; - bp->initline = -1; - - //associate this object with the pointer - lb->__cl_initnum = bp->initnumber; - - //break if necessary - if ( _lucene_counter_break == lb->__cl_initnum ) - CLDebugBreak(); - - //add the pointer object - LuceneBase_Pointers.insert(pair(lb,bp)); - - CONSTRUCTOR_LOG("newobj","unknown",-1,size); - return p; -} -void LuceneBase::operator delete (void *p) -{ - SCOPED_LOCK_MUTEX(memleak_lock) - - LuceneBase* lb=(LuceneBase*)p; - - defPointer::iterator itr = LuceneBase_Pointers.find(lb); - if ( itr != LuceneBase_Pointers.end() ){ - _pointers* bp = itr->second; - remove_file(bp->file); - LuceneBase_Pointers.removeitr(itr); - }else{ - CLDebugBreak(); - } - free(p); -} - -/////////////////////////////////////////////////////////////////////////// -// other memtracking functions -/////////////////////////////////////////////////////////////////////////// -void LuceneBase::__cl_unregister(const void* obj){ - SCOPED_LOCK_MUTEX(memleak_lock) - - LuceneBase* lb=(LuceneBase*)obj; - defPointer::iterator itr = LuceneBase_Pointers.find(lb); - CND_PRECONDITION(itr != LuceneBase_Pointers.end(),"__cl_unregister object not found"); - _pointers* bp = itr->second; - LuceneBase_Pointers.removeitr(itr); -} - -void* LuceneBase::__cl_voidpadd(void* data, const char* file, int line,size_t size){ - SCOPED_LOCK_MUTEX(memleak_lock) - - _file* br = get_file(file); - _pointers* bp = new _pointers; - bp->file = br; - bp->initnumber = _instance_counter++; - bp->initline = line; - - LuceneBase_Voids.insert(pair(data,bp)); - CONSTRUCTOR_LOG("newarr",file,line,size); - return data; -} -void LuceneBase::__cl_voidpremove(const void* data, const char* file, int line){ - SCOPED_LOCK_MUTEX(memleak_lock) - defVoid::iterator itr = LuceneBase_Voids.find(data); - if ( itr != LuceneBase_Voids.end() ){ - _pointers* bp = itr->second; - remove_file(bp->file); - LuceneBase_Voids.removeitr(itr); - }else{ - printf("Data deleted when not added with _CL_NEWARRAY in %s at %d\n",file,line); - } -} - - -//////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////// -//The lucene base memory leak printout functions -//////////////////////////////////////////////////////////// -//static -void __internalcl_PrintUnclosedObject(bool isObject, string& sb,_pointers* bp,_file* bf, bool print){ - TCHAR ttmp[100]; - char atmp[100]; - - sb.append(" "); - { - _i64tot(bp->initnumber,ttmp,10); - STRCPY_TtoA(atmp,ttmp,100); - sb.append(atmp); - } - if ( isObject ){ - sb.append("(obj). "); - }else{ - sb.append(". "); - } - sb.append(bf->value); - sb.append(", line "); - { - _i64tot(bp->initline,ttmp,10); - STRCPY_TtoA(atmp,ttmp,100); - sb.append(atmp); - } - sb.append("\n"); - - if ( print && sb.length() > 0 ){ - printf("%s\n", sb.c_str()); - sb = ""; - } -} -char* __internalcl_GetUnclosedObjects(bool print){ - TCHAR ttmp[100]; - char atmp[100]; - SCOPED_LOCK_MUTEX(memleak_lock) - - string sb; - bool unknowns = false; - if ( LuceneBase_Pointers.size() > 0 ){ - { - _i64tot(LuceneBase_Pointers.size(),ttmp,10); - STRCPY_TtoA(atmp,ttmp,100); - sb.append(atmp); - } - sb.append(" clucene objects are still open\n"); - - defPointer::iterator itr = LuceneBase_Pointers.begin(); - while ( itr != LuceneBase_Pointers.end() ){ - _pointers* bp = itr->second; - _file* bf = bp->file; - - if ( bp->initline == -1 ) - unknowns = true; - __internalcl_PrintUnclosedObject(true, sb,bp,bf,print); - - ++itr; - } - - defVoid::iterator itr2 = LuceneBase_Voids.begin(); - while ( itr2 != LuceneBase_Voids.end() ){ - _pointers* bp = itr2->second; - _file* bf = bp->file; - - if ( bp->initline == -1 ) - unknowns = true; - __internalcl_PrintUnclosedObject(false, sb,bp,bf,print); - - itr2++; - } - } - - if ( unknowns == true ){ - sb.append("*** Some memory was not created with _CLNEW and was not tracked... ***\n"); - sb.append("*** Use _CLNEW instead of new when creating CLucene objects ***\n"); - sb.append("*** Memory may also have not been freed in the current context ***\n"); - } - - if ( print ){ - if ( sb.length() > 0 ){ - printf("%s\n", sb.c_str()); - sb = ""; - } - return NULL; - }else{ - if ( sb.length() > 0 ) - return STRDUP_AtoA(sb.c_str()); - else - return NULL; - } -} - -void LuceneBase::__cl_ClearMemory(){ - SCOPED_LOCK_MUTEX(memleak_lock) - - while ( LuceneBase_Files.size() > 0 ){ - defFile::iterator fi = LuceneBase_Files.begin(); - _file* f = fi->second; - delete[] f->value; - LuceneBase_Files.removeitr (fi); - } - LuceneBase_Pointers.clear(); - LuceneBase_Voids.clear(); -} -char* LuceneBase::__cl_GetUnclosedObjects(){ - return __internalcl_GetUnclosedObjects(false); -} -//static -int32_t LuceneBase::__cl_GetUnclosedObjectsCount(){ - return LuceneBase_Pointers.size(); -} - -const char* LuceneBase::__cl_GetUnclosedObject(int32_t item){ - SCOPED_LOCK_MUTEX(memleak_lock) - - defPointer::iterator itr=LuceneBase_Pointers.begin(); - int32_t i=0; - for ( ;itr!=LuceneBase_Pointers.end() && isecond->file->value; - else - return NULL; -} -void LuceneBase::__cl_PrintUnclosedObjects(){ - __internalcl_GetUnclosedObjects(true); -} -//////////////////////////////////////////////////////////// - -#endif //LUCENE_ENABLE_MEMLEAKTRACKING -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/document/DateField.cpp b/3rdparty/clucene/src/CLucene/document/DateField.cpp deleted file mode 100644 index ff72b12bb..000000000 --- a/3rdparty/clucene/src/CLucene/document/DateField.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -#include "DateField.h" -#include "CLucene/util/Misc.h" -CL_NS_USE(util) -CL_NS_DEF(document) - -DateField::~DateField(){ -} - -TCHAR* DateField::timeToString(const int64_t time) { - TCHAR* buf = _CL_NEWARRAY(TCHAR,DATEFIELD_DATE_LEN + 1); - timeToString(time,buf); - return buf; -} -void DateField::timeToString(const int64_t time, TCHAR* buf) { - CND_PRECONDITION (buf, "buf == NULL"); - *buf = '\0'; - if (time < 0) - _CLTHROWA (CL_ERR_IllegalArgument,"time too early"); //todo: make richer error - - if (time > DATEFIELD_DATE_MAX) - _CLTHROWA (CL_ERR_IllegalArgument, "time too late (past DATEFIELD_DATE_MAX"); //todo: make richer error - - _i64tot(time, buf, 36); - int32_t bufLen = _tcslen(buf); - - CND_PRECONDITION (bufLen <= DATEFIELD_DATE_LEN, "timeToString length is greater than 9"); - - /* Supply leading zeroes if necessary. */ - if (bufLen < DATEFIELD_DATE_LEN) { - const int32_t nMissingZeroes = DATEFIELD_DATE_LEN - bufLen; - /* Move buffer contents forward to make room for leading zeroes. */ - for (int32_t i = DATEFIELD_DATE_LEN - 1; i >= nMissingZeroes; i--) - buf[i] = buf[i - nMissingZeroes]; - - /* Insert leading zeroes. */ - {// MSVC6 scoping fix - for (int32_t i = 0; i < nMissingZeroes; i++) - buf[i] = '0'; - } - - buf[DATEFIELD_DATE_LEN] = 0; - } - - CND_PRECONDITION (_tcslen(buf) == DATEFIELD_DATE_LEN, "timeToString return is not equal to DATEFIELD_DATE_LEN"); -} - -int64_t DateField::stringToTime(const TCHAR* time) { - TCHAR* end; - return _tcstoi64(time, &end, 36); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/document/DateField.h b/3rdparty/clucene/src/CLucene/document/DateField.h deleted file mode 100644 index 712fe9b62..000000000 --- a/3rdparty/clucene/src/CLucene/document/DateField.h +++ /dev/null @@ -1,64 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_document_DateField_ -#define _lucene_document_DateField_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(document) - -//here are some constants used throughout clucene -//make date strings long enough to last a millenium -#define DATEFIELD_DATE_MAX _ILONGLONG(31536000000000) //1000L*365*24*60*60*1000 - -#define DATEFIELD_DATE_LEN 9 ////Long.toString(DATEFIELD_DATE_MAX, Character.MAX_RADIX).length() - -/** -* Provides support for converting dates to strings and vice-versa. -* The strings are structured so that lexicographic sorting orders by date, -* which makes them suitable for use as field values and search terms. -* -*

Note that this class saves dates with millisecond granularity, -* which is bad for {@link RangeQuery} and {@link PrefixQuery}, as those -* queries are expanded to a BooleanQuery with a potentially large number -* of terms when searching. Thus you might want to use -* {@link DateTools} instead. -* -*

-* Note: dates before 1970 cannot be used, and therefore cannot be -* indexed when using this class. See {@link DateTools} for an -* alternative without such a limitation. -* -* @deprecated If you build a new index, use {@link DateTools} instead. This class is included for use with existing -* indices and will be removed in a future release. -*/ -class DateField :LUCENE_BASE { -public: - ~DateField(); - - /** - * Converts a millisecond time to a string suitable for indexing. - * @throws RuntimeException if the time specified in the - * method argument is negative, that is, before 1970 - */ - static TCHAR* timeToString(const int64_t time); - - /** - * Converts a millisecond time to a string suitable for indexing. - * @throws CL_ERR_IllegalArgument if the time specified in the - * method argument is negative, that is, before 1970 - * @param str must be a character array DATEFIELD_DATE_LEN+1 or longer - */ - static void timeToString(const int64_t time, TCHAR* str); - - /** Converts a string-encoded date into a millisecond time. */ - static int64_t stringToTime(const TCHAR* s); -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/document/Document.cpp b/3rdparty/clucene/src/CLucene/document/Document.cpp deleted file mode 100644 index a0ce03942..000000000 --- a/3rdparty/clucene/src/CLucene/document/Document.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Document.h" -#include "Field.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(document) - - DocumentFieldEnumeration::DocumentFieldList::DocumentFieldList(Field* f, DocumentFieldList* n ) { - //Func - Constructor - //Pre - f != NULL - // n may be NULL - //Post - Instance has been created - CND_PRECONDITION(f != NULL, "f is NULL"); - - field = f; - next = n; - } - DocumentFieldEnumeration::DocumentFieldList::~DocumentFieldList(){ - //Func - Destructor - //Pre - true - //Post - Instance has been destroyed - - // Instead of recursively deleting the field list we do - // it iteratively to avoid stack overflows when - // dealing with several thousands of fields. - - if (!field) { - return; // nothing to do; deleted by different invocation of dtor - } - - DocumentFieldList* cur = next; - while (cur != NULL) - { - DocumentFieldList* temp = cur->next; - cur->next = NULL; - - _CLDELETE(cur); - cur = temp; - } - _CLDELETE(field); - } - - - DocumentFieldEnumeration::DocumentFieldEnumeration(const DocumentFieldList* fl){ - //Func - Constructor - //Pre - fl may be NULL - //Post - Instance has been created - - fields = fl; - } - - DocumentFieldEnumeration::~DocumentFieldEnumeration(){ - //Func - Destructor - //Pre - true - //Post - Instance has been destroyed - } - - bool DocumentFieldEnumeration::hasMoreElements() const { - return fields == NULL ? false : true; - } - - Field* DocumentFieldEnumeration::nextElement() { - //Func - Return the next element in the enumeration - //Pre - true - //Post - The next element is returned or NULL - - - Field* result = NULL; - //Check if fields is still valid - if (fields){ - result = fields->field; - fields = fields->next; - } - return result; - } - - /** Constructs a new document with no fields. */ - Document::Document(){ - //Func - Constructor - //Pre - true - //Post - Instance has been created - boost = 1.0f; - fieldList = NULL; - } - - Document::~Document(){ - //Func - Destructor - //Pre - true - //Post - Instance has been destroyed - boost = 1.0f; - _CLDELETE(fieldList); - } - - void Document::clear(){ - _CLDELETE(fieldList); - } - - void Document::add(Field& field) { - fieldList = _CLNEW DocumentFieldEnumeration::DocumentFieldList(&field, fieldList); - } - - void Document::setBoost(qreal boost) { - this->boost = boost; - } - - qreal Document::getBoost() const { - return boost; - } - - - Field* Document::getField(const TCHAR* name) const{ - CND_PRECONDITION(name != NULL, "name is NULL"); - - for (DocumentFieldEnumeration::DocumentFieldList* list = fieldList; list != NULL; list = list->next) - //cannot use interning here, because name is probably not interned - if ( _tcscmp(list->field->name(), name) == 0 ){ - return list->field; - } - - return NULL; - } - - const TCHAR* Document::get(const TCHAR* field) const { - CND_PRECONDITION(field != NULL, "field is NULL"); - Field *f = getField(field); - if (f!=NULL) - return f->stringValue(); //this returns null it is a binary(reader) - else - return NULL; - } - - DocumentFieldEnumeration* Document::fields() const { - return _CLNEW DocumentFieldEnumeration(fieldList); - } - - - TCHAR* Document::toString() const { - StringBuffer ret(_T("Document<")); - for (DocumentFieldEnumeration::DocumentFieldList* list = fieldList; list != NULL; list = list->next) { - TCHAR* tmp = list->field->toString(); - ret.append( tmp ); - if (list->next != NULL) - ret.append(_T(" ")); - _CLDELETE_ARRAY( tmp ); - } - ret.append(_T(">")); - return ret.toString(); - } - - - - void Document::removeField(const TCHAR* name) { - CND_PRECONDITION(name != NULL, "name is NULL"); - - DocumentFieldEnumeration::DocumentFieldList* previous = NULL; - DocumentFieldEnumeration::DocumentFieldList* current = fieldList; - while (current != NULL) { - //cannot use interning here, because name is probably not interned - if ( _tcscmp(current->field->name(),name) == 0 ){ - if (previous){ - previous->next = current->next; - }else - fieldList = current->next; - current->next=NULL; //ensure fieldlist destructor doesnt delete it - _CLDELETE(current); - return; - } - previous = current; - current = current->next; - } - } - - void Document::removeFields(const TCHAR* name) { - CND_PRECONDITION(name != NULL, "name is NULL"); - - DocumentFieldEnumeration::DocumentFieldList* previous = NULL; - DocumentFieldEnumeration::DocumentFieldList* current = fieldList; - while (current != NULL) { - //cannot use interning here, because name is probably not interned - if ( _tcscmp(current->field->name(),name) == 0 ){ - if (previous){ - previous->next = current->next; - }else - fieldList = current->next; - - current->next=NULL; //ensure fieldlist destructor doesnt delete it - _CLDELETE(current); - - if ( previous ) - current = previous->next; - else - current = fieldList; - }else{ - previous = current; - current = current->next; - } - } - } - - TCHAR** Document::getValues(const TCHAR* name) { - DocumentFieldEnumeration* it = fields(); - int32_t count = 0; - while ( it->hasMoreElements() ){ - Field* f = it->nextElement(); - //cannot use interning here, because name is probably not interned - if ( _tcscmp(f->name(),name) == 0 && f->stringValue() != NULL ) - count++; - } - _CLDELETE(it); - it = fields(); - - //todo: there must be a better way of doing this, we are doing two iterations of the fields - TCHAR** ret = NULL; - if ( count > 0 ){ - //start again - ret = _CL_NEWARRAY(TCHAR*,count+1); - int32_t i=0; - while ( it->hasMoreElements() ){ - Field* fld=it->nextElement(); - if ( _tcscmp(fld->name(),name)== 0 && fld->stringValue() != NULL ){ - ret[i] = stringDuplicate(fld->stringValue()); - i++; - } - } - ret[count]=NULL; - } - _CLDELETE(it); - return ret; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/document/Document.h b/3rdparty/clucene/src/CLucene/document/Document.h deleted file mode 100644 index ba7a283f7..000000000 --- a/3rdparty/clucene/src/CLucene/document/Document.h +++ /dev/null @@ -1,158 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_document_Document_ -#define _lucene_document_Document_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Field.h" - -///todo: jlucene has change from using DocumentFieldList/Enumeration -///to using a java List... do we want to do this too? -CL_NS_DEF(document) - -class Document; //predefine -class DocumentFieldEnumeration :LUCENE_BASE{ - class DocumentFieldList :LUCENE_BASE{ - public: - DocumentFieldList(Field* f, DocumentFieldList* n); - ~DocumentFieldList(); - Field* field; - DocumentFieldList* next; - }; - friend class Document; -private: - const DocumentFieldList* fields; -public: - DocumentFieldEnumeration(const DocumentFieldList* fl); - ~DocumentFieldEnumeration(); - bool hasMoreElements() const; - Field* nextElement(); -}; - -/** Documents are the unit of indexing and search. -* -* A Document is a set of fields. Each field has a name and a textual value. -* A field may be {@link Field#isStored() stored} with the document, in which -* case it is returned with search hits on the document. Thus each document -* should typically contain one or more stored fields which uniquely identify -* it. -* -*

Note that fields which are not {@link Field#isStored() stored} are -* not available in documents retrieved from the index, e.g. with {@link -* Hits#doc(int32_t, Document*)}, {@link Searcher#doc(int32_t, Document*)} or {@link -* IndexReader#document(int32_t, Document*)}. -*/ -class Document:LUCENE_BASE { -private: - DocumentFieldEnumeration::DocumentFieldList* fieldList; - qreal boost; -public: - Document(); - ~Document(); - - /** - *

Adds a field to a document. Several fields may be added with - * the same name. In this case, if the fields are indexed, their text is - * treated as though appended for the purposes of search.

- *

Note that add like the removeField(s) methods only makes sense - * prior to adding a document to an index. These methods cannot - * be used to change the content of an existing index! In order to achieve this, - * a document has to be deleted from an index and a new changed version of that - * document has to be added.

- * - */ - void add(Field& field); - /** Returns a field with the given name if any exist in this document, or - * null. If multiple fields exists with this name, this method returns the - * first value added. - * Note: name is case sensitive - */ - Field* getField(const TCHAR* name) const; - - /** Returns the string value of the field with the given name if any exist in - * this document, or null. If multiple fields exist with this name, this - * method returns the first value added. If only binary fields with this name - * exist, returns null. - * Note: name is case sensitive - */ - const TCHAR* get(const TCHAR* field) const; - - /** Returns an Enumeration of all the fields in a document. */ - DocumentFieldEnumeration* fields() const; - /** Prints the fields of a document for human consumption. */ - TCHAR* toString() const; - - /** Sets a boost factor for hits on any field of this document. This value - * will be multiplied into the score of all hits on this document. - * - *

Values are multiplied into the value of {@link Field#getBoost()} of - * each field in this document. Thus, this method in effect sets a default - * boost for the fields of this document. - * - * @see Field#setBoost(qreal) - */ - void setBoost(qreal boost); - - /** Returns the boost factor for hits on any field of this document. - * - *

The default value is 1.0. - * - *

Note: This value is not stored directly with the document in the index. - * Documents returned from {@link IndexReader#document(int32_t, Document*)} and - * {@link Hits#doc(int32_t, Document*)} may thus not have the same value present as when - * this document was indexed. - * - * @see #setBoost(qreal) - */ - qreal getBoost() const; - - - /** - *

Removes field with the specified name from the document. - * If multiple fields exist with this name, this method removes the first field that has been added. - * If there is no field with the specified name, the document remains unchanged.

- *

Note that the removeField(s) methods like the add method only make sense - * prior to adding a document to an index. These methods cannot - * be used to change the content of an existing index! In order to achieve this, - * a document has to be deleted from an index and a new changed version of that - * document has to be added.

- * Note: name is case sensitive - */ - void removeField(const TCHAR* name); - - /** - *

Removes all fields with the given name from the document. - * If there is no field with the specified name, the document remains unchanged.

- *

Note that the removeField(s) methods like the add method only make sense - * prior to adding a document to an index. These methods cannot - * be used to change the content of an existing index! In order to achieve this, - * a document has to be deleted from an index and a new changed version of that - * document has to be added.

- * Note: name is case sensitive - */ - void removeFields(const TCHAR* name); - - /** - * Returns an array of values of the field specified as the method parameter. - * This method can return null. - * Note: name is case sensitive - * - * @param name the name of the field - * @return a String[] of field values - */ - TCHAR** getValues(const TCHAR* name); - - /** - * Empties out the document so that it can be reused - */ - void clear(); -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/document/Field.cpp b/3rdparty/clucene/src/CLucene/document/Field.cpp deleted file mode 100644 index 8cd88a36b..000000000 --- a/3rdparty/clucene/src/CLucene/document/Field.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CLucene/util/Reader.h" -#include "Field.h" -#include "CLucene/util/Misc.h" -#include "CLucene/util/StringIntern.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(document) - -Field::Field(const TCHAR* Name, const TCHAR* String, bool store, bool index, bool token, const bool storeTermVector) -{ -//Func - Constructor -//Pre - Name != NULL and contains the name of the field -// String != NULL and contains the value of the field -// store indicates if the field must be stored -// index indicates if the field must be indexed -// token indicates if the field must be tokenized -//Post - The instance has been created - - CND_PRECONDITION(Name != NULL, "Name is NULL"); - CND_PRECONDITION(String != NULL,"String is NULL"); - CND_PRECONDITION(!(!index && storeTermVector),"cannot store a term vector for fields that are not indexed."); - - _name = CLStringIntern::intern( Name CL_FILELINE); - _stringValue = stringDuplicate( String ); - _readerValue = NULL; - _streamValue = NULL; - boost=1.0f; - omitNorms = false; - - int cfg = 0; - if ( store ) - cfg |= STORE_YES; - if ( index && token ) - cfg |= INDEX_TOKENIZED; - else if ( index && !token ) - cfg |= INDEX_UNTOKENIZED; - - if ( storeTermVector ) - _CLTHROWA(CL_ERR_IllegalArgument,"Stored term vector is deprecated with using this constructor"); - - setConfig(cfg); -} - -Field::Field(const TCHAR* Name, Reader* reader, bool store, bool index, bool token, const bool storeTermVector) -{ -//Func - Constructor -//Pre - Name != NULL and contains the name of the field -// reader != NULL and contains a Reader -// store indicates if the field must be stored -// index indicates if the field must be indexed -// token indicates if the field must be tokenized -//Post - The instance has been created - - CND_PRECONDITION(Name != NULL, "Name is NULL"); - CND_PRECONDITION(reader != NULL, "reader is NULL"); - - _name = CLStringIntern::intern( Name CL_FILELINE); - _stringValue = NULL; - _readerValue = reader; - _streamValue = NULL; - boost=1.0f; - omitNorms = false; - - int cfg = 0; - if ( store ) - cfg |= STORE_YES; - if ( index && token ) - cfg |= INDEX_TOKENIZED; - else if ( index && !token ) - cfg |= INDEX_UNTOKENIZED; - - if ( storeTermVector ) - _CLTHROWA(CL_ERR_IllegalArgument,"Stored term vector is deprecated with using this constructor"); - - setConfig(cfg); -} - -Field::Field(const TCHAR* Name, Reader* reader, int config) -{ - CND_PRECONDITION(Name != NULL, "Name is NULL"); - CND_PRECONDITION(reader != NULL, "reader is NULL"); - - _name = CLStringIntern::intern( Name CL_FILELINE); - _stringValue = NULL; - _readerValue = reader; - _streamValue = NULL; - boost=1.0f; - omitNorms = false; - - setConfig(config); -} - - -Field::Field(const TCHAR* Name, const TCHAR* Value, int config) -{ - CND_PRECONDITION(Name != NULL, "Name is NULL"); - CND_PRECONDITION(Value != NULL, "value is NULL"); - - _name = CLStringIntern::intern( Name CL_FILELINE); - _stringValue = stringDuplicate( Value ); - _readerValue = NULL; - _streamValue = NULL; - boost=1.0f; - omitNorms = false; - - setConfig(config); -} - -Field::Field(const TCHAR* Name, jstreams::StreamBase* Value, int config) -{ - CND_PRECONDITION(Name != NULL, "Name is NULL"); - CND_PRECONDITION(Value != NULL, "value is NULL"); - - _name = CLStringIntern::intern( Name CL_FILELINE); - _stringValue = NULL; - _readerValue = NULL; - _streamValue = Value; - boost=1.0f; - omitNorms = false; - - setConfig(config); -} - -Field::~Field(){ -//Func - Destructor -//Pre - true -//Post - Instance has been destroyed - - CLStringIntern::unintern(_name); - _CLDELETE_CARRAY(_stringValue); - _CLDELETE(_readerValue); - _CLVDELETE( _streamValue ); -} - - -/*===============FIELDS=======================*/ -const TCHAR* Field::name() { return _name; } ///* Field::streamValue() { return _streamValue; } ///omitNorms=omitNorms; } - -void Field::setBoost(qreal boost) { this->boost = boost; } -qreal Field::getBoost() { return boost; } - -void Field::setConfig(int x){ - int newConfig=0; - - //set storage settings - if ( (x & STORE_YES) || (x & STORE_COMPRESS) ){ - newConfig |= STORE_YES; - if ( x & STORE_COMPRESS ) - newConfig |= STORE_COMPRESS; - }else - newConfig |= STORE_NO; - - if ( (x & INDEX_NO)==0 ){ - bool index=false; - - if ( x & INDEX_NONORMS ){ - newConfig |= INDEX_NONORMS; - index = true; - } - - if ( x & INDEX_TOKENIZED && x & INDEX_UNTOKENIZED ) - _CLTHROWA(CL_ERR_IllegalArgument,"it doesn't make sense to have an untokenised and tokenised field"); - if ( x & INDEX_TOKENIZED ){ - newConfig |= INDEX_TOKENIZED; - index = true; - } - if ( x & INDEX_UNTOKENIZED ){ - newConfig |= INDEX_UNTOKENIZED; - index = true; - } - if ( !index ) - newConfig |= INDEX_NO; - }else - newConfig |= INDEX_NO; - - if ( newConfig & INDEX_NO && newConfig & STORE_NO ) - _CLTHROWA(CL_ERR_IllegalArgument,"it doesn't make sense to have a field that is neither indexed nor stored"); - - //set termvector settings - if ( (x & TERMVECTOR_NO) == 0 ){ - bool termVector=false; - if ( x & TERMVECTOR_YES ){ - termVector=true; - } - if ( x & TERMVECTOR_WITH_OFFSETS ){ - newConfig |= TERMVECTOR_WITH_OFFSETS; - termVector=true; - } - if ( x & TERMVECTOR_WITH_POSITIONS ){ - newConfig |= TERMVECTOR_WITH_POSITIONS; - termVector=true; - } - if ( termVector ){ - if ( newConfig & INDEX_NO ) - _CLTHROWA(CL_ERR_IllegalArgument,"cannot store a term vector for fields that are not indexed."); - - newConfig |= TERMVECTOR_YES; - }else - newConfig |= TERMVECTOR_NO; - }else - newConfig |= TERMVECTOR_NO; - - config = newConfig; -} - -TCHAR* Field::toString() { - CL_NS(util)::StringBuffer result; - if (isStored()) { - result.append( _T("stored") ); - } - if (isIndexed()) { - if (result.length() > 0) - result.append( _T(",") ); - result.append( _T("indexed") ); - } - if (isTokenized()) { - if (result.length() > 0) - result.append( _T(",") ); - result.append( _T("tokenized") ); - } - if (isTermVectorStored()) { - if (result.length() > 0) - result.append( _T(",") ); - result.append( _T("termVector") ); - } - if (isStoreOffsetWithTermVector()) { - if (result.length() > 0) - result.appendChar( ',' ); - result.append( _T("termVectorOffsets") ); - } - if (isStorePositionWithTermVector()) { - if (result.length() > 0) - result.appendChar( ',' ); - result.append( _T("termVectorPosition") ); - } - if (isBinary()) { - if (result.length() > 0) - result.appendChar( ',' ); - result.append( _T("binary") ); - } - if (getOmitNorms()) { - result.append( _T(",omitNorms") ); - } - result.appendChar('<'); - result.append(name()); - result.appendChar(':'); - - if (_stringValue != NULL) - result.append(_stringValue); - else if ( _readerValue != NULL ) - result.append( _T("Reader") ); - else if ( _streamValue != NULL ) - result.append( _T("Stream") ); - else - result.append( _T("NULL") ); - - result.appendChar('>'); - return result.toString(); -} - - -Field* Field::Keyword(const TCHAR* Name, const TCHAR* Value) { - return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_UNTOKENIZED); -} - -Field* Field::UnIndexed(const TCHAR* Name, const TCHAR* Value) { - return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_NO); -} - -Field* Field::Text(const TCHAR* Name, const TCHAR* Value, const bool storeTermVector) { - if ( storeTermVector ) - return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_TOKENIZED | Field::TERMVECTOR_YES); - else - return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_TOKENIZED); -} - -Field* Field::UnStored(const TCHAR* Name, const TCHAR* Value, const bool storeTermVector) { - if ( storeTermVector ) - return _CLNEW Field(Name,Value,Field::STORE_NO | Field::INDEX_TOKENIZED | Field::TERMVECTOR_YES); - else - return _CLNEW Field(Name,Value,Field::STORE_NO | Field::INDEX_TOKENIZED); -} - -Field* Field::Text(const TCHAR* Name, Reader* Value, const bool storeTermVector) { - if ( storeTermVector ) - return _CLNEW Field(Name,Value,Field::INDEX_TOKENIZED | Field::TERMVECTOR_YES); - else - return _CLNEW Field(Name,Value,Field::INDEX_TOKENIZED); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/document/Field.h b/3rdparty/clucene/src/CLucene/document/Field.h deleted file mode 100644 index 771a1382b..000000000 --- a/3rdparty/clucene/src/CLucene/document/Field.h +++ /dev/null @@ -1,261 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_document_Field_ -#define _lucene_document_Field_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/Reader.h" -#include "CLucene/util/streambase.h" - -CL_NS_DEF(document) -/** -A field is a section of a Document. Each field has two parts, a name and a -value. Values may be free text, provided as a String or as a Reader, or they -may be atomic keywords, which are not further processed. Such keywords may -be used to represent dates, urls, etc. Fields are optionally stored in the -index, so that they may be returned with hits on the document. - -PORTING: CLucene doesn't directly support compressed fields. However, it is easy -to reproduce this functionality by using the GZip streams in the contrib package. -Also note that binary fields are not read immediately in CLucene, a substream -is pointed directly to the field's data, in affect creating a lazy load ability. -This means that large fields are best saved in binary format (even if they are -text), so that they can be loaded lazily. -*/ -class Field :LUCENE_BASE{ -private: - const TCHAR* _name; - TCHAR* _stringValue; - CL_NS(util)::Reader* _readerValue; - jstreams::StreamBase* _streamValue; - - int config; - qreal boost; - bool omitNorms; -public: - enum Store{ - /** Store the original field value in the index. This is useful for short texts - * like a document's title which should be displayed with the results. The - * value is stored in its original form, i.e. no analyzer is used before it is - * stored. - */ - STORE_YES=1, - /** Do not store the field value in the index. */ - STORE_NO=2, - - /** Store the original field value in the index in a compressed form. This is - * useful for long documents and for binary valued fields. - * NOTE: CLucene does not directly support compressed fields, to store a - * compressed field. - * //TODO: need better documentation on how to add a compressed field - * //because actually we still need to write a GZipOutputStream... - */ - STORE_COMPRESS=4 - }; - - enum Index{ - /** Do not index the field value. This field can thus not be searched, - * but one can still access its contents provided it is - * {@link Field::Store stored}. */ - INDEX_NO=16, - /** Index the field's value so it can be searched. An Analyzer will be used - * to tokenize and possibly further normalize the text before its - * terms will be stored in the index. This is useful for common text. - */ - INDEX_TOKENIZED=32, - /** Index the field's value without using an Analyzer, so it can be searched. - * As no analyzer is used the value will be stored as a single term. This is - * useful for unique Ids like product numbers. - */ - INDEX_UNTOKENIZED=64, - /** Index the field's value without an Analyzer, and disable - * the storing of norms. No norms means that index-time boosting - * and field length normalization will be disabled. The benefit is - * less memory usage as norms take up one byte per indexed field - * for every document in the index. - */ - INDEX_NONORMS=128 - }; - - enum TermVector{ - /** Do not store term vectors. */ - TERMVECTOR_NO=256, - /** Store the term vectors of each document. A term vector is a list - * of the document's terms and their number of occurences in that document. */ - TERMVECTOR_YES=512, - /** - * Store the term vector + token position information - * - * @see #YES - */ - TERMVECTOR_WITH_POSITIONS=1024, - /** - * Store the term vector + Token offset information - * - * @see #YES - */ - TERMVECTOR_WITH_OFFSETS=2048 - }; - - _CL_DEPRECATED( another overload ) Field(const TCHAR* name, const TCHAR* value, bool store, bool index, bool token, const bool storeTermVector=false); - _CL_DEPRECATED( another overload ) Field(const TCHAR* name, CL_NS(util)::Reader* reader, bool store, bool index, bool token, const bool storeTermVector=false); - - Field(const TCHAR* name, const TCHAR* value, int configs); - Field(const TCHAR* name, CL_NS(util)::Reader* reader, int configs); - Field(const TCHAR* name, jstreams::StreamBase* stream, int configs); - ~Field(); - - /** Constructs a String-valued Field that is not tokenized, but is indexed - * and stored. Useful for non-text fields, e.g. date or url. - * @deprecated Use new Field(name,value,Field::STORE_YES | Field::INDEX_UNTOKENIZED) - */ - _CL_DEPRECATED( new Field(*) ) static Field* Keyword(const TCHAR* name, const TCHAR* value); - - /** Constructs a String-valued Field that is not tokenized nor indexed, - * but is stored in the index, for return with hits. - * @deprecated Use new Field(name,value,Field::STORE_YES | Field::INDEX_NO) - */ - _CL_DEPRECATED( new Field(*) ) static Field* UnIndexed(const TCHAR* name, const TCHAR* value); - - /** Constructs a String-valued Field that is tokenized and indexed, - * and is stored in the index, for return with hits. Useful for short text - * fields, like "title" or "subject". - * @deprecated Use new Field(name,value,Field::STORE_YES | Field::INDEX_TOKENIZED) - */ - _CL_DEPRECATED( new Field(*) ) static Field* Text(const TCHAR* name, const TCHAR* value, const bool storeTermVector=false); - - /** Constructs a String-valued Field that is tokenized and indexed, - * but that is not stored in the index. - * @deprecated Use new Field(name,value,Field::STORE_NO | Field::INDEX_TOKENIZED) - */ - _CL_DEPRECATED( new Field(*) ) static Field* UnStored(const TCHAR* name, const TCHAR* value, const bool storeTermVector=false); - - /** Constructs a Reader-valued Field that is tokenized and indexed, but is - * *not* stored in the index verbatim. Useful for longer text fields, like - * "body". - * @deprecated Use new Field(name,value, Field::INDEX_TOKENIZED) - */ - _CL_DEPRECATED( new Field(*) ) static Field* Text(const TCHAR* name, CL_NS(util)::Reader* value, const bool storeTermVector=false); - - /** The name of the field (e.g., "date", "subject", "title", "body", etc.) - * as an interned string. */ - const TCHAR* name(); ///* streamValue(); - - // True iff the value of the field is to be stored in the index for return - // with search hits. It is an error for this to be true if a field is - // Reader-valued. - bool isStored(); - - // True iff the value of the field is to be indexed, so that it may be - // searched on. - bool isIndexed(); - - // True iff the value of the field should be tokenized as text prior to - // indexing. Un-tokenized fields are indexed as a single word and may not be - // Reader-valued. - bool isTokenized(); - - /** True if the value of the field is stored and compressed within the index - * NOTE: CLucene does not actually support compressed fields, Instead, a reader - * will be returned with a pointer to a SubIndexInputStream. A GZipInputStream - * and a UTF8 reader must be used to actually read the content. This flag - * will only be set if the index was created by another lucene implementation. - */ - bool isCompressed(); - - //Set configs using XOR. This resets all the settings - //For example, to use term vectors with positions and offsets do: - //object->setConfig(TERMVECTOR_WITH_POSITIONS | TERMVECTOR_WITH_OFFSETS); - void setConfig(int termVector); - - /** True iff the term or terms used to index this field are stored as a term - * vector, available from {@link IndexReader#getTermFreqVector(int32_t,TCHAR*)}. - * These methods do not provide access to the original content of the field, - * only to terms used to index it. If the original content must be - * preserved, use the stored attribute instead. - * - * @see IndexReader#getTermFreqVector(int32_t, String) - */ - bool isTermVectorStored(); - - /** - * True iff terms are stored as term vector together with their offsets - * (start and end positon in source text). - */ - bool isStoreOffsetWithTermVector(); - - /** - * True iff terms are stored as term vector together with their token positions. - */ - bool isStorePositionWithTermVector(); - - /** Returns the boost factor for hits for this field. - * - *

The default value is 1.0. - * - *

Note: this value is not stored directly with the document in the index. - * Documents returned from {@link IndexReader#document(int)} and - * {@link Hits#doc(int)} may thus not have the same value present as when - * this field was indexed. - * - * @see #setBoost(float) - */ - qreal getBoost(); - - /** Sets the boost factor hits on this field. This value will be - * multiplied into the score of all hits on this field of this document. - * - *

The boost is multiplied by {@link Document#getBoost()} of the document - * containing this field. If a document has multiple fields with the same - * name, all such values are multiplied together. This product is then - * multipled by the value {@link Similarity#lengthNorm(String,int)}, and - * rounded by {@link Similarity#encodeNorm(float)} before it is stored in the - * index. One should attempt to ensure that this product does not overflow - * the range of that encoding. - * - * @see Document#setBoost(float) - * @see Similarity#lengthNorm(String, int) - * @see Similarity#encodeNorm(float) - */ - void setBoost(qreal value); - - /** True iff the value of the filed is stored as binary */ - bool isBinary(); - - /** True if norms are omitted for this indexed field */ - bool getOmitNorms(); - - /** Expert: - * - * If set, omit normalization factors associated with this indexed field. - * This effectively disables indexing boosts and length normalization for this field. - */ - void setOmitNorms(bool omitNorms); - - // Prints a Field for human consumption. - TCHAR* toString(); -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp b/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp deleted file mode 100644 index efa0e2563..000000000 --- a/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CompoundFile.h" -#include "CLucene/util/Misc.h" - -CL_NS_USE(store) -CL_NS_USE(util) -CL_NS_DEF(index) - -CompoundFileReader::CSIndexInput::CSIndexInput(CL_NS(store)::IndexInput* base, - const int64_t fileOffset, const int64_t length) -{ - this->base = base; - this->fileOffset = fileOffset; - this->_length = length; -} - -void CompoundFileReader::CSIndexInput::readInternal(uint8_t* b, const int32_t len) -{ - SCOPED_LOCK_MUTEX(base->THIS_LOCK) - - int64_t start = getFilePointer(); - if(start + len > _length) - _CLTHROWA(CL_ERR_IO, "read past EOF"); - base->seek(fileOffset + start); - base->readBytes(b, len); -} - -CompoundFileReader::CSIndexInput::~CSIndexInput() -{ -} - -IndexInput* CompoundFileReader::CSIndexInput::clone() const -{ - return _CLNEW CSIndexInput(*this); -} - -CompoundFileReader::CSIndexInput::CSIndexInput(const CSIndexInput& clone) - : BufferedIndexInput(clone) -{ - this->base = clone.base; //no need to clone this.. - this->fileOffset = clone.fileOffset; - this->_length = clone._length; -} - -void CompoundFileReader::CSIndexInput::close() -{ -} - -CompoundFileReader::CompoundFileReader(Directory* dir, const QString& name) - : entries(false, true) -{ - directory = dir; - fileName = name; - - bool success = false; - try { - stream = dir->openInput(name); - - // read the directory and init files - int32_t count = stream->readVInt(); - FileEntry* entry = NULL; - TCHAR tid[CL_MAX_PATH]; - for (int32_t i = 0; i < count; i++) { - int64_t offset = stream->readLong(); - int32_t read = stream->readString(tid, CL_MAX_PATH); - QString aid(QString::fromWCharArray(tid, read)); - - // set length of the previous entry - if (entry != NULL) - entry->length = offset - entry->offset; - - entry = _CLNEW FileEntry(offset); - entries.put(aid, entry); - } - - // set the length of the final entry - if (entry != NULL) - entry->length = stream->length() - entry->offset; - success = true; - } _CLFINALLY ( - if (!success && (stream != NULL)) { - try { - stream->close(); - _CLDELETE(stream); - } catch (CLuceneError& err) { - if (err.number() != CL_ERR_IO) - throw err; - } - } - ) -} - -CompoundFileReader::~CompoundFileReader() -{ - close(); -} - -Directory* CompoundFileReader::getDirectory() -{ - return directory; -} - -QString CompoundFileReader::getName() const -{ - return fileName; -} - -void CompoundFileReader::close() -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - - if (stream != NULL) { - entries.clear(); - stream->close(); - _CLDELETE(stream); - } -} - -IndexInput* CompoundFileReader::openInput(const QString& id) -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - - if (stream == NULL) - _CLTHROWA(CL_ERR_IO, "Stream closed"); - - const FileEntry* entry = entries.get(id); - if (entry == NULL) { - char buf[CL_MAX_PATH + 30]; - strcpy(buf,"No sub-file with id "); - strncat(buf, id.toLocal8Bit().constData(), CL_MAX_PATH); - strcat(buf, " found"); - _CLTHROWA(CL_ERR_IO,buf); - } - return _CLNEW CSIndexInput(stream, entry->offset, entry->length); -} - -QStringList CompoundFileReader::list() const -{ - // for (EntriesType::const_iterator i=entries.begin();i!=entries.end();i++){ - // names->push_back(i->first); - // ++i; - // } - - QStringList names; - EntriesType::const_iterator itr; - // TODO: verify this, see old code above ??? - for (itr = entries.begin(); itr != entries.end(); ++itr) - names.push_back(itr->first); - - return names; -} - -bool CompoundFileReader::fileExists(const QString& name) const -{ - return entries.exists(name); -} - -int64_t CompoundFileReader::fileModified(const QString& name) const -{ - return directory->fileModified(fileName); -} - -void CompoundFileReader::touchFile(const QString& name) -{ - directory->touchFile(fileName); -} - -bool CompoundFileReader::doDeleteFile(const QString& name) -{ - _CLTHROWA(CL_ERR_UnsupportedOperation, - "UnsupportedOperationException: CompoundFileReader::doDeleteFile"); -} - -void CompoundFileReader::renameFile(const QString& from, const QString& to) -{ - _CLTHROWA(CL_ERR_UnsupportedOperation, - "UnsupportedOperationException: CompoundFileReader::renameFile"); -} - -int64_t CompoundFileReader::fileLength(const QString& name) const -{ - FileEntry* e = entries.get(name); - if (e == NULL) { - char buf[CL_MAX_PATH + 30]; - strcpy(buf,"File "); - strncat(buf, name.toLocal8Bit().constData(), CL_MAX_PATH); - strcat(buf," does not exist"); - _CLTHROWA(CL_ERR_IO,buf); - } - return e->length; -} - -IndexOutput* CompoundFileReader::createOutput(const QString& name) -{ - _CLTHROWA(CL_ERR_UnsupportedOperation, - "UnsupportedOperationException: CompoundFileReader::createOutput"); -} - -LuceneLock* CompoundFileReader::makeLock(const QString& name) -{ - _CLTHROWA(CL_ERR_UnsupportedOperation, - "UnsupportedOperationException: CompoundFileReader::makeLock"); -} - -QString CompoundFileReader::toString() const -{ - QString ret(QLatin1String("CompoundFileReader@")); - return ret.append(fileName); -} - -CompoundFileWriter::CompoundFileWriter(Directory* dir, const QString& name) - : ids(false) - , entries(true) -{ - if (dir == NULL) - _CLTHROWA(CL_ERR_NullPointer, "directory cannot be null"); - - if (name.isEmpty()) - _CLTHROWA(CL_ERR_NullPointer, "name cannot be null"); - - merged = false; - directory = dir; - fileName = name; -} - -CompoundFileWriter::~CompoundFileWriter() -{ -} - -Directory* CompoundFileWriter::getDirectory() -{ - return directory; -} - -/** Returns the name of the compound file. */ -QString CompoundFileWriter::getName() const -{ - return fileName; -} - -void CompoundFileWriter::addFile(const QString& file) -{ - if (merged) - _CLTHROWA(CL_ERR_IO, "Can't add extensions after merge has been called"); - - if (file.isEmpty()) - _CLTHROWA(CL_ERR_NullPointer, "file cannot be null"); - - if (ids.find(file) != ids.end()) { - char buf[CL_MAX_PATH + 30]; - strcpy(buf, "File "); - strncat(buf, file.toLocal8Bit().constData(), CL_MAX_PATH); - strcat(buf," already added"); - _CLTHROWA(CL_ERR_IO,buf); - } - ids.insert(file); - entries.push_back(_CLNEW WriterFileEntry(file)); -} - -void CompoundFileWriter::close() -{ - if (merged) - _CLTHROWA(CL_ERR_IO, "Merge already performed"); - - if (entries.size() == 0) // isEmpty() - _CLTHROWA(CL_ERR_IO, "No entries to merge have been defined"); - - merged = true; - - // open the compound stream - IndexOutput* os = NULL; - try { - os = directory->createOutput(fileName); - - // Write the number of entries - os->writeVInt(entries.size()); - - // Write the directory with all offsets at 0. - // Remember the positions of directory entries so that we can - // adjust the offsets later - { //msvc6 for scope fix - TCHAR tfile[CL_MAX_PATH]; - for (CLLinkedList::iterator i = entries.begin(); - i != entries.end(); i++) { - WriterFileEntry* fe = *i; - fe->directoryOffset = os->getFilePointer(); - os->writeLong(0); // for now - tfile[fe->file.toWCharArray(tfile)] = '\0'; - os->writeString(tfile, _tcslen(tfile)); - } - } - - // Open the files and copy their data into the stream. - // Remember the locations of each file's data section. - { //msvc6 for scope fix - int32_t bufferLength = 1024; - uint8_t buffer[1024]; - for (CLLinkedList::iterator i = entries.begin(); - i != entries.end(); i++) { - WriterFileEntry* fe = *i; - fe->dataOffset = os->getFilePointer(); - copyFile(fe, os, buffer, bufferLength); - } - } - - { //msvc6 for scope fix - // Write the data offsets into the directory of the compound stream - for (CLLinkedList::iterator i = entries.begin(); - i != entries.end(); i++) { - WriterFileEntry* fe = *i; - os->seek(fe->directoryOffset); - os->writeLong(fe->dataOffset); - } - } - - - } _CLFINALLY ( - if (os != NULL) { - try { - os->close(); - _CLDELETE(os); - } catch (...) { } - } - ); -} - -void CompoundFileWriter::copyFile(WriterFileEntry* source, IndexOutput* os, - uint8_t* buffer, int32_t bufferLength) -{ - IndexInput* is = NULL; - try { - int64_t startPtr = os->getFilePointer(); - - is = directory->openInput(source->file); - int64_t length = is->length(); - int64_t remainder = length; - int32_t chunk = bufferLength; - - while(remainder > 0) { - int32_t len = (int32_t)min((int64_t)chunk, remainder); - is->readBytes(buffer, len); - os->writeBytes(buffer, len); - remainder -= len; - } - - // Verify that remainder is 0 - if (remainder != 0) { - TCHAR buf[CL_MAX_PATH+100]; - _sntprintf(buf, CL_MAX_PATH + 100, _T("Non-zero remainder length ") - _T("after copying: %d (id: %s, length: %d, buffer size: %d)"), - remainder, source->file.toLocal8Bit().constData(), length, chunk); - _CLTHROWT(CL_ERR_IO, buf); - } - - // Verify that the output length diff is equal to original file - int64_t endPtr = os->getFilePointer(); - int64_t diff = endPtr - startPtr; - if (diff != length) { - TCHAR buf[100]; - _sntprintf(buf, 100, _T("Difference in the output file offsets %d ") - _T("does not match the original file length %d"), diff, length); - _CLTHROWT(CL_ERR_IO,buf); - } - } _CLFINALLY ( - if (is != NULL) { - is->close(); - _CLDELETE(is); - } - ); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/CompoundFile.h b/3rdparty/clucene/src/CLucene/index/CompoundFile.h deleted file mode 100644 index 84799a62f..000000000 --- a/3rdparty/clucene/src/CLucene/index/CompoundFile.h +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#ifndef _lucene_index_compoundfile_h -#define _lucene_index_compoundfile_h - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include - -#include "CLucene/store/IndexInput.h" -#include "CLucene/store/IndexOutput.h" -#include "CLucene/store/Directory.h" -#include "CLucene/store/Lock.h" -#include "CLucene/util/VoidList.h" -#include "CLucene/util/VoidMap.h" - -CL_NS_DEF(index) - -// Class for accessing a compound stream. -// This class implements a directory, but is limited to only read operations. -// Directory methods that would normally modify data throw an exception. -class CompoundFileReader : public CL_NS(store)::Directory -{ -private: - /** Implementation of an IndexInput that reads from a portion of the - * compound file. The visibility is left as "package" *only* because - * this helps with testing since JUnit test cases in a different class - * can then access package fields of this class. - */ - class CSIndexInput : public CL_NS(store)::BufferedIndexInput - { - private: - CL_NS(store)::IndexInput* base; - int64_t fileOffset; - int64_t _length; - protected: - /** Expert: implements buffer refill. Reads uint8_ts from the current - * position in the input. - * @param b the array to read uint8_ts into - * @param length the number of uint8_ts to read - */ - void readInternal(uint8_t* b, const int32_t len); - void seekInternal(const int64_t pos) {} - - public: - CSIndexInput(CL_NS(store)::IndexInput* base, const int64_t fileOffset, - const int64_t length); - CSIndexInput(const CSIndexInput& clone); - ~CSIndexInput(); - - /** Closes the stream to futher operations. */ - void close(); - CL_NS(store)::IndexInput* clone() const; - - int64_t length() { return _length; } - - QString getDirectoryType() const { - return CompoundFileReader::DirectoryType(); } - }; - - class FileEntry : LUCENE_BASE - { - public: - FileEntry() - : offset(0), length(0) {} - FileEntry(int64_t _offset) - : offset(_offset), length(0) {} - ~FileEntry() {} - - int64_t offset; - int64_t length; - }; - - // Base info - CL_NS(store)::Directory* directory; - QString fileName; - - CL_NS(store)::IndexInput* stream; - - typedef CL_NS(util)::CLHashMap > EntriesType; - EntriesType entries; -protected: - // Removes an existing file in the directory-> - bool doDeleteFile(const QString& name); - -public: - CompoundFileReader(CL_NS(store)::Directory* dir, const QString& name); - ~CompoundFileReader(); - CL_NS(store)::Directory* getDirectory(); - QString getName() const; - - void close(); - CL_NS(store)::IndexInput* openInput(const QString& id); - - /** Returns an array of strings, one for each file in the directory-> */ - QStringList list() const; - /** Returns true iff a file with the given name exists. */ - bool fileExists(const QString& name) const; - /** Returns the time the named file was last modified. */ - int64_t fileModified(const QString& name) const; - /** Set the modified time of an existing file to now. */ - void touchFile(const QString& name); - /** Renames an existing file in the directory-> - If a file already exists with the new name, then it is replaced. - This replacement should be atomic. */ - void renameFile(const QString& from, const QString& to); - /** Returns the length of a file in the directory. - * @throws IOException if the file does not exist */ - int64_t fileLength(const QString& name) const; - /** Not implemented - * @throws UnsupportedOperationException */ - CL_NS(store)::IndexOutput* createOutput(const QString& name); - /** Not implemented - * @throws UnsupportedOperationException */ - CL_NS(store)::LuceneLock* makeLock(const QString& name); - - QString toString() const; - - static QString DirectoryType() { return QLatin1String("CFS"); } - QString getDirectoryType() const { return DirectoryType(); } -}; - - - -// Combines multiple files into a single compound file. -// The file format:
-//

    -//
  • VInt fileCount
  • -//
  • {Directory} -// fileCount entries with the following structure:
  • -//
      -//
    • int64_t dataOffset
    • -//
    • UTFString extension
    • -//
    -//
  • {File Data} -// fileCount entries with the raw data of the corresponding file
  • -//
-// The fileCount integer indicates how many files are contained in this compound -// file. The {directory} that follows has that many entries. Each directory entry -// contains an encoding identifier, an int64_t pointer to the start of this file's -// data section, and a UTF String with that file's extension. -class CompoundFileWriter : LUCENE_BASE -{ - class WriterFileEntry : LUCENE_BASE { - public: - WriterFileEntry() - : dataOffset(0), directoryOffset(0) {} - WriterFileEntry(const QString& _file) - : file(_file), dataOffset(0), directoryOffset(0) {} - ~WriterFileEntry() {} - - QString file; - // temporary holder for the start of this file's data section - int64_t dataOffset; - // temporary holder for the start of directory entry for this file - int64_t directoryOffset; - }; - - bool merged; - QString fileName; - CL_NS(store)::Directory* directory; - - CL_NS(util)::CLHashSet ids; - - CL_NS(util)::CLLinkedList > entries; - - // Copy the contents of the file with specified extension into the - // provided output stream. Use the provided buffer for moving data - // to reduce memory allocation. - void copyFile(WriterFileEntry* source, CL_NS(store)::IndexOutput* os, - uint8_t* buffer, int32_t bufferLength); - -public: - // Create the compound stream in the specified file. The file name is the - // entire name (no extensions are added). - CompoundFileWriter(CL_NS(store)::Directory* dir, const QString& name); - ~CompoundFileWriter(); - - // Returns the directory of the compound file. - CL_NS(store)::Directory* getDirectory(); - - QString getName() const ; - /* Add a source stream. file is the string by which the - * sub-stream will be known in the compound stream. - * - * @throws IllegalStateException if this writer is closed - * @throws NullPointerException if file is null - * @throws IllegalArgumentException if a file with the same name - * has been added already - */ - void addFile(const QString& file); - /* Merge files with the extensions added up to now. - * All files with these extensions are combined sequentially into the - * compound stream. After successful merge, the source files - * @throws IllegalStateException if close() had been called before or - * if no file has been added to this object - * are deleted. - */ - void close(); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp b/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp deleted file mode 100644 index dcbc31591..000000000 --- a/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp +++ /dev/null @@ -1,571 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" - -#include "DocumentWriter.h" -#include "FieldInfos.h" -#include "IndexWriter.h" -#include "FieldsWriter.h" -#include "Term.h" -#include "TermInfo.h" -#include "TermInfosWriter.h" - -#include "CLucene/analysis/AnalysisHeader.h" - -#include "CLucene/search/Similarity.h" -#include "TermInfosWriter.h" -#include "FieldsWriter.h" - -CL_NS_USE(util) -CL_NS_USE(store) -CL_NS_USE(analysis) -CL_NS_USE(document) -CL_NS_DEF(index) - -/*Posting*/ - -DocumentWriter::Posting::Posting(Term* t, const int32_t position, - TermVectorOffsetInfo* offset) -{ - //Func - Constructor - //Pre - t contains a valid reference to a Term - //Post - Instance has been created - freq = 1; - - term = _CL_POINTER(t); - positions.values = (int32_t*)malloc(sizeof(int32_t)); - positions.values[0] = position; - positions.length = 1; - - if ( offset != NULL ){ - this->offsets.values =(TermVectorOffsetInfo*)malloc(sizeof(TermVectorOffsetInfo)); - this->offsets.values[0] = *offset; - this->offsets.length = 1; - } -} - -DocumentWriter::Posting::~Posting() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - free(positions.values); - if ( this->offsets.values != NULL ) - free(this->offsets.values); - _CLDECDELETE(term); -} - -DocumentWriter::DocumentWriter(Directory* d, Analyzer* a, - CL_NS(search)::Similarity* sim, const int32_t mfl) - : analyzer(a) - , directory(d) - , maxFieldLength(mfl) - , fieldInfos(NULL) - , fieldLengths(NULL) - , similarity(sim) - , termIndexInterval(IndexWriter::DEFAULT_TERM_INDEX_INTERVAL) - , fieldPositions(NULL) - , fieldBoosts(NULL) - , termBuffer(_CLNEW Term) -{ - //Pre - d contains a valid reference to a Directory - // d contains a valid reference to a Analyzer - // mfl > 0 and contains the maximum field length - //Post - Instance has been created - - CND_PRECONDITION(((mfl > 0) || (mfl == IndexWriter::FIELD_TRUNC_POLICY__WARN)), - "mfl is 0 or smaller than IndexWriter::FIELD_TRUNC_POLICY__WARN") - - fieldInfos = NULL; - fieldLengths = NULL; -} - -DocumentWriter::DocumentWriter(CL_NS(store)::Directory* d, - CL_NS(analysis)::Analyzer* a, IndexWriter* writer) - : analyzer(a) - , directory(d) - , maxFieldLength(writer->getMaxFieldLength()) - , fieldInfos(NULL) - , fieldLengths(NULL) - , similarity(writer->getSimilarity()) - , termIndexInterval(writer->getTermIndexInterval()) - , fieldPositions(NULL) - , fieldBoosts(NULL) - , termBuffer(_CLNEW Term) -{ - //Pre - d contains a valid reference to a Directory - // d contains a valid reference to a Analyzer - // mfl > 0 and contains the maximum field length - //Post - Instance has been created - - CND_PRECONDITION(((maxFieldLength > 0) - || (maxFieldLength == IndexWriter::FIELD_TRUNC_POLICY__WARN)), - "mfl is 0 or smaller than IndexWriter::FIELD_TRUNC_POLICY__WARN") - - fieldInfos = NULL; - fieldLengths = NULL; - -} - -DocumentWriter::~DocumentWriter() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - clearPostingTable(); - _CLDELETE( fieldInfos ); - _CLDELETE_ARRAY(fieldLengths); - _CLDELETE_ARRAY(fieldPositions); - _CLDELETE_ARRAY(fieldBoosts); - _CLDELETE_ARRAY(fieldOffsets); - - _CLDECDELETE(termBuffer); -} - -void DocumentWriter::clearPostingTable() -{ - PostingTableType::iterator itr = postingTable.begin(); - while (itr != postingTable.end()){ - _CLDELETE(itr->second); - _CLLDECDELETE(itr->first); - ++itr; - } - postingTable.clear(); -} - -void DocumentWriter::addDocument(const QString& segment, Document* doc) -{ - CND_PRECONDITION(fieldInfos == NULL, "fieldInfos!=NULL") - - // write field names - fieldInfos = _CLNEW FieldInfos(); - fieldInfos->add(doc); - - QString buf = Misc::segmentname(segment, QLatin1String(".fnm")); - fieldInfos->write(directory, buf); - - // write field values - FieldsWriter fieldsWriter(directory, segment, fieldInfos); - try { - fieldsWriter.addDocument(doc); - } _CLFINALLY ( - fieldsWriter.close() - ); - - // clear postingTable - clearPostingTable(); - - int32_t fieldInfoSize = fieldInfos->size(); - fieldLengths = _CL_NEWARRAY(int32_t, fieldInfoSize); // init fieldLengths - fieldPositions = _CL_NEWARRAY(int32_t, fieldInfoSize); // init fieldPositions - fieldOffsets = _CL_NEWARRAY(int32_t, fieldInfoSize); // init fieldOffsets - fieldBoosts = _CL_NEWARRAY(qreal, fieldInfoSize); // init fieldBoosts - - qreal fbd = doc->getBoost(); - for (int32_t i = 0; i < fieldInfoSize; ++i) { - fieldLengths[i] = 0; - fieldPositions[i] = 0; - fieldOffsets[i] = 0; - //initialise fieldBoost array with default boost - fieldBoosts[i] = fbd; - } - - // invert doc into postingTable - invertDocument(doc); - - // sort postingTable into an array - Posting** postings = NULL; - int32_t postingsLength = 0; - sortPostingTable(postings, postingsLength); - - //DEBUG: - /*for (int32_t i = 0; i < postingsLength; i++) { - Posting* posting = postings[i]; - - TCHAR* b = posting->term->toString(); - _cout << b << " freq=" << posting->freq; - _CLDELETE(b); - - _cout << " pos=" << posting->positions[0]; - for (int32_t j = 1; j < posting->freq; j++) - _cout <<"," << posting->positions[j]; - - _cout << endl; - }*/ - - - // write postings - writePostings(postings, postingsLength, segment); - - // write norms of indexed fields - writeNorms(segment); - _CLDELETE_ARRAY(postings); -} - -void DocumentWriter::sortPostingTable(Posting**& array, int32_t& arraySize) -{ - // copy postingTable into an array - arraySize = postingTable.size(); - array = _CL_NEWARRAY(Posting*,arraySize); - PostingTableType::iterator postings = postingTable.begin(); - int32_t i=0; - while ( postings != postingTable.end() ){ - array[i] = (Posting*)postings->second; - postings++; - i++; - } - // sort the array - quickSort(array, 0, i - 1); -} - - -void DocumentWriter::invertDocument(const Document* doc) -{ - DocumentFieldEnumeration* fields = doc->fields(); - try { - while (fields->hasMoreElements()) { - Field* field = (Field*)fields->nextElement(); - const TCHAR* fieldName = field->name(); - const int32_t fieldNumber = fieldInfos->fieldNumber(fieldName); - - int32_t length = fieldLengths[fieldNumber]; // length of field - int32_t position = fieldPositions[fieldNumber]; // position in field - if (length>0) - position+=analyzer->getPositionIncrementGap(fieldName); - int32_t offset = fieldOffsets[fieldNumber]; // offset field - - if (field->isIndexed()) { - if (!field->isTokenized()) { // un-tokenized field - //FEATURE: this is bug in java: if using a Reader, then - //field value will not be added. With CLucene, an untokenized - //field with a reader will still be added (if it isn't stored, - //because if it's stored, then the reader has already been read. - const TCHAR* charBuf = NULL; - int64_t dataLen = 0; - - if (field->stringValue() == NULL && !field->isStored() ) { - CL_NS(util)::Reader* r = field->readerValue(); - // this call tries to read the entire stream - // this may invalidate the string for the further calls - // it may be better to do this via a FilterReader - // TODO make a better implementation of this - dataLen = r->read(charBuf, LUCENE_INT32_MAX_SHOULDBE); - if (dataLen == -1) - dataLen = 0; - //todo: would be better to pass the string length, in case - //a null char is passed, but then would need to test the output too. - } else { - charBuf = field->stringValue(); - dataLen = _tcslen(charBuf); - } - - if(field->isStoreOffsetWithTermVector()){ - TermVectorOffsetInfo tio; - tio.setStartOffset(offset); - tio.setEndOffset(offset + dataLen); - addPosition(fieldName, charBuf, position++, &tio ); - }else - addPosition(fieldName, charBuf, position++, NULL); - offset += dataLen; - length++; - } else { // field must be tokenized - CL_NS(util)::Reader* reader; // find or make Reader - bool delReader = false; - if (field->readerValue() != NULL) { - reader = field->readerValue(); - } else if (field->stringValue() != NULL) { - reader = _CLNEW CL_NS(util)::StringReader( - field->stringValue(),_tcslen(field->stringValue()), - false); - delReader = true; - } else { - _CLTHROWA(CL_ERR_IO,"field must have either String or Reader value"); - } - - try { - // Tokenize field and add to postingTable. - CL_NS(analysis)::TokenStream* stream = - analyzer->tokenStream(fieldName, reader); - - try { - CL_NS(analysis)::Token t; - int32_t lastTokenEndOffset = -1; - while (stream->next(&t)) { - position += (t.getPositionIncrement() - 1); - - if(field->isStoreOffsetWithTermVector()){ - TermVectorOffsetInfo tio; - tio.setStartOffset(offset + t.startOffset()); - tio.setEndOffset(offset + t.endOffset()); - addPosition(fieldName, t.termText(), position++, &tio); - } else - addPosition(fieldName, t.termText(), position++, NULL); - - lastTokenEndOffset = t.endOffset(); - length++; - // Apply field truncation policy. - if (maxFieldLength != IndexWriter::FIELD_TRUNC_POLICY__WARN) { - // The client programmer has explicitly authorized us to - // truncate the token stream after maxFieldLength tokens. - if ( length > maxFieldLength) - break; - } else if (length > IndexWriter::DEFAULT_MAX_FIELD_LENGTH) { - const TCHAR* errMsgBase = - _T("Indexing a huge number of tokens from a single") - _T(" field (\"%s\", in this case) can cause CLucene") - _T(" to use memory excessively.") - _T(" By default, CLucene will accept only %s tokens") - _T(" tokens from a single field before forcing the") - _T(" client programmer to specify a threshold at") - _T(" which to truncate the token stream.") - _T(" You should set this threshold via") - _T(" IndexReader::maxFieldLength (set to LUCENE_INT32_MAX") - _T(" to disable truncation, or a value to specify maximum number of fields)."); - - TCHAR defaultMaxAsChar[34]; - _i64tot(IndexWriter::DEFAULT_MAX_FIELD_LENGTH, - defaultMaxAsChar, 10 - ); - int32_t errMsgLen = _tcslen(errMsgBase) - + _tcslen(fieldName) - + _tcslen(defaultMaxAsChar); - TCHAR* errMsg = _CL_NEWARRAY(TCHAR,errMsgLen+1); - - _sntprintf(errMsg, errMsgLen,errMsgBase, fieldName, defaultMaxAsChar); - - _CLTHROWT_DEL(CL_ERR_Runtime,errMsg); - } - } // while token->next - - if(lastTokenEndOffset != -1 ) - offset += lastTokenEndOffset + 1; - } _CLFINALLY ( - stream->close(); - _CLDELETE(stream); - ); - } _CLFINALLY ( - if (delReader) { - _CLDELETE(reader); - } - ); - } // if/else field is to be tokenized - fieldLengths[fieldNumber] = length; // save field length - fieldPositions[fieldNumber] = position; // save field position - fieldBoosts[fieldNumber] *= field->getBoost(); - fieldOffsets[fieldNumber] = offset; - } // if field is to beindexed - } // while more fields available - } _CLFINALLY ( - _CLDELETE(fields); - ); -} - -void DocumentWriter::addPosition(const TCHAR* field, const TCHAR* text, - const int32_t position, TermVectorOffsetInfo* offset) -{ - termBuffer->set(field,text,false); - - Posting* ti = postingTable.get(termBuffer); - if (ti != NULL) { // word seen before - int32_t freq = ti->freq; - if (ti->positions.length == freq) { - // positions array is full, realloc its size - ti->positions.length = freq*2; - ti->positions.values = (int32_t*)realloc(ti->positions.values, ti->positions.length * sizeof(int32_t)); - } - ti->positions.values[freq] = position; // add new position - - if (offset != NULL) { - if (ti->offsets.length == freq){ - ti->offsets.length = freq*2; - ti->offsets.values = (TermVectorOffsetInfo*)realloc(ti->offsets.values, ti->offsets.length * sizeof(TermVectorOffsetInfo)); - } - ti->offsets[freq] = *offset; - } - - ti->freq = freq + 1; // update frequency - } else { // word not seen before - Term* term = _CLNEW Term( field, text, false); - postingTable.put(term, _CLNEW Posting(term, position, offset)); - } -} - -//static -void DocumentWriter::quickSort(Posting**& postings, const int32_t lo, const int32_t hi) -{ - if(lo >= hi) - return; - - int32_t mid = (lo + hi) / 2; - - if(postings[lo]->term->compareTo(postings[mid]->term) > 0) { - Posting* tmp = postings[lo]; - postings[lo] = postings[mid]; - postings[mid] = tmp; - } - - if(postings[mid]->term->compareTo(postings[hi]->term) > 0) { - Posting* tmp = postings[mid]; - postings[mid] = postings[hi]; - postings[hi] = tmp; - - if(postings[lo]->term->compareTo(postings[mid]->term) > 0) { - Posting* tmp2 = postings[lo]; - postings[lo] = postings[mid]; - postings[mid] = tmp2; - } - } - - int32_t left = lo + 1; - int32_t right = hi - 1; - - if (left >= right) - return; - - const Term* partition = postings[mid]->term; //not kept, so no need to finalize - - for( ;; ) { - while(postings[right]->term->compareTo(partition) > 0) - --right; - - while(left < right && postings[left]->term->compareTo(partition) <= 0) - ++left; - - if(left < right) { - Posting* tmp = postings[left]; - postings[left] = postings[right]; - postings[right] = tmp; - --right; - } else { - break; - } - } - - quickSort(postings, lo, left); - quickSort(postings, left + 1, hi); -} - -void DocumentWriter::writePostings(Posting** postings, - const int32_t postingsLength, const QString& segment) -{ - #define __DOCLOSE(obj) \ - if (obj!=NULL) { \ - try { \ - obj->close(); \ - _CLDELETE(obj); \ - } catch(CLuceneError &e) { \ - ierr = e.number(); \ - err = e.what(); \ - } catch(...) { \ - err = "Unknown error while closing posting tables"; \ - } \ - } - - IndexOutput* freq = NULL; - IndexOutput* prox = NULL; - TermInfosWriter* tis = NULL; - TermVectorsWriter* termVectorWriter = NULL; - try { - //open files for inverse index storage - QString buf = Misc::segmentname(segment, QLatin1String(".frq")); - freq = directory->createOutput(buf); - - buf = Misc::segmentname(segment, QLatin1String(".prx")); - prox = directory->createOutput(buf); - - tis = _CLNEW TermInfosWriter(directory, segment, fieldInfos, - termIndexInterval); - TermInfo* ti = _CLNEW TermInfo(); - const TCHAR* currentField = NULL; - for (int32_t i = 0; i < postingsLength; i++) { - Posting* posting = postings[i]; - - // add an entry to the dictionary with pointers to prox and freq files - ti->set(1, freq->getFilePointer(), prox->getFilePointer(), -1); - tis->add(posting->term, ti); - - // add an entry to the freq file - int32_t postingFreq = posting->freq; - if (postingFreq == 1) // optimize freq=1 - freq->writeVInt(1); // set low bit of doc num. - else { - freq->writeVInt(0); // the document number - freq->writeVInt(postingFreq); // frequency in doc - } - - int32_t lastPosition = 0; // write positions - for (int32_t j = 0; j < postingFreq; ++j) { // use delta-encoding - prox->writeVInt(posting->positions.values[j] - lastPosition); - lastPosition = posting->positions.values[j]; - } - - // check to see if we switched to a new field - const TCHAR* termField = posting->term->field(); - if ( currentField == NULL || _tcscmp(currentField,termField) != 0 ) { - //todo, can we do an intern'd check? - // changing field - see if there is something to save - currentField = termField; - FieldInfo* fi = fieldInfos->fieldInfo(currentField); - - if (fi->storeTermVector) { - if (termVectorWriter == NULL) { - termVectorWriter = _CLNEW TermVectorsWriter(directory, - segment, fieldInfos); - termVectorWriter->openDocument(); - } - termVectorWriter->openField(currentField); - } else if (termVectorWriter != NULL) { - termVectorWriter->closeField(); - } - } - if (termVectorWriter != NULL && termVectorWriter->isFieldOpen()) { - termVectorWriter->addTerm(posting->term->text(), postingFreq, - &posting->positions, &posting->offsets); - } - } - if (termVectorWriter != NULL) - termVectorWriter->closeDocument(); - _CLDELETE(ti); - } _CLFINALLY ( - const char* err = NULL; - int32_t ierr = 0; - - // make an effort to close all streams we can but remember and re-throw - // the first exception encountered in this process - __DOCLOSE(freq); - __DOCLOSE(prox); - __DOCLOSE(tis); - __DOCLOSE(termVectorWriter); - if (err != NULL) - _CLTHROWA(ierr,err); - ); -} - -void DocumentWriter::writeNorms(const QString& segment) -{ - for(int32_t n = 0; n < fieldInfos->size(); n++){ - FieldInfo* fi = fieldInfos->fieldInfo(n); - if(fi->isIndexed && !fi->omitNorms) { - qreal norm = fieldBoosts[n] * similarity->lengthNorm( - fi->name, fieldLengths[n]); - - QString fn(segment + QLatin1String(".f%1")); - IndexOutput* norms = directory->createOutput(fn.arg(n)); - try { - norms->writeByte(CL_NS(search)::Similarity::encodeNorm(norm)); - }_CLFINALLY ( - norms->close(); - _CLDELETE(norms); - ) - } - } -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/DocumentWriter.h b/3rdparty/clucene/src/CLucene/index/DocumentWriter.h deleted file mode 100644 index 7096ba3ee..000000000 --- a/3rdparty/clucene/src/CLucene/index/DocumentWriter.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_DocumentWriter_ -#define _lucene_index_DocumentWriter_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/document/Document.h" -#include "CLucene/store/Directory.h" -#include "FieldInfos.h" -#include "IndexWriter.h" -#include "CLucene/util/VoidMap.h" -#include "CLucene/document/Field.h" -#include "TermInfo.h" -#include "CLucene/search/Similarity.h" -#include "TermInfosWriter.h" -#include "FieldsWriter.h" -#include "Term.h" - -CL_NS_DEF(index) - -class DocumentWriter : LUCENE_BASE -{ -public: - // info about a Term in a doc - class Posting : LUCENE_BASE - { - public: - Term* term; // the Term - int32_t freq; // its frequency in doc - Array positions; // positions it occurs at - Array offsets; - - Posting(Term* t, const int32_t position, TermVectorOffsetInfo* offset); - ~Posting(); - }; - -private: - CL_NS(analysis)::Analyzer* analyzer; - CL_NS(store)::Directory* directory; - FieldInfos* fieldInfos; //array - const int32_t maxFieldLength; - CL_NS(search)::Similarity* similarity; - int32_t termIndexInterval; - - // Keys are Terms, values are Postings. - // Used to buffer a document before it is written to the index. - typedef CL_NS(util)::CLHashtable PostingTableType; - PostingTableType postingTable; - int32_t* fieldLengths; //array - int32_t* fieldPositions; //array - int32_t* fieldOffsets; //array - qreal* fieldBoosts; //array - - Term* termBuffer; -public: - /** This ctor used by test code only. - * - * @param directory The directory to write the document information to - * @param analyzer The analyzer to use for the document - * @param similarity The Similarity function - * @param maxFieldLength The maximum number of tokens a field may have - */ - DocumentWriter(CL_NS(store)::Directory* d, CL_NS(analysis)::Analyzer* a, - CL_NS(search)::Similarity* similarity, const int32_t maxFieldLength); - - DocumentWriter(CL_NS(store)::Directory* directory, - CL_NS(analysis)::Analyzer* analyzer, IndexWriter* writer); - ~DocumentWriter(); - - void addDocument(const QString& segment, CL_NS(document)::Document* doc); - - -private: - // Tokenizes the fields of a document into Postings. - void invertDocument(const CL_NS(document)::Document* doc); - - void addPosition(const TCHAR* field, const TCHAR* text, - const int32_t position, TermVectorOffsetInfo* offset); - - void sortPostingTable(Posting**& array, int32_t& arraySize); - - static void quickSort(Posting**& postings, const int32_t lo, const int32_t hi); - - void writePostings(Posting** postings, const int32_t postingsLength, - const QString& segment); - - void writeNorms(const QString& segment); - - void clearPostingTable(); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/FieldInfo.h b/3rdparty/clucene/src/CLucene/index/FieldInfo.h deleted file mode 100644 index 387c4a6ac..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldInfo.h +++ /dev/null @@ -1,16 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_FieldInfo_ -#define _lucene_index_FieldInfo_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#error "This header is deprecated, use FieldInfos.h instead" - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp b/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp deleted file mode 100644 index 0c66882f4..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "FieldInfos.h" - -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/document/Field.h" -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Misc.h" -#include "CLucene/util/StringIntern.h" - -CL_NS_USE(store) -CL_NS_USE(document) -CL_NS_USE(util) -CL_NS_DEF(index) - -FieldInfo::FieldInfo(const TCHAR* _fieldName, bool _isIndexed, - int32_t _fieldNumber, bool _storeTermVector, bool _storeOffsetWithTermVector, - bool _storePositionWithTermVector, bool _omitNorms) - : name(CLStringIntern::intern(_fieldName CL_FILELINE)) - , isIndexed(_isIndexed) - , number(_fieldNumber) - , storeTermVector(_storeTermVector) - , storeOffsetWithTermVector(_storeOffsetWithTermVector) - , storePositionWithTermVector(_storeTermVector) - , omitNorms(_omitNorms) -{ -} - -FieldInfo::~FieldInfo() -{ - CL_NS(util)::CLStringIntern::unintern(name); -} - -// #pragma mark -- FieldInfos - -FieldInfos::FieldInfos() - : byName(false, false) - , byNumber(true) -{ -} - -FieldInfos::~FieldInfos() -{ - byName.clear(); - byNumber.clear(); -} - -FieldInfos::FieldInfos(Directory* d, const QString& name) - : byName(false, false) - , byNumber(true) -{ - IndexInput* input = d->openInput(name); - try { - read(input); - } _CLFINALLY ( - input->close(); - _CLDELETE(input); - ); -} - -void FieldInfos::add(const Document* doc) -{ - DocumentFieldEnumeration* fields = doc->fields(); - Field* field; - while (fields->hasMoreElements()) { - field = fields->nextElement(); - add(field->name(), field->isIndexed(), field->isTermVectorStored()); - } - _CLDELETE(fields); -} - -void FieldInfos::add(const TCHAR* name, bool isIndexed, bool storeTermVector, - bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms) -{ - FieldInfo* fi = fieldInfo(name); - if (fi == NULL) { - addInternal(name, isIndexed, storeTermVector, - storePositionWithTermVector, - storeOffsetWithTermVector, omitNorms); - } else { - if (fi->isIndexed != isIndexed) { - // once indexed, always index - fi->isIndexed = true; - } - - if (fi->storeTermVector != storeTermVector) { - // once vector, always vector - fi->storeTermVector = true; - } - - if (fi->storePositionWithTermVector != storePositionWithTermVector) { - // once vector, always vector - fi->storePositionWithTermVector = true; - } - - if (fi->storeOffsetWithTermVector != storeOffsetWithTermVector) { - // once vector, always vector - fi->storeOffsetWithTermVector = true; - } - - if (fi->omitNorms != omitNorms) { - // once norms are stored, always store - fi->omitNorms = false; - } - } -} - -void FieldInfos::add(const TCHAR** names, bool isIndexed, bool storeTermVectors, - bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms) -{ - int32_t i=0; - while (names[i] != NULL) { - add(names[i], isIndexed, storeTermVectors, storePositionWithTermVector, - storeOffsetWithTermVector, omitNorms); - ++i; - } -} - -int32_t FieldInfos::fieldNumber(const TCHAR* fieldName) const -{ - FieldInfo* fi = fieldInfo(fieldName); - return (fi != NULL) ? fi->number : -1; -} - -FieldInfo* FieldInfos::fieldInfo(const TCHAR* fieldName) const -{ - return byName.get(fieldName); -} - -const TCHAR* FieldInfos::fieldName(const int32_t fieldNumber) const -{ - FieldInfo* fi = fieldInfo(fieldNumber); - return (fi == NULL) ? LUCENE_BLANK_STRING : fi->name; -} - -FieldInfo* FieldInfos::fieldInfo(const int32_t fieldNumber) const -{ - if (fieldNumber < 0 || (size_t)fieldNumber >= byNumber.size()) - return NULL; - return byNumber[fieldNumber]; -} - -int32_t FieldInfos::size() const -{ - return byNumber.size(); -} - -void FieldInfos::write(Directory* d, const QString& name) const -{ - IndexOutput* output = d->createOutput(name); - try { - write(output); - } _CLFINALLY ( - output->close(); - _CLDELETE(output); - ); -} - -void FieldInfos::write(IndexOutput* output) const -{ - output->writeVInt(size()); - FieldInfo* fi; - uint8_t bits; - for (int32_t i = 0; i < size(); ++i) { - fi = fieldInfo(i); - bits = 0x0; - if (fi->isIndexed) - bits |= IS_INDEXED; - - if (fi->storeTermVector) - bits |= STORE_TERMVECTOR; - - if (fi->storePositionWithTermVector) - bits |= STORE_POSITIONS_WITH_TERMVECTOR; - - if (fi->storeOffsetWithTermVector) - bits |= STORE_OFFSET_WITH_TERMVECTOR; - - if (fi->omitNorms) - bits |= OMIT_NORMS; - - output->writeString(fi->name, _tcslen(fi->name)); - output->writeByte(bits); - } -} - -void FieldInfos::read(IndexInput* input) -{ - int32_t size = input->readVInt(); - for (int32_t i = 0; i < size; ++i) { - // we could read name into a string buffer, but we can't be sure what - // the maximum field length will be. - TCHAR* name = input->readString(); - uint8_t bits = input->readByte(); - bool isIndexed = (bits & IS_INDEXED) != 0; - bool storeTermVector = (bits & STORE_TERMVECTOR) != 0; - bool storePositionsWithTermVector = - (bits & STORE_POSITIONS_WITH_TERMVECTOR) != 0; - bool storeOffsetWithTermVector = (bits & STORE_OFFSET_WITH_TERMVECTOR) != 0; - bool omitNorms = (bits & OMIT_NORMS) != 0; - - addInternal(name, isIndexed, storeTermVector, - storePositionsWithTermVector, storeOffsetWithTermVector, omitNorms); - _CLDELETE_CARRAY(name); - } -} - -void FieldInfos::addInternal(const TCHAR* name, bool isIndexed, - bool storeTermVector, bool storePositionWithTermVector, - bool storeOffsetWithTermVector, bool omitNorms) -{ - FieldInfo* fi = _CLNEW FieldInfo(name, isIndexed, byNumber.size(), - storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, - omitNorms); - byNumber.push_back(fi); - byName.put(fi->name, fi); -} - -bool FieldInfos::hasVectors() const -{ - for (int32_t i = 0; i < size(); i++) { - if (fieldInfo(i)->storeTermVector) - return true; - } - return false; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/FieldInfos.h b/3rdparty/clucene/src/CLucene/index/FieldInfos.h deleted file mode 100644 index 7b6d0f56d..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldInfos.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_FieldInfos_ -#define _lucene_index_FieldInfos_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/VoidList.h" - -CL_NS_DEF(index) - -class FieldInfo : LUCENE_BASE -{ - public: - //name of the field - const TCHAR* name; - - //Is field indexed? true = yes false = no - bool isIndexed; - - //field number - const int32_t number; - - // true if term vector for this field should be stored - bool storeTermVector; - bool storeOffsetWithTermVector; - bool storePositionWithTermVector; - - bool omitNorms; // omit norms associated with indexed fields - - //Func - Constructor - // Initialises FieldInfo. - // na holds the name of the field - // tk indicates whether this field is indexed or not - // nu indicates its number - //Pre - na != NULL and holds the name of the field - // tk is true or false - // number >= 0 - //Post - The FieldInfo instance has been created and initialized. - // name holds the duplicated string of na - // isIndexed = tk - // number = nu - FieldInfo(const TCHAR* fieldName, bool isIndexed, int32_t fieldNumber, - bool storeTermVector, bool storeOffsetWithTermVector, - bool storePositionWithTermVector, bool omitNorms); - - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - ~FieldInfo(); -}; - -/* Access to the Field Info file that describes document fields and whether or - * not they are indexed. Each segment has a separate Field Info file. Objects - * of this class are thread-safe for multiple readers, but only one thread can - * be adding documents at a time, with no other reader or writer threads - * accessing this object. -*/ -class FieldInfos : LUCENE_BASE -{ -private: - // we now use internd field names, so we can use the voidCompare to - // directly compare the strings - typedef CL_NS(util)::CLHashMap defByName; - defByName byName; - - CL_NS(util)::CLArrayList > byNumber; - -public: - enum { - IS_INDEXED = 0x1, - STORE_TERMVECTOR = 0x2, - STORE_POSITIONS_WITH_TERMVECTOR = 0x4, - STORE_OFFSET_WITH_TERMVECTOR = 0x8, - OMIT_NORMS = 0x10 - }; - - FieldInfos(); - ~FieldInfos(); - - // Construct a FieldInfos object using the directory and the name of the - // file IndexInput - // @param d The directory to open the IndexInput from - // @param name Name of the file to open the IndexInput from in the Directory - // @throws IOException - // @see #read - FieldInfos(CL_NS(store)::Directory* d, const QString& name); - - int32_t fieldNumber(const TCHAR* fieldName)const; - - // Return the fieldinfo object referenced by the fieldNumber. - // @param fieldNumber - // @return the FieldInfo object or null when the given fieldNumber - // doesn't exist. - FieldInfo* fieldInfo(const TCHAR* fieldName) const; - - // Return the fieldName identified by its number. - // @param fieldNumber - // @return the fieldName or an empty string when the field - // with the given number doesn't exist. - const TCHAR* fieldName(const int32_t fieldNumber) const; - - FieldInfo* fieldInfo(const int32_t fieldNumber) const; - - int32_t size()const; - - bool hasVectors() const; - - // Adds field info for a Document. - void add(const CL_NS(document)::Document* doc); - - // Merges in information from another FieldInfos. - void add(FieldInfos* other); - - - /** If the field is not yet known, adds it. If it is known, checks to make - * sure that the isIndexed flag is the same as was given previously for this - * field. If not - marks it as being indexed. Same goes for the TermVector - * parameters. - * - * @param name The name of the field - * @param isIndexed true if the field is indexed - * @param storeTermVector true if the term vector should be stored - * @param storePositionWithTermVector true if the term vector with positions should be stored - * @param storeOffsetWithTermVector true if the term vector with offsets should be stored - */ - void add(const TCHAR* name, bool isIndexed, bool storeTermVector = false, - bool storePositionWithTermVector = false, - bool storeOffsetWithTermVector = false, bool omitNorms = false); - - /** - * Assumes the fields are not storing term vectors - * @param names The names of the fields - * @param isIndexed true if the field is indexed - * @param storeTermVector true if the term vector should be stored - * - * @see #add(String, boolean) - */ - void add(const TCHAR** names, bool isIndexed, bool storeTermVector = false, - bool storePositionWithTermVector = false, - bool storeOffsetWithTermVector = false, bool omitNorms = false); - - void write(CL_NS(store)::Directory* d, const QString& name) const; - void write(CL_NS(store)::IndexOutput* output) const; - -private: - void read(CL_NS(store)::IndexInput* input); - void addInternal(const TCHAR* name, bool isIndexed, bool storeTermVector, - bool storePositionWithTermVector, bool storeOffsetWithTermVector, - bool omitNorms); - -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp b/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp deleted file mode 100644 index e3f9d1cc2..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "FieldsReader.h" - -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Misc.h" -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/document/Field.h" -#include "FieldInfos.h" -#include "FieldsWriter.h" - -CL_NS_USE(store) -CL_NS_USE(document) -CL_NS_USE(util) -CL_NS_DEF(index) - -FieldsReader::FieldsReader(Directory* d, const QString& segment, FieldInfos* fn) - : fieldInfos(fn) -{ - //Func - Constructor - //Pre - d contains a valid reference to a Directory - // segment != NULL - // fn contains a valid reference to a FieldInfos - //Post - The instance has been created - - CND_PRECONDITION(!segment.isEmpty(), "segment != NULL"); - - QString buf = Misc::segmentname(segment, QLatin1String(".fdt")); - fieldsStream = d->openInput(buf); - - buf = Misc::segmentname(segment, QLatin1String(".fdx")); - indexStream = d->openInput(buf); - - _size = (int32_t)indexStream->length() / 8; -} - -FieldsReader::~FieldsReader() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - close(); -} - -void FieldsReader::close() -{ - //Func - Closes the FieldsReader - //Pre - true - //Post - The FieldsReader has been closed - if (fieldsStream) { - fieldsStream->close(); - _CLDELETE(fieldsStream); - } - - if(indexStream) { - indexStream->close(); - _CLDELETE(indexStream); - } -} - -int32_t FieldsReader::size() const -{ - return _size; -} - -bool FieldsReader::doc(int32_t n, Document* doc) -{ - if ( n * 8L > indexStream->length() ) - return false; - - indexStream->seek(n * 8L); - int64_t position = indexStream->readLong(); - fieldsStream->seek(position); - - int32_t numFields = fieldsStream->readVInt(); - for (int32_t i = 0; i < numFields; i++) { - int32_t fieldNumber = fieldsStream->readVInt(); - FieldInfo* fi = fieldInfos->fieldInfo(fieldNumber); - - if ( fi == NULL ) - _CLTHROWA(CL_ERR_IO, "Field stream is invalid"); - - uint8_t bits = fieldsStream->readByte(); - if ((bits & FieldsWriter::FIELD_IS_BINARY) != 0) { - int32_t fieldLen = fieldsStream->readVInt(); - FieldsReader::FieldsStreamHolder* subStream = new - FieldsReader::FieldsStreamHolder(fieldsStream, fieldLen); - uint8_t bits = Field::STORE_YES; - Field* f = _CLNEW Field( - fi->name, // name - subStream, // read value - bits); - - doc->add(*f); - - //now skip over the rest of the field - if (fieldsStream->getFilePointer() + fieldLen - == fieldsStream->length()) { - // set to eof - fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen - 1); - fieldsStream->readByte(); - } else { - fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen); - } - } else { - uint8_t bits = Field::STORE_YES; - if (fi->isIndexed && (bits & FieldsWriter::FIELD_IS_TOKENIZED)!=0 ) - bits |= Field::INDEX_TOKENIZED; - else if (fi->isIndexed && (bits & FieldsWriter::FIELD_IS_TOKENIZED) == 0) - bits |= Field::INDEX_UNTOKENIZED; - else - bits |= Field::INDEX_NO; - - if (fi->storeTermVector) { - if (fi->storeOffsetWithTermVector) { - if (fi->storePositionWithTermVector) { - bits |= Field::TERMVECTOR_WITH_OFFSETS; - bits |= Field::TERMVECTOR_WITH_POSITIONS; - } else { - bits |= Field::TERMVECTOR_WITH_OFFSETS; - } - } else if (fi->storePositionWithTermVector) { - bits |= Field::TERMVECTOR_WITH_POSITIONS; - } else { - bits |= Field::TERMVECTOR_YES; - } - } else { - bits |= Field::TERMVECTOR_NO; - } - - if ( (bits & FieldsWriter::FIELD_IS_COMPRESSED) != 0 ) { - bits |= Field::STORE_COMPRESS; - int32_t fieldLen = fieldsStream->readVInt(); - FieldsStreamHolder* subStream = new - FieldsStreamHolder(fieldsStream, fieldLen); - - // TODO: we dont have gzip inputstream available, must alert - // user to somehow use a gzip inputstream - Field* f = _CLNEW Field( - fi->name, // name - subStream, // read value - bits); - - f->setOmitNorms(fi->omitNorms); - doc->add(*f); - - // now skip over the rest of the field - if (fieldsStream->getFilePointer() + fieldLen - == fieldsStream->length()) { - //set to eof - fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen - 1); - fieldsStream->readByte(); - } else { - fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen); - } - } else { - TCHAR* fvalue = fieldsStream->readString(true); - Field* f = _CLNEW Field( - fi->name, // name - fvalue, // read value - bits); - // TODO: could optimise this - _CLDELETE_CARRAY(fvalue); - f->setOmitNorms(fi->omitNorms); - doc->add(*f); - } - } - } - return true; -} - -FieldsReader::FieldsStreamHolder::FieldsStreamHolder(IndexInput* indexInput, - int32_t subLength) -{ - this->indexInput = indexInput->clone(); - this->indexInputStream = new IndexInputStream(this->indexInput); - this->subStream = new jstreams::SubInputStream(indexInputStream, - subLength); - - this->size = subStream->getSize(); - this->position = subStream->getPosition(); - this->error = subStream->getError(); - this->status = subStream->getStatus(); -} - -FieldsReader::FieldsStreamHolder::~FieldsStreamHolder() -{ - delete subStream; - delete indexInputStream; - - indexInput->close(); - _CLDELETE(indexInput); -} - -int32_t FieldsReader::FieldsStreamHolder::read(const char*& start, int32_t _min, - int32_t _max) -{ - int32_t ret = subStream->read(start,_min,_max); - this->position = subStream->getPosition(); - this->error = subStream->getError(); - this->status = subStream->getStatus(); - return ret; -} - -int64_t FieldsReader::FieldsStreamHolder::skip(int64_t ntoskip) -{ - int64_t ret = subStream->skip(ntoskip); - this->position = subStream->getPosition(); - this->error = subStream->getError(); - this->status = subStream->getStatus(); - return ret; -} - -int64_t FieldsReader::FieldsStreamHolder::reset(int64_t pos) -{ - int64_t ret = subStream->reset(pos); - this->position = subStream->getPosition(); - this->error = subStream->getError(); - this->status = subStream->getStatus(); - return ret; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/FieldsReader.h b/3rdparty/clucene/src/CLucene/index/FieldsReader.h deleted file mode 100644 index 53589a5cc..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldsReader.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_FieldsReader_ -#define _lucene_index_FieldsReader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/util/subinputstream.h" -#include "CLucene/store/IndexInput.h" - -CL_NS_DEF(index) - -class FieldInfos; - -class FieldsReader : LUCENE_BASE -{ -private: - const FieldInfos* fieldInfos; - CL_NS(store)::IndexInput* fieldsStream; - CL_NS(store)::IndexInput* indexStream; - int32_t _size; - - class FieldsStreamHolder : public jstreams::StreamBase - { - CL_NS(store)::IndexInput* indexInput; - CL_NS(store)::IndexInputStream* indexInputStream; - jstreams::SubInputStream* subStream; - - public: - FieldsStreamHolder(CL_NS(store)::IndexInput* indexInput, int32_t subLength); - ~FieldsStreamHolder(); - int32_t read(const char*& start, int32_t _min, int32_t _max); - int64_t skip(int64_t ntoskip); - int64_t reset(int64_t pos); - }; - -public: - FieldsReader(CL_NS(store)::Directory* d, const QString& segment, FieldInfos* fn); - ~FieldsReader(); - void close(); - int32_t size() const; - // loads the fields from n'th document into doc. returns true on success. - bool doc(int32_t n, CL_NS(document)::Document* doc); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp b/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp deleted file mode 100644 index ceb6735cb..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "FieldsWriter.h" - -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Reader.h" -#include "CLucene/util/Misc.h" -#include "CLucene/store/Directory.h" -#include "CLucene/store/IndexOutput.h" -#include "CLucene/document/Document.h" -#include "CLucene/document/Field.h" -#include "FieldInfos.h" - -CL_NS_USE(store) -CL_NS_USE(util) -CL_NS_USE(document) -CL_NS_DEF(index) - -FieldsWriter::FieldsWriter(Directory* d, const QString& segment, FieldInfos* fn) - : fieldInfos(fn) -{ - //Func - Constructor - //Pre - d contains a valid reference to a directory - // segment != NULL and contains the name of the segment - //Post - fn contains a valid reference toa a FieldInfos - - CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); - - QString buf = Misc::segmentname(segment, QLatin1String(".fdt")); - fieldsStream = d->createOutput(buf); - - buf = Misc::segmentname(segment, QLatin1String(".fdx")); - indexStream = d->createOutput(buf); - - CND_CONDITION(indexStream != NULL, "indexStream is NULL"); -} - -FieldsWriter::~FieldsWriter() -{ - //Func - Destructor - //Pre - true - //Post - Instance has been destroyed - - close(); -} - -void FieldsWriter::close() -{ - //Func - Closes all streams and frees all resources - //Pre - true - //Post - All streams have been closed all resources have been freed - - //Check if fieldsStream is valid - if (fieldsStream) { - //Close fieldsStream - fieldsStream->close(); - _CLDELETE(fieldsStream); - } - - //Check if indexStream is valid - if (indexStream) { - //Close indexStream - indexStream->close(); - _CLDELETE(indexStream); - } -} - -void FieldsWriter::addDocument(Document* doc) -{ - //Func - Adds a document - //Pre - doc contains a valid reference to a Document - // indexStream != NULL - // fieldsStream != NULL - //Post - The document doc has been added - - CND_PRECONDITION(indexStream != NULL, "indexStream is NULL"); - CND_PRECONDITION(fieldsStream != NULL, "fieldsStream is NULL"); - - indexStream->writeLong(fieldsStream->getFilePointer()); - - int32_t storedCount = 0; - DocumentFieldEnumeration* fields = doc->fields(); - while (fields->hasMoreElements()) { - Field* field = fields->nextElement(); - if (field->isStored()) - storedCount++; - } - _CLDELETE(fields); - fieldsStream->writeVInt(storedCount); - - fields = doc->fields(); - while (fields->hasMoreElements()) { - Field* field = fields->nextElement(); - if (field->isStored()) { - fieldsStream->writeVInt(fieldInfos->fieldNumber(field->name())); - - uint8_t bits = 0; - if (field->isTokenized()) - bits |= FieldsWriter::FIELD_IS_TOKENIZED; - if (field->isBinary()) - bits |= FieldsWriter::FIELD_IS_BINARY; - if (field->isCompressed()) - bits |= FieldsWriter::FIELD_IS_COMPRESSED; - - fieldsStream->writeByte(bits); - - if ( field->isCompressed()) { - _CLTHROWA(CL_ERR_Runtime, - "CLucene does not directly support compressed fields. " - "Write a compressed byte array instead"); - } else { - // FEATURE: this problem in Java Lucene too, if using Reader, - // data is not stored. - // - // TODO: this is a logic bug... - // if the field is stored, and indexed, and is using a reader - // the field wont get indexed - // - // if we could write zero prefixed vints (therefore static - // length), then we could write a reader directly to the field - // indexoutput and then go back and write the data length. - // however this is not supported in lucene yet... - // if this is ever implemented, then it would make sense to - // also be able to combine the FieldsWriter and - // DocumentWriter::invertDocument process, and use a - // streamfilter to write the field data while the documentwrite - // analyses the document! how cool would that be! it would cut - // out all these buffers!!! - - // compression is disabled for the current field - if (field->isBinary()) { - // TODO: since we currently don't support static length vints, - // we have to read the entire stream into memory first.... ugly! - jstreams::StreamBase* stream = field->streamValue(); - const char* sd; - // how do we make sure we read the entire index in now??? - // TODO: we need to have a max amount, and guarantee its all - // in or throw an error... - int32_t rl = stream->read(sd,10000000,0); - - if ( rl < 0 ) { - // TODO: could we detect this earlier and not actually - // write the field?? - fieldsStream->writeVInt(0); - } else { - // TODO: if this int could be written with a constant - // length, then the stream could be read and written a - // bit at a time then the length is re-written at the end. - fieldsStream->writeVInt(rl); - fieldsStream->writeBytes((uint8_t*)sd, rl); - } - } else if (field->stringValue() == NULL ) { - // we must be using readerValue - CND_PRECONDITION(!field->isIndexed(), - "Cannot store reader if it is indexed too") - Reader* r = field->readerValue(); - - //read the entire string - const TCHAR* rv; - int64_t rl = r->read(rv, LUCENE_INT32_MAX_SHOULDBE); - if ( rl > LUCENE_INT32_MAX_SHOULDBE ) - _CLTHROWA(CL_ERR_Runtime, "Field length too long"); - else if ( rl < 0 ) - rl = 0; - - fieldsStream->writeString( rv, (int32_t)rl); - } else if (field->stringValue() != NULL ) { - fieldsStream->writeString(field->stringValue(), - _tcslen(field->stringValue())); - } else { - _CLTHROWA(CL_ERR_Runtime, "No values are set for the field"); - } - } - } - } - _CLDELETE(fields); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/FieldsWriter.h b/3rdparty/clucene/src/CLucene/index/FieldsWriter.h deleted file mode 100644 index 7dde5f225..000000000 --- a/3rdparty/clucene/src/CLucene/index/FieldsWriter.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_FieldsWriter_ -#define _lucene_index_FieldsWriter_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/document/Document.h" -#include "CLucene/store/Directory.h" -#include "CLucene/store/IndexOutput.h" - -CL_NS_DEF(index) - -class FieldInfos; - -class FieldsWriter : LUCENE_BASE -{ -private: - FieldInfos* fieldInfos; - - CL_NS(store)::IndexOutput* fieldsStream; - CL_NS(store)::IndexOutput* indexStream; - -public: - LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_TOKENIZED = 0x1); - LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_BINARY = 0x2); - LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_COMPRESSED = 0x4); - - FieldsWriter(CL_NS(store)::Directory* d, const QString& segment, FieldInfos* fn); - ~FieldsWriter(); - - void close(); - - void addDocument(CL_NS(document)::Document* doc); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp b/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp deleted file mode 100644 index 1423cc7a8..000000000 --- a/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "IndexModifier.h" - -#include "Term.h" -#include "IndexWriter.h" -#include "IndexReader.h" - -CL_NS_DEF(index) -CL_NS_USE(util) -CL_NS_USE(store) -CL_NS_USE(analysis) -CL_NS_USE(document) - -IndexModifier::IndexModifier(Directory* directory, Analyzer* analyzer, bool create) { - init(directory, analyzer, create); -} - -IndexModifier::IndexModifier(const QString& dirName, Analyzer* analyzer, bool create) { - Directory* dir = FSDirectory::getDirectory(dirName, create); - init(dir, analyzer, create); -} - -void IndexModifier::init(Directory* directory, Analyzer* analyzer, bool create) { - indexWriter = NULL; - indexReader = NULL; - this->analyzer = analyzer; - open = false; - - useCompoundFile = true; - int32_t maxBufferedDocs = IndexWriter::DEFAULT_MAX_BUFFERED_DOCS; - this->maxFieldLength = IndexWriter::DEFAULT_MAX_FIELD_LENGTH; - int32_t mergeFactor = IndexWriter::DEFAULT_MERGE_FACTOR; - - this->directory = _CL_POINTER(directory); - createIndexReader(); - open = true; -} - -IndexModifier::~IndexModifier(){ - close(); -} - -void IndexModifier::assureOpen() const{ - if (!open) { - _CLTHROWA(CL_ERR_IllegalState,"Index is closed"); - } -} - -void IndexModifier::createIndexWriter() { - if (indexWriter == NULL) { - if (indexReader != NULL) { - indexReader->close(); - _CLDELETE(indexReader); - } - indexWriter = _CLNEW IndexWriter(directory, analyzer, false); - indexWriter->setUseCompoundFile(useCompoundFile); - //indexWriter->setMaxBufferedDocs(maxBufferedDocs); - indexWriter->setMaxFieldLength(maxFieldLength); - //indexWriter->setMergeFactor(mergeFactor); - } -} - -void IndexModifier::createIndexReader() { - if (indexReader == NULL) { - if (indexWriter != NULL) { - indexWriter->close(); - _CLDELETE(indexWriter); - } - indexReader = IndexReader::open(directory); - } -} - -void IndexModifier::flush() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - if (indexWriter != NULL) { - indexWriter->close(); - _CLDELETE(indexWriter); - createIndexWriter(); - } else { - indexReader->close(); - _CLDELETE(indexReader); - createIndexReader(); - } -} - -void IndexModifier::addDocument(Document* doc, Analyzer* docAnalyzer) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexWriter(); - if (docAnalyzer != NULL) - indexWriter->addDocument(doc, docAnalyzer); - else - indexWriter->addDocument(doc); -} - -int32_t IndexModifier::deleteDocuments(Term* term) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexReader(); - return indexReader->deleteDocuments(term); -} - -void IndexModifier::deleteDocument(int32_t docNum) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexReader(); - indexReader->deleteDocument(docNum); -} - -int32_t IndexModifier::docCount() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - if (indexWriter != NULL) - return indexWriter->docCount(); - else - return indexReader->numDocs(); -} - -void IndexModifier::optimize() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexWriter(); - indexWriter->optimize(); -} - -void IndexModifier::setUseCompoundFile(bool useCompoundFile) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - if (indexWriter != NULL) - indexWriter->setUseCompoundFile(useCompoundFile); - this->useCompoundFile = useCompoundFile; -} - -bool IndexModifier::getUseCompoundFile() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexWriter(); - return indexWriter->getUseCompoundFile(); -} - -void IndexModifier::setMaxFieldLength(int32_t maxFieldLength) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - if (indexWriter != NULL) - indexWriter->setMaxFieldLength(maxFieldLength); - this->maxFieldLength = maxFieldLength; -} - -int32_t IndexModifier::getMaxFieldLength() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexWriter(); - return indexWriter->getMaxFieldLength(); -} - -void IndexModifier::setMaxBufferedDocs(int32_t maxBufferedDocs) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - if (indexWriter != NULL) - indexWriter->setMaxBufferedDocs(maxBufferedDocs); - this->maxBufferedDocs = maxBufferedDocs; -} - -int32_t IndexModifier::getMaxBufferedDocs() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexWriter(); - return indexWriter->getMaxBufferedDocs(); -} -void IndexModifier::setMergeFactor(int32_t mergeFactor) { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - if (indexWriter != NULL) - indexWriter->setMergeFactor(mergeFactor); - this->mergeFactor = mergeFactor; -} - -int32_t IndexModifier::getMergeFactor() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexWriter(); - return indexWriter->getMergeFactor(); -} - -void IndexModifier::close() { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - if (indexWriter != NULL) { - indexWriter->close(); - _CLDELETE(indexWriter); - } else { - indexReader->close(); - _CLDELETE(indexReader); - } - _CLDECDELETE(directory) - open = false; -} - -QString IndexModifier::toString() const -{ - QString ret(QLatin1String("Index@")); - return ret.append(directory->toString()); -} - - - -int64_t IndexModifier::getCurrentVersion() const{ - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - return IndexReader::getCurrentVersion(directory); -} - -TermDocs* IndexModifier::termDocs(Term* term){ - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexReader(); - return indexReader->termDocs(term); -} - -TermEnum* IndexModifier::terms(Term* term){ - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexReader(); - if ( term != NULL ) - return indexReader->terms(term); - else - return indexReader->terms(); -} - - - CL_NS(document)::Document* IndexModifier::document(const int32_t n){ - Document* ret = _CLNEW Document; - if (!document(n,ret) ) - _CLDELETE(ret); - return ret; - } -bool IndexModifier::document(int32_t n, CL_NS(document)::Document* doc){ - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - assureOpen(); - createIndexReader(); - return indexReader->document(n, doc); -} -CL_NS(store)::Directory* IndexModifier::getDirectory(){ - return directory; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/IndexModifier.h b/3rdparty/clucene/src/CLucene/index/IndexModifier.h deleted file mode 100644 index 4e9963f5a..000000000 --- a/3rdparty/clucene/src/CLucene/index/IndexModifier.h +++ /dev/null @@ -1,316 +0,0 @@ -/* -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_IndexModifier_ -#define _lucene_index_IndexModifier_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/analysis/AnalysisHeader.h" - -CL_NS_DEF(index) - -class IndexReader; -class IndexWriter; -class Term; -class TermDocs; -class TermEnum; - -/** -* A class to modify an index, i.e. to delete and add documents. This -* class hides {@link IndexReader} and {@link IndexWriter} so that you -* do not need to care about implementation details such as that adding -* documents is done via IndexWriter and deletion is done via IndexReader. -* -*

Note that you cannot create more than one IndexModifier object -* on the same directory at the same time. -* -*

Example usage: -* -*

-* -* -* -* -*
-* -* //note this code will leak memory :) -* Analyzer* analyzer = new StandardAnalyzer();
-* // create an index in /tmp/index, overwriting an existing one:
-* IndexModifier* indexModifier = new IndexModifier("/tmp/index", analyzer, true);
-* Document* doc = new Document*();
-* doc->add(*new Field("id", "1", Field::STORE_YES| Field::INDEX_UNTOKENIZED));
-* doc->add(*new Field("body", "a simple test", Field::STORE_YES, Field::INDEX_TOKENIZED));
-* indexModifier->addDocument(doc);
-* int32_t deleted = indexModifier->deleteDocuments(new Term("id", "1"));
-* printf("Deleted %d document", deleted);
-* indexModifier->flush();
-* printf( "$d docs in index", indexModifier->docCount() );
-* indexModifier->close(); -*
-*
-* -*

Not all methods of IndexReader and IndexWriter are offered by this -* class. If you need access to additional methods, either use those classes -* directly or implement your own class that extends IndexModifier. -* -*

Although an instance of this class can be used from more than one -* thread, you will not get the best performance. You might want to use -* IndexReader and IndexWriter directly for that (but you will need to -* care about synchronization yourself then). -* -*

While you can freely mix calls to add() and delete() using this class, -* you should batch you calls for best performance. For example, if you -* want to update 20 documents, you should first delete all those documents, -* then add all the new documents. -* -*/ -class IndexModifier : LUCENE_BASE -{ -protected: - IndexWriter* indexWriter; - IndexReader* indexReader; - - CL_NS(store)::Directory* directory; - CL_NS(analysis)::Analyzer* analyzer; - bool open; - - // Lucene defaults: - bool useCompoundFile; - int32_t maxBufferedDocs; - int32_t maxFieldLength; - int32_t mergeFactor; - -public: - - /** - * Open an index with write access. - * - * @param directory the index directory - * @param analyzer the analyzer to use for adding new documents - * @param create true to create the index or overwrite - * the existing one; false to append to the existing index - */ - IndexModifier(CL_NS(store)::Directory* directory, - CL_NS(analysis)::Analyzer* analyzer, bool create); - - ~IndexModifier(); - - /** - * Open an index with write access. - * - * @param dirName the index directory - * @param analyzer the analyzer to use for adding new documents - * @param create true to create the index or overwrite - * the existing one; false to append to the existing index - */ - IndexModifier(const QString& dirName, CL_NS(analysis)::Analyzer* analyzer, - bool create); - -protected: - - // Initialize an IndexWriter. @throws IOException - void init(CL_NS(store)::Directory* directory, - CL_NS(analysis)::Analyzer* analyzer, bool create); - - // Throw an IllegalStateException if the index is closed. - // @throws IllegalStateException - void assureOpen() const; - - // Close the IndexReader and open an IndexWriter. @throws IOException - void createIndexWriter(); - - // Close the IndexWriter and open an IndexReader. @throws IOException - void createIndexReader(); - -public: - // Make sure all changes are written to disk. @throws IOException - void flush(); - - // Adds a document to this index, using the provided analyzer instead of - // the one specific in the constructor. If the document contains more than - // {@link #setMaxFieldLength(int32_t)} terms for a given field, the - // remainder are discarded. - // @see IndexWriter#addDocument(Document*, Analyzer*) - // @throws IllegalStateException if the index is closed - void addDocument(CL_NS(document)::Document* doc, CL_NS(analysis)::Analyzer* - docAnalyzer = NULL); - - - /** - * Deletes all documents containing term. - * This is useful if one uses a document field to hold a unique ID string for - * the document. Then to delete such a document, one merely constructs a - * term with the appropriate field and the unique ID string as its text and - * passes it to this method. Returns the number of documents deleted. - * @return the number of documents deleted - * @see IndexReader#deleteDocuments(Term*) - * @throws IllegalStateException if the index is closed - */ - int32_t deleteDocuments(Term* term); - - /** - * Deletes the document numbered docNum. - * @see IndexReader#deleteDocument(int32_t) - * @throws IllegalStateException if the index is closed - */ - void deleteDocument(int32_t docNum); - - /** - * Returns the number of documents currently in this index. - * @see IndexWriter#docCount() - * @see IndexReader#numDocs() - * @throws IllegalStateException if the index is closed - */ - int32_t docCount(); - - /** - * Merges all segments together into a single segment, optimizing an index - * for search. - * @see IndexWriter#optimize() - * @throws IllegalStateException if the index is closed - */ - void optimize(); - - /** - * Setting to turn on usage of a compound file. When on, multiple files - * for each segment are merged into a single file once the segment creation - * is finished. This is done regardless of what directory is in use. - * @see IndexWriter#setUseCompoundFile(bool) - * @throws IllegalStateException if the index is closed - */ - void setUseCompoundFile(bool useCompoundFile); - - /** - * @throws IOException - * @see IndexModifier#setUseCompoundFile(bool) - */ - bool getUseCompoundFile(); - - /** - * The maximum number of terms that will be indexed for a single field in a - * document. This limits the amount of memory required for indexing, so that - * collections with very large files will not crash the indexing process by - * running out of memory.

- * Note that this effectively truncates large documents, excluding from the - * index terms that occur further in the document. If you know your source - * documents are large, be sure to set this value high enough to accomodate - * the expected size. If you set it to Integer.MAX_VALUE, then the only limit - * is your memory, but you should anticipate an OutOfMemoryError.

- * By default, no more than 10,000 terms will be indexed for a field. - * @see IndexWriter#setMaxFieldLength(int32_t) - * @throws IllegalStateException if the index is closed - */ - void setMaxFieldLength(int32_t maxFieldLength); - - /** - * @throws IOException - * @see IndexModifier#setMaxFieldLength(int32_t) - */ - int32_t getMaxFieldLength(); - - /* - * The maximum number of terms that will be indexed for a single field in a - * document. This limits the amount of memory required for indexing, so that - * collections with very large files will not crash the indexing process by - * running out of memory.

- * Note that this effectively truncates large documents, excluding from the - * index terms that occur further in the document. If you know your source - * documents are large, be sure to set this value high enough to accomodate - * the expected size. If you set it to Integer.MAX_VALUE, then the only limit - * is your memory, but you should anticipate an OutOfMemoryError.

- * By default, no more than 10,000 terms will be indexed for a field. - * @see IndexWriter#setMaxBufferedDocs(int32_t) - * @throws IllegalStateException if the index is closed - */ - void setMaxBufferedDocs(int32_t maxBufferedDocs); - - // @see IndexModifier#setMaxBufferedDocs(int32_t) @throws IOException - int32_t getMaxBufferedDocs(); - - /* - * Determines how often segment indices are merged by addDocument(). With - * smaller values, less RAM is used while indexing, and searches on - * unoptimized indices are faster, but indexing speed is slower. With larger - * values, more RAM is used during indexing, and while searches on unoptimized - * indices are slower, indexing is faster. Thus larger values (> 10) are - * best for batch index creation, and smaller values (< 10) for indices - * that are interactively maintained. - *

This must never be less than 2. The default value is 10. - * - * @see IndexWriter#setMergeFactor(int32_t) - * @throws IllegalStateException if the index is closed - */ - void setMergeFactor(int32_t mergeFactor); - - /** - * @throws IOException - * @see IndexModifier#setMergeFactor(int32_t) - */ - int32_t getMergeFactor(); - - /** - * Close this index, writing all pending changes to disk. - * - * @throws IllegalStateException if the index has been closed before already - */ - void close(); - - QString toString() const; - - /** - * Gets the version number of the currently open index. - */ - int64_t getCurrentVersion() const; - - /** - * Returns an enumeration of all the documents which contain term. - * - * Warning: This is not threadsafe. Make sure you lock the modifier object - * while using the TermDocs. If the IndexReader that the modifier manages - * is closed, the TermDocs object will fail. - */ - TermDocs* termDocs(Term* term = NULL); - - /** - * Returns an enumeration of all terms after a given term. - * If no term is given, an enumeration of all the terms - * in the index is returned. - * The enumeration is ordered by Term.compareTo(). Each term - * is greater than all that precede it in the enumeration. - * - * Warning: This is not threadsafe. Make sure you lock the modifier object - * while using the TermDocs. If the IndexReader that the modifier manages - * is closed, the Document will be invalid - */ - TermEnum* terms(Term* term = NULL); - - /** - * Returns the stored fields of the n-th Document in this index. - * - * Warning: This is not threadsafe. Make sure you lock the modifier object - * while using the TermDocs. If the IndexReader that the modifier manages - * is closed, the Document will be invalid - */ - bool document(const int32_t n, CL_NS(document)::Document* doc); - _CL_DEPRECATED(document(i, document)) - CL_NS(document)::Document* document(const int32_t n); - - // Returns the directory used by this index. - CL_NS(store)::Directory* getDirectory(); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/IndexReader.cpp b/3rdparty/clucene/src/CLucene/index/IndexReader.cpp deleted file mode 100644 index 91c735632..000000000 --- a/3rdparty/clucene/src/CLucene/index/IndexReader.cpp +++ /dev/null @@ -1,668 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -# include -# include - -#include "CLucene/StdHeader.h" -#include "IndexReader.h" -#include "IndexWriter.h" - -#include "CLucene/store/Directory.h" -#include "CLucene/store/FSDirectory.h" -#include "CLucene/store/Lock.h" -#include "CLucene/document/Document.h" -#include "CLucene/search/Similarity.h" -#include "SegmentInfos.h" -#include "MultiReader.h" -#include "Terms.h" - -CL_NS_USE(util) -CL_NS_USE(store) -CL_NS_DEF(index) - -IndexReader::IndexReader(Directory* dir) - : stale(false) - , hasChanges(false) - , closeDirectory(false) - , directoryOwner(false) - , segmentInfos(NULL) - , directory(_CL_POINTER(dir)) - , writeLock(NULL) -{ -} - -IndexReader::IndexReader(Directory* dir, SegmentInfos* infos, bool close) - : stale(false) - , hasChanges(false) - , closeDirectory(close) - , directoryOwner(true) - , segmentInfos(infos) - , directory(_CL_POINTER(dir)) - , writeLock(NULL) -{ -} - -IndexReader::~IndexReader() -{ - if (writeLock != NULL) { - writeLock->release(); - _CLDELETE(writeLock); - } - _CLDELETE(segmentInfos); - _CLDECDELETE(directory); -} - -IndexReader* IndexReader::open(const QString& path) -{ - //Func - Static method. - // Returns an IndexReader reading the index in an FSDirectory in the named path. - //Pre - path != NULL and contains the path of the index for which an IndexReader must be - // instantiated - // closeDir indicates if the directory needs to be closed - //Post - An IndexReader has been returned that reads tnhe index located at path - - CND_PRECONDITION(!path.isEmpty(), "path is NULL"); - - Directory* dir = FSDirectory::getDirectory(path, false); - IndexReader* reader = open(dir, true); - //because fsdirectory will now have a refcount of 1 more than - //if the reader had been opened with a directory object, - //we need to do a refdec - _CLDECDELETE(dir); - return reader; -} - -IndexReader* IndexReader::open(Directory* directory, bool closeDirectory) -{ - //Func - Static method. - // Returns an IndexReader reading the index in an FSDirectory in the named path. - //Pre - directory represents a directory - // closeDir indicates if the directory needs to be closed - //Post - An IndexReader has been returned that reads the index located at directory - - // in- & inter-process sync - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - - //Instantiate an IndexReader::LockWith which can produce an IndexReader - LuceneLock* lock = directory->makeLock(QLatin1String("commit.lock")); - IndexReader::LockWith with(lock, directory); - - IndexReader* ret = NULL; - try { - //Create an IndexReader reading the index - ret = with.runAndReturn(); - } _CLFINALLY ( - _CLDELETE(lock); - ); - - CND_CONDITION(ret != NULL, "ret is NULL"); - ret->closeDirectory = closeDirectory; - - return ret; -} - -CL_NS(document)::Document* IndexReader::document(const int32_t n) -{ - CL_NS(document)::Document* ret = _CLNEW CL_NS(document)::Document; - if (!document(n, ret)) - _CLDELETE(ret); - return ret; -} - -IndexReader* IndexReader::LockWith::doBody() -{ - //Func - Reads the segmentinfo file and depending on the number of segments found - // it returns a SegmentsReader or a SegmentReader - //Pre - directory != NULL - //Post - Depending on the number of Segments present in directory this method - // returns an empty SegmentsReader when there are no segments, a SegmentReader when - // directory contains 1 segment and a nonempty SegmentsReader when directory - // contains multiple segements - - CND_PRECONDITION(directory != NULL, "directory is NULL"); - - //Instantiate SegmentInfos - SegmentInfos* infos = _CLNEW SegmentInfos; - try { - //Have SegmentInfos read the segments file in directory - infos->read(directory); - } catch(...) { - //make sure infos is cleaned up - _CLDELETE(infos); - throw; - } - - // If there is at least one segment (if infos.size() >= 1), the last - // SegmentReader object will close the directory when the SegmentReader - // object itself is closed (see SegmentReader::doClose). - // If there are no segments, there will be no "last SegmentReader object" - // to fulfill this responsibility, so we need to explicitly close the - // directory in the segmentsreader.close - - //Count the number segments in the directory - const uint32_t nSegs = infos->size(); - - if (nSegs == 1 ) { - // index is optimized - return _CLNEW SegmentReader(infos, infos->info(0)); - } else { - //Instantiate an array of pointers to SegmentReaders of size nSegs (The number of segments in the index) - IndexReader** readers = NULL; - - if (nSegs > 0){ - uint32_t infosize = infos->size(); - readers = _CL_NEWARRAY(IndexReader*,infosize+1); - for (uint32_t i = 0; i < infosize; ++i) { - //Instantiate a SegementReader responsible for reading the i-th segment and store it in - //the readers array - readers[i] = _CLNEW SegmentReader(infos->info(i)); - } - readers[infosize] = NULL; - } - - //return an instance of SegmentsReader which is a reader that manages all Segments - return _CLNEW MultiReader(directory, infos, readers); - }// end if -} - -uint64_t IndexReader::lastModified(const QString& directory) -{ - //Func - Static method - // Returns the time the index in the named directory was last modified. - //Pre - directory != NULL and contains the path name of the directory to check - //Post - The last modified time of the index has been returned - - CND_PRECONDITION(!directory.isEmpty(), "directory is NULL"); - - return FSDirectory::fileModified(directory, QLatin1String("segments")); -} - -int64_t IndexReader::getCurrentVersion(Directory* directory) -{ - // in- & inter-process sync - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - - int64_t ret = 0; - bool locked = false; - LuceneLock* commitLock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - try { - locked = commitLock->obtain(IndexWriter::COMMIT_LOCK_TIMEOUT); - ret = SegmentInfos::readCurrentVersion(directory); - } _CLFINALLY ( - if (locked) - commitLock->release(); - _CLDELETE(commitLock); - ) - return ret; -} - -int64_t IndexReader::getCurrentVersion(const QString& directory) -{ - Directory* dir = FSDirectory::getDirectory(directory, false); - int64_t version = getCurrentVersion(dir); - dir->close(); - _CLDECDELETE(dir); - return version; -} - -int64_t IndexReader::getVersion() -{ - return segmentInfos->getVersion(); -} - -bool IndexReader::isCurrent() -{ - // in- & inter-process sync - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - - bool ret = false; - bool locked = false; - LuceneLock* commitLock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - try { - locked = commitLock->obtain(IndexWriter::COMMIT_LOCK_TIMEOUT); - ret = SegmentInfos::readCurrentVersion(directory) - == segmentInfos->getVersion(); - } _CLFINALLY( - if (locked) - commitLock->release(); - _CLDELETE(commitLock); - ) - return ret; -} - -uint64_t IndexReader::lastModified(const Directory* directory) -{ - //Func - Static method - // Returns the time the index in this directory was last modified. - //Pre - directory contains a valid reference - //Post - The last modified time of the index has been returned - - return directory->fileModified(QLatin1String("segments")); -} - - -bool IndexReader::indexExists(const QString& directory) -{ - //Func - Static method - // Checks if an index exists in the named directory - //Pre - directory != NULL - //Post - Returns true if an index exists at the specified directory-> - // If the directory does not exist or if there is no index in it. - // false is returned. - - CND_PRECONDITION(!directory.isEmpty(), "directory is NULL"); - return QFile(directory + QLatin1String("/segments")).exists(); -} - - -void IndexReader::setNorm(int32_t doc, const TCHAR* field, uint8_t value) -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - if(directoryOwner) - aquireWriteLock(); - doSetNorm(doc, field, value); - hasChanges = true; -} - -void IndexReader::aquireWriteLock() -{ - if (stale) { - _CLTHROWA(CL_ERR_IO, - "IndexReader out of date and no longer valid for delete, " - "undelete, or setNorm operations"); - } - - if (writeLock == NULL) { - LuceneLock* writeLock = directory->makeLock(QLatin1String("write.lock")); - if (!writeLock->obtain(IndexWriter::WRITE_LOCK_TIMEOUT)) // obtain write lock - _CLTHROWA(CL_ERR_IO,"Index locked for write"); // + writeLock - this->writeLock = writeLock; - - // we have to check whether index has changed since this reader was opened. - // if so, this reader is no longer valid for deletion - if (SegmentInfos::readCurrentVersion(directory) > segmentInfos->getVersion()) { - stale = true; - this->writeLock->release(); - _CLDELETE(this->writeLock); - _CLTHROWA(CL_ERR_IO,"IndexReader out of date and no longer valid " - "for delete, undelete, or setNorm operations"); - } - } -} - - -void IndexReader::setNorm(int32_t doc, const TCHAR* field, qreal value) -{ - setNorm(doc, field, CL_NS(search)::Similarity::encodeNorm(value)); -} - -bool IndexReader::indexExists(const Directory* directory) -{ - //Func - Static method - // Checks if an index exists in the directory - //Pre - directory is a valid reference - //Post - Returns true if an index exists at the specified directory-> - // If the directory does not exist or if there is no index in it. - // false is returned. - - return directory->fileExists(QLatin1String("segments")); -} - -TermDocs* IndexReader::termDocs(Term* term) const -{ - //Func - Returns an enumeration of all the documents which contain - // term. For each document, the document number, the frequency of - // the term in that document is also provided, for use in search scoring. - // Thus, this method implements the mapping: - // - // Term => * - // The enumeration is ordered by document number. Each document number - // is greater than all that precede it in the enumeration. - //Pre - term != NULL - //Post - A reference to TermDocs containing an enumeration of all found documents - // has been returned - - CND_PRECONDITION(term != NULL, "term is NULL"); - - //Reference an instantiated TermDocs instance - TermDocs* _termDocs = termDocs(); - //Seek all documents containing term - _termDocs->seek(term); - //return the enumaration - return _termDocs; -} - -TermPositions* IndexReader::termPositions(Term* term) const -{ - //Func - Returns an enumeration of all the documents which contain term. For each - // document, in addition to the document number and frequency of the term in - // that document, a list of all of the ordinal positions of the term in the document - // is available. Thus, this method implements the mapping: - // - // Term => >* - // - // This positional information faciliates phrase and proximity searching. - // The enumeration is ordered by document number. Each document number is greater than - // all that precede it in the enumeration. - //Pre - term != NULL - //Post - A reference to TermPositions containing an enumeration of all found documents - // has been returned - - CND_PRECONDITION(term != NULL, "term is NULL"); - - //Reference an instantiated termPositions instance - TermPositions* _termPositions = termPositions(); - //Seek all documents containing term - _termPositions->seek(term); - //return the enumeration - return _termPositions; -} - -void IndexReader::deleteDocument(const int32_t docNum) -{ - //Func - Deletes the document numbered docNum. Once a document is deleted it will not appear - // in TermDocs or TermPostitions enumerations. Attempts to read its field with the document - // method will result in an error. The presence of this document may still be reflected in - // the docFreq statistic, though this will be corrected eventually as the index is further modified. - //Pre - docNum >= 0 - //Post - If successful the document identified by docNum has been deleted. If no writelock - // could be obtained an exception has been thrown stating that the index was locked or has no write access - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CND_PRECONDITION(docNum >= 0, "docNum is negative"); - - if (directoryOwner) - aquireWriteLock(); - - //Have the document identified by docNum deleted - doDelete(docNum); - hasChanges = true; -} - -/** -* Commit changes resulting from delete, undeleteAll, or setNorm operations -* -* @throws IOException -*/ -void IndexReader::commit() -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - if(hasChanges){ - if(directoryOwner){ - { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync - - LuceneLock* commitLock = directory->makeLock(QLatin1String("commit.lock")); - IndexReader::CommitLockWith cl(commitLock,this); - cl.run(); - _CLDELETE(commitLock); - - } - if (writeLock != NULL) { - writeLock->release(); // release write lock - _CLDELETE(writeLock); - } - }else - doCommit(); - } - hasChanges = false; -} - - -void IndexReader::undeleteAll() -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - if(directoryOwner) - aquireWriteLock(); - doUndeleteAll(); - hasChanges = true; -} - -int32_t IndexReader::deleteDocuments(Term* term) -{ - //Func - Deletes all documents containing term. This is useful if one uses a - // document field to hold a unique ID string for the document. Then to delete such - // a document, one merely constructs a term with the appropriate field and the unique - // ID string as its text and passes it to this method. - //Pre - term != NULL - //Post - All documents containing term have been deleted. The number of deleted documents - // has been returned - - CND_PRECONDITION(term != NULL, "term is NULL"); - - //Search for the documents contain term - TermDocs* docs = termDocs(term); - - //Check if documents have been found - if ( docs == NULL ){ - return 0; - } - - //initialize - int32_t Counter = 0; - try { - //iterate through the found documents - while (docs->next()) { - //Delete the document - deleteDocument(docs->doc()); - ++Counter; - } - }_CLFINALLY( - //Close the enumeration - docs->close(); - ); - - //Delete the enumeration of found documents - _CLDELETE( docs ); - - //Return the number of deleted documents - return Counter; -} - -TCHAR** IndexReader::getFieldNames() -{ - CL_NS(util)::StringArrayWithDeletor array; - getFieldNames(IndexReader::ALL, array); - - array.setDoDelete(false); - TCHAR** ret = _CL_NEWARRAY(TCHAR*,array.size()+1); - int j=0; - CL_NS(util)::StringArrayWithDeletor::iterator itr = array.begin(); - while ( itr != array.end() ){ - ret[j]=*itr; - ++j;++itr; - } - ret[j]=NULL; - return ret; -} - -TCHAR** IndexReader::getFieldNames(bool indexed) -{ - CL_NS(util)::StringArrayWithDeletor array; - getFieldNames(indexed?IndexReader::INDEXED:IndexReader::UNINDEXED, array); - - array.setDoDelete(false); - TCHAR** ret = _CL_NEWARRAY(TCHAR*,array.size()+1); - int j=0; - CL_NS(util)::StringArrayWithDeletor::iterator itr = array.begin(); - while ( itr != array.end() ){ - ret[j]=*itr; - ++j;++itr; - } - ret[j]=NULL; - return ret; -} - -void IndexReader::close() -{ - //Func - Closes files associated with this index and also saves any new deletions to disk. - // No other methods should be called after this has been called. - //Pre - true - //Post - All files associated with this index have been deleted and new deletions have been - // saved to disk - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CloseCallbackMap::iterator iter; - for (iter = closeCallbacks.begin(); iter != closeCallbacks.end(); iter++) { - CloseCallback callback = *iter->first; - callback(this, iter->second); - } - - commit(); - doClose(); - - if(closeDirectory) { - directory->close(); - _CLDECDELETE(directory); - } -} - -bool IndexReader::isLocked(Directory* directory) -{ - //Func - Static method - // Checks if the index in the directory is currently locked. - //Pre - directory is a valid reference to a directory to check for a lock - //Post - Returns true if the index in the named directory is locked otherwise false - - //Check the existence of the file write.lock and return true when it does and false - //when it doesn't - LuceneLock* l1 = directory->makeLock(QLatin1String("write.lock")); - LuceneLock* l2 = directory->makeLock(QLatin1String("commit.lock")); - - bool ret = l1->isLocked() || l2->isLocked(); - - _CLDELETE(l1); - _CLDELETE(l2); - return ret; -} - -bool IndexReader::isLocked(const QString& directory) -{ - //Func - Static method - // Checks if the index in the named directory is currently locked. - //Pre - directory != NULL and contains the directory to check for a lock - //Post - Returns true if the index in the named directory is locked otherwise false - - CND_PRECONDITION(!directory.isEmpty(), "directory is NULL"); - - Directory* dir = FSDirectory::getDirectory(directory, false); - bool ret = isLocked(dir); - dir->close(); - _CLDECDELETE(dir); - - return ret; -} - -/** Returns true if there are norms stored for this field. */ -bool IndexReader::hasNorms(const TCHAR* field) -{ - // backward compatible implementation. - // SegmentReader has an efficient implementation. - return norms(field) != NULL; -} - -void IndexReader::unlock(const QString& path) -{ - FSDirectory* dir = FSDirectory::getDirectory(path, false); - unlock(dir); - dir->close(); - _CLDECDELETE(dir); -} - -void IndexReader::unlock(Directory* directory) -{ - //Func - Static method - // Forcibly unlocks the index in the named directory-> - // Caution: this should only be used by failure recovery code, - // when it is known that no other process nor thread is in fact - // currently accessing this index. - //Pre - directory is a valid reference to a directory - //Post - The directory has been forcibly unlocked - LuceneLock* lock; - - lock = directory->makeLock(QLatin1String("write.lock")); - lock->release(); - _CLDELETE(lock); - - lock = directory->makeLock(QLatin1String("commit.lock")); - lock->release(); - _CLDELETE(lock); -} - -bool IndexReader::isLuceneFile(const QString& filename) -{ - if (filename.isNull() || filename.isEmpty()) - return false; - - size_t len = filename.length(); - if (len < 6) //need at least x.frx - return false; - - if (filename == QLatin1String("segments")) - return true; - - if (filename == QLatin1String("segments.new")) - return true; - - if (filename == QLatin1String("deletable")) - return true; - - QStringList extList; - extList << QLatin1String(".cfs") - << QLatin1String(".fnm") << QLatin1String(".fdx") << QLatin1String(".fdt") - << QLatin1String(".tii") << QLatin1String(".tis") << QLatin1String(".frq") - << QLatin1String(".prx") << QLatin1String(".del") << QLatin1String(".tvx") - << QLatin1String(".tvd") << QLatin1String(".tvf") << QLatin1String(".tvp"); - - QString suffix = filename.right(4); - if (extList.contains(suffix, Qt::CaseInsensitive)) - return true; - - if (suffix.leftRef(2) == QLatin1String(".f")) { - suffix = suffix.remove(0, 2); - if (suffix.length() > 0) { - for (int i = 0; i < suffix.length(); ++i) { - if (!suffix.at(i).isDigit()) - return false; - } - return true; - } - } - return false; -} - -void IndexReader::addCloseCallback(CloseCallback callback, void* parameter) -{ - closeCallbacks.put(callback, parameter); -} - -// #pragma mark -- IndexReader::LockWith - -IndexReader::LockWith::LockWith(CL_NS(store)::LuceneLock* lock, CL_NS(store)::Directory* dir) - : CL_NS(store)::LuceneLockWith(lock, IndexWriter::COMMIT_LOCK_TIMEOUT) -{ - this->directory = dir; -} - -// #pragma mark -- IndexReader::CommitLockWith - -IndexReader::CommitLockWith::CommitLockWith(CL_NS(store)::LuceneLock* lock, IndexReader* r) - : CL_NS(store)::LuceneLockWith(lock,IndexWriter::COMMIT_LOCK_TIMEOUT) - , reader(r) -{ -} - -void IndexReader::CommitLockWith::doBody() -{ - reader->doCommit(); - reader->segmentInfos->write(reader->getDirectory()); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/IndexReader.h b/3rdparty/clucene/src/CLucene/index/IndexReader.h deleted file mode 100644 index 352d16e80..000000000 --- a/3rdparty/clucene/src/CLucene/index/IndexReader.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_IndexReader_ -#define _lucene_index_IndexReader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/store/FSDirectory.h" -#include "CLucene/store/Lock.h" -#include "CLucene/document/Document.h" -#include "CLucene/index/TermVector.h" -#include "SegmentInfos.h" -#include "Terms.h" - - -CL_NS_DEF(index) - - -/** IndexReader is an abstract class, providing an interface for accessing an - index. Search of an index is done entirely through this abstract interface, - so that any subclass which implements it is searchable. - -

Concrete subclasses of IndexReader are usually constructed with a call to - one of the static open() methods, e.g. {@link #open(String)}. - -

For efficiency, in this API documents are often referred to via - document numbers, non-negative integers which each name a unique - document in the index. These document numbers are ephemeral--they may change - as documents are added to and deleted from an index. Clients should thus not - rely on a given document having the same number between sessions. - -

An IndexReader can be opened on a directory for which an IndexWriter is - opened already, but it cannot be used to delete documents from the index then. -*/ -class IndexReader : LUCENE_BASE -{ -public: - //Callback for classes that need to know if IndexReader is closing. - typedef void (*CloseCallback)(IndexReader*, void*); - - class CloseCallbackCompare:public CL_NS(util)::Compare::_base{ - public: - bool operator()( CloseCallback t1, CloseCallback t2 ) const{ - return t1 > t2; - } - static void doDelete(CloseCallback dummy){ - } - }; - - - enum FieldOption { - // all fields - ALL = 1, - // all indexed fields - INDEXED = 2, - // all fields which are not indexed - UNINDEXED = 4, - // all fields which are indexed with termvectors enables - INDEXED_WITH_TERMVECTOR = 8, - // all fields which are indexed but don't have termvectors enabled - INDEXED_NO_TERMVECTOR = 16, - // all fields where termvectors are enabled. Please note that only standard termvector fields are returned - TERMVECTOR = 32, - // all field with termvectors wiht positions enabled - TERMVECTOR_WITH_POSITION = 64, - // all fields where termvectors with offset position are set - TERMVECTOR_WITH_OFFSET = 128, - // all fields where termvectors with offset and position values set - TERMVECTOR_WITH_POSITION_OFFSET = 256 - }; - - -private: - bool stale; - bool hasChanges; - bool closeDirectory; - bool directoryOwner; - - SegmentInfos* segmentInfos; - CL_NS(store)::Directory* directory; - CL_NS(store)::LuceneLock* writeLock; - - typedef CL_NS(util)::CLSet CloseCallbackMap; - CloseCallbackMap closeCallbacks; - - /** Internal use. Implements commit */ - virtual void doCommit() = 0; - - /** - * Tries to acquire the WriteLock on this directory. - * this method is only valid if this IndexReader is directory owner. - * - * @throws IOException If WriteLock cannot be acquired. - */ - void aquireWriteLock(); -protected: - /** - * Constructor used if IndexReader is not owner of its directory. - * This is used for IndexReaders that are used within other IndexReaders that take care or locking directories. - * - * @param directory Directory where IndexReader files reside. - */ - IndexReader(CL_NS(store)::Directory* dir); - - /** - * Constructor used if IndexReader is owner of its directory. - * If IndexReader is owner of its directory, it locks its directory in case of write operations. - * - * @param directory Directory where IndexReader files reside. - * @param segmentInfos Used for write-l - * @param closeDirectory - */ - IndexReader(CL_NS(store)::Directory* directory, SegmentInfos* segmentInfos, bool closeDirectory); - - - /// Implements close. - virtual void doClose() = 0; - - /** Implements setNorm in subclass.*/ - virtual void doSetNorm(int32_t doc, const TCHAR* field, uint8_t value) = 0; - - /** Implements actual undeleteAll() in subclass. */ - virtual void doUndeleteAll() = 0; - - - /** Implements deletion of the document numbered docNum. - * Applications should call {@link #deleteDocument(int32_t)} or {@link #deleteDocuments(Term*)}. - */ - virtual void doDelete(const int32_t docNum) = 0; - -public: - - DEFINE_MUTEX(THIS_LOCK) - - ///Do not access this directly, only public so that MultiReader can access it - virtual void commit(); - - - /** Undeletes all documents currently marked as deleted in this index.*/ - void undeleteAll(); - - /** - * Get a list of unique field names that exist in this index and have the specified - * field option information. - * @param fldOption specifies which field option should be available for the returned fields - * @return Collection of Strings indicating the names of the fields. - * @see IndexReader.FieldOption - */ - virtual void getFieldNames(FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor& retarray) = 0; - - _CL_DEPRECATED( getFieldNames(FieldOption, StringArrayWithDeletor&) ) virtual TCHAR** getFieldNames(); - _CL_DEPRECATED( getFieldNames(FieldOption, StringArrayWithDeletor&) ) virtual TCHAR** getFieldNames(bool indexed); - - /** Returns the byte-encoded normalization factor for the named field of - * every document. This is used by the search code to score documents. - * - * The number of bytes returned is the size of the IndexReader->maxDoc() - * MEMORY: The values are cached, so don't delete the returned byte array. - * @see Field#setBoost(qreal) - */ - virtual uint8_t* norms(const TCHAR* field) = 0; - - - /** Reads the byte-encoded normalization factor for the named field of every - * document. This is used by the search code to score documents. - * - * @see Field#setBoost(qreal) - */ - virtual void norms(const TCHAR* field, uint8_t* bytes) = 0; - - /** Expert: Resets the normalization factor for the named field of the named - * document. - * - * @see #norms(TCHAR*) - * @see Similarity#decodeNorm(uint8_t) - */ - void setNorm(int32_t doc, const TCHAR* field, qreal value); - - /** Expert: Resets the normalization factor for the named field of the named - * document. The norm represents the product of the field's {@link - * Field#setBoost(qreal) boost} and its {@link Similarity#lengthNorm(TCHAR*, - * int32_t) length normalization}. Thus, to preserve the length normalization - * values when resetting this, one should base the new value upon the old. - * - * @see #norms(TCHAR*) - * @see Similarity#decodeNorm(uint8_t) - */ - void setNorm(int32_t doc, const TCHAR* field, uint8_t value); - - /// Release the write lock, if needed. - virtual ~IndexReader(); - - /// Returns an IndexReader reading the index in an FSDirectory in the named path. - static IndexReader* open(const QString& path); - - /// Returns an IndexReader reading the index in the given Directory. - static IndexReader* open( CL_NS(store)::Directory* directory, bool closeDirectory=false); - - /** - * Returns the time the index in the named directory was last modified. - * Do not use this to check whether the reader is still up-to-date, use - * {@link #isCurrent()} instead. - */ - static uint64_t lastModified(const QString& directory); - - /** - * Returns the time the index in the named directory was last modified. - * Do not use this to check whether the reader is still up-to-date, use - * {@link #isCurrent()} instead. - */ - static uint64_t lastModified(const CL_NS(store)::Directory* directory); - - - /** - * Reads version number from segments files. The version number is - * initialized with a timestamp and then increased by one for each change of - * the index. - * - * @param directory where the index resides. - * @return version number. - * @throws IOException if segments file cannot be read - */ - static int64_t getCurrentVersion(CL_NS(store)::Directory* directory); - - /** - * Reads version number from segments files. The version number is - * initialized with a timestamp and then increased by one for each change of - * the index. - * - * @param directory where the index resides. - * @return version number. - * @throws IOException if segments file cannot be read - */ - static int64_t getCurrentVersion(const QString& directory); - - /** - * Version number when this IndexReader was opened. - */ - int64_t getVersion(); - - /** - * Check whether this IndexReader still works on a current version of the index. - * If this is not the case you will need to re-open the IndexReader to - * make sure you see the latest changes made to the index. - * - * @throws IOException - */ - bool isCurrent(); - - - /** - * Return an array of term frequency vectors for the specified document. - * The array contains a vector for each vectorized field in the document. - * Each vector contains terms and frequencies for all terms in a given vectorized field. - * If no such fields existed, the method returns null. The term vectors that are - * returned my either be of type TermFreqVector or of type TermPositionsVector if - * positions or offsets have been stored. - * - * @param docNumber document for which term frequency vectors are returned - * @return array of term frequency vectors. May be null if no term vectors have been - * stored for the specified document. - * @throws IOException if index cannot be accessed - * @see org.apache.lucene.document.Field.TermVector - */ - virtual bool getTermFreqVectors(int32_t docNumber, Array& result) =0; - - /** - * Return a term frequency vector for the specified document and field. The - * returned vector contains terms and frequencies for the terms in - * the specified field of this document, if the field had the storeTermVector - * flag set. If termvectors had been stored with positions or offsets, a - * TermPositionsVector is returned. - * - * @param docNumber document for which the term frequency vector is returned - * @param field field for which the term frequency vector is returned. - * @return term frequency vector May be null if field does not exist in the specified - * document or term vector was not stored. - * @throws IOException if index cannot be accessed - * @see org.apache.lucene.document.Field.TermVector - */ - virtual TermFreqVector* getTermFreqVector(int32_t docNumber, const TCHAR* field) = 0; - - /** - * Returns true if an index exists at the specified directory. - * If the directory does not exist or if there is no index in it. - * @param directory the directory to check for an index - * @return true if an index exists; false otherwise - */ - static bool indexExists(const QString& directory); - - /** - * Returns true if an index exists at the specified directory. - * If the directory does not exist or if there is no index in it. - * @param directory the directory to check for an index - * @return true if an index exists; false otherwise - * @throws IOException if there is a problem with accessing the index - */ - static bool indexExists(const CL_NS(store)::Directory* directory); - - /** Returns the number of documents in this index. */ - virtual int32_t numDocs() = 0; - - /** Returns one greater than the largest possible document number. - * This may be used to, e.g., determine how big to allocate an array which - * will have an element for every document number in an index. - */ - virtual int32_t maxDoc() const = 0; - - /** Gets the stored fields of the nth - * Document in this index. - * The fields are not cleared before retrieving the document, so the - * object should be new or just cleared. - */ - virtual bool document(int32_t n, CL_NS(document)::Document*) =0; - - _CL_DEPRECATED( document(i, document) ) CL_NS(document)::Document* document(const int32_t n); - - /** Returns true if document n has been deleted */ - virtual bool isDeleted(const int32_t n) = 0; - - /** Returns true if any documents have been deleted */ - virtual bool hasDeletions() const = 0; - - /** Returns true if there are norms stored for this field. */ - virtual bool hasNorms(const TCHAR* field); - - /** Returns an enumeration of all the terms in the index. - * The enumeration is ordered by Term.compareTo(). Each term - * is greater than all that precede it in the enumeration. - * @memory Caller must clean up - */ - virtual TermEnum* terms() const =0; - - /** Returns an enumeration of all terms after a given term. - * The enumeration is ordered by Term.compareTo(). Each term - * is greater than all that precede it in the enumeration. - * @memory Caller must clean up - */ - virtual TermEnum* terms(const Term* t) const = 0; - - /** Returns the number of documents containing the term t. */ - virtual int32_t docFreq(const Term* t) const = 0; - - /* Returns an unpositioned TermPositions enumerator. - * @memory Caller must clean up - */ - virtual TermPositions* termPositions() const = 0; - - /** Returns an enumeration of all the documents which contain - * term. For each document, in addition to the document number - * and frequency of the term in that document, a list of all of the ordinal - * positions of the term in the document is available. Thus, this method - * implements the mapping: - * - *

    - * Term    =>    <docNum, freq, - * <pos1, pos2, ... - * posfreq-1> - * >* - *
- *

This positional information faciliates phrase and proximity searching. - *

The enumeration is ordered by document number. Each document number is - * greater than all that precede it in the enumeration. - * @memory Caller must clean up - */ - TermPositions* termPositions(Term* term) const; - - /** Returns an unpositioned {@link TermDocs} enumerator. - * @memory Caller must clean up - */ - virtual TermDocs* termDocs() const = 0; - - /** Returns an enumeration of all the documents which contain - * term. For each document, the document number, the frequency of - * the term in that document is also provided, for use in search scoring. - * Thus, this method implements the mapping: - *

    Term    =>    <docNum, freq>*
- *

The enumeration is ordered by document number. Each document number - * is greater than all that precede it in the enumeration. - * @memory Caller must clean up - */ - TermDocs* termDocs(Term* term) const; - - /** Deletes the document numbered docNum. Once a document is - * deleted it will not appear in TermDocs or TermPostitions enumerations. - * Attempts to read its field with the {@link #document} - * method will result in an error. The presence of this document may still be - * reflected in the {@link #docFreq} statistic, though - * this will be corrected eventually as the index is further modified. - */ - void deleteDocument(const int32_t docNum); - - ///@deprecated. Use deleteDocument instead. - _CL_DEPRECATED( deleteDocument ) void deleteDoc(const int32_t docNum) - { deleteDocument(docNum); } - - /** Deletes all documents containing term. - * This is useful if one uses a document field to hold a unique ID string for - * the document. Then to delete such a document, one merely constructs a - * term with the appropriate field and the unique ID string as its text and - * passes it to this method. - * See {@link #deleteDocument(int)} for information about when this deletion will - * become effective. - * @return the number of documents deleted - */ - int32_t deleteDocuments(Term* term); - - ///@deprecated. Use deleteDocuments instead. - _CL_DEPRECATED( deleteDocuments ) int32_t deleteTerm(Term* term){ return deleteDocuments(term); } - - /** - * Closes files associated with this index and also saves any new deletions to disk. - * No other methods should be called after this has been called. - */ - void close(); - - ///Checks if the index in the named directory is currently locked. - static bool isLocked(CL_NS(store)::Directory* directory); - - ///Checks if the index in the named directory is currently locked. - static bool isLocked(const QString& directory); - - - ///Forcibly unlocks the index in the named directory. - ///Caution: this should only be used by failure recovery code, - ///when it is known that no other process nor thread is in fact - ///currently accessing this index. - static void unlock(CL_NS(store)::Directory* directory); - static void unlock(const QString& path); - - /** Returns the directory this index resides in. */ - CL_NS(store)::Directory* getDirectory() { return directory; } - - /** Returns true if the file is a lucene filename (based on extension or filename) */ - static bool isLuceneFile(const QString& filename); - - /** - * For classes that need to know when the IndexReader closes (such as caches, etc), - * should pass their callback function to this. - */ - void addCloseCallback(CloseCallback callback, void* parameter); - -protected: - class LockWith : public CL_NS(store)::LuceneLockWith - { - public: - LockWith(CL_NS(store)::LuceneLock* lock, CL_NS(store)::Directory* dir); - - //Reads the segmentinfo file and depending on the number of segments found - //it returns a MultiReader or a SegmentReader - IndexReader* doBody(); - - private: - CL_NS(store)::Directory* directory; - }; - friend class IndexReader::LockWith; - - class CommitLockWith : public CL_NS(store)::LuceneLockWith - { - public: - CommitLockWith(CL_NS(store)::LuceneLock* lock, IndexReader* r); - void doBody(); - - private: - IndexReader* reader; - }; - friend class IndexReader::CommitLockWith; -}; - -CL_NS_END -#endif - - diff --git a/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp b/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp deleted file mode 100644 index 5504cf6fa..000000000 --- a/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp +++ /dev/null @@ -1,697 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "IndexWriter.h" - -#include "CLucene/document/Document.h" -#include "CLucene/store/Directory.h" -#include "CLucene/store/Lock.h" -#include "CLucene/util/VoidList.h" -#include "DocumentWriter.h" -#include "SegmentInfos.h" -#include "SegmentMerger.h" - -CL_NS_USE(store) -CL_NS_USE(util) -CL_NS_USE(document) -CL_NS_USE(analysis) -CL_NS_DEF(index) - -const QLatin1String IndexWriter::WRITE_LOCK_NAME("write.lock"); -const QLatin1String IndexWriter::COMMIT_LOCK_NAME("commit.lock"); - -IndexWriter::IndexWriter(const QString& path, Analyzer* a, const bool create, - const bool _closeDir) - : directory(FSDirectory::getDirectory(path, create)) - , analyzer(a) - , segmentInfos(true) - , closeDir(_closeDir) -{ - //Func - Constructor - // Constructs an IndexWriter for the index in path. - //Pre - path != NULL and contains a named directory path - // a holds a valid reference to an analyzer and analyzes the text to - // be indexed create indicates if the indexWriter must create a new - // index located at path or just open it - //Post - If create is true, then a new, empty index has been created in - // path, replacing the index already there, if any. The named - // directory path is owned by this Instance - - CND_PRECONDITION(!path.isEmpty(), "path is NULL"); - - //Continue initializing the instance by _IndexWriter - _IndexWriter(create); -} - -IndexWriter::IndexWriter(Directory* d, Analyzer* a, const bool create, - const bool _closeDir) - : directory(_CL_POINTER(d)) - , analyzer(a) - , segmentInfos(true) - , closeDir(_closeDir) -{ - //Func - Constructor - // Constructs an IndexWriter for the index in path. - //Pre - d contains a valid reference to a directory - // a holds a valid reference to an analyzer and analyzes the text to - // be indexed create indicates if the indexWriter must create a new - // index located at path or just open it - //Post - If create is true, then a new, empty index has been created in - // path, replacing the index already there, if any. The directory d - // is not owned by this Instance - - //Continue initializing the instance by _IndexWriter - _IndexWriter ( create ); -} - -void IndexWriter::_IndexWriter(const bool create) -{ - //Func - Initialises the instances - //Pre - create indicates if the indexWriter must create a new index - // located at path or just open it - - similarity = CL_NS(search)::Similarity::getDefault(); - - useCompoundFile = true; - if ( directory->getDirectoryType() == RAMDirectory::DirectoryType() ) - useCompoundFile = false; - - //Create a ramDirectory - ramDirectory = _CLNEW TransactionalRAMDirectory; - - CND_CONDITION(ramDirectory != NULL, "ramDirectory is NULL"); - - //Initialize the writeLock to - writeLock = NULL; - - //initialise the settings... - maxFieldLength = DEFAULT_MAX_FIELD_LENGTH; - mergeFactor = DEFAULT_MERGE_FACTOR; - maxMergeDocs = DEFAULT_MAX_MERGE_DOCS; - writeLockTimeout = WRITE_LOCK_TIMEOUT; - commitLockTimeout = COMMIT_LOCK_TIMEOUT; - minMergeDocs = DEFAULT_MAX_BUFFERED_DOCS; - termIndexInterval = DEFAULT_TERM_INDEX_INTERVAL; - - //Create a new lock using the name "write.lock" - LuceneLock* newLock = directory->makeLock(IndexWriter::WRITE_LOCK_NAME); - - //Condition check to see if newLock has been allocated properly - CND_CONDITION(newLock != NULL, - "No memory could be allocated for LuceneLock newLock"); - - //Try to obtain a write lock - if (!newLock->obtain(writeLockTimeout)){ - //Write lock could not be obtained so delete it - _CLDELETE(newLock); - //Reset the instance - _finalize(); - //throw an exception because no writelock could be created or obtained - _CLTHROWA(CL_ERR_IO, "Index locked for write or no write access." ); - } - - //The Write Lock has been obtained so save it for later use - this->writeLock = newLock; - - //Create a new lock using the name "commit.lock" - LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - - //Condition check to see if lock has been allocated properly - CND_CONDITION(lock != NULL, "No memory could be allocated for LuceneLock lock"); - - LockWith2 with(lock, commitLockTimeout, this, NULL, create); - { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync - with.run(); - } - - //Release the commit lock - _CLDELETE(lock); - - isOpen = true; -} - -IndexWriter::~IndexWriter() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - close(); - _finalize(); -} - -void IndexWriter::close() -{ - //Func - Flushes all changes to an index, closes all associated files, and - // closes the directory that the index is stored in. - //Pre - closeDir indicates if the directory must be closed or not - //Post - All the changes have been flushed to disk and the write lock has - // been released. The ramDirectory has also been closed. The - // directory has been closed if the reference count of the directory - // reaches zero - - SCOPED_LOCK_MUTEX(THIS_LOCK) - if (isOpen) { - //Flush the Ram Segments - flushRamSegments(); - //Close the ram directory - if (ramDirectory != NULL) { - ramDirectory->close(); - _CLDECDELETE(ramDirectory); - } - - //Check if this instance must close the directory - if (closeDir) - directory->close(); - _CLDECDELETE(directory); - - // release write lock - if (writeLock != NULL) { - writeLock->release(); - _CLDELETE(writeLock); - } - isOpen = false; - } -} - -void IndexWriter::_finalize() -{ - //Func - Releases all the resources of the instance - //Pre - true - //Post - All the releases have been released - - if(writeLock != NULL) { - //release write lock - writeLock->release(); - _CLDELETE( writeLock ); - } - - //Delete the ramDirectory - if (ramDirectory != NULL) { - ramDirectory->close(); - _CLDECDELETE(ramDirectory); - } -} - -int32_t IndexWriter::docCount() -{ - //Func - Counts the number of documents in the index - //Pre - true - //Post - The number of documents have been returned - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - //Initialize count - int32_t count = 0; - - //Iterate through all segmentInfos - for (int32_t i = 0; i < segmentInfos.size(); i++) { - //Get the i-th SegmentInfo - SegmentInfo* si = segmentInfos.info(i); - //Retrieve the number of documents of the segment and add it to count - count += si->docCount; - } - return count; -} - -void IndexWriter::addDocument(Document* doc, Analyzer* analyzer) -{ - //Func - Adds a document to the index - //Pre - doc contains a valid reference to a document - // ramDirectory != NULL - //Post - The document has been added to the index of this IndexWriter - CND_PRECONDITION(ramDirectory != NULL, "ramDirectory is NULL"); - - if (analyzer == NULL) - analyzer = this->analyzer; - - ramDirectory->transStart(); - try { - QString segmentName = newSegmentName(); - CND_CONDITION(!segmentName.isEmpty(), "segmentName is NULL"); - try { - //Create the DocumentWriter using a ramDirectory and analyzer - // supplied by the IndexWriter (this). - DocumentWriter* dw = _CLNEW DocumentWriter(ramDirectory, analyzer, - this ); - CND_CONDITION(dw != NULL, "dw is NULL"); - try { - //Add the client-supplied document to the new segment. - dw->addDocument(segmentName, doc); - } _CLFINALLY ( - _CLDELETE(dw); - ); - - //Create a new SegmentInfo instance about this new segment. - SegmentInfo* si = _CLNEW SegmentInfo(segmentName, 1, ramDirectory); - CND_CONDITION(si != NULL, "Si is NULL"); - { - SCOPED_LOCK_MUTEX(THIS_LOCK) - - //Add the info object for this particular segment to the list - // of all segmentInfos-> - segmentInfos.add(si); - - //Check to see if the segments must be merged - maybeMergeSegments(); - } - } _CLFINALLY() - } catch (...) { - ramDirectory->transAbort(); - throw; -} - ramDirectory->transCommit(); -} - -void IndexWriter::optimize() -{ - //Func - Optimizes the index for which this Instance is responsible - //Pre - true - //Post - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - //Flush the RamSegments to disk - flushRamSegments(); - while (segmentInfos.size() > 1 - || (segmentInfos.size() == 1 - && (SegmentReader::hasDeletions(segmentInfos.info(0)) - || segmentInfos.info(0)->getDir()!=directory - || (useCompoundFile - && (!SegmentReader::usesCompoundFile(segmentInfos.info(0)) - || SegmentReader::hasSeparateNorms(segmentInfos.info(0))))))) { - int32_t minSegment = segmentInfos.size() - mergeFactor; - mergeSegments(minSegment < 0 ? 0 : minSegment); - } -} - - -QString IndexWriter::newSegmentName() -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - return QLatin1Char('_') + QString::number(segmentInfos.counter++, 36); -} - -void IndexWriter::flushRamSegments() -{ - //Func - Merges all RAM-resident segments. - //Pre - ramDirectory != NULL - //Post - The RAM-resident segments have been merged to disk - - CND_PRECONDITION(ramDirectory != NULL, "ramDirectory is NULL"); - - int32_t minSegment = segmentInfos.size()-1; //don't make this unsigned... - CND_CONDITION(minSegment >= -1, "minSegment must be >= -1"); - - int32_t docCount = 0; - //Iterate through all the segements and check if the directory is a ramDirectory - while (minSegment >= 0 && - segmentInfos.info(minSegment)->getDir() == ramDirectory) { - docCount += segmentInfos.info(minSegment)->docCount; - minSegment--; - } - if (minSegment < 0 || // add one FS segment? - (docCount + segmentInfos.info(minSegment)->docCount) > mergeFactor || - !(segmentInfos.info(segmentInfos.size()-1)->getDir() == ramDirectory)) - minSegment++; - - CND_CONDITION(minSegment >= 0, "minSegment must be >= 0"); - if (minSegment >= segmentInfos.size()) - return; // none to merge - mergeSegments(minSegment); -} - -void IndexWriter::maybeMergeSegments() { - //Func - Incremental Segment Merger - //Pre - - //Post - - - int64_t targetMergeDocs = minMergeDocs; - - // find segments smaller than current target size - while (targetMergeDocs <= maxMergeDocs) { - int32_t minSegment = segmentInfos.size(); - int32_t mergeDocs = 0; - - while (--minSegment >= 0) { - SegmentInfo* si = segmentInfos.info(minSegment); - if (si->docCount >= targetMergeDocs) - break; - mergeDocs += si->docCount; - } - - if (mergeDocs >= targetMergeDocs){ - // found a merge to do - mergeSegments(minSegment+1); - }else - break; - - //increase target size - targetMergeDocs *= mergeFactor; - } -} - -void IndexWriter::mergeSegments(const uint32_t minSegment) -{ - mergeSegments(minSegment, segmentInfos.size()); -} - -void IndexWriter::mergeSegments(const uint32_t minSegment, const uint32_t end) -{ - CLVector segmentsToDelete(false); - QString mergedName = newSegmentName(); -#ifdef _CL_DEBUG_INFO - fprintf(_CL_DEBUG_INFO, "merging segments\n"); -#endif - SegmentMerger merger(this, mergedName); - for (size_t i = minSegment; i < end; i++) { - SegmentInfo* si = segmentInfos.info(i); -#ifdef _CL_DEBUG_INFO - fprintf(_CL_DEBUG_INFO, " %s (%d docs)\n", - si->name.toLocal8Bit().constData(), si->docCount); -#endif - SegmentReader* reader = _CLNEW SegmentReader(si); - merger.add(reader); - // if we own the directory - if ((reader->getDirectory() == this->directory) - || (reader->getDirectory() == this->ramDirectory)) { - // queue segment for deletion - segmentsToDelete.push_back(reader); - } - } - - int32_t mergedDocCount = merger.merge(); - -#ifdef _CL_DEBUG_INFO - fprintf(_CL_DEBUG_INFO, "\n into %s (%d docs)\n", - mergedName.toLocal8Bit().constData(), mergedDocCount); -#endif - - segmentInfos.clearto(minSegment);// remove old infos & add new - segmentInfos.add(_CLNEW SegmentInfo(mergedName, mergedDocCount, directory)); - - // close readers before we attempt to delete now-obsolete segments - merger.closeReaders(); - - LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - LockWith2 with (lock, commitLockTimeout, this, &segmentsToDelete, true); - { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync - with.run(); - } - _CLDELETE( lock ); - - if (useCompoundFile) { - QStringList filesToDelete; - merger.createCompoundFile(mergedName + QLatin1String(".tmp"), filesToDelete); - - LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - LockWithCFS with(lock, commitLockTimeout, directory, this, mergedName, - filesToDelete); - { - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync - with.run(); - } - _CLDELETE(lock); - } -} - -void IndexWriter::deleteSegments(CLVector* segments) -{ - QStringList deletable; - - {//scope delete deleteArray object - QStringList deleteArray; - readDeleteableFiles(deleteArray); - deleteFiles(deleteArray, deletable); // try to delete deleteable - } - - QStringList files; - for (uint32_t i = 0; i < segments->size(); i++) { - SegmentReader* reader = (*segments)[i]; - files.clear(); - reader->files(files); - if (reader->getDirectory() == this->directory) - deleteFiles(files, deletable); // try to delete our files - else - deleteFiles(files, reader->getDirectory()); // delete, eg, RAM files - } - - writeDeleteableFiles(deletable); // note files we can't delete -} - -void IndexWriter::deleteFiles(const QStringList& files) -{ - QStringList currentDeletable; - readDeleteableFiles(currentDeletable); - - // try to delete deleteable - QStringList deletable; - deleteFiles(currentDeletable, deletable); - - // try to delete our files - deleteFiles(files, deletable); - - // note files we can't delete - writeDeleteableFiles(deletable); -} - -void IndexWriter::readDeleteableFiles(QStringList& result) -{ - if (!directory->fileExists(QLatin1String("deletable"))) - return; - - IndexInput* input = directory->openInput(QLatin1String("deletable")); - try { - // read file names - TCHAR tname[CL_MAX_PATH]; - for (int32_t i = input->readInt(); i > 0; i--) { - int32_t read = input->readString(tname, CL_MAX_PATH); - result.push_back(QString::fromWCharArray(tname, read)); - } - } _CLFINALLY ( - input->close(); - _CLDELETE(input); - ); -} - -void IndexWriter::deleteFiles(const QStringList& files, QStringList& deletable) -{ - QStringList::const_iterator itr; - for (itr = files.begin(); itr != files.end(); ++itr) { - if (!getDirectory()->fileExists((*itr))) - continue; - - if (!getDirectory()->deleteFile((*itr), false)) { - if (directory->fileExists((*itr))) { -#ifdef _CL_DEBUG_INFO - fprintf(_CL_DEBUG_INFO, "%s; Will re-try later.\n", err.what()); -#endif - // add to deletable - deletable.push_back((*itr)); - } - } - } -} - -void IndexWriter::deleteFiles(const QStringList& files, Directory* directory) -{ - QStringList::const_iterator itr; - for (itr = files.begin(); itr != files.end(); ++itr) - directory->deleteFile((*itr), true); -} - -void IndexWriter::writeDeleteableFiles(const QStringList& files) -{ - IndexOutput* output = directory->createOutput(QLatin1String("deleteable.new")); - try { - output->writeInt(files.size()); - - TCHAR tfile[CL_MAX_PATH]; - QStringList::const_iterator itr; - for (itr = files.begin(); itr != files.end(); ++itr) { - tfile[(*itr).toWCharArray(tfile)] = '\0'; - output->writeString(tfile, _tcslen(tfile)); - } - } _CLFINALLY ( - output->close(); - _CLDELETE(output); - ); - - directory->renameFile(QLatin1String("deleteable.new"), - QLatin1String("deletable")); -} - -void IndexWriter::addIndexes(Directory** dirs) -{ - //Func - Add several indexes located in different directories into the current - // one managed by this instance - //Pre - dirs != NULL and contains directories of several indexes - // dirsLength > 0 and contains the number of directories - //Post - The indexes located in the directories in dirs have been merged with - // the pre(current) index. The Resulting index has also been optimized - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CND_PRECONDITION(dirs != NULL, "dirs is NULL"); - - // start with zero or 1 seg so optimize the current - optimize(); - - int32_t start = segmentInfos.size(); - - //Iterate through the directories - for (int32_t i = 0; dirs[i] != NULL; ++i) { - // DSR: Changed SegmentInfos constructor arg (see bug discussion below). - SegmentInfos sis(false); - sis.read(dirs[i]); - for (int32_t j = 0; j < sis.size(); j++) - segmentInfos.add(sis.info(j)); // add each info - } - - // commented out by tbusch to solve a bug and to be conform with - // java lucene - - // merge newly added segments in log(n) passes - //while (segmentInfos.size() > start + mergeFactor) { - // for (int32_t base = start; base < segmentInfos.size(); base++) { - // int32_t end = min(segmentInfos.size(), base + mergeFactor); - // if (end - base > 1) - // mergeSegments(base, end); - // } - //} - - // cleanup - optimize(); -} - - -void IndexWriter::addIndexes(IndexReader** readers) -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - optimize(); // start with zero or 1 seg - - QString mergedName = newSegmentName(); - SegmentMerger merger(this, mergedName); - - CLVector segmentsToDelete; - SegmentReader* sReader = NULL; - if (segmentInfos.size() == 1) { // add existing index, if any - sReader = _CLNEW SegmentReader(segmentInfos.info(0)); - merger.add(sReader); - segmentsToDelete.push_back(sReader); // queue segment for deletion - } - - int32_t readersLength = 0; - while (readers[readersLength] != NULL) - merger.add(readers[readersLength++]); - - int32_t docCount = merger.merge(); // merge 'em - - // pop old infos & add new - segmentInfos.clearto(0); - segmentInfos.add(_CLNEW SegmentInfo(mergedName, docCount, directory)); - - if (sReader != NULL) { - sReader->close(); - _CLDELETE(sReader); - } - - LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - LockWith2 with(lock, commitLockTimeout, this, &segmentsToDelete, true); - { - // in- & inter-process sync - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - with.run(); - } - _CLDELETE(lock); - - if (useCompoundFile) { - QStringList filesToDelete; - merger.createCompoundFile(mergedName + QLatin1String(".tmp"), - filesToDelete); - - LuceneLock* cfslock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); - LockWithCFS with(cfslock, commitLockTimeout, directory, this, mergedName, - filesToDelete); - { - // in- & inter-process sync - SCOPED_LOCK_MUTEX(directory->THIS_LOCK) - with.run(); - } - _CLDELETE(cfslock); - } -} - -// #pragma mark -- IndexWriter::LockWith2 - -IndexWriter::LockWith2::LockWith2(CL_NS(store)::LuceneLock* lock, - int64_t lockWaitTimeout, - IndexWriter* indexWriter, - CL_NS(util)::CLVector* std, - bool _create) - : CL_NS(store)::LuceneLockWith(lock, lockWaitTimeout) - , create(_create) - , writer(indexWriter) - , segmentsToDelete(std) -{ -} - -void IndexWriter::LockWith2::doBody() -{ - //Func - Writes segmentInfos to or reads segmentInfos from disk - //Pre - writer != NULL - //Post - if create is true then segementInfos has been written to disk - // otherwise segmentInfos has been read from disk - - CND_PRECONDITION(writer != NULL, "writer is NULL"); - - if (create) { - writer->segmentInfos.write(writer->getDirectory()); - // delete now-unused segments - if (segmentsToDelete != NULL) - writer->deleteSegments(segmentsToDelete); - } else { - writer->segmentInfos.read(writer->getDirectory()); - } -} - -// #pragma mark -- IndexWriter::LockWithCFS - -IndexWriter::LockWithCFS::LockWithCFS(CL_NS(store)::LuceneLock* lock, - int64_t lockWaitTimeout, - CL_NS(store)::Directory* dir, - IndexWriter* indexWriter, - const QString& segmentName, - const QStringList& ftd) - : CL_NS(store)::LuceneLockWith(lock, lockWaitTimeout) - , segName(segmentName) - , writer(indexWriter) - , directory(dir) - , filesToDelete(ftd) -{ -} - -void IndexWriter::LockWithCFS::doBody() -{ - //Func - Writes segmentInfos to or reads segmentInfos from disk - //Pre - writer != NULL - //Post - if create is true then segementInfos has been written to disk - // otherwise segmentInfos has been read from disk - - CND_PRECONDITION(directory != NULL, "directory is NULL"); - CND_PRECONDITION(!segName.isEmpty(), "mergedName is NULL"); - - // make compound file visible for SegmentReaders - directory->renameFile(segName + QLatin1String(".tmp"), - segName + QLatin1String(".cfs")); - // delete now unused files of segment - writer->deleteFiles(filesToDelete); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/IndexWriter.h b/3rdparty/clucene/src/CLucene/index/IndexWriter.h deleted file mode 100644 index 80476c864..000000000 --- a/3rdparty/clucene/src/CLucene/index/IndexWriter.h +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_IndexWriter_ -#define _lucene_index_IndexWriter_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include - -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/util/VoidList.h" -#include "CLucene/search/Similarity.h" -#include "CLucene/store/Lock.h" -#include "CLucene/store/TransactionalRAMDirectory.h" - -#include "SegmentHeader.h" - -CL_NS_DEF(index) - -/** -An IndexWriter creates and maintains an index. - -The third argument to the -constructor -determines whether a new index is created, or whether an existing index is -opened for the addition of new documents. - -In either case, documents are added with the addDocument method. -When finished adding documents, close should be called. - -

If an index will not have more documents added for a while and optimal search -performance is desired, then the optimize -method should be called before the index is closed. - -

Opening an IndexWriter creates a lock file for the directory in use. Trying to open -another IndexWriter on the same directory will lead to an IOException. The IOException -is also thrown if an IndexReader on the same directory is used to delete documents -from the index. - -@see IndexModifier IndexModifier supports the important methods of IndexWriter plus deletion -*/ -class IndexWriter : LUCENE_BASE -{ - class LockWith2 : public CL_NS(store)::LuceneLockWith - { - public: - LockWith2(CL_NS(store)::LuceneLock* lock, - int64_t lockWaitTimeout, - IndexWriter* wr, - CL_NS(util)::CLVector* std, - bool create); - - ~LockWith2() {} - - void doBody(); - - private: - bool create; - IndexWriter* writer; - CL_NS(util)::CLVector* segmentsToDelete; - }; - friend class LockWith2; - - class LockWithCFS : public CL_NS(store)::LuceneLockWith - { - public: - LockWithCFS(CL_NS(store)::LuceneLock* lock, - int64_t lockWaitTimeout, - CL_NS(store)::Directory* dir, - IndexWriter* wr, - const QString& segName, - const QStringList& ftd); - - ~LockWithCFS() {} - - void doBody(); - - private: - QString segName; - IndexWriter* writer; - CL_NS(store)::Directory* directory; - QStringList filesToDelete; - }; - friend class IndexWriter::LockWithCFS; - - // indicates if the writers is open - this way close can be called multiple - // times - bool isOpen; - - // how to analyze text - CL_NS(analysis)::Analyzer* analyzer; - - CL_NS(search)::Similarity* similarity; // how to normalize - - /** Use compound file setting. Normally defaults to true, except when - * using a RAMDirectory. This minimizes the number of files used. - * Setting this to false may improve indexing performance, but - * may also cause file handle problems. - */ - bool useCompoundFile; - bool closeDir; - - // for temp segs - CL_NS(store)::TransactionalRAMDirectory* ramDirectory; - - CL_NS(store)::LuceneLock* writeLock; - - void _IndexWriter(const bool create); - - void _finalize(); - - // where this index resides - CL_NS(store)::Directory* directory; - - - int32_t getSegmentsCounter() { return segmentInfos.counter; } - int32_t maxFieldLength; - int32_t mergeFactor; - int32_t minMergeDocs; - int32_t maxMergeDocs; - int32_t termIndexInterval; - - int64_t writeLockTimeout; - int64_t commitLockTimeout; -public: - DEFINE_MUTEX(THIS_LOCK) - - // Release the write lock, if needed. - SegmentInfos segmentInfos; - - // Release the write lock, if needed. - ~IndexWriter(); - - /** - * The Java implementation of Lucene silently truncates any tokenized - * field if the number of tokens exceeds a certain threshold. Although - * that threshold is adjustable, it is easy for the client programmer - * to be unaware that such a threshold exists, and to become its - * unwitting victim. - * CLucene implements a less insidious truncation policy. Up to - * DEFAULT_MAX_FIELD_LENGTH tokens, CLucene behaves just as JLucene - * does. If the number of tokens exceeds that threshold without any - * indication of a truncation preference by the client programmer, - * CLucene raises an exception, prompting the client programmer to - * explicitly set a truncation policy by adjusting maxFieldLength. - */ - LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_FIELD_LENGTH = 10000); - LUCENE_STATIC_CONSTANT(int32_t, FIELD_TRUNC_POLICY__WARN = -1); - int32_t getMaxFieldLength() const{ return maxFieldLength; } - void setMaxFieldLength(int32_t val){ maxFieldLength = val; } - - /** - * Default value is 10. Change using {@link #setMaxBufferedDocs(int)}. - */ - LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_BUFFERED_DOCS = 10); - /** Determines the minimal number of documents required before the buffered - * in-memory documents are merging and a new Segment is created. - * Since Documents are merged in a {@link RAMDirectory}, - * large value gives faster indexing. At the same time, mergeFactor limits - * the number of files open in a FSDirectory. - * - *

The default value is DEFAULT_MAX_BUFFERED_DOCS.*/ - void setMaxBufferedDocs(int32_t val){ minMergeDocs = val; } - /** - * @see #setMaxBufferedDocs - */ - int32_t getMaxBufferedDocs(){ return minMergeDocs; } - - /** - * Default value for the write lock timeout (1,000). - */ - LUCENE_STATIC_CONSTANT(int64_t, WRITE_LOCK_TIMEOUT = 1000); - /** - * Sets the maximum time to wait for a write lock (in milliseconds). - */ - void setWriteLockTimeout(int64_t writeLockTimeout) - { this->writeLockTimeout = writeLockTimeout; } - /** - * @see #setWriteLockTimeout - */ - int64_t getWriteLockTimeout() { return writeLockTimeout; } - - /** - * Default value for the commit lock timeout (10,000). - */ - LUCENE_STATIC_CONSTANT(int64_t, COMMIT_LOCK_TIMEOUT = 10000); - /** - * Sets the maximum time to wait for a commit lock (in milliseconds). - */ - void setCommitLockTimeout(int64_t commitLockTimeout) - { this->commitLockTimeout = commitLockTimeout; } - /** - * @see #setCommitLockTimeout - */ - int64_t getCommitLockTimeout() { return commitLockTimeout; } - - static const QLatin1String WRITE_LOCK_NAME; //"write.lock"; - static const QLatin1String COMMIT_LOCK_NAME; //"commit.lock"; - - /** - * Default value is 10. Change using {@link #setMergeFactor(int)}. - */ - LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MERGE_FACTOR = 10); - /* Determines how often segment indices are merged by addDocument(). With - * smaller values, less RAM is used while indexing, and searches on - * unoptimized indices are faster, but indexing speed is slower. With larger - * values more RAM is used while indexing and searches on unoptimized indices - * are slower, but indexing is faster. Thus larger values (> 10) are best - * for batched index creation, and smaller values (< 10) for indices that are - * interactively maintained. - * - *

This must never be less than 2. The default value is 10. - */ - int32_t getMergeFactor() const{ return mergeFactor; } - void setMergeFactor(int32_t val){ mergeFactor = val; } - - - /** Expert: The fraction of terms in the "dictionary" which should be stored - * in RAM. Smaller values use more memory, but make searching slightly - * faster, while larger values use less memory and make searching slightly - * slower. Searching is typically not dominated by dictionary lookup, so - * tweaking this is rarely useful. - */ - LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_TERM_INDEX_INTERVAL = 128); - /** Expert: Set the interval between indexed terms. Large values cause less - * memory to be used by IndexReader, but slow random-access to terms. Small - * values cause more memory to be used by an IndexReader, and speed - * random-access to terms. - * - * This parameter determines the amount of computation required per query - * term, regardless of the number of documents that contain that term. In - * particular, it is the maximum number of other terms that must be - * scanned before a term is located and its frequency and position information - * may be processed. In a large index with user-entered query terms, query - * processing time is likely to be dominated not by term lookup but rather - * by the processing of frequency and positional data. In a small index - * or when many uncommon query terms are generated (e.g., by wildcard - * queries) term lookup may become a dominant cost. - * - * In particular, numUniqueTerms/interval terms are read into - * memory by an IndexReader, and, on average, interval/2 terms - * must be scanned for each random term access. - * - * @see #DEFAULT_TERM_INDEX_INTERVAL - */ - void setTermIndexInterval(int32_t interval) { termIndexInterval = interval; } - /** Expert: Return the interval between indexed terms. - * - * @see #setTermIndexInterval(int) - */ - int32_t getTermIndexInterval() { return termIndexInterval; } - - /** Determines the minimal number of documents required before the buffered - * in-memory documents are merging and a new Segment is created. - * Since Documents are merged in a {@link RAMDirectory}, - * large value gives faster indexing. At the same time, mergeFactor limits - * the number of files open in a FSDirectory. - * - *

The default value is 10.*/ - int32_t getMinMergeDocs() const{ return minMergeDocs; } - void setMinMergeDocs(int32_t val){ minMergeDocs = val; } - - /** Determines the largest number of documents ever merged by addDocument(). - * Small values (e.g., less than 10,000) are best for interactive indexing, - * as this limits the length of pauses while indexing to a few seconds. - * Larger values are best for batched indexing and speedier searches. - * - *

The default value is {@link #DEFAULT_MAX_MERGE_DOCS}. - */ - LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_MERGE_DOCS = LUCENE_INT32_MAX_SHOULDBE); - /**Determines the largest number of documents ever merged by addDocument(). - * Small values (e.g., less than 10,000) are best for interactive indexing, - * as this limits the length of pauses while indexing to a few seconds. - * Larger values are best for batched indexing and speedier searches. - * - *

The default value is {@link Integer#MAX_VALUE}. - */ - int32_t getMaxMergeDocs() const{ return maxMergeDocs; } - void setMaxMergeDocs(int32_t val){ maxMergeDocs = val; } - - /** - * Constructs an IndexWriter for the index in path. - * Text will be analyzed with a. If create - * is true, then a new, empty index will be created in - * path, replacing the index already there, if any. - * - * @param path the path to the index directory - * @param a the analyzer to use - * @param create true to create the index or overwrite - * the existing one; false to append to the existing - * index - * @throws IOException if the directory cannot be read/written to, or - * if it does not exist, and create is - * false - */ - IndexWriter(const QString& path, CL_NS(analysis)::Analyzer* a, - const bool create, const bool closeDir = true); - - - /**Constructs an IndexWriter for the index in d. Text will be - * analyzed with a. If create is true, then a new, - * empty index will be created in d, replacing the index already - * there, if any. - */ - IndexWriter(CL_NS(store)::Directory* d, CL_NS(analysis)::Analyzer* a, - const bool create, const bool closeDir = false); - - // Flushes all changes to an index, closes all associated files, and closes - // the directory that the index is stored in. - void close(); - - // Returns the number of documents currently in this index. synchronized - int32_t docCount(); - - - // Adds a document to this index, using the provided analyzer instead of - // the value of {@link #getAnalyzer()}. If the document contains more than - // {@link #setMaxFieldLength(int)} terms for a given field, the remainder - // are discarded. - void addDocument(CL_NS(document)::Document* doc, - CL_NS(analysis)::Analyzer* analyzer = NULL); - - - // Merges all segments together into a single segment, optimizing an index - // for search. synchronized - void optimize(); - - - /**Merges all segments from an array of indices into this index. - * - *

This may be used to parallelize batch indexing. A large document - * collection can be broken into sub-collections. Each sub-collection can be - * indexed in parallel, on a different thread, process or machine. The - * complete index can then be created by merging sub-collection indices - * with this method. - * - *

After this completes, the index is optimized. - *@synchronized - */ - void addIndexes(CL_NS(store)::Directory** dirs); - - /** Merges the provided indexes into this index. - *

After this completes, the index is optimized.

- *

The provided IndexReaders are not closed.

- */ - void addIndexes(IndexReader** readers); - - - /** Returns the directory this index resides in. */ - CL_NS(store)::Directory* getDirectory() { return directory; } - - /** Get the current setting of whether to use the compound file format. - * Note that this just returns the value you set with setUseCompoundFile(boolean) - * or the default. You cannot use this to query the status of an existing index. - * @see #setUseCompoundFile(boolean) - */ - bool getUseCompoundFile() { return useCompoundFile; } - - /** Setting to turn on usage of a compound file. When on, multiple files - * for each segment are merged into a single file once the segment creation - * is finished. This is done regardless of what directory is in use. - */ - void setUseCompoundFile(bool value) { useCompoundFile = value; } - - - /** Expert: Set the Similarity implementation used by this IndexWriter. - * - * @see Similarity#setDefault(Similarity) - */ - void setSimilarity(CL_NS(search)::Similarity* similarity) - { this->similarity = similarity; } - - /** Expert: Return the Similarity implementation used by this IndexWriter. - * - *

This defaults to the current value of {@link Similarity#getDefault()}. - */ - CL_NS(search)::Similarity* getSimilarity() { return this->similarity; } - - /** Returns the analyzer used by this index. */ - CL_NS(analysis)::Analyzer* getAnalyzer() { return analyzer; } - -private: - /** Merges all RAM-resident segments. */ - void flushRamSegments(); - - /** Incremental segment merger. */ - void maybeMergeSegments(); - - // Pops segments off of segmentInfos stack down to minSegment, merges them, - // and pushes the merged index onto the top of the segmentInfos stack. - void mergeSegments(const uint32_t minSegment); - - // Merges the named range of segments, replacing them in the stack with a - // single segment. - void mergeSegments(const uint32_t minSegment, const uint32_t end); - - // Some operating systems (e.g. Windows) don't permit a file to be deleted - // while it is opened for read (e.g. by another process or thread). So we - // assume that when a delete fails it is because the file is open in another - // process, and queue the file for subsequent deletion. - void deleteSegments(CL_NS(util)::CLVector* segments); - - void deleteFiles(const QStringList& files); - void readDeleteableFiles(QStringList& files); - void deleteFiles(const QStringList& files, QStringList& deletable); - void deleteFiles(const QStringList& files, CL_NS(store)::Directory* directory); - void writeDeleteableFiles(const QStringList& files); - - // synchronized - QString newSegmentName(); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/MultiReader.cpp b/3rdparty/clucene/src/CLucene/index/MultiReader.cpp deleted file mode 100644 index 1260d04dc..000000000 --- a/3rdparty/clucene/src/CLucene/index/MultiReader.cpp +++ /dev/null @@ -1,722 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "MultiReader.h" - -#include "IndexReader.h" -#include "CLucene/document/Document.h" -#include "Terms.h" -#include "SegmentMergeQueue.h" - -CL_NS_USE(store) -CL_NS_USE(util) -CL_NS_DEF(index) - -MultiReader::MultiReader(IndexReader** subReaders): - IndexReader(subReaders == NULL || subReaders[0] == NULL ? NULL : subReaders[0]->getDirectory()), - normsCache(true, true) -{ - initialize(subReaders); -} - -MultiReader::MultiReader(Directory* directory, SegmentInfos* sis, IndexReader** subReaders): - IndexReader(directory, sis, false), - normsCache(true, true) -{ - initialize(subReaders); -} - - -MultiReader::~MultiReader() { -//Func - Destructor -//Pre - true -//Post - The instance has been destroyed all IndexReader instances -// this instance managed have been destroyed to - - _CLDELETE_ARRAY(ones); - _CLDELETE_ARRAY(starts); - - //Iterate through the subReaders and destroy each reader - if (subReaders && subReadersLength > 0) { - for (int32_t i = 0; i < subReadersLength; i++) { - _CLDELETE(subReaders[i]); - } - } - //Destroy the subReaders array - _CLDELETE_ARRAY(subReaders); -} - -void MultiReader::initialize(IndexReader** subReaders){ - this->subReadersLength = 0; - this->subReaders = subReaders; - - //count the subReaders size - if ( subReaders != NULL ){ - while ( subReaders[subReadersLength] != NULL ){ - subReadersLength++; - } - } - _maxDoc = 0; - _numDocs = -1; - ones = NULL; - - starts = _CL_NEWARRAY(int32_t,subReadersLength + 1); // build starts array - for (int32_t i = 0; i < subReadersLength; i++) { - starts[i] = _maxDoc; - - // compute maxDocs - _maxDoc += subReaders[i]->maxDoc(); - if (subReaders[i]->hasDeletions()) - _hasDeletions = true; - } - starts[subReadersLength] = _maxDoc; -} - -bool MultiReader::getTermFreqVectors(int32_t n, Array& result){ - int32_t i = readerIndex(n); // find segment num - return subReaders[i]->getTermFreqVectors(n - starts[i], result); // dispatch to segment -} - -TermFreqVector* MultiReader::getTermFreqVector(int32_t n, const TCHAR* field){ - int32_t i = readerIndex(n); // find segment num - return subReaders[i]->getTermFreqVector(n - starts[i], field); -} - - -int32_t MultiReader::numDocs() { - SCOPED_LOCK_MUTEX(THIS_LOCK) - if (_numDocs == -1) { // check cache - int32_t n = 0; // cache miss--recompute - for (int32_t i = 0; i < subReadersLength; i++) - n += subReaders[i]->numDocs(); // sum from readers - _numDocs = n; - } - return _numDocs; -} - -int32_t MultiReader::maxDoc() const { - return _maxDoc; -} - -bool MultiReader::document(int32_t n, CL_NS(document)::Document* doc){ - int32_t i = readerIndex(n); // find segment num - return subReaders[i]->document(n - starts[i],doc); // dispatch to segment reader -} - -bool MultiReader::isDeleted(const int32_t n) { - int32_t i = readerIndex(n); // find segment num - return subReaders[i]->isDeleted(n - starts[i]); // dispatch to segment reader -} - -uint8_t* MultiReader::norms(const TCHAR* field){ - SCOPED_LOCK_MUTEX(THIS_LOCK) - uint8_t* bytes; - bytes = normsCache.get(field); - if (bytes != NULL){ - return bytes; // cache hit - } - - if ( !hasNorms(field) ) - return fakeNorms(); - - bytes = _CL_NEWARRAY(uint8_t,maxDoc()); - for (int32_t i = 0; i < subReadersLength; i++) - subReaders[i]->norms(field, bytes + starts[i]); - - //Unfortunately the data in the normCache can get corrupted, since it's being loaded with string - //keys that may be deleted while still in use by the map. To prevent this field is duplicated - //and then stored in the normCache - TCHAR* key = STRDUP_TtoT(field); - //update cache - normsCache.put(key, bytes); - - return bytes; -} - -void MultiReader::norms(const TCHAR* field, uint8_t* result) { - SCOPED_LOCK_MUTEX(THIS_LOCK) - uint8_t* bytes = normsCache.get(field); - if (bytes==NULL && !hasNorms(field)) - bytes=fakeNorms(); - - if (bytes != NULL){ // cache hit - int32_t len = maxDoc(); - memcpy(result,bytes,len * sizeof(int32_t)); - } - - for (int32_t i = 0; i < subReadersLength; i++) // read from segments - subReaders[i]->norms(field, result + starts[i]); -} - - -void MultiReader::doSetNorm(int32_t n, const TCHAR* field, uint8_t value){ - normsCache.remove(field); // clear cache - int32_t i = readerIndex(n); // find segment num - subReaders[i]->setNorm(n-starts[i], field, value); // dispatch -} - -TermEnum* MultiReader::terms() const { - return _CLNEW MultiTermEnum(subReaders, starts, NULL); -} - -TermEnum* MultiReader::terms(const Term* term) const { - return _CLNEW MultiTermEnum(subReaders, starts, term); -} - -int32_t MultiReader::docFreq(const Term* t) const { - int32_t total = 0; // sum freqs in Multi - for (int32_t i = 0; i < subReadersLength; i++) - total += subReaders[i]->docFreq(t); - return total; -} - -TermDocs* MultiReader::termDocs() const { - TermDocs* ret = _CLNEW MultiTermDocs(subReaders, starts); - return ret; -} - -TermPositions* MultiReader::termPositions() const { - TermPositions* ret = (TermPositions*)_CLNEW MultiTermPositions(subReaders, starts); - return ret; -} - -void MultiReader::doDelete(const int32_t n) { - _numDocs = -1; // invalidate cache - int32_t i = readerIndex(n); // find segment num - subReaders[i]->deleteDocument(n - starts[i]); // dispatch to segment reader - _hasDeletions = true; -} - -int32_t MultiReader::readerIndex(const int32_t n) const { // find reader for doc n: - int32_t lo = 0; // search starts array - int32_t hi = subReadersLength - 1; // for first element less - // than n, return its index - while (hi >= lo) { - int32_t mid = (lo + hi) >> 1; - int32_t midValue = starts[mid]; - if (n < midValue) - hi = mid - 1; - else if (n > midValue) - lo = mid + 1; - else{ // found a match - while (mid+1 < subReadersLength && starts[mid+1] == midValue) { - mid++; // scan to last match - } - return mid; - } - } - return hi; -} - -bool MultiReader::hasNorms(const TCHAR* field) { - for (int i = 0; i < subReadersLength; i++) { - if (subReaders[i]->hasNorms(field)) - return true; - } - return false; -} -uint8_t* MultiReader::fakeNorms() { - if (ones==NULL) - ones=SegmentReader::createFakeNorms(maxDoc()); - return ones; -} - -void MultiReader::doUndeleteAll(){ - for (int32_t i = 0; i < subReadersLength; i++) - subReaders[i]->undeleteAll(); - _hasDeletions = false; - _numDocs = -1; -} -void MultiReader::doCommit() { - for (int32_t i = 0; i < subReadersLength; i++) - subReaders[i]->commit(); -} - -void MultiReader::doClose() { - SCOPED_LOCK_MUTEX(THIS_LOCK) - for (int32_t i = 0; i < subReadersLength; i++){ - subReaders[i]->close(); - } -} - - -void MultiReader::getFieldNames(FieldOption fldOption, StringArrayWithDeletor& retarray){ - StringArrayWithDeletor temp; - CLHashList hashList; - for (int32_t i = 0; i < subReadersLength; i++) { - IndexReader* reader = subReaders[i]; - reader->getFieldNames(fldOption, temp); - - //create a unique list of names. - StringArrayWithDeletor::iterator itr = temp.begin(); - while ( itr != temp.end() ){ - if ( hashList.find(*itr) == hashList.end() ) - hashList.insert(STRDUP_TtoT(*itr)); - itr++; - } - } - //move the items into the return - CLHashList::iterator itr = hashList.begin(); - while ( itr != hashList.end() ){ - retarray.push_back(*itr);//no need to copy, already done! - itr++; - } -} - - -MultiTermDocs::MultiTermDocs(){ -//Func - Default constructor -// Initialises an empty MultiTermDocs. -// This constructor is needed to allow the constructor of MultiTermPositions -// initialise the instance by itself -//Pre - true -//Post - An empty - - subReaders = NULL; - subReadersLength = 0; - starts = NULL; - base = 0; - pointer = 0; - current = NULL; - term = NULL; - readerTermDocs = NULL; -} - -MultiTermDocs::MultiTermDocs(IndexReader** r, const int32_t* s){ -//Func - Constructor -//Pre - if r is NULL then rLen must be 0 else if r != NULL then rLen > 0 -// s != NULL -//Post - The instance has been created - - //count readers - subReadersLength = 0; - subReaders = r; - - CND_PRECONDITION(s != NULL, "s is NULL"); - - if ( subReaders != NULL ){ - while ( subReaders[subReadersLength] != NULL ) - subReadersLength++; - } - - starts = s; - base = 0; - pointer = 0; - current = NULL; - term = NULL; - - readerTermDocs = NULL; - - //Check if there are subReaders - if(subReaders != NULL && subReadersLength > 0){ - readerTermDocs = _CL_NEWARRAY(TermDocs*, subReadersLength+1); - - CND_CONDITION(readerTermDocs != NULL,"No memory could be allocated for readerTermDocs"); - - //Initialize the readerTermDocs pointer array to NULLs - for ( int32_t i=0;idoc(); -} -int32_t MultiTermDocs::freq() const { - CND_PRECONDITION(current!=NULL,"current==NULL, check that next() was called"); - return current->freq(); -} - -void MultiTermDocs::seek(TermEnum* termEnum){ - seek(termEnum->term(false)); -} - -void MultiTermDocs::seek( Term* tterm) { -//Func - Resets the instance for a new search -//Pre - tterm != NULL -//Post - The instance has been reset for a new search - - CND_PRECONDITION(tterm != NULL, "tterm is NULL"); - - //Assigning tterm is done as below for a reason - //The construction ensures that if seek is called from within - //MultiTermDocs with as argument this->term (seek(this->term)) that the assignment - //will succeed and all referencecounters represent the correct situation - - //Get a pointer from tterm and increase its reference counter - Term *TempTerm = _CL_POINTER(tterm); - - //Finialize term to ensure we decrease the reference counter of the instance which term points to - _CLDECDELETE(term); - - //Assign TempTerm to term - term = TempTerm; - - base = 0; - pointer = 0; - current = NULL; -} - -bool MultiTermDocs::next() { - if (current != NULL && current->next()) { - return true; - } else if (pointer < subReadersLength) { - base = starts[pointer]; - current = termDocs(pointer++); - return next(); - } else - return false; -} - -int32_t MultiTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) { - while (true) { - while (current == NULL) { - if (pointer < subReadersLength) { // try next segment - base = starts[pointer]; - current = termDocs(pointer++); - } else { - return 0; - } - } - int32_t end = current->read(docs, freqs,length); - if (end == 0) { // none left in segment - current = NULL; - } else { // got some - int32_t b = base; // adjust doc numbers - for (int32_t i = 0; i < end; i++) - docs[i] += b; - return end; - } - } -} - -bool MultiTermDocs::skipTo(const int32_t target) { - do { - if (!next()) - return false; - } while (target > doc()); - return true; -} - -void MultiTermDocs::close() { -//Func - Closes all MultiTermDocs managed by this instance -//Pre - true -//Post - All the MultiTermDocs have been closed - - - //Check if readerTermDocs is valid - if (readerTermDocs){ - TermDocs* curTD = NULL; - //iterate through the readerTermDocs array - for (int32_t i = 0; i < subReadersLength; i++) { - //Retrieve the i-th TermDocs instance - curTD = readerTermDocs[i]; - - //Check if it is a valid pointer - if (curTD != NULL) { - //Close it - curTD->close(); - _CLDELETE(curTD); - } - } - - _CLDELETE_ARRAY(readerTermDocs); - } - - //current previously pointed to a member of readerTermDocs; ensure that - //it doesn't now point to invalid memory. - current = NULL; - base = 0; - pointer = 0; - - _CLDECDELETE(term); -} - -TermDocs* MultiTermDocs::termDocs(const IndexReader* reader) const { - TermDocs* ret = reader->termDocs(); - return ret; -} - -TermDocs* MultiTermDocs::termDocs(const int32_t i) const { - if (term == NULL) - return NULL; - TermDocs* result = readerTermDocs[i]; - if (result == NULL){ - readerTermDocs[i] = termDocs(subReaders[i]); - result = readerTermDocs[i]; - } - result->seek(term); - - return result; -} - - -MultiTermEnum::MultiTermEnum( - IndexReader** subReaders, const int32_t *starts, const Term* t){ -//Func - Constructor -// Opens all enumerations of all readers -//Pre - readers != NULL and contains an array of IndexReader instances each responsible for -// reading a single segment -// subReadersLength >= 0 and represents the number of readers in the readers array -// starts is an array of -//Post - An instance of has been created - -//Pre - if readers is NULL then subReadersLength must be 0 else if readers != NULL then subReadersLength > 0 -// s != NULL -//Post - The instance has been created - - int32_t subReadersLength = 0; - if ( subReaders != NULL ){ - while ( subReaders[subReadersLength] != NULL ) - subReadersLength++; - } - CND_PRECONDITION(starts != NULL,"starts is NULL"); - - //Temporary variables - IndexReader* reader = NULL; - TermEnum* termEnum = NULL; - SegmentMergeInfo* smi = NULL; - _docFreq = 0; - _term = NULL; - queue = _CLNEW SegmentMergeQueue(subReadersLength); - - CND_CONDITION (queue != NULL, "Could not allocate memory for queue"); - - //iterate through all the readers - for ( int32_t i=0;iterms(t); - }else{ - //termEnum is an enumeration of all the Terms and TermInfos in the set. - termEnum = reader->terms(); - } - - //Instantiate an new SegmentMerginfo - smi = _CLNEW SegmentMergeInfo(starts[i], termEnum, reader); - - // Note that in the call termEnum->getTerm(false) below false is required because - // otherwise a reference is leaked. By passing false getTerm is - // ordered to return an unowned reference instead. (Credits for DSR) - if (t == NULL ? smi->next() : termEnum->term(false) != NULL){ - // initialize queue - queue->put(smi); - } else{ - //Close the SegmentMergeInfo - smi->close(); - //And have it deleted - _CLDELETE(smi); - } - } - - //Check if the queue has elements - if (t != NULL && queue->size() > 0) { - next(); - } -} - -MultiTermEnum::~MultiTermEnum(){ -//Func - Destructor -//Pre - true -//Post - All the resource have been freed and the instance has been deleted - - //Close the enumeration - close(); - - //Delete the queue - _CLDELETE(queue); -} - -bool MultiTermEnum::next(){ -//Func - Move the current term to the next in the set of enumerations -//Pre - true -//Post - Returns true if term has been moved to the next in the set of enumerations -// Returns false if this was not possible - - SegmentMergeInfo* top = queue->top(); - if (top == NULL) { - _CLDECDELETE(_term); - _term = NULL; - return false; - } - - //The getTerm method requires the client programmer to indicate whether he - // owns the returned reference, so we can discard ours - // right away. - _CLDECDELETE(_term); - - //Assign term the term of top and make sure the reference counter is increased - _term = _CL_POINTER(top->term); - _docFreq = 0; - - //Find the next term - while (top != NULL && _term->compareTo(top->term) == 0) { - //don't delete, this is the top - queue->pop(); - // increment freq - _docFreq += top->termEnum->docFreq(); - if (top->next()){ - // restore queue - queue->put(top); - }else{ - // done with a segment - top->close(); - _CLDELETE(top); - } - top = queue->top(); - } - - return true; -} - - -Term* MultiTermEnum::term() { -//Func - Returns the current term of the set of enumerations -//Pre - pointer is true or false and indicates if the reference counter -// of term must be increased or not -// next() must have been called once! -//Post - pointer = true -> term has been returned with an increased reference counter -// pointer = false -> term has been returned - - return _CL_POINTER(_term); -} - -Term* MultiTermEnum::term(bool pointer) { - if ( pointer ) - return _CL_POINTER(_term); - else - return _term; -} - -int32_t MultiTermEnum::docFreq() const { -//Func - Returns the document frequency of the current term in the set -//Pre - termInfo != NULL -// next() must have been called once -//Post - The document frequency of the current enumerated term has been returned - - return _docFreq; -} - - -void MultiTermEnum::close() { -//Func - Closes the set of enumerations in the queue -//Pre - queue holds a valid reference to a SegmentMergeQueue -//Post - The queue has been closed all SegmentMergeInfo instance have been deleted by -// the closing of the queue -// term has been finalized and reset to NULL - - // Needed when this enumeration hasn't actually been exhausted yet - _CLDECDELETE(_term); - - //Close the queue This will destroy all SegmentMergeInfo instances! - queue->close(); - -} - - - - - -MultiTermPositions::MultiTermPositions(IndexReader** r, const int32_t* s){ -//Func - Constructor -//Pre - if r is NULL then rLen must be 0 else if r != NULL then rLen > 0 -// s != NULL -//Post - The instance has been created - - subReaders = r; - subReadersLength = 0; - if ( subReaders != NULL ){ - while ( subReaders[subReadersLength] != NULL ) - subReadersLength ++ ; - } - - CND_PRECONDITION(s != NULL, "s is NULL"); - - starts = s; - base = 0; - pointer = 0; - current = NULL; - term = NULL; - - readerTermDocs = NULL; - - //Check if there are readers - if(subReaders != NULL && subReadersLength > 0){ - readerTermDocs = (TermDocs**)_CL_NEWARRAY(SegmentTermPositions*,subReadersLength); - - CND_CONDITION(readerTermDocs != NULL,"No memory could be allocated for readerTermDocs"); - - //Initialize the readerTermDocs pointer array - for ( int32_t i=0;icurrent to always -// be a SegmentTermPositions rather than merely a SegmentTermDocs. -// To that end, we override the termDocs(IndexReader&) method to produce -// a SegmentTermPositions via the underlying reader's termPositions method -// rather merely producing a SegmentTermDocs via the reader's termDocs -// method. - - TermPositions* tp = reader->termPositions(); - TermDocs* ret = tp->__asTermDocs(); - - CND_CONDITION(ret != NULL, - "Dynamic downcast in MultiTermPositions::termDocs from" - " TermPositions to TermDocs failed." - ); - return ret; - } - -int32_t MultiTermPositions::nextPosition() { - //Func - - //Pre - current != NULL - //Post - - CND_PRECONDITION(current != NULL,"current is NULL"); - - TermPositions* curAsTP = current->__asTermPositions(); - - CND_CONDITION(curAsTP != NULL, - "Dynamic downcast in MultiTermPositions::nextPosition from" - " SegmentTermDocs to TermPositions failed." - ) - return curAsTP->nextPosition(); -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/MultiReader.h b/3rdparty/clucene/src/CLucene/index/MultiReader.h deleted file mode 100644 index 1d76814e1..000000000 --- a/3rdparty/clucene/src/CLucene/index/MultiReader.h +++ /dev/null @@ -1,202 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_MultiReader -#define _lucene_index_MultiReader - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SegmentHeader.h" -#include "IndexReader.h" -#include "CLucene/document/Document.h" -#include "Terms.h" -#include "SegmentMergeQueue.h" - -CL_NS_DEF(index) - -/** An IndexReader which reads multiple indexes, appending their content. -*/ -class MultiTermDocs:public virtual TermDocs { -private: -protected: - TermDocs** readerTermDocs; - - IndexReader** subReaders; - int32_t subReadersLength; - const int32_t* starts; - Term* term; - - int32_t base; - int32_t pointer; - - TermDocs* current; // == segTermDocs[pointer] -public: - MultiTermDocs(); - MultiTermDocs(IndexReader** subReaders, const int32_t* s); - virtual ~MultiTermDocs(); - - int32_t doc() const; - int32_t freq() const; - - void seek(TermEnum* termEnum); - void seek(Term* tterm); - bool next(); - - /** Optimized implementation. */ - int32_t read(int32_t* docs, int32_t* freqs, int32_t length); - - /** As yet unoptimized implementation. */ - bool skipTo(const int32_t target); - - void close(); - - virtual TermPositions* __asTermPositions(); -protected: - virtual TermDocs* termDocs(const IndexReader* reader) const; -private: - TermDocs* termDocs(const int32_t i) const; - -}; - - -//MultiTermEnum represents the enumeration of all terms of all readers -class MultiTermEnum:public TermEnum { -private: - SegmentMergeQueue* queue; - - Term* _term; - int32_t _docFreq; -public: - //Constructor - //Opens all enumerations of all readers - MultiTermEnum(IndexReader** subReaders, const int32_t* starts, const Term* t); - - //Destructor - ~MultiTermEnum(); - - //Move the current term to the next in the set of enumerations - bool next(); - - //Returns a pointer to the current term of the set of enumerations - Term* term(); - Term* term(bool pointer); - - //Returns the document frequency of the current term in the set - int32_t docFreq() const; - - //Closes the set of enumerations in the queue - void close(); - - - const char* getObjectName(){ return MultiTermEnum::getClassName(); } - static const char* getClassName(){ return "MultiTermEnum"; } -}; - - -class MultiTermPositions:public MultiTermDocs,public TermPositions { -public: - MultiTermPositions(IndexReader** subReaders, const int32_t* s); - ~MultiTermPositions() {}; - int32_t nextPosition(); - - - virtual TermDocs* __asTermDocs(); - virtual TermPositions* __asTermPositions(); -protected: - TermDocs* termDocs(const IndexReader* reader) const; -}; - - -class MultiReader:public IndexReader{ -private: - bool _hasDeletions; - IndexReader** subReaders; - int32_t subReadersLength; - int32_t* starts; // 1st docno for each segment - - CL_NS(util)::CLHashtable > normsCache; - int32_t _maxDoc; - int32_t _numDocs; - void initialize(IndexReader** subReaders); - - int32_t readerIndex(const int32_t n) const; - - bool hasNorms(const TCHAR* field); - uint8_t* ones; - uint8_t* fakeNorms(); -protected: - void doSetNorm(int32_t n, const TCHAR* field, uint8_t value); - void doUndeleteAll(); - void doCommit(); - // synchronized - void doClose(); - - // synchronized - void doDelete(const int32_t n); -public: - /** Construct reading the named set of readers. */ - MultiReader(CL_NS(store)::Directory* directory, SegmentInfos* sis, IndexReader** subReaders); - - /** - *

Construct a MultiReader aggregating the named set of (sub)readers. - * Directory locking for delete, undeleteAll, and setNorm operations is - * left to the subreaders.

- *

Note that all subreaders are closed if this Multireader is closed.

- * @param subReaders set of (sub)readers - * @throws IOException - */ - MultiReader(IndexReader** subReaders); - - ~MultiReader(); - - /** Return an array of term frequency vectors for the specified document. - * The array contains a vector for each vectorized field in the document. - * Each vector vector contains term numbers and frequencies for all terms - * in a given vectorized field. - * If no such fields existed, the method returns null. - */ - bool getTermFreqVectors(int32_t n, Array& result); - TermFreqVector* getTermFreqVector(int32_t n, const TCHAR* field); - - - // synchronized - int32_t numDocs(); - - int32_t maxDoc() const; - - bool document(int32_t n, CL_NS(document)::Document* doc); - - bool isDeleted(const int32_t n); - bool hasDeletions() const{ return _hasDeletions; } - - // synchronized - uint8_t* norms(const TCHAR* field); - void norms(const TCHAR* field, uint8_t* result); - - TermEnum* terms() const; - TermEnum* terms(const Term* term) const; - - //Returns the document frequency of the current term in the set - int32_t docFreq(const Term* t=NULL) const; - TermDocs* termDocs() const; - TermPositions* termPositions() const; - - - /** - * @see IndexReader#getFieldNames(IndexReader.FieldOption fldOption) - */ - void getFieldNames(FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor& retarray); -}; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/index/SegmentHeader.h b/3rdparty/clucene/src/CLucene/index/SegmentHeader.h deleted file mode 100644 index 00b08991d..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentHeader.h +++ /dev/null @@ -1,314 +0,0 @@ -/* -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_SegmentHeader_ -#define _lucene_index_SegmentHeader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include - -#include "SegmentInfos.h" -#include "CLucene/util/BitSet.h" -#include "CLucene/util/VoidMap.h" -#include "Term.h" -#include "FieldInfos.h" -#include "FieldsReader.h" -#include "IndexReader.h" -#include "TermInfosReader.h" -#include "CompoundFile.h" -#include "CLucene/util/ThreadLocal.h" - -CL_NS_DEF(index) - -class SegmentReader; - -class SegmentTermDocs : public virtual TermDocs -{ - int32_t _doc; - int32_t skipInterval; - int32_t numSkips; - int32_t skipCount; - CL_NS(store)::IndexInput* skipStream; - int32_t skipDoc; - int64_t freqPointer; - int64_t proxPointer; - int64_t skipPointer; - bool haveSkipped; - -protected: - // SegmentReader parent - const SegmentReader* parent; - CL_NS(store)::IndexInput* freqStream; - int32_t count; - int32_t df; - int32_t _freq; - CL_NS(util)::BitSet* deletedDocs; -public: - virtual ~SegmentTermDocs(); - - virtual void seek(TermEnum* termEnum); - virtual void seek(Term* term); - virtual void seek(const TermInfo* ti); - - virtual void close(); - virtual int32_t doc()const; - virtual int32_t freq()const; - - virtual bool next(); - - /** Optimized implementation. */ - virtual int32_t read(int32_t* docs, int32_t* freqs, int32_t length); - - /** Optimized implementation. */ - virtual bool skipTo(const int32_t target); - - virtual TermPositions* __asTermPositions(); - - // \param Parent must be a segment reader - SegmentTermDocs( const SegmentReader* Parent); -protected: - virtual void skippingDoc(){} - virtual void skipProx(int64_t proxPointer){} -}; - - -class SegmentTermPositions : public SegmentTermDocs, public TermPositions -{ -private: - CL_NS(store)::IndexInput* proxStream; - int32_t proxCount; - int32_t position; - -public: - // \param Parent must be a segment reader - SegmentTermPositions(const SegmentReader* Parent); - ~SegmentTermPositions(); - - void seek(const TermInfo* ti); - void close(); - int32_t nextPosition(); - bool next(); - int32_t read(int32_t* docs, int32_t* freqs, int32_t length); - virtual TermDocs* __asTermDocs(); - virtual TermPositions* __asTermPositions(); - - //resolve SegmentTermDocs/TermPositions ambiguity - void seek(Term* term){ SegmentTermDocs::seek(term); } - void seek(TermEnum* termEnum){ SegmentTermDocs::seek(termEnum); } - int32_t doc() const{ return SegmentTermDocs::doc(); } - int32_t freq() const{ return SegmentTermDocs::freq(); } - bool skipTo(const int32_t target){ return SegmentTermDocs::skipTo(target); } - -protected: - void skippingDoc(); - /** Called by super.skipTo(). */ - void skipProx(int64_t proxPointer); -}; - -// An IndexReader responsible for reading 1 segment of an index -class SegmentReader : public IndexReader -{ - /** - * The class Norm represents the normalizations for a field. - * These normalizations are read from an IndexInput in into an array of bytes called bytes - */ - class Norm : LUCENE_BASE - { - int32_t number; - SegmentReader* reader; - QString segment; // segment name - - public: - CL_NS(store)::IndexInput* in; - uint8_t* bytes; - bool dirty; - //Constructor - Norm(CL_NS(store)::IndexInput* instrm, int32_t number, - SegmentReader* reader, const QString& segment); - //Destructor - ~Norm(); - - void reWrite(); - }; - friend class SegmentReader::Norm; - - //Holds the name of the segment that is being read - QString segment; - - //Indicates if there are documents marked as deleted - bool deletedDocsDirty; - bool normsDirty; - bool undeleteAll; - - //Holds all norms for all fields in the segment - typedef CL_NS(util)::CLHashtable NormsType; - NormsType _norms; - - uint8_t* ones; - uint8_t* fakeNorms(); - - // Compound File Reader when based on a compound file segment - CompoundFileReader* cfsReader; - // Reads the Field Info file - FieldsReader* fieldsReader; - TermVectorsReader* termVectorsReaderOrig; - CL_NS(util)::ThreadLocal >termVectorsLocal; - - void initialize(SegmentInfo* si); - - // Create a clone from the initial TermVectorsReader and store it in the - // ThreadLocal. @return TermVectorsReader - TermVectorsReader* getTermVectorsReader(); - -protected: - // Marks document docNum as deleted - void doDelete(const int32_t docNum); - void doUndeleteAll(); - void doCommit(); - void doSetNorm(int32_t doc, const TCHAR* field, uint8_t value); - - // can return null if norms aren't stored - uint8_t* getNorms(const TCHAR* field); - -public: - /** - Func - Constructor. - Opens all files of a segment - .fnm -> Field Info File - Field names are stored in the field info file, with suffix .fnm. - .frq -> Frequency File - The .frq file contains the lists of documents which contain - each term, along with the frequency of the term in that document. - .prx -> Prox File - The prox file contains the lists of positions that each term occurs - at within documents. - .tis -> Term Info File - This file is sorted by Term. Terms are ordered first lexicographically - by the term's field name, and within that lexicographically by the term's text. - .del -> Deletion File - The .del file is optional, and only exists when a segment contains deletions - .f[0-9]* -> Norm File - Contains s, for each document, a byte that encodes a value that is - multiplied into the score for hits on that field: - */ - SegmentReader(SegmentInfo* si); - - SegmentReader(SegmentInfos* sis, SegmentInfo* si); - // Destructor. - virtual ~SegmentReader(); - - // Closes all streams to the files of a single segment - void doClose(); - - // Checks if a segment managed by SegmentInfo si has deletions - static bool hasDeletions(const SegmentInfo* si); - bool hasDeletions() const; - bool hasNorms(const TCHAR* field) const; - - // Returns all file names managed by this SegmentReader - void files(QStringList& retarray); - // Returns an enumeration of all the Terms and TermInfos in the set. - TermEnum* terms() const; - // Returns an enumeration of terms starting at or after the named term t - TermEnum* terms(const Term* t) const; - - // Gets the document identified by n - bool document(int32_t n, CL_NS(document)::Document* doc); - - // Checks if the n-th document has been marked deleted - bool isDeleted(const int32_t n); - - // Returns an unpositioned TermDocs enumerator. - TermDocs* termDocs() const; - // Returns an unpositioned TermPositions enumerator. - TermPositions* termPositions() const; - - // Returns the number of documents which contain the term t - int32_t docFreq(const Term* t) const; - - // Returns the actual number of documents in the segment - int32_t numDocs(); - // Returns the number of all the documents in the segment including the - // ones that have been marked deleted - int32_t maxDoc() const; - - // Returns the bytes array that holds the norms of a named field. - // Returns fake norms if norms aren't available - uint8_t* norms(const TCHAR* field); - - // Reads the Norms for field from disk - void norms(const TCHAR* field, uint8_t* bytes); - - // concatenating segment with ext and x - QString SegmentName(const QString& ext, const int32_t x = -1); - // Creates a filename in buffer by concatenating segment with ext and x - void SegmentName(QString& buffer, int32_t bufferLen, const QString& ext, - const int32_t x = -1); - - /** - * @see IndexReader#getFieldNames(IndexReader.FieldOption fldOption) - */ - void getFieldNames(FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor& retarray); - - static bool usesCompoundFile(SegmentInfo* si); - - /** Return a term frequency vector for the specified document and field. The - * vector returned contains term numbers and frequencies for all terms in - * the specified field of this document, if the field had storeTermVector - * flag set. If the flag was not set, the method returns null. - * @throws IOException - */ - TermFreqVector* getTermFreqVector(int32_t docNumber, const TCHAR* field = NULL); - - /** Return an array of term frequency vectors for the specified document. - * The array contains a vector for each vectorized field in the document. - * Each vector vector contains term numbers and frequencies for all terms - * in a given vectorized field. - * If no such fields existed, the method returns null. - * @throws IOException - */ - bool getTermFreqVectors(int32_t docNumber, Array& result); - -private: - //Open all norms files for all fields - void openNorms(CL_NS(store)::Directory* cfsDir); - //Closes all norms files - void closeNorms(); - - // a bitVector that manages which documents have been deleted - CL_NS(util)::BitSet* deletedDocs; - // an IndexInput to the frequency file - CL_NS(store)::IndexInput* freqStream; - // For reading the fieldInfos file - FieldInfos* fieldInfos; - // For reading the Term Dictionary .tis file - TermInfosReader* tis; - // an IndexInput to the prox file - CL_NS(store)::IndexInput* proxStream; - - static bool hasSeparateNorms(SegmentInfo* si); - static uint8_t* createFakeNorms(int32_t size); - - // allow various classes to access the internals of this. this allows us - // to have a more tight idea of the package - friend class IndexReader; - friend class IndexWriter; - friend class SegmentTermDocs; - friend class SegmentTermPositions; - friend class MultiReader; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp b/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp deleted file mode 100644 index f62c4061a..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#include "CLucene/StdHeader.h" -#include "SegmentInfos.h" - -#include "CLucene/store/Directory.h" -#include "CLucene/util/Misc.h" - -CL_NS_USE(store) -CL_NS_USE(util) -CL_NS_DEF(index) - -SegmentInfo::SegmentInfo(const QString& Name, const int32_t DocCount, - CL_NS(store)::Directory* Dir) - : docCount(DocCount) - , dir(Dir) -{ - //Func - Constructor. Initialises SegmentInfo. - //Pre - Name holds the unique name in the directory Dir - // DocCount holds the number of documents in the segment - // Dir holds the Directory where the segment resides - //Post - The instance has been created. name contains the duplicated string - // Name. docCount = DocCount and dir references Dir - name = Name; -} - -SegmentInfo::~SegmentInfo() -{ -} - -SegmentInfos::SegmentInfos(bool _deleteMembers) - : deleteMembers(_deleteMembers) -{ - //Func - Constructor - //Pre - deleteMembers indicates if the instance to be created must delete - // all SegmentInfo instances it manages when the instance is destroyed - // or not true -> must delete, false may not delete - //Post - An instance of SegmentInfos has been created. - - //initialize counter to 0 - counter = 0; - version = Misc::currentTimeMillis(); -} - -SegmentInfos::~SegmentInfos() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed. Depending on the constructor used - // the SegmentInfo instances that this instance managed have been - // deleted or not. - - if (deleteMembers) { - segmentInfosType::iterator it; - for (it = infos.begin(); it != infos.end(); ++it) - _CLLDELETE(*it); - } - //Clear the list of SegmentInfo instances - make sure everything is deleted - infos.clear(); -} - -SegmentInfo* SegmentInfos::info(int32_t i) const -{ - //Func - Returns a reference to the i-th SegmentInfo in the list. - //Pre - i >= 0 - //Post - A reference to the i-th SegmentInfo instance has been returned - - CND_PRECONDITION(i >= 0, "i contains negative number"); - - //Get the i-th SegmentInfo instance - SegmentInfo *ret = infos.value(i, 0); - - //Condition check to see if the i-th SegmentInfo has been retrieved - CND_CONDITION(ret != NULL, "No SegmentInfo instance found"); - - return ret; -} - -void SegmentInfos::clearto(size_t _min) -{ - // Make sure we actually need to remove - if (infos.size() > _min) { - segmentInfosType::iterator itr; - segmentInfosType::iterator eitr = infos.end(); - segmentInfosType::iterator bitr = infos.begin() + _min; - - for(itr = bitr; itr != eitr; ++itr) - _CLLDELETE((*itr)); - infos.erase(bitr, eitr); - } -} - -void SegmentInfos::add(SegmentInfo* info) -{ - infos.push_back(info); -} - -int32_t SegmentInfos::size() const -{ - return infos.size(); -} - -void SegmentInfos::read(Directory* directory) -{ - //Func - Reads segments file that resides in directory. - //Pre - directory contains a valid reference - //Post - The segments file has been read and for each segment found - // a SegmentsInfo intance has been created and stored. - - //Open an IndexInput to the segments file and check if valid - IndexInput* input = directory->openInput(QLatin1String("segments")); - if (input) { - try { - int32_t format = input->readInt(); - // file contains explicit format info - if (format < 0) { - // check that it is a format we can understand - if (format < FORMAT) { - TCHAR err[30]; - _sntprintf(err, 30, _T("Unknown format version: %d"), format); - _CLTHROWT(CL_ERR_Runtime, err); - } - // read version - version = input->readLong(); - // read counter - counter = input->readInt(); - } else { - // file is in old format without explicit format info - counter = format; - } - - //Temporary variable for storing the name of the segment - char aname[CL_MAX_PATH] = { 0 }; - TCHAR tname[CL_MAX_PATH] = { 0 }; - - //read segmentInfos - for (int32_t i = input->readInt(); i > 0; --i) { - // read the name of the segment - input->readString(tname, CL_MAX_PATH); - STRCPY_TtoA(aname, tname, CL_MAX_PATH); - - //Instantiate a new SegmentInfo Instance - SegmentInfo* si = _CLNEW SegmentInfo(QLatin1String(aname), - input->readInt(), directory); - - //Condition check to see if si points to an instance - CND_CONDITION(si != NULL, "Memory allocation for si failed") ; - - //store SegmentInfo si - infos.push_back(si); - } - - if (format >= 0) { - // in old format the version number may be at the end of the file - if (input->getFilePointer() >= input->length()) { - // old file format without version number - version = Misc::currentTimeMillis(); - } else { - // read version - version = input->readLong(); - } - } - } _CLFINALLY ( - //destroy the inputStream input. The destructor of IndexInput will - //also close the Inputstream input - _CLDELETE(input); - ); - } -} - -void SegmentInfos::write(Directory* directory) -{ - //Func - Writes a new segments file based upon the SegmentInfo instances it manages - //Pre - directory is a valid reference to a Directory - //Post - The new segment has been written to disk - - //Open an IndexOutput to the segments file and check if valid - IndexOutput* output = directory->createOutput(QLatin1String("segments.new")); - if (output) { - try { - // write FORMAT - output->writeInt(FORMAT); - // every write changes the index - output->writeLong(++version); - // Write the counter - output->writeInt(counter); - - // Write the number of SegmentInfo Instances which is equal to the number - // of segments in directory as each SegmentInfo manages a single segment - output->writeInt(infos.size()); - - //temporary value for wide segment name - TCHAR tname[CL_MAX_PATH]; - - //Iterate through all the SegmentInfo instances - for (uint32_t i = 0; i < infos.size(); ++i) { - //Retrieve the SegmentInfo - SegmentInfo *si = infos.value(i, 0); - //Condition check to see if si has been retrieved - CND_CONDITION(si != NULL, "No SegmentInfo instance found"); - - //Write the name of the current segment - int32_t count = si->name.toWCharArray(tname); - tname[count] = '\0'; - output->writeString(tname, _tcslen(tname)); - - //Write the number of documents in the segment - output->writeInt(si->docCount); - } - } _CLFINALLY( - output->close(); - _CLDELETE(output); - ); - - // install new segment info - directory->renameFile(QLatin1String("segments.new"), - QLatin1String("segments")); - } -} - - -int64_t SegmentInfos::readCurrentVersion(Directory* directory) -{ - int32_t format = 0; - int64_t version = 0; - IndexInput* input = directory->openInput(QLatin1String("segments")); - try { - format = input->readInt(); - if (format < 0){ - if (format < FORMAT) { - TCHAR err[30]; - _sntprintf(err, 30, _T("Unknown format version: %d"), format); - _CLTHROWT(CL_ERR_Runtime, err); - } - // read version - version = input->readLong(); - } - } _CLFINALLY ( - input->close(); - _CLDELETE(input); - ); - - if (format < 0) - return version; - - // We cannot be sure about the format of the file. Therefore we have to - // read the whole file and cannot simply seek to the version entry. - SegmentInfos segmentInfos; - segmentInfos.read(directory); - return segmentInfos.getVersion(); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentInfos.h b/3rdparty/clucene/src/CLucene/index/SegmentInfos.h deleted file mode 100644 index ce7183820..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentInfos.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#ifndef _lucene_index_SegmentInfos_ -#define _lucene_index_SegmentInfos_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include - -#include "CLucene/store/Directory.h" - -CL_NS_DEF(index) - -class SegmentInfo : LUCENE_BASE -{ -public: - SegmentInfo(const QString& Name, const int32_t DocCount, - CL_NS(store)::Directory* Dir); - ~SegmentInfo(); - - ///Gets the Directory where the segment resides - CL_NS(store)::Directory* getDir() const { return dir; } - - //Unique name in directory dir - QString name; - - //Number of docs in the segment - const int32_t docCount; - -private: - //Directory where the segment resides - CL_NS(store)::Directory* dir; -}; - -typedef QVector segmentInfosType; - -//SegmentInfos manages a list of SegmentInfo instances -//Each SegmentInfo contains information about a segment in a directory. -// -//The active segments in the index are stored in the segment info file. -//An index only has a single file in this format, and it is named "segments". -//This lists each segment by name, and also contains the size of each segment. -//The format of the file segments is defined as follows: -// -// SegCount -//Segments --> SegCount, -// -//SegCount, SegSize --> UInt32 -// -//SegName --> String -// -//SegName is the name of the segment, and is used as the file name prefix -//for all of the files that compose the segment's index. -// -//SegSize is the number of documents contained in the segment index. -// -//Note: -//At http://jakarta.apache.org/lucene/docs/fileformats.html the definition -//of all file formats can be found. Note that java lucene currently -//defines Segments as follows: -// -//Segments --> Format, Version, SegCount, SegCount -// -//Format, SegCount, SegSize --> UInt32 -// -//Format and Version have not been implemented yet -class SegmentInfos : LUCENE_BASE -{ -public: - SegmentInfos(bool deleteMembers = true); - ~SegmentInfos(); - - //delete and clears objects 'from' from to 'to' - void clearto(size_t to); - - //count of segment infos - int32_t size() const; - - //add a segment info - void add(SegmentInfo* info); - - //Returns a reference to the i-th SegmentInfo in the list. - SegmentInfo* info(int32_t i) const; - - // version number when this SegmentInfos was generated. - int64_t getVersion() const { return version; } - - static int64_t readCurrentVersion(CL_NS(store)::Directory* directory); - - //Reads segments file that resides in directory - void read(CL_NS(store)::Directory* directory); - - //Writes a new segments file based upon the SegmentInfo instances it manages - void write(CL_NS(store)::Directory* directory); - -private: - // The file format version, a negative number. - // Works since counter, the old 1st entry, is always >= 0 - LUCENE_STATIC_CONSTANT(int32_t, FORMAT = -1); - - // counts how often the index has been changed by adding or deleting docs. - // starting with the current time in milliseconds forces to create unique - // version numbers. - int64_t version; - - segmentInfosType infos; - - // used to name new segments - int32_t counter; - - // allow IndexWriter to use counter - friend class IndexWriter; - - bool deleteMembers; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp b/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp deleted file mode 100644 index 85ac784ad..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SegmentMergeInfo.h" - -#include "SegmentTermEnum.h" -#include "SegmentHeader.h" - -CL_NS_DEF(index) - -SegmentMergeInfo::SegmentMergeInfo(const int32_t b, TermEnum* te, IndexReader* r): - reader(r),termEnum(te),base(b), docMap(NULL) { -//Func - Constructor -//Pre - b >= 0 -// te contains a valid reference to a SegmentTermEnum instance -// r contains a valid reference to a SegmentReader instance -//Post - The instance has been created - - CND_PRECONDITION(b >= 0, "b is a negative number"); - - postings=NULL; - term = te->term(); -} - -SegmentMergeInfo::~SegmentMergeInfo(){ -//Func - Destructor -//Pre - true -//Post - The instance has been destroyed - - close(); -} - -int32_t* SegmentMergeInfo::getDocMap(){ - if ( docMap == NULL ){ - // build array which maps document numbers around deletions - if (reader->hasDeletions()) { - //Get the total number of documents managed by the reader including the deleted ones - int32_t maxDoc = reader->maxDoc(); - //Create a map for all documents - docMap = _CL_NEWARRAY(int32_t,maxDoc); - int32_t j = 0; - //Iterate through all the document numbers - for (int32_t i = 0; i < maxDoc; i++) { - //Check if document i is marked deleted - if (reader->isDeleted(i)){ - //Document i has not been marked deleted so assign -1 - docMap[i] = -1; - }else{ - docMap[i] = j++; - } - } - } - } - return docMap; -} - -TermPositions* SegmentMergeInfo::getPositions() { - if (postings == NULL) { - postings = reader->termPositions(); - } - return postings; -} - - -bool SegmentMergeInfo::next() { -//Func - Moves the current term of the enumeration termEnum to the next and term -// points to this new current term -//Pre - true -//Post - Returns true if the term has been moved to the next otherwise false - if (termEnum->next()) { - _CLDECDELETE(term); - term = termEnum->term(); - return true; - } else { - _CLDECDELETE(term); //TODO: test HighFreqTerms errors with this - term = NULL; - return false; - } -} - -void SegmentMergeInfo::close() { -//Func - Closes the the resources -//Pre - true -//Post - The resources have been closed - - //First make sure posting has been closed - if ( postings != NULL ){ - postings->close(); - _CLVDELETE(postings); //todo: not a clucene object... should be - } - - if ( termEnum != NULL ){ - termEnum->close(); - _CLDELETE(termEnum); - } - _CLDECDELETE(term); - _CLDELETE_ARRAY(docMap); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h b/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h deleted file mode 100644 index 7ffd46ade..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h +++ /dev/null @@ -1,47 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_SegmentMergeInfo_ -#define _lucene_index_SegmentMergeInfo_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SegmentTermEnum.h" -#include "SegmentHeader.h" - -CL_NS_DEF(index) -class SegmentMergeInfo:LUCENE_BASE { - int32_t* docMap; // maps around deleted docs - TermPositions* postings; -public: - TermEnum* termEnum; - Term* term; - int32_t base; - IndexReader* reader; - - //Constructor - SegmentMergeInfo(const int32_t b, TermEnum* te, IndexReader* r); - - //Destructor - ~SegmentMergeInfo(); - - //Moves the current term of the enumeration termEnum to the next and term - //points to this new current term - bool next(); - - //Closes the the resources - void close(); - - // maps around deleted docs - int32_t* getDocMap(); - - TermPositions* getPositions(); -}; -CL_NS_END -#endif - diff --git a/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp b/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp deleted file mode 100644 index 879781287..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SegmentMergeQueue.h" - -#include "SegmentMergeInfo.h" -CL_NS_DEF(index) - - - SegmentMergeQueue::SegmentMergeQueue(const int32_t size) { - //Func - Constructor - // Creates a queue of length size - //Pre - size >= 0 - //Post - The queue has been created of length size - - //BVK: bug. changed condition from size > 0 to size >= 0 - //if size is 0, as it is when retrieving a TermEnum - //from an empty index this should this should not fail. - CND_PRECONDITION(size >= 0, "size is too small"); - - //Call the initialize method of its superclass. The boolean value passed here - //indicates that the superclass PriorityQueue takes the responsibility to have its elements deleted - //The destructor of SegmentMergInfo will make sure that each intstance it will be closed properly - //before it is deleted - initialize(size,true); - } - - SegmentMergeQueue::~SegmentMergeQueue(){ - //Func - Destructor - // Does nothing as its parent class will clean up everything - //Pre - true - //Post - true - close(); - } - - void SegmentMergeQueue::close() { - //Func - Closes and destroyes all SegmentMergeInfo Instances in the queue - //Pre - true - //post - All SegmentMergeInfo Instances in the queue have been closed and deleted - // The queue is now empty but can still be used - - //call the clear method of the parent class PriorityQueue - clear(); - } - - bool SegmentMergeQueue::lessThan(SegmentMergeInfo* stiA, SegmentMergeInfo* stiB) { - //Func - Overloaded method that implements the lessThan operator for the parent class - // This method is used by the parent class Priority queue to reorder its internal - // data structures. This implementation check if stiA is less than the current term of stiB. - //Pre - stiA != NULL - // stiB != NULL - //Post - true is returned if stiA < stiB otherwise false - - CND_PRECONDITION(stiA != NULL, "stiA is NULL"); - CND_PRECONDITION(stiB != NULL, "stiB is NULL"); - - //Compare the two terms - int32_t comparison = stiA->term->compareTo(stiB->term); - //Check if they match - if (comparison == 0){ //todo: can we do an optimized compare here? compare using equals, then compare properly? - //If the match check if the base of stiA is smaller than the base of stiB - //Note that different bases means that the terms of stiA an stiB ly in different segments - return stiA->base < stiB->base; - }else{ - //Terms didn't match so return the difference in positions - return comparison < 0; - } - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h b/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h deleted file mode 100644 index faa690252..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h +++ /dev/null @@ -1,38 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_SegmentMergeQueue_ -#define _lucene_index_SegmentMergeQueue_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/PriorityQueue.h" -#include "SegmentMergeInfo.h" - -CL_NS_DEF(index) - class SegmentMergeQueue :public CL_NS(util)::PriorityQueue > { - public: - //Constructor - //Creates a queue of length size - SegmentMergeQueue(const int32_t size); - - //Destructor - //Does nothing as its parent class will clean up everything - ~SegmentMergeQueue(); - - //Closes and destroyes all SegmentMergeInfo Instances in the queue - void close(); - protected: - //Overloaded method that implements the lessThan operator for the parent class - //This method is used by the parent class Priority queue to reorder its internal - //data structures. This implementation check if stiA is less than the current term of stiB. - bool lessThan(SegmentMergeInfo* stiA, SegmentMergeInfo* stiB); - - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp b/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp deleted file mode 100644 index 40814da0c..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp +++ /dev/null @@ -1,723 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "SegmentMerger.h" - -CL_NS_USE(util) -CL_NS_USE(document) -CL_NS_USE(store) -CL_NS_DEF(index) - -// File extensions of old-style index files -int COMPOUND_EXTENSIONS_LENGTH = 7; -const char* COMPOUND_EXTENSIONS = "fnm\0" "frq\0" "prx\0" "fdx\0" "fdt\0" "tii\0" "tis\0"; - -int VECTOR_EXTENSIONS_LENGTH = 3; -const char* VECTOR_EXTENSIONS = "tvx\0" "tvd\0" "tvf\0"; - -SegmentMerger::SegmentMerger(IndexWriter* writer, const QString& name) -{ - //Func - Constructor - //Pre - dir holds a valid reference to a Directory - // name != NULL - //Post - Instance has been created - - CND_PRECONDITION(!name.isEmpty(), "name is NULL"); - - freqOutput = NULL; - proxOutput = NULL; - termInfosWriter = NULL; - queue = NULL; - fieldInfos = NULL; - useCompoundFile = writer->getUseCompoundFile(); - skipBuffer = _CLNEW CL_NS(store)::RAMIndexOutput(); - - segment = name; - directory = writer->getDirectory(); - termIndexInterval = writer->getTermIndexInterval(); - - lastSkipDoc=0; - lastSkipFreqPointer=0; - lastSkipProxPointer=0; - skipInterval=0; -} - -SegmentMerger::~SegmentMerger() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - //Clear the readers set - readers.clear(); - - //Delete field Infos - _CLDELETE(fieldInfos); - //Close and destroy the IndexOutput to the Frequency File - if (freqOutput != NULL) { - freqOutput->close(); - _CLDELETE(freqOutput); - } - //Close and destroy the IndexOutput to the Prox File - if (proxOutput != NULL) { - proxOutput->close(); - _CLDELETE(proxOutput); - } - //Close and destroy the termInfosWriter - if (termInfosWriter != NULL) { - termInfosWriter->close(); - _CLDELETE(termInfosWriter); - } - //Close and destroy the queue - if (queue != NULL) { - queue->close(); - _CLDELETE(queue); - } - //close and destory the skipBuffer - if (skipBuffer != NULL) { - skipBuffer->close(); - _CLDELETE(skipBuffer); - } -} - -void SegmentMerger::add(IndexReader* reader) -{ - //Func - Adds a IndexReader to the set of readers - //Pre - reader contains a valid reference to a IndexReader - //Post - The SegementReader reader has been added to the set of readers - - readers.push_back(reader); -} - -IndexReader* SegmentMerger::segmentReader(const int32_t i) -{ - //Func - Returns a reference to the i-th IndexReader - //Pre - 0 <= i < readers.size() - //Post - A reference to the i-th IndexReader has been returned - - CND_PRECONDITION(i >= 0, "i is a negative number"); - CND_PRECONDITION((size_t)i < readers.size(), - "i is bigger than the number of IndexReader instances"); - - //Retrieve the i-th IndexReader - IndexReader* ret = readers[i]; - CND_CONDITION(ret != NULL, "No IndexReader found"); - - return ret; -} - -int32_t SegmentMerger::merge() -{ - int32_t value = mergeFields(); - mergeTerms(); - mergeNorms(); - - if (fieldInfos->hasVectors()) - mergeVectors(); - - return value; -} - -void SegmentMerger::closeReaders() -{ - for (uint32_t i = 0; i < readers.size(); i++) { - // close readers - IndexReader* reader = readers[i]; - reader->close(); - } -} - -void SegmentMerger::createCompoundFile(const QString& filename, QStringList& files) -{ - CompoundFileWriter* cfsWriter = _CLNEW CompoundFileWriter(directory, filename); - - { //msvc6 scope fix - // Basic files - for (int32_t i = 0; i < COMPOUND_EXTENSIONS_LENGTH; i++) { - files.push_back(Misc::qjoin(segment, QLatin1String("."), - QLatin1String(COMPOUND_EXTENSIONS+(i*4)))); - } - } - - { //msvc6 scope fix - // Field norm files - for (int32_t i = 0; i < fieldInfos->size(); i++) { - FieldInfo* fi = fieldInfos->fieldInfo(i); - if (fi->isIndexed && !fi->omitNorms) { - TCHAR tbuf[10]; - char abuf[10]; - _i64tot(i, tbuf, 10); - STRCPY_TtoA(abuf, tbuf, 10); - - files.push_back(Misc::qjoin(segment, QLatin1String(".f"), - QLatin1String(abuf))); - } - } - } - - // Vector files - if (fieldInfos->hasVectors()) { - for (int32_t i = 0; i < VECTOR_EXTENSIONS_LENGTH; i++) { - files.push_back(Misc::qjoin(segment, QLatin1String("."), - QLatin1String(VECTOR_EXTENSIONS+(i*4)))); - } - } - - { //msvc6 scope fix - // Now merge all added files - for (size_t i=0;iaddFile(files[i]); - } - } - - // Perform the merge - cfsWriter->close(); - _CLDELETE(cfsWriter); -} - -void SegmentMerger::addIndexed(IndexReader* reader, FieldInfos* fieldInfos, - StringArrayWithDeletor& names, bool storeTermVectors, - bool storePositionWithTermVector, bool storeOffsetWithTermVector) -{ - StringArrayWithDeletor::const_iterator itr = names.begin(); - while (itr != names.end()) { - fieldInfos->add(*itr, true, - storeTermVectors, storePositionWithTermVector, - storeOffsetWithTermVector, !reader->hasNorms(*itr)); - ++itr; - } -} - -int32_t SegmentMerger::mergeFields() -{ - //Func - Merge the fields of all segments - //Pre - true - //Post - The field infos and field values of all segments have been merged. - - //Create a new FieldInfos - fieldInfos = _CLNEW FieldInfos(); // merge field names - - //Condition check to see if fieldInfos points to a valid instance - CND_CONDITION(fieldInfos != NULL, "Memory allocation for fieldInfos failed"); - - IndexReader* reader = NULL; - - int32_t docCount = 0; - - //Iterate through all readers - for (uint32_t i = 0; i < readers.size(); i++) { - //get the i-th reader - reader = readers[i]; - //Condition check to see if reader points to a valid instance - CND_CONDITION(reader != NULL,"No IndexReader found"); - - StringArrayWithDeletor tmp; - - tmp.clear(); - reader->getFieldNames(IndexReader::TERMVECTOR_WITH_POSITION_OFFSET, tmp); - addIndexed(reader, fieldInfos, tmp, true, true, true); - - tmp.clear(); - reader->getFieldNames(IndexReader::TERMVECTOR_WITH_POSITION, tmp); - addIndexed(reader, fieldInfos, tmp, true, true, false); - - tmp.clear(); - reader->getFieldNames(IndexReader::TERMVECTOR_WITH_OFFSET, tmp); - addIndexed(reader, fieldInfos, tmp, true, false, true); - - tmp.clear(); - reader->getFieldNames(IndexReader::TERMVECTOR, tmp); - addIndexed(reader, fieldInfos, tmp, true, false, false); - - tmp.clear(); - reader->getFieldNames(IndexReader::INDEXED, tmp); - addIndexed(reader, fieldInfos, tmp, false, false, false); - - tmp.clear(); - reader->getFieldNames(IndexReader::UNINDEXED, tmp); - if (tmp.size() > 0) { - TCHAR** arr = _CL_NEWARRAY(TCHAR*,tmp.size()+1); - tmp.toArray(arr); - fieldInfos->add((const TCHAR**)arr, false); - _CLDELETE_ARRAY(arr); - //no need to delete the contents, since tmp is responsible for it - } - } - - //Create the filename of the new FieldInfos file - QString buf = Misc::segmentname(segment, QLatin1String(".fnm")); - //Write the new FieldInfos file to the directory - fieldInfos->write(directory, buf); - - // merge field values - // Instantiate Fieldswriter which will write in directory for the segment - // name segment using the new merged fieldInfos - FieldsWriter* fieldsWriter = _CLNEW FieldsWriter(directory, segment, fieldInfos); - - //Condition check to see if fieldsWriter points to a valid instance - CND_CONDITION(fieldsWriter != NULL, "Memory allocation for fieldsWriter failed"); - - try { - IndexReader* reader = NULL; - int32_t maxDoc = 0; - //Iterate through all readers - for (uint32_t i = 0; i < readers.size(); i++) { - // get the i-th reader - reader = readers[i]; - - - // Condition check to see if reader points to a valid instance - CND_CONDITION(reader != NULL, "No IndexReader found"); - - // Get the total number documents including the documents that have - // been marked deleted - int32_t maxDoc = reader->maxDoc(); - - //document buffer - Document doc; - - //Iterate through all the documents managed by the current reader - for (int32_t j = 0; j < maxDoc; j++) { - //Check if the j-th document has been deleted, if so skip it - if (!reader->isDeleted(j)) { - //Get the document - if (reader->document(j, &doc)) { - //Add the document to the new FieldsWriter - fieldsWriter->addDocument(&doc); - docCount++; - //doc is cleard for re-use - doc.clear(); - } - } - } - } - } _CLFINALLY ( - //Close the fieldsWriter - fieldsWriter->close(); - //And have it deleted as it not used any more - _CLDELETE(fieldsWriter); - ); - - return docCount; -} - -void SegmentMerger::mergeVectors() -{ - TermVectorsWriter* termVectorsWriter = - _CLNEW TermVectorsWriter(directory, segment, fieldInfos); - - try { - for (uint32_t r = 0; r < readers.size(); r++) { - IndexReader* reader = readers[r]; - int32_t maxDoc = reader->maxDoc(); - for (int32_t docNum = 0; docNum < maxDoc; docNum++) { - // skip deleted docs - if (reader->isDeleted(docNum)) - continue; - - Array tmp; - if (reader->getTermFreqVectors(docNum, tmp)) - termVectorsWriter->addAllDocVectors(tmp); - tmp.deleteAll(); - } - } - } _CLFINALLY ( - _CLDELETE(termVectorsWriter); - ); -} - - -void SegmentMerger::mergeTerms() -{ - //Func - Merge the terms of all segments - //Pre - fieldInfos != NULL - //Post - The terms of all segments have been merged - - CND_PRECONDITION(fieldInfos != NULL, "fieldInfos is NULL"); - - try{ - //create a filename for the new Frequency File for segment - QString buf = Misc::segmentname(segment, QLatin1String(".frq")); - //Open an IndexOutput to the new Frequency File - freqOutput = directory->createOutput(buf); - - //create a filename for the new Prox File for segment - buf = Misc::segmentname(segment, QLatin1String(".prx")); - //Open an IndexOutput to the new Prox File - proxOutput = directory->createOutput(buf); - - //Instantiate a new termInfosWriter which will write in directory - //for the segment name segment using the new merged fieldInfos - termInfosWriter = _CLNEW TermInfosWriter(directory, segment, fieldInfos, - termIndexInterval); - - //Condition check to see if termInfosWriter points to a valid instance - CND_CONDITION(termInfosWriter != NULL, - "Memory allocation for termInfosWriter failed"); - - skipInterval = termInfosWriter->skipInterval; - queue = _CLNEW SegmentMergeQueue(readers.size()); - - //And merge the Term Infos - mergeTermInfos(); - } _CLFINALLY ( - //Close and destroy the IndexOutput to the Frequency File - if (freqOutput != NULL) { - freqOutput->close(); _CLDELETE(freqOutput); - } - - //Close and destroy the IndexOutput to the Prox File - if (proxOutput != NULL) - { - proxOutput->close(); - _CLDELETE(proxOutput); - } - - //Close and destroy the termInfosWriter - if (termInfosWriter != NULL) { - termInfosWriter->close(); - _CLDELETE(termInfosWriter); - } - - //Close and destroy the queue - if (queue != NULL) { - queue->close(); - _CLDELETE(queue); - } - ); -} - -void SegmentMerger::mergeTermInfos() -{ - //Func - Merges all TermInfos into a single segment - //Pre - true - //Post - All TermInfos have been merged into a single segment - - //Condition check to see if queue points to a valid instance - CND_CONDITION(queue != NULL, "Memory allocation for queue failed"); - - //base is the id of the first document in a segment - int32_t base = 0; - - IndexReader* reader = NULL; - SegmentMergeInfo* smi = NULL; - - //iterate through all the readers - for (uint32_t i = 0; i < readers.size(); i++) { - //Get the i-th reader - reader = readers[i]; - - //Condition check to see if reader points to a valid instance - CND_CONDITION(reader != NULL, "No IndexReader found"); - - //Get the term enumeration of the reader - TermEnum* termEnum = reader->terms(); - //Instantiate a new SegmentMerginfo for the current reader and enumeration - smi = _CLNEW SegmentMergeInfo(base, termEnum, reader); - - //Condition check to see if smi points to a valid instance - CND_CONDITION(smi != NULL, "Memory allocation for smi failed") ; - - //Increase the base by the number of documents that have not been marked deleted - //so base will contain a new value for the first document of the next iteration - base += reader->numDocs(); - //Get the next current term - if (smi->next()) { - //Store the SegmentMergeInfo smi with the initialized SegmentTermEnum TermEnum - //into the queue - queue->put(smi); - } else { - //Apparently the end of the TermEnum of the SegmentTerm has been reached so - //close the SegmentMergeInfo smi - smi->close(); - //And destroy the instance and set smi to NULL (It will be used later in this method) - _CLDELETE(smi); - } - } - - //Instantiate an array of SegmentMergeInfo instances called match - SegmentMergeInfo** match = _CL_NEWARRAY(SegmentMergeInfo*,readers.size()+1); - - //Condition check to see if match points to a valid instance - CND_CONDITION(match != NULL, "Memory allocation for match failed") ; - - SegmentMergeInfo* top = NULL; - - //As long as there are SegmentMergeInfo instances stored in the queue - while (queue->size() > 0) { - int32_t matchSize = 0; - - // pop matching terms - - //Pop the first SegmentMergeInfo from the queue - match[matchSize++] = queue->pop(); - //Get the Term of match[0] - Term* term = match[0]->term; - - //Condition check to see if term points to a valid instance - CND_CONDITION(term != NULL,"term is NULL") ; - - //Get the current top of the queue - top = queue->top(); - - //For each SegmentMergInfo still in the queue - //Check if term matches the term of the SegmentMergeInfo instances in the queue - while (top != NULL && term->equals(top->term)) { - //A match has been found so add the matching SegmentMergeInfo to the match array - match[matchSize++] = queue->pop(); - //Get the next SegmentMergeInfo - top = queue->top(); - } - match[matchSize]=NULL; - - //add new TermInfo - mergeTermInfo(match); //matchSize - - //Restore the SegmentTermInfo instances in the match array back into the queue - while (matchSize > 0) { - smi = match[--matchSize]; - - //Condition check to see if smi points to a valid instance - CND_CONDITION(smi != NULL, "smi is NULL"); - - //Move to the next term in the enumeration of SegmentMergeInfo smi - if (smi->next()) { - //There still are some terms so restore smi in the queue - queue->put(smi); - - } else { - //Done with a segment - //No terms anymore so close this SegmentMergeInfo instance - smi->close(); - _CLDELETE(smi); - } - } - } - - _CLDELETE_ARRAY(match); -} - -void SegmentMerger::mergeTermInfo(SegmentMergeInfo** smis) -{ - //Func - Merge the TermInfo of a term found in one or more segments. - //Pre - smis != NULL and it contains segments that are positioned at the same term. - // n is equal to the number of SegmentMergeInfo instances in smis - // freqOutput != NULL - // proxOutput != NULL - //Post - The TermInfo of a term has been merged - - CND_PRECONDITION(smis != NULL, "smis is NULL"); - CND_PRECONDITION(freqOutput != NULL, "freqOutput is NULL"); - CND_PRECONDITION(proxOutput != NULL, "proxOutput is NULL"); - - //Get the file pointer of the IndexOutput to the Frequency File - int64_t freqPointer = freqOutput->getFilePointer(); - //Get the file pointer of the IndexOutput to the Prox File - int64_t proxPointer = proxOutput->getFilePointer(); - - //Process postings from multiple segments all positioned on the same term. - int32_t df = appendPostings(smis); - - int64_t skipPointer = writeSkip(); - - //df contains the number of documents across all segments where this term was found - if (df > 0) { - //add an entry to the dictionary with pointers to prox and freq files - termInfo.set(df, freqPointer, proxPointer, (int32_t)(skipPointer - freqPointer)); - //Precondition check for to be sure that the reference to - //smis[0]->term will be valid - CND_PRECONDITION(smis[0]->term != NULL, "smis[0]->term is NULL"); - //Write a new TermInfo - termInfosWriter->add(smis[0]->term, &termInfo); - } -} - - -int32_t SegmentMerger::appendPostings(SegmentMergeInfo** smis) -{ - //Func - Process postings from multiple segments all positioned on the - // same term. Writes out merged entries into freqOutput and - // the proxOutput streams. - //Pre - smis != NULL and it contains segments that are positioned at the same term. - // n is equal to the number of SegmentMergeInfo instances in smis - // freqOutput != NULL - // proxOutput != NULL - //Post - Returns number of documents across all segments where this term was found - - CND_PRECONDITION(smis != NULL, "smis is NULL"); - CND_PRECONDITION(freqOutput != NULL, "freqOutput is NULL"); - CND_PRECONDITION(proxOutput != NULL, "proxOutput is NULL"); - - int32_t lastDoc = 0; - int32_t df = 0; //Document Counter - - resetSkip(); - SegmentMergeInfo* smi = NULL; - - //Iterate through all SegmentMergeInfo instances in smis - int32_t i = 0; - while ((smi=smis[i]) != NULL) { - //Get the i-th SegmentMergeInfo - - //Condition check to see if smi points to a valid instance - CND_PRECONDITION(smi != NULL, " is NULL"); - - //Get the term positions - TermPositions* postings = smi->getPositions(); - //Get the base of this segment - int32_t base = smi->base; - //Get the docMap so we can see which documents have been deleted - int32_t* docMap = smi->getDocMap(); - //Seek the termpost - postings->seek(smi->termEnum); - while (postings->next()) { - int32_t doc = postings->doc(); - //Check if there are deletions - if (docMap != NULL) - doc = docMap[doc]; // map around deletions - doc += base; // convert to merged space - - //Condition check to see doc is eaqual to or bigger than lastDoc - CND_CONDITION(doc >= lastDoc,"docs out of order"); - - //Increase the total frequency over all segments - df++; - - if ((df % skipInterval) == 0) { - bufferSkip(lastDoc); - } - - //Calculate a new docCode - //use low bit to flag freq=1 - int32_t docCode = (doc - lastDoc) << 1; - lastDoc = doc; - - //Get the frequency of the Term - int32_t freq = postings->freq(); - if (freq == 1) { - //write doc & freq=1 - freqOutput->writeVInt(docCode | 1); - } else { - //write doc - freqOutput->writeVInt(docCode); - //write frequency in doc - freqOutput->writeVInt(freq); - } - - int32_t lastPosition = 0; - // write position deltas - for (int32_t j = 0; j < freq; j++) { - //Get the next position - int32_t position = postings->nextPosition(); - //Write the difference between position and the last position - proxOutput->writeVInt(position - lastPosition); - lastPosition = position; - } - } - - i++; - } - - //Return total number of documents across all segments where term was found - return df; -} - -void SegmentMerger::resetSkip() -{ - skipBuffer->reset(); - lastSkipDoc = 0; - lastSkipFreqPointer = freqOutput->getFilePointer(); - lastSkipProxPointer = proxOutput->getFilePointer(); -} - -void SegmentMerger::bufferSkip(int32_t doc) -{ - int64_t freqPointer = freqOutput->getFilePointer(); - int64_t proxPointer = proxOutput->getFilePointer(); - - skipBuffer->writeVInt(doc - lastSkipDoc); - skipBuffer->writeVInt((int32_t) (freqPointer - lastSkipFreqPointer)); - skipBuffer->writeVInt((int32_t) (proxPointer - lastSkipProxPointer)); - - lastSkipDoc = doc; - lastSkipFreqPointer = freqPointer; - lastSkipProxPointer = proxPointer; -} - -int64_t SegmentMerger::writeSkip() -{ - int64_t skipPointer = freqOutput->getFilePointer(); - skipBuffer->writeTo(freqOutput); - return skipPointer; -} - -// Func - Merges the norms for all fields -// Pre - fieldInfos != NULL -// Post - The norms for all fields have been merged -void SegmentMerger::mergeNorms() -{ - CND_PRECONDITION(fieldInfos != NULL, "fieldInfos is NULL"); - - //iterate through all the Field Infos instances - for (int32_t i = 0; i < fieldInfos->size(); i++) { - //Get the i-th FieldInfo - FieldInfo* fi = fieldInfos->fieldInfo(i); - //Is this Field indexed? - if (fi->isIndexed && !fi->omitNorms) { - //Create and Instantiate an IndexOutput to that norm file - QString buf = Misc::segmentname(segment, QLatin1String(".f"), i); - IndexOutput* output = directory->createOutput(buf); - - //Condition check to see if output points to a valid instance - CND_CONDITION(output != NULL, "No Outputstream retrieved"); - - uint8_t* input = NULL; - try { - for (uint32_t j = 0; j < readers.size(); ++j) { - // get the next index reader + condition check - IndexReader* reader = readers[j]; - CND_CONDITION(reader != NULL, "No reader found"); - - // Get the total number of documents including the documents - // that have been marked deleted - int32_t maxDoc = reader->maxDoc(); - if (maxDoc > 0) { - // if there are docs, allocate buffer to read it's norms - uint8_t* data = (uint8_t*)realloc(input, maxDoc * - sizeof(uint8_t)); - if (data) { - input = data; - memset(input, 0, maxDoc * sizeof(uint8_t)); - // Get an IndexInput to the norm file for this - // field in this segment - reader->norms(fi->name, input); - - //Iterate through all the documents - for(int32_t k = 0; k < maxDoc; k++) { - //Check if document k is deleted - if (!reader->isDeleted(k)) { - //write the new norm - output->writeByte(input[k]); - } - } - } - } - } - } _CLFINALLY ( - if (output != NULL) { - output->close(); - _CLDELETE(output); - } - free(input); - ); - } - } -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentMerger.h b/3rdparty/clucene/src/CLucene/index/SegmentMerger.h deleted file mode 100644 index 230843b00..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentMerger.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_SegmentMerger_ -#define _lucene_index_SegmentMerger_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/store/RAMDirectory.h" -#include "CLucene/util/VoidList.h" -#include "SegmentMergeInfo.h" -#include "SegmentMergeQueue.h" -#include "IndexWriter.h" -#include "FieldInfos.h" -#include "FieldsWriter.h" -#include "TermInfosWriter.h" - -CL_NS_DEF(index) - -/** -* The SegmentMerger class combines two or more Segments, represented by an IndexReader ({@link #add}, -* into a single Segment. After adding the appropriate readers, call the merge method to combine the -* segments. -*

-* If the compoundFile flag is set, then the segments will be merged into a compound file. -* -* -* @see #merge -* @see #add -*/ -class SegmentMerger : LUCENE_BASE -{ - bool useCompoundFile; - - CL_NS(store)::RAMIndexOutput* skipBuffer; - int32_t lastSkipDoc; - int64_t lastSkipFreqPointer; - int64_t lastSkipProxPointer; - - void resetSkip(); - void bufferSkip(int32_t doc); - int64_t writeSkip(); - - //Directory of the segment - CL_NS(store)::Directory* directory; - //name of the new segment - QString segment; - //Set of IndexReaders - CL_NS(util)::CLVector > readers; - //Field Infos for t he FieldInfo instances of all fields - FieldInfos* fieldInfos; - - //The queue that holds SegmentMergeInfo instances - SegmentMergeQueue* queue; - //IndexOutput to the new Frequency File - CL_NS(store)::IndexOutput* freqOutput; - //IndexOutput to the new Prox File - CL_NS(store)::IndexOutput* proxOutput; - //Writes Terminfos that have been merged - TermInfosWriter* termInfosWriter; - TermInfo termInfo; //(new) minimize consing - - int32_t termIndexInterval; - int32_t skipInterval; - -public: - /** - * - * @param dir The Directory to merge the other segments into - * @param name The name of the new segment - * @param compoundFile true if the new segment should use a compoundFile - */ - SegmentMerger( IndexWriter* writer, const QString& name ); - - //Destructor - ~SegmentMerger(); - - /** - * Add an IndexReader to the collection of readers that are to be merged - * @param reader - */ - void add(IndexReader* reader); - - /** - * - * @param i The index of the reader to return - * @return The ith reader to be merged - */ - IndexReader* segmentReader(const int32_t i); - - /** - * Merges the readers specified by the {@link #add} method into the - * directory passed to the constructor - * @return The number of documents that were merged - * @throws IOException - */ - int32_t merge(); - /** - * close all IndexReaders that have been added. - * Should not be called before merge(). - * @throws IOException - */ - void closeReaders(); -private: - void addIndexed(IndexReader* reader, FieldInfos* fieldInfos, - CL_NS(util)::StringArrayWithDeletor& names, - bool storeTermVectors, bool storePositionWithTermVector, - bool storeOffsetWithTermVector); - - /** - * Merge the fields of all segments - * @return The number of documents in all of the readers - * @throws IOException - */ - int32_t mergeFields(); - - /** - * Merge the TermVectors from each of the segments into the new one. - * @throws IOException - */ - void mergeVectors(); - - /** Merge the terms of all segments */ - void mergeTerms(); - - /** Merges all TermInfos into a single segment */ - void mergeTermInfos(); - - /** Merge one term found in one or more segments. The array smis - * contains segments that are positioned at the same term. N - * is the number of cells in the array actually occupied. - * - * @param smis array of segments - * @param n number of cells in the array actually occupied - */ - void mergeTermInfo( SegmentMergeInfo** smis); - - /** Process postings from multiple segments all positioned on the - * same term. Writes out merged entries into freqOutput and - * the proxOutput streams. - * - * @param smis array of segments - * @param n number of cells in the array actually occupied - * @return number of documents across all segments where this term was found - */ - int32_t appendPostings(SegmentMergeInfo** smis); - - //Merges the norms for all fields - void mergeNorms(); - - void createCompoundFile(const QString& filename, QStringList& files); - friend class IndexWriter; //allow IndexWriter to use createCompoundFile -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp b/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp deleted file mode 100644 index ba061714b..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp +++ /dev/null @@ -1,816 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#include "CLucene/StdHeader.h" -#include "SegmentHeader.h" - -#include "FieldInfos.h" -#include "FieldsReader.h" -#include "IndexReader.h" -#include "TermInfosReader.h" -#include "Terms.h" -#include "CLucene/search/Similarity.h" - -CL_NS_USE(util) -CL_NS_USE(store) -CL_NS_USE(document) -CL_NS_USE(search) -CL_NS_DEF(index) - -SegmentReader::Norm::Norm(IndexInput* instrm, int32_t n, SegmentReader* r, - const QString& seg) - : number(n) - , reader(r) - , segment(seg) - , in(instrm) - , bytes(NULL) - , dirty(false) -{ - //Func - Constructor - //Pre - instrm is a valid reference to an IndexInput - //Post - A Norm instance has been created with an empty bytes array - bytes = NULL; - dirty = false; -} - -SegmentReader::Norm::~Norm() -{ - //Func - Destructor - //Pre - true - //Post - The IndexInput in has been deleted (and closed by its destructor) - // and the array too. - - //Close and destroy the inputstream in-> The inputstream will be closed - // by its destructor. Note that the IndexInput 'in' actually is a pointer!!!!! - _CLDELETE(in); - - //Delete the bytes array - _CLDELETE_ARRAY(bytes); - -} - -void SegmentReader::Norm::reWrite() -{ - QString buf(segment + QLatin1String(".tmp")); - - // NOTE: norms are re-written in regular directory, not cfs - IndexOutput* out = reader->getDirectory()->createOutput(buf); - try { - out->writeBytes(bytes, reader->maxDoc()); - } _CLFINALLY ( - out->close(); - _CLDELETE(out) - ); - - QString fileName(segment); - if (reader->cfsReader == NULL) - fileName.append(QLatin1String(".f%1")).arg(number); - else // use a different file name if we have compound format - fileName.append(QLatin1String(".s%1")).arg(number); - - reader->getDirectory()->renameFile(buf, fileName); - this->dirty = false; -} - -SegmentReader::SegmentReader(SegmentInfo* si) - : IndexReader(si->getDir()) - , _norms(false, false) -{ - initialize(si); -} - -SegmentReader::SegmentReader(SegmentInfos* sis, SegmentInfo* si) - : IndexReader(si->getDir(), sis, false) - , _norms(false, false) -{ - initialize(si); -} - -void SegmentReader::initialize(SegmentInfo* si) -{ - //Pre - si-> is a valid reference to SegmentInfo instance - // identified by si-> - //Post - All files of the segment have been read - - deletedDocs = NULL; - ones = NULL; - //There are no documents yet marked as deleted - deletedDocsDirty = false; - - normsDirty=false; - undeleteAll=false; - - //Duplicate the name of the segment from SegmentInfo to segment - segment = si->name; - // make sure that all index files have been read or are kept open - // so that if an index update removes them we'll still have them - freqStream = NULL; - proxStream = NULL; - - //instantiate a buffer large enough to hold a directory path - QString buf; - - // Use compound file directory for some files, if it exists - Directory* cfsDir = getDirectory(); - SegmentName(buf, CL_MAX_PATH, QLatin1String(".cfs")); - if (cfsDir->fileExists(buf)) { - cfsReader = _CLNEW CompoundFileReader(cfsDir, buf); - cfsDir = cfsReader; - }else - cfsReader = NULL; - - // Create the name of the field info file with suffix .fnm in buf - SegmentName(buf, CL_MAX_PATH, QLatin1String(".fnm")); - fieldInfos = _CLNEW FieldInfos(cfsDir, buf ); - - // Condition check to see if fieldInfos points to a valid instance - CND_CONDITION(fieldInfos != NULL, - "No memory could be allocated for fieldInfos"); - - // Create the name of the frequence file with suffix .frq in buf - SegmentName(buf ,CL_MAX_PATH, QLatin1String(".frq")); - - // Open an IndexInput freqStream to the frequency file - freqStream = cfsDir->openInput( buf ); - - // Condition check to see if freqStream points to a valid instance and was - // able to open the frequency file - CND_CONDITION(freqStream != NULL, - "IndexInput freqStream could not open the frequency file"); - - // Create the name of the prox file with suffix .prx in buf - SegmentName(buf, CL_MAX_PATH, QLatin1String(".prx")); - - // Open an IndexInput proxStream to the prox file - proxStream = cfsDir->openInput( buf ); - - // Condition check to see if proxStream points to a valid instance and was - // able to open the prox file - CND_CONDITION(proxStream != NULL, - "IndexInput proxStream could not open proximity file"); - - // Instantiate a FieldsReader for reading the Field Info File - fieldsReader = _CLNEW FieldsReader(cfsDir, segment, fieldInfos); - - // Condition check to see if fieldsReader points to a valid instance - CND_CONDITION(fieldsReader != NULL, - "No memory could be allocated for fieldsReader"); - - //Instantiate a TermInfosReader for reading the Term Dictionary .tis file - tis = _CLNEW TermInfosReader(cfsDir, segment, fieldInfos); - - //Condition check to see if tis points to a valid instance - CND_CONDITION(tis != NULL,"No memory could be allocated for tis"); - - // Check if the segment has deletion according to the SegmentInfo instance - // si-> NOTE: the bitvector is stored using the regular directory, not cfs - if (hasDeletions(si)) { - //Create a deletion file with suffix .del - SegmentName(buf, CL_MAX_PATH, QLatin1String(".del")); - // Instantiate a BitVector that manages which documents have been deleted - deletedDocs = _CLNEW BitSet(getDirectory(), buf); - } - - // Open the norm file. There's a norm file for each indexed field with a - // byte for each document. The .f[0-9]* file contains, for each document, - // a byte that encodes a value that is multiplied into the score for hits - // on that field - openNorms(cfsDir); - - termVectorsReaderOrig = NULL; - if (fieldInfos->hasVectors()) // open term vector files only as needed - termVectorsReaderOrig = _CLNEW TermVectorsReader(cfsDir, segment, fieldInfos); -} - -SegmentReader::~SegmentReader() -{ - //Func - Destructor. - //Pre - doClose has been invoked! - //Post - the instance has been destroyed - - doClose(); //this means that index reader doesn't need to be closed manually - - _CLDELETE(fieldInfos); - _CLDELETE(fieldsReader); - _CLDELETE(tis); - _CLDELETE(freqStream); - _CLDELETE(proxStream); - _CLDELETE(deletedDocs); - _CLDELETE_ARRAY(ones); - _CLDELETE(termVectorsReaderOrig); - _CLDECDELETE(cfsReader); -} - -void SegmentReader::doCommit() -{ - QString bufdel(segment + QLatin1String(".del")); - - if (deletedDocsDirty) { // re-write deleted - QString buftmp(segment + QLatin1String(".tmp")); - deletedDocs->write(getDirectory(), buftmp); - getDirectory()->renameFile(buftmp, bufdel); - } - - if(undeleteAll && getDirectory()->fileExists(bufdel)) - getDirectory()->deleteFile(bufdel, true); - - if (normsDirty) { // re-write norms - NormsType::iterator itr = _norms.begin(); - while (itr != _norms.end()) { - Norm* norm = itr->second; - if (norm->dirty) { - norm->reWrite(); - } - ++itr; - } - } - deletedDocsDirty = false; - normsDirty = false; - undeleteAll = false; -} - -void SegmentReader::doClose() -{ - //Func - Closes all streams to the files of a single segment - //Pre - fieldsReader != NULL - // tis != NULL - //Post - All streams to files have been closed - - CND_PRECONDITION(fieldsReader != NULL, "fieldsReader is NULL"); - CND_PRECONDITION(tis != NULL, "tis is NULL"); - - //Close the fieldsReader - fieldsReader->close(); - //Close the TermInfosReader - tis->close(); - - //Close the frequency stream - if (freqStream != NULL){ - freqStream->close(); - } - //Close the prox stream - if (proxStream != NULL){ - proxStream->close(); - } - - //Close the norm file - closeNorms(); - - if (termVectorsReaderOrig != NULL) - termVectorsReaderOrig->close(); - - if (cfsReader != NULL) - cfsReader->close(); -} - -bool SegmentReader::hasDeletions() const -{ - return deletedDocs != NULL; -} - -//static -bool SegmentReader::usesCompoundFile(SegmentInfo* si) -{ - return si->getDir()->fileExists(si->name + QLatin1String(".cfs")); -} - -//static -bool SegmentReader::hasSeparateNorms(SegmentInfo* si) -{ - QString pattern(si->name); - pattern.append(QLatin1String(".s")); - size_t patternLength = pattern.length(); - - QStringList names = si->getDir()->list(); - foreach (const QString& name, names) { - int length = name.length(); - if (length > patternLength && name.left(patternLength) == pattern) { - if (name.at(patternLength) >= QLatin1Char('0') - && name.at(patternLength) <= QLatin1Char('9')) { - return true; - } - } - } - return false; -} - -bool SegmentReader::hasDeletions(const SegmentInfo* si) -{ - //Func - Static method - // Checks if a segment managed by SegmentInfo si-> has deletions - //Pre - si-> holds a valid reference to an SegmentInfo instance - //Post - if the segement contains deleteions true is returned otherwise flas - - //Check if the deletion file exists and return the result - QString f; - Misc::segmentname(f, CL_MAX_PATH, si->name, QLatin1String(".del"), -1); - return si->getDir()->fileExists(f); -} - -//synchronized -void SegmentReader::doDelete(const int32_t docNum) -{ - //Func - Marks document docNum as deleted - //Pre - docNum >=0 and DocNum < maxDoc() - // docNum contains the number of the document that must be - // marked deleted - //Post - The document identified by docNum has been marked deleted - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CND_PRECONDITION(docNum >= 0, "docNum is a negative number"); - CND_PRECONDITION(docNum < maxDoc(), - "docNum is bigger than the total number of documents"); - - //Check if deletedDocs exists - if (deletedDocs == NULL) { - deletedDocs = _CLNEW BitSet(maxDoc()); - - //Condition check to see if deletedDocs points to a valid instance - CND_CONDITION(deletedDocs != NULL, - "No memory could be allocated for deletedDocs"); - } - //Flag that there are documents marked deleted - deletedDocsDirty = true; - undeleteAll = false; - //Mark document identified by docNum as deleted - deletedDocs->set(docNum); - -} - -void SegmentReader::doUndeleteAll() -{ - _CLDELETE(deletedDocs); - deletedDocsDirty = false; - undeleteAll = true; -} - -void SegmentReader::files(QStringList& retarray) -{ - //Func - Returns all file names managed by this SegmentReader - //Pre - segment != NULL - //Post - All filenames managed by this SegmentRead have been returned - - CND_PRECONDITION(segment != NULL, "segment is NULL"); - - QString temp; - #define _ADD_SEGMENT(ext) \ - temp = SegmentName(ext); \ - if (getDirectory()->fileExists(temp)) \ - retarray.push_back(temp); - - //Add the name of the Field Info file - _ADD_SEGMENT(QLatin1String(".cfs")); - _ADD_SEGMENT(QLatin1String(".fnm")); - _ADD_SEGMENT(QLatin1String(".fdx")); - _ADD_SEGMENT(QLatin1String(".fdt")); - _ADD_SEGMENT(QLatin1String(".tii")); - _ADD_SEGMENT(QLatin1String(".tis")); - _ADD_SEGMENT(QLatin1String(".frq")); - _ADD_SEGMENT(QLatin1String(".prx")); - _ADD_SEGMENT(QLatin1String(".del")); - _ADD_SEGMENT(QLatin1String(".tvx")); - _ADD_SEGMENT(QLatin1String(".tvd")); - _ADD_SEGMENT(QLatin1String(".tvf")); - _ADD_SEGMENT(QLatin1String(".tvp")); - - //iterate through the field infos - for (int32_t i = 0; i < fieldInfos->size(); ++i) { - //Get the field info for the i-th field - FieldInfo* fi = fieldInfos->fieldInfo(i); - //Check if the field has been indexed - if (fi->isIndexed && !fi->omitNorms) { - QString name; - if (cfsReader == NULL) - name = SegmentName(QLatin1String(".f"), i); - else - name = SegmentName(QLatin1String(".s"), i); - - //The field has been indexed so add its norm file - if (getDirectory()->fileExists(name)) - retarray.push_back(name); - } - } -} - -TermEnum* SegmentReader::terms() const -{ - //Func - Returns an enumeration of all the Terms and TermInfos in the set. - //Pre - tis != NULL - //Post - An enumeration of all the Terms and TermInfos in the set has been returned - - CND_PRECONDITION(tis != NULL, "tis is NULL"); - - return tis->terms(); -} - -TermEnum* SegmentReader::terms(const Term* t) const -{ - //Func - Returns an enumeration of terms starting at or after the named term t - //Pre - t != NULL - // tis != NULL - //Post - An enumeration of terms starting at or after the named term t - - CND_PRECONDITION(t != NULL, "t is NULL"); - CND_PRECONDITION(tis != NULL, "tis is NULL"); - - return tis->terms(t); -} - -bool SegmentReader::document(int32_t n, Document* doc) -{ - //Func - Returns a document identified by n - //Pre - n >=0 and identifies the document n - //Post - if the document has been deleted then an exception has been thrown - // otherwise a reference to the found document has been returned - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CND_PRECONDITION(n >= 0, "n is a negative number"); - - //Check if the n-th document has been marked deleted - if (isDeleted(n)) - _CLTHROWA(CL_ERR_InvalidState, "attempt to access a deleted document" ); - - //Retrieve the n-th document - return fieldsReader->doc(n, doc); -} - -bool SegmentReader::isDeleted(const int32_t n) -{ - //Func - Checks if the n-th document has been marked deleted - //Pre - n >=0 and identifies the document n - //Post - true has been returned if document n has been deleted otherwise fralse - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CND_PRECONDITION(n >= 0, "n is a negative number"); - - //Is document n deleted - return (deletedDocs != NULL && deletedDocs->get(n)); -} - -TermDocs* SegmentReader::termDocs() const -{ - //Func - Returns an unpositioned TermDocs enumerator. - //Pre - true - //Post - An unpositioned TermDocs enumerator has been returned - - return _CLNEW SegmentTermDocs(this); -} - -TermPositions* SegmentReader::termPositions() const -{ - //Func - Returns an unpositioned TermPositions enumerator. - //Pre - true - //Post - An unpositioned TermPositions enumerator has been returned - - return _CLNEW SegmentTermPositions(this); -} - -int32_t SegmentReader::docFreq(const Term* t) const -{ - //Func - Returns the number of documents which contain the term t - //Pre - t holds a valid reference to a Term - //Post - The number of documents which contain term t has been returned - - //Get the TermInfo ti for Term t in the set - TermInfo* ti = tis->get(t); - //Check if an TermInfo has been returned - if (ti) { - //Get the frequency of the term - int32_t ret = ti->docFreq; - //TermInfo ti is not needed anymore so delete it - _CLDELETE( ti ); - //return the number of documents which containt term t - return ret; - } - - //No TermInfo returned so return 0 - return 0; -} - -int32_t SegmentReader::numDocs() -{ - //Func - Returns the actual number of documents in the segment - //Pre - true - //Post - The actual number of documents in the segments - - //Get the number of all the documents in the segment including the ones that have - //been marked deleted - int32_t n = maxDoc(); - - //Check if there any deleted docs - if (deletedDocs != NULL) - //Substract the number of deleted docs from the number returned by maxDoc - n -= deletedDocs->count(); - - //return the actual number of documents in the segment - return n; -} - -int32_t SegmentReader::maxDoc() const -{ - //Func - Returns the number of all the documents in the segment including - // the ones that have been marked deleted - //Pre - true - //Post - The total number of documents in the segment has been returned - - return fieldsReader->size(); -} - -void SegmentReader::getFieldNames(FieldOption fldOption, - StringArrayWithDeletor& retarray) -{ - size_t len = fieldInfos->size(); - for (size_t i = 0; i < len; i++) { - bool v = false; - FieldInfo* fi = fieldInfos->fieldInfo(i); - if (fldOption & IndexReader::ALL) { - v = true; - } else { - if (!fi->isIndexed && (fldOption & IndexReader::UNINDEXED)) { - v = true; - } - - if (fi->isIndexed && (fldOption & IndexReader::INDEXED)) { - v = true; - } - - if (fi->isIndexed && fi->storeTermVector == false - && (fldOption & IndexReader::INDEXED_NO_TERMVECTOR)) { - v = true; - } - - if ((fldOption & IndexReader::TERMVECTOR) - && fi->storeTermVector == true - && fi->storePositionWithTermVector == false - && fi->storeOffsetWithTermVector == false) { - v = true; - } - - if (fi->isIndexed && fi->storeTermVector - && (fldOption & IndexReader::INDEXED_WITH_TERMVECTOR)) { - v = true; - } - - if (fi->storePositionWithTermVector - && fi->storeOffsetWithTermVector == false - && (fldOption & IndexReader::TERMVECTOR_WITH_POSITION)) { - v = true; - } - - if (fi->storeOffsetWithTermVector - && fi->storePositionWithTermVector == false - && (fldOption & IndexReader::TERMVECTOR_WITH_OFFSET)) { - v = true; - } - - if ((fi->storeOffsetWithTermVector && fi->storePositionWithTermVector) - && (fldOption & IndexReader::TERMVECTOR_WITH_POSITION_OFFSET)) { - v = true; - } - } - - if (v) - retarray.push_back(STRDUP_TtoT(fi->name)); - } -} - -bool SegmentReader::hasNorms(const TCHAR* field) const -{ - return _norms.find(field) != _norms.end(); -} - - -void SegmentReader::norms(const TCHAR* field, uint8_t* bytes) -{ - //Func - Reads the Norms for field from disk starting at offset in the inputstream - //Pre - field != NULL - // bytes != NULL is an array of bytes which is to be used to read the norms into. - // it is advisable to have bytes initalized by zeroes! - //Post - The if an inputstream to the norm file could be retrieved the bytes have been read - // You are never sure whether or not the norms have been read into bytes properly!!!!!!!!!!!!!!!!! - - CND_PRECONDITION(field != NULL, "field is NULL"); - CND_PRECONDITION(bytes != NULL, "field is NULL"); - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - Norm* norm = _norms.get(field); - if ( norm == NULL ){ - memcpy(bytes, fakeNorms(), maxDoc()); - return; - } - - if (norm->bytes != NULL) { // can copy from cache - memcpy(bytes, norm->bytes, maxDoc()); - return; - } - - IndexInput* _normStream = norm->in->clone(); - CND_PRECONDITION(_normStream != NULL, "normStream==NULL") - - // read from disk - try { - _normStream->seek(0); - _normStream->readBytes(bytes, maxDoc()); - } _CLFINALLY ( - //Have the normstream closed - _normStream->close(); - //Destroy the normstream - _CLDELETE( _normStream ); - ); -} - -uint8_t* SegmentReader::createFakeNorms(int32_t size) -{ - uint8_t* ones = _CL_NEWARRAY(uint8_t,size); - memset(ones, DefaultSimilarity::encodeNorm(1.0f), size); - return ones; -} - -uint8_t* SegmentReader::fakeNorms() -{ - if (ones == NULL) - ones = createFakeNorms(maxDoc()); - return ones; -} - -// can return null if norms aren't stored -uint8_t* SegmentReader::getNorms(const TCHAR* field) -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - Norm* norm = _norms.get(field); - if (norm == NULL) - return NULL; // not indexed, or norms not stored - - if (norm->bytes == NULL) { // value not yet read - uint8_t* bytes = _CL_NEWARRAY(uint8_t, maxDoc()); - norms(field, bytes); - norm->bytes = bytes; // cache it - } - return norm->bytes; -} - -uint8_t* SegmentReader::norms(const TCHAR* field) -{ - //Func - Returns the bytes array that holds the norms of a named field - //Pre - field != NULL and contains the name of the field for which the norms - // must be retrieved - //Post - If there was norm for the named field then a bytes array has been allocated - // and returned containing the norms for that field. If the named field is unknown NULL is returned. - - CND_PRECONDITION(field != NULL, "field is NULL"); - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - uint8_t* bytes = getNorms(field); - if (bytes == NULL) - bytes = fakeNorms(); - return bytes; -} - -void SegmentReader::doSetNorm(int32_t doc, const TCHAR* field, uint8_t value) -{ - Norm* norm = _norms.get(field); - if (norm == NULL) // not an indexed field - return; - - norm->dirty = true; // mark it dirty - normsDirty = true; - - uint8_t* bits = norms(field); - bits[doc] = value; // set the value -} - -QString SegmentReader::SegmentName(const QString& ext, const int32_t x) -{ - //Func - Returns an allocated buffer in which it creates a filename by - // concatenating segment with ext and x - //Pre ext != NULL and holds the extension - // x contains a number - //Post - A buffer has been instantiated an when x = -1 buffer contains the concatenation of - // segment and ext otherwise buffer contains the contentation of segment, ext and x - - CND_PRECONDITION(!ext.isEmpty(), "ext is NULL"); - - QString buf; - SegmentName(buf, CL_MAX_PATH, ext, x); - return buf; -} - -void SegmentReader::SegmentName(QString& buffer, int32_t bufferLen, - const QString& ext, const int32_t x) -{ - //Func - Creates a filename in buffer by concatenating segment with ext and x - //Pre - buffer != NULL - // ext != NULL - // x contains a number - //Post - When x = -1 buffer contains the concatenation of segment and ext otherwise - // buffer contains the contentation of segment, ext and x - - CND_PRECONDITION(!segment.isEmpty(), "Segment is NULL"); - - Misc::segmentname(buffer, bufferLen, segment, ext, x); -} - -void SegmentReader::openNorms(Directory* cfsDir) -{ - //Func - Open all norms files for all fields - // Creates for each field a norm Instance with an open inputstream to - // a corresponding norm file ready to be read - //Pre - true - //Post - For each field a norm instance has been created with an open inputstream to - // a corresponding norm file ready to be read - - //Iterate through all the fields - for (int32_t i = 0; i < fieldInfos->size(); i++) { - //Get the FieldInfo for the i-th field - FieldInfo* fi = fieldInfos->fieldInfo(i); - //Check if the field is indexed - if (fi->isIndexed && !fi->omitNorms ) { - //Allocate a buffer - QString fileName; - - // look first if there are separate norms in compound format - SegmentName(fileName, CL_MAX_PATH, QLatin1String(".s"), fi->number); - Directory* d = getDirectory(); - if(!d->fileExists(fileName)){ - SegmentName(fileName, CL_MAX_PATH, QLatin1String(".f"), fi->number); - d = cfsDir; - } - - _norms.put(fi->name, _CLNEW Norm(d->openInput(fileName), - fi->number, this, segment)); - } - } -} - -void SegmentReader::closeNorms() -{ - //Func - Close all the norms stored in norms - //Pre - true - //Post - All the norms have been destroyed - - SCOPED_LOCK_MUTEX(_norms.THIS_LOCK) - - //Create an interator initialized at the beginning of norms - NormsType::iterator itr = _norms.begin(); - //Iterate through all the norms - while (itr != _norms.end()) { - // Get, delete the norm - _CLDELETE(itr->second); - // Move the interator to the next norm in the norms collection. - // Note ++ is an overloaded operator - ++itr; - } - _norms.clear(); //bvk: they're deleted, so clear them so that they are not re-used -} - -TermVectorsReader* SegmentReader::getTermVectorsReader() -{ - TermVectorsReader* tvReader = termVectorsLocal.get(); - if (tvReader == NULL) { - tvReader = termVectorsReaderOrig->clone(); - termVectorsLocal.set(tvReader); - } - return tvReader; -} - -TermFreqVector* SegmentReader::getTermFreqVector(int32_t docNumber, - const TCHAR* field) -{ - if (field) { - FieldInfo* fi = fieldInfos->fieldInfo(field); - // Check if this field is invalid or has no stored term vector - if (fi == NULL || !fi->storeTermVector || termVectorsReaderOrig == NULL) - return NULL; - } - - TermVectorsReader* termVectorsReader = getTermVectorsReader(); - if (termVectorsReader == NULL) - return NULL; - - return termVectorsReader->get(docNumber, field); -} - -bool SegmentReader::getTermFreqVectors(int32_t docNumber, - Array& result) -{ - if (termVectorsReaderOrig == NULL) - return false; - - TermVectorsReader* termVectorsReader = getTermVectorsReader(); - if (termVectorsReader == NULL) - return false; - - return termVectorsReader->get(docNumber, result); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp b/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp deleted file mode 100644 index 50951e9ba..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SegmentHeader.h" - -#include "CLucene/store/IndexInput.h" -#include "Term.h" - -CL_NS_DEF(index) - - SegmentTermDocs::SegmentTermDocs(const SegmentReader* _parent){ - //Func - Constructor - //Pre - Paren != NULL - //Post - The instance has been created - - CND_PRECONDITION(_parent != NULL,"Parent is NULL"); - - parent = _parent; - deletedDocs = parent->deletedDocs; - - _doc = 0; - _freq = 0; - count = 0; - df = 0; - - skipInterval=0; - numSkips=0; - skipCount=0; - skipStream=NULL; - skipDoc=0; - freqPointer=0; - proxPointer=0; - skipPointer=0; - haveSkipped=false; - - freqStream = parent->freqStream->clone(); - skipInterval = parent->tis->getSkipInterval(); - } - - SegmentTermDocs::~SegmentTermDocs() { - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - close(); - } - - TermPositions* SegmentTermDocs::__asTermPositions(){ - return NULL; - } - - void SegmentTermDocs::seek(Term* term) { - TermInfo* ti = parent->tis->get(term); - seek(ti); - _CLDELETE(ti); - } - - void SegmentTermDocs::seek(TermEnum* termEnum){ - TermInfo* ti=NULL; - - // use comparison of fieldinfos to verify that termEnum belongs to the same segment as this SegmentTermDocs - if ( termEnum->getObjectName() == SegmentTermEnum::getClassName() ){ - SegmentTermEnum* te = (SegmentTermEnum*)termEnum; - te->fieldInfos = parent->fieldInfos; - ti = te->getTermInfo(); - }else{ - ti = parent->tis->get(termEnum->term(false)); - } - - seek(ti); - _CLDELETE(ti); - } - void SegmentTermDocs::seek(const TermInfo* ti) { - count = 0; - if (ti == NULL) { - df = 0; - } else { - df = ti->docFreq; - _doc = 0; - skipDoc = 0; - skipCount = 0; - numSkips = df / skipInterval; - freqPointer = ti->freqPointer; - proxPointer = ti->proxPointer; - skipPointer = freqPointer + ti->skipOffset; - freqStream->seek(freqPointer); - haveSkipped = false; - } - } - - void SegmentTermDocs::close() { - - //Check if freqStream still exists - if (freqStream != NULL){ - freqStream->close(); //todo: items like these can probably be delete, because deleting the object also closes it...do everywhere - _CLDELETE( freqStream ); - } - if (skipStream != NULL){ - skipStream->close(); - _CLDELETE( skipStream ); - } - } - - int32_t SegmentTermDocs::doc()const { - return _doc; - } - int32_t SegmentTermDocs::freq()const { - return _freq; - } - - -bool SegmentTermDocs::next() -{ - while (true) { - if (count == df) - return false; - - uint32_t docCode = freqStream->readVInt(); - _doc += docCode >> 1; //unsigned shift - if ((docCode & 1) != 0) // if low bit is set - _freq = 1; // _freq is one - else - _freq = freqStream->readVInt(); // else read _freq - count++; - - if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) - break; - skippingDoc(); - } - return true; -} - - -int32_t SegmentTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) -{ - int32_t i = 0; - // TODO: one optimization would be to get the pointer buffer for ram or mmap - // dirs and iterate over them instead of using readByte() intensive functions. - while (i < length && count < df) { - uint32_t docCode = freqStream->readVInt(); - _doc += docCode >> 1; - if ((docCode & 1) != 0) // if low bit is set - _freq = 1; // _freq is one - else - _freq = freqStream->readVInt(); // else read _freq - count++; - - if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) { - docs[i] = _doc; - freqs[i] = _freq; - i++; - } - } - return i; -} - - bool SegmentTermDocs::skipTo(const int32_t target){ - if (df >= skipInterval) { // optimized case - if (skipStream == NULL) - skipStream = freqStream->clone(); // lazily clone - - if (!haveSkipped) { // lazily seek skip stream - skipStream->seek(skipPointer); - haveSkipped = true; - } - - // scan skip data - int32_t lastSkipDoc = skipDoc; - int64_t lastFreqPointer = freqStream->getFilePointer(); - int64_t lastProxPointer = -1; - int32_t numSkipped = -1 - (count % skipInterval); - - while (target > skipDoc) { - lastSkipDoc = skipDoc; - lastFreqPointer = freqPointer; - lastProxPointer = proxPointer; - - if (skipDoc != 0 && skipDoc >= _doc) - numSkipped += skipInterval; - - if(skipCount >= numSkips) - break; - - skipDoc += skipStream->readVInt(); - freqPointer += skipStream->readVInt(); - proxPointer += skipStream->readVInt(); - - skipCount++; - } - - // if we found something to skip, then skip it - if (lastFreqPointer > freqStream->getFilePointer()) { - freqStream->seek(lastFreqPointer); - skipProx(lastProxPointer); - - _doc = lastSkipDoc; - count += numSkipped; - } - - } - - // done skipping, now just scan - - do { - if (!next()) - return false; - } while (target > _doc); - return true; - } - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp b/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp deleted file mode 100644 index 20e286fd1..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SegmentTermEnum.h" - -#include "Terms.h" -#include "FieldInfos.h" -#include "Term.h" -#include "TermInfo.h" -#include "TermInfosWriter.h" - -CL_NS_USE(store) -CL_NS_DEF(index) - - SegmentTermEnum::SegmentTermEnum(IndexInput* i, FieldInfos* fis, const bool isi): - fieldInfos(fis){ - //Func - Constructor - //Pre - i holds a reference to an instance of IndexInput - // fis holds a reference to an instance of FieldInfos - // isi - //Post - An instance of SegmentTermEnum has been created - input = i; - position = -1; - //Instantiate a Term with empty field, empty text and which is interned (see term.h what interned means) - _term = _CLNEW Term; - isIndex = isi; - termInfo = _CLNEW TermInfo(); - indexPointer = 0; - buffer = NULL; - bufferLength = 0; - prev = NULL; - formatM1SkipInterval = 0; - - //Set isClone to false as the instance is not clone of another instance - isClone = false; - - - int32_t firstInt = input->readInt(); - if (firstInt >= 0) { - // original-format file, without explicit format version number - format = 0; - size = firstInt; - - // back-compatible settings - indexInterval = 128; - skipInterval = LUCENE_INT32_MAX_SHOULDBE; // switch off skipTo optimization - - } else { - // we have a format version number - format = firstInt; - - // check that it is a format we can understand - if (format < TermInfosWriter::FORMAT){ - TCHAR err[30]; - _sntprintf(err,30,_T("Unknown format version: %d"), format); - _CLTHROWT(CL_ERR_Runtime,err); - } - - size = input->readLong(); // read the size - - if(format == -1){ - if (!isIndex) { - indexInterval = input->readInt(); - formatM1SkipInterval = input->readInt(); - } - // switch off skipTo optimization for file format prior to 1.4rc2 in order to avoid a bug in - // skipTo implementation of these versions - skipInterval = LUCENE_INT32_MAX_SHOULDBE; - }else{ - indexInterval = input->readInt(); - skipInterval = input->readInt(); - } - } - } - - SegmentTermEnum::SegmentTermEnum(const SegmentTermEnum& clone): - fieldInfos(clone.fieldInfos) - { - //Func - Constructor - // The instance is created by cloning all properties of clone - //Pre - clone holds a valid reference to SegmentTermEnum - //Post - An instance of SegmentTermEnum with the same properties as clone - - input = clone.input->clone(); - //Copy the postion from the clone - position = clone.position; - - if ( clone._term != NULL ){ - _term = _CLNEW Term; - _term->set(clone._term,clone._term->text()); - }else - _term = NULL; - isIndex = clone.isIndex; - termInfo = _CLNEW TermInfo(clone.termInfo); - indexPointer = clone.indexPointer; - buffer = clone.buffer==NULL?NULL:(TCHAR*)malloc(sizeof(TCHAR) * (clone.bufferLength+1)); - bufferLength = clone.bufferLength; - prev = clone.prev==NULL?NULL:_CLNEW Term(clone.prev->field(),clone.prev->text(),false); - size = clone.size; - - format = clone.format; - indexInterval= clone.indexInterval; - skipInterval = clone.skipInterval; - formatM1SkipInterval = clone.formatM1SkipInterval; - //Set isClone to true as this instance is a clone of another instance - isClone = true; - - //Copy the contents of buffer of clone to the buffer of this instance - if ( clone.buffer != NULL ) - memcpy(buffer,clone.buffer,bufferLength * sizeof(TCHAR)); - } - - SegmentTermEnum::~SegmentTermEnum(){ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed. If this instance was a clone - // then the inputstream is closed and deleted too. - - //todo: revisit this... close() should clean up most of everything. - - //Finalize prev - _CLDECDELETE(prev ); - //Finalize term - _CLDECDELETE( _term ); - - - //Delete the buffer if necessary - free(buffer); - //Delete termInfo if necessary - _CLDELETE(termInfo); - - //Check if this instance is a clone - if ( isClone ){ - //Close the inputstream - input->close(); - //delete the inputstream - _CLDELETE(input); - } - } - - bool SegmentTermEnum::next(){ - //Func - Moves the current of the set to the next in the set - //Pre - true - //Post - If the end has been reached NULL is returned otherwise the term has - // become the next Term in the enumeration - - //Increase position by and and check if the end has been reached - if (position++ >= size-1) { - //delete term - _CLDECDELETE(_term); - return false; - } - - //delete the previous enumerated term - Term* tmp=NULL; - if ( prev != NULL ){ - int32_t usage = prev->__cl_refcount; - if ( usage > 1 ){ - _CLDECDELETE(prev); //todo: tune other places try and delete its term - }else - tmp = prev; //we are going to re-use this term - } - //prev becomes the current enumerated term - prev = _term; - //term becomes the next term read from inputStream input - _term = readTerm(tmp); - - //Read docFreq, the number of documents which contain the term. - termInfo->docFreq = input->readVInt(); - //Read freqPointer, a pointer into the TermFreqs file (.frq) - termInfo->freqPointer += input->readVLong(); - - //Read proxPointer, a pointer into the TermPosition file (.prx). - termInfo->proxPointer += input->readVLong(); - - if(format == -1){ - // just read skipOffset in order to increment file pointer; - // value is never used since skipTo is switched off - if (!isIndex) { - if (termInfo->docFreq > formatM1SkipInterval) { - termInfo->skipOffset = input->readVInt(); - } - } - }else{ - if (termInfo->docFreq >= skipInterval) - termInfo->skipOffset = input->readVInt(); - } - - //Check if the enumeration is an index - if (isIndex) - //read index pointer - indexPointer += input->readVLong(); - - return true; - } - - Term* SegmentTermEnum::term() { - //Func - Returns the current term. - //Pre - pointer is true or false and indicates if the reference counter - // of term must be increased or not - // next() must have been called once! - //Post - pointer = true -> term has been returned with an increased reference counter - // pointer = false -> term has been returned - - return _CL_POINTER(_term); - } - Term* SegmentTermEnum::term(bool pointer) { - if ( pointer ) - return _CL_POINTER(_term); - else - return _term; - } - - void SegmentTermEnum::scanTo(const Term *term){ - //Func - Scan for Term without allocating new Terms - //Pre - term != NULL - //Post - The iterator term has been moved to the position where Term is expected to be - // in the enumeration - while ( term->compareTo(this->_term) > 0 && next()) - { - } - } - - void SegmentTermEnum::close() { - //Func - Closes the enumeration to further activity, freeing resources. - //Pre - true - //Post - The inputStream input has been closed - - input->close(); - } - - int32_t SegmentTermEnum::docFreq() const { - //Func - Returns the document frequency of the current term in the set - //Pre - termInfo != NULL - // next() must have been called once - //Post - The document frequency of the current enumerated term has been returned - - return termInfo->docFreq; - } - - void SegmentTermEnum::seek(const int64_t pointer, const int32_t p, Term* t, TermInfo* ti) { - //Func - Repositions term and termInfo within the enumeration - //Pre - pointer >= 0 - // p >= 0 and contains the new position within the enumeration - // t is a valid reference to a Term and is the new current term in the enumeration - // ti is a valid reference to a TermInfo and is corresponding TermInfo form the new - // current Term - //Post - term and terminfo have been repositioned within the enumeration - - //Reset the IndexInput input to pointer - input->seek(pointer); - //Assign the new position - position = p; - - //finalize the current term - if ( _term == NULL || _term->__cl_refcount > 1 ){ - _CLDECDELETE(_term); - //Get a pointer from t and increase the reference counter of t - _term = _CLNEW Term; //cannot use reference, because TermInfosReader uses non ref-counted array - } - _term->set(t,t->text()); - - //finalize prev - _CLDECDELETE(prev); - - //Change the current termInfo so it matches the new current term - termInfo->set(ti); - - //Have the buffer grown if needed - if ( bufferLength <= _term->textLength() ) - growBuffer(_term->textLength(), true ); // copy term text into buffer - else - _tcsncpy(buffer,_term->text(),bufferLength); //just copy the buffer - } - - TermInfo* SegmentTermEnum::getTermInfo()const { - //Func - Returns a clone of the current termInfo - //Pre - termInfo != NULL - // next() must have been called once - //Post - A clone of the current termInfo has been returned - - return _CLNEW TermInfo(*termInfo); //clone - } - - void SegmentTermEnum::getTermInfo(TermInfo* ti)const { - //Func - Retrieves a clone of termInfo through the reference ti - //Pre - ti contains a valid reference to TermInfo - // termInfo != NULL - // next() must have been called once - //Post - ti contains a clone of termInfo - - ti->set(termInfo); - } - - int64_t SegmentTermEnum::freqPointer()const { - //Func - Returns the freqpointer of the current termInfo - //Pre - termInfo != NULL - // next() must have been called once - //Post - The freqpointer of the current termInfo has been returned - - return termInfo->freqPointer; - } - - int64_t SegmentTermEnum::proxPointer()const { - //Func - Returns the proxPointer of the current termInfo - //Pre - termInfo != NULL - // next() must have been called once - //Post - the proxPointer of the current termInfo has been returned - - return termInfo->proxPointer; - } - - SegmentTermEnum* SegmentTermEnum::clone() const { - //Func - Returns a clone of this instance - //Pre - true - //Post - An clone of this instance has been returned - - return _CLNEW SegmentTermEnum(*this); - } - - Term* SegmentTermEnum::readTerm(Term* reuse) { - //Func - Reads the next term in the enumeration - //Pre - true - //Post - The next Term in the enumeration has been read and returned - - //Read the start position from the inputStream input - int32_t start = input->readVInt(); - //Read the length of term in the inputStream input - int32_t length = input->readVInt(); - - //Calculated the total lenght of bytes that buffer must be to contain the current - //chars in buffer and the new ones yet to be read - uint32_t totalLength = start + length; - - if (static_cast(bufferLength) < totalLength+1) - growBuffer(totalLength, false); - - //Read a length number of characters into the buffer from position start in the inputStream input - input->readChars(buffer, start, length); - //Null terminate the string - buffer[totalLength] = 0; - - //Return a new Term - int32_t field = input->readVInt(); - const TCHAR* fieldname = fieldInfos->fieldName(field); - if ( reuse == NULL ) - reuse = _CLNEW Term; - - reuse->set(fieldname, buffer, false); - return reuse; - } - - void SegmentTermEnum::growBuffer(const uint32_t length, bool force_copy) { - //Func - Instantiate a buffer of length length+1 - //Pre - length > 0 - //Post - pre(buffer) has been deleted with its contents. A new buffer - // has been allocated of length length+1 and the text of term has been copied - // to buffer - //todo: we could guess that we will need to re-grow this - //buffer a few times...so start off with a reasonable grow - //value... - if ( bufferLength > length ) - return; - - //Store the new bufferLength - if ( length - bufferLength < LUCENE_SEGMENTTERMENUM_GROWSIZE ) - bufferLength = length+LUCENE_SEGMENTTERMENUM_GROWSIZE; - else - bufferLength = length+1; - - bool copy = buffer==NULL; - - //Instantiate the new buffer + 1 is needed for terminator '\0' - if ( buffer == NULL ) - buffer = (TCHAR*)malloc(sizeof(TCHAR) * (bufferLength+1)); - else - buffer = (TCHAR*)realloc(buffer, sizeof(TCHAR) * (bufferLength+1)); - - if ( copy || force_copy){ - //Copy the text of term into buffer - _tcsncpy(buffer,_term->text(),bufferLength); - } - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h b/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h deleted file mode 100644 index 0d50103f3..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_SegmentTermEnum_ -#define _lucene_index_SegmentTermEnum_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Terms.h" -#include "FieldInfos.h" -#include "TermInfo.h" - -CL_NS_DEF(index) - -/** - * SegmentTermEnum is an enumeration of all Terms and TermInfos - */ -class SegmentTermEnum:public TermEnum{ -private: - Term* _term; ///points to the current Term in the enumeration - TermInfo* termInfo; ///points to the TermInfo matching the current Term in the enumeration - - bool isIndex; ///Indicates if the Segment is a an index - bool isClone; ///Indicates if SegmentTermEnum is an orignal instance or - ///a clone of another SegmentTermEnum - - TCHAR* buffer; ///The buffer that contains the data read from the Term Infos File - uint32_t bufferLength; ///Length of the buffer - - int32_t format; - int32_t formatM1SkipInterval; - - CL_NS(store)::IndexInput* input; ///The IndexInput that reads from the Term Infos File - FieldInfos* fieldInfos; ///contains the Field Infos for the segment - int64_t size; ///The size of the enumeration - int64_t position; ///The position of the current (term) in the enumeration - int64_t indexPointer; - Term* prev; ///The previous current - int32_t indexInterval; - int32_t skipInterval; - - friend class TermInfosReader; - friend class SegmentTermDocs; -protected: - - /** - * Constructor. - * The instance is created by cloning all properties of clone - */ - SegmentTermEnum( const SegmentTermEnum& clone); - -public: - ///Constructor - SegmentTermEnum(CL_NS(store)::IndexInput* i, FieldInfos* fis, const bool isi ); - - ///Destructor - ~SegmentTermEnum(); - - /** - * Moves the current of the set to the next in the set - */ - bool next(); - - /** - * Returns a pointer to the current term. - */ - Term* term(); - /** - * Returns the current term. - */ - Term* term(bool pointer); - - /** - * Scan for Term term without allocating new Terms - */ - void scanTo(const Term *term); - - /** - * Closes the enumeration to further activity, freeing resources. - */ - void close(); - - /** - * Returns the document frequency of the current term in the set - */ - int32_t docFreq() const; - - /** - * Repositions term and termInfo within the enumeration - */ - void seek(const int64_t pointer, const int32_t p, Term* t, TermInfo* ti); - - /** - * Returns a clone of the current termInfo - */ - TermInfo* getTermInfo()const; - - /** - * Retrieves a clone of termInfo through the reference ti - */ - void getTermInfo(TermInfo* ti)const; - - /** - * Returns the freqPointer from the current TermInfo in the enumeration. - */ - int64_t freqPointer() const; - - /** - * Returns the proxPointer from the current TermInfo in the enumeration. - */ - int64_t proxPointer() const; - - /** - * Returns a clone of this instance - */ - SegmentTermEnum* clone() const; - - const char* getObjectName(){ return SegmentTermEnum::getClassName(); } - static const char* getClassName(){ return "SegmentTermEnum"; } - -private: - /** - * Reads the next term in the enumeration - */ - Term* readTerm(Term* reuse); - /** - * Instantiate a buffer of length length+1 - */ - void growBuffer(const uint32_t length, bool force_copy); - -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp b/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp deleted file mode 100644 index e481838e9..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SegmentHeader.h" - -#include "Terms.h" - -CL_NS_USE(util) -CL_NS_DEF(index) - -SegmentTermPositions::SegmentTermPositions(const SegmentReader* _parent): - SegmentTermDocs(_parent){ -//Func - Constructor -//Pre - Parent != NULL -//Post - The instance has been created - - CND_PRECONDITION(_parent != NULL, "Parent is NULL"); - - proxStream = _parent->proxStream->clone(); - - CND_CONDITION(proxStream != NULL,"proxStream is NULL"); - - position = 0; - proxCount = 0; -} - -SegmentTermPositions::~SegmentTermPositions() { -//Func - Destructor -//Pre - true -//Post - The intance has been closed - close(); -} - -TermDocs* SegmentTermPositions::__asTermDocs(){ - return (TermDocs*) this; -} -TermPositions* SegmentTermPositions::__asTermPositions(){ - return (TermPositions*) this; -} - -void SegmentTermPositions::seek(const TermInfo* ti) { - SegmentTermDocs::seek(ti); - if (ti != NULL) - proxStream->seek(ti->proxPointer); - proxCount = 0; -} - -void SegmentTermPositions::close() { -//Func - Frees the resources -//Pre - true -//Post - The resources have been freed - - SegmentTermDocs::close(); - //Check if proxStream still exists - if(proxStream){ - proxStream->close(); - _CLDELETE( proxStream ); - } -} - -int32_t SegmentTermPositions::nextPosition() { - /* DSR:CL_BUG: Should raise exception if proxCount == 0 at the - ** beginning of this method, as in - ** if (--proxCount == 0) throw ...; - ** The JavaDocs for TermPositions.nextPosition declare this constraint, - ** but CLucene doesn't enforce it. */ - proxCount--; - return position += proxStream->readVInt(); -} - -bool SegmentTermPositions::next() { - for (int32_t f = proxCount; f > 0; f--) // skip unread positions - proxStream->readVInt(); - - if (SegmentTermDocs::next()) { // run super - proxCount = _freq; // note frequency - position = 0; // reset position - return true; - } - return false; -} - -int32_t SegmentTermPositions::read(int32_t* docs, int32_t* freqs, int32_t length) { - _CLTHROWA(CL_ERR_InvalidState,"TermPositions does not support processing multiple documents in one call. Use TermDocs instead."); -} - -void SegmentTermPositions::skippingDoc() { - for (int32_t f = _freq; f > 0; f--) // skip all positions - proxStream->readVInt(); -} - -void SegmentTermPositions::skipProx(int64_t proxPointer){ - proxStream->seek(proxPointer); - proxCount = 0; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp b/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp deleted file mode 100644 index 5e9ac3c3b..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "TermVector.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(index) - -Array SegmentTermPositionVector::EMPTY_TERM_POS; - -SegmentTermVector::SegmentTermVector(const TCHAR* field, TCHAR** terms, Array* termFreqs) { - this->field = STRDUP_TtoT(field); - this->terms = terms; - this->termsLen = -1; //lazily get the size of the terms - this->termFreqs = termFreqs; -} - -SegmentTermVector::~SegmentTermVector(){ - _CLDELETE_CARRAY(field); - _CLDELETE_CARRAY_ALL(terms); - - _CLDELETE_ARRAY(termFreqs->values); - _CLDELETE(termFreqs); -} -TermPositionVector* SegmentTermVector::__asTermPositionVector(){ - return NULL; -} - -const TCHAR* SegmentTermVector::getField() { -return field; -} - -TCHAR* SegmentTermVector::toString() const{ -StringBuffer sb; -sb.appendChar('{'); -sb.append(field); -sb.append(_T(": ")); - -int32_t i=0; -while ( terms && terms[i] != NULL ){ - if (i>0) - sb.append(_T(", ")); - sb.append(terms[i]); - sb.appendChar('/'); - - sb.appendInt((*termFreqs)[i]); -} -sb.appendChar('}'); -return sb.toString(); -} - -int32_t SegmentTermVector::size() { -if ( terms == NULL ) - return 0; - -if ( termsLen == -1 ){ - termsLen=0; - while ( terms[termsLen] != 0 ) - termsLen++; -} -return termsLen; -} - -const TCHAR** SegmentTermVector::getTerms() { - return (const TCHAR**)terms; -} - -const Array* SegmentTermVector::getTermFrequencies() { - return termFreqs; -} - -int32_t SegmentTermVector::binarySearch(TCHAR** a, const int32_t arraylen, const TCHAR* key) const -{ - int32_t low = 0; - int32_t hi = arraylen - 1; - int32_t mid = 0; - while (low <= hi) - { - mid = (low + hi) >> 1; - - int32_t c = _tcscmp(a[mid],key); - if (c==0) - return mid; - else if (c > 0) - hi = mid - 1; - else // This gets the insertion point right on the last loop. - low = ++mid; - } - return -mid - 1; -} - -int32_t SegmentTermVector::indexOf(const TCHAR* termText) { - if(terms == NULL) - return -1; - int32_t res = binarySearch(terms, size(), termText); - return res >= 0 ? res : -1; -} - -void SegmentTermVector::indexesOf(const TCHAR** termNumbers, const int32_t start, const int32_t len, Array& ret) { - // TODO: there must be a more efficient way of doing this. - // At least, we could advance the lower bound of the terms array - // as we find valid indexes. Also, it might be possible to leverage - // this even more by starting in the middle of the termNumbers array - // and thus dividing the terms array maybe in half with each found index. - ret.length = len; - ret.values = _CL_NEWARRAY(int32_t,len); - for (int32_t i=0; i* termFreqs, Array< Array >* positions, Array< Array >* offsets): - SegmentTermVector(field,terms,termFreqs) -{ - this->offsets = offsets; - this->positions = positions; -} - -SegmentTermPositionVector::~SegmentTermPositionVector(){ - if ( offsets ){ - for (size_t i=0;ilength;i++){ - if ( offsets->values != NULL ){ - Array& offs = offsets->values[i]; - for ( size_t j=0;jvalues); - _CLDELETE(offsets); - } - if ( positions ){ - for (size_t i=0;ilength;i++){ - if ( positions->values != NULL ){ - Array& pos = positions->values[i]; - for ( size_t j=0;jvalues); - _CLDELETE(positions); - } -} - -TermPositionVector* SegmentTermPositionVector::__asTermPositionVector(){ - return this; -} -/** -* Returns an array of TermVectorOffsetInfo in which the term is found. -* -* @param index The position in the array to get the offsets from -* @return An array of TermVectorOffsetInfo objects or the empty list -* @see org.apache.lucene.analysis.Token -*/ -Array* SegmentTermPositionVector::getOffsets(int32_t index) { - if(offsets == NULL) - return NULL; - if (index >=0 && index < offsets->length) - return &offsets->values[index]; - else - return &TermVectorOffsetInfo::EMPTY_OFFSET_INFO; -} - -/** -* Returns an array of positions in which the term is found. -* Terms are identified by the index at which its number appears in the -* term String array obtained from the indexOf method. -*/ -Array* SegmentTermPositionVector::getTermPositions(int32_t index) { - if(positions == NULL) - return NULL; - - if (index >=0 && index < positions->length) - return &positions->values[index]; - else - return &EMPTY_TERM_POS; -} -CL_NS_END - diff --git a/3rdparty/clucene/src/CLucene/index/Term.cpp b/3rdparty/clucene/src/CLucene/index/Term.cpp deleted file mode 100644 index 5ff7bb264..000000000 --- a/3rdparty/clucene/src/CLucene/index/Term.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ - -#include "CLucene/StdHeader.h" -#include "Term.h" -#include "CLucene/util/StringIntern.h" - -CL_NS_USE(util) -CL_NS_DEF(index) - -Term::Term() -{ - init(); -} - -Term::Term(const TCHAR* fld, const TCHAR* txt, bool internField) -{ - init(); - set(fld, txt, internField); -} - -Term::Term(const Term* fieldTerm, const TCHAR* txt) -{ - init(); - set(fieldTerm, txt); -} - -Term::Term(const TCHAR* fld, const TCHAR* txt) -{ - init(); - set(fld, txt); -} - -Term::~Term() -{ - if (internF) - CLStringIntern::unintern(_field); - _field = NULL; - -#ifndef LUCENE_TERM_TEXT_LENGTH - if (_text != LUCENE_BLANK_STRING) - _CLDELETE_CARRAY(_text); -#endif -} - -const TCHAR* Term::field() const -{ - return _field; -} - -const TCHAR* Term::text() const -{ - return _text; -} - -void Term::set(const Term* term, const TCHAR* txt) -{ - set(term->field(), txt, false); -} - -void Term::set(const TCHAR* fld, const TCHAR* txt,bool internField) -{ - CND_PRECONDITION(fld != NULL, "fld contains NULL"); - CND_PRECONDITION(txt != NULL, "txt contains NULL"); - - //save field for unintern later - const TCHAR* oldField = _field; - cachedHashCode = 0; - textLen = _tcslen(txt); - - //Delete text if it is the owner -#ifdef LUCENE_TERM_TEXT_LENGTH - if (textLen > LUCENE_TERM_TEXT_LENGTH) - textLen = LUCENE_TERM_TEXT_LENGTH; - - _tcsncpy(_text,txt,textLen+1); - _text[textLen]=0; -#else - //if the term text buffer is bigger than what we have - if (_text && textLen > textLenBuf) { - if (_text != LUCENE_BLANK_STRING) { - _CLDELETE_ARRAY(_text); - } else { - _text = NULL; - } - textLenBuf = 0; - } - - if (_text == LUCENE_BLANK_STRING) { - _text = LUCENE_BLANK_STRING; - } else if (_text == NULL) { - if (txt[0] == 0) { - //if the string is blank and we aren't re-using the buffer... - _text = LUCENE_BLANK_STRING; - } else { - //duplicate the text - _text = stringDuplicate(txt); - textLenBuf = textLen; - } - } else { - //re-use the buffer - _tcscpy(_text,txt); - } -#endif - - //Set Term Field - if (internField) { - _field = CLStringIntern::intern(fld CL_FILELINE); - } else { - _field = fld; - } - - //unintern old field after interning new one, - if (internF) - CLStringIntern::unintern(oldField); - internF = internField; - - CND_PRECONDITION(_tcscmp(fld, _field) == 0, "field not equal"); -} - -bool Term::equals(const Term* other) const -{ - if (cachedHashCode != 0 && other->cachedHashCode != 0 - && other->cachedHashCode != cachedHashCode) - return false; - - if (_field == other->_field) { - if (textLen == other->textLen) - return (_tcscmp(_text, other->_text) == 0); - return false; - } - - return false; -} - -size_t Term::hashCode() -{ - if (cachedHashCode == 0) - cachedHashCode = Misc::thashCode(_field) + Misc::thashCode(_text, textLen); - - return cachedHashCode; -} - -int32_t Term::compareTo(const Term* other) const -{ - //Check ret to see if text needs to be compared - if (_field == other->_field) - return _tcscmp(_text, other->_text); - - int32_t ret = _tcscmp(_field, other->_field); - if (ret == 0) - ret = _tcscmp(_text, other->_text); - return ret; -} - -TCHAR* Term::toString() const -{ - return CL_NS(util)::Misc::join(_field, _T(":"), _text); -} - -void Term::init() -{ - textLen = 0; - internF = false; - cachedHashCode = 0; - _field = LUCENE_BLANK_STRING; - -#ifdef LUCENE_TERM_TEXT_LENGTH - _text[0] = 0; -#else - _text = LUCENE_BLANK_STRING; - textLenBuf = 0; -#endif -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/Term.h b/3rdparty/clucene/src/CLucene/index/Term.h deleted file mode 100644 index 68eefd194..000000000 --- a/3rdparty/clucene/src/CLucene/index/Term.h +++ /dev/null @@ -1,146 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_Term_ -#define _lucene_index_Term_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/Misc.h" -#include "CLucene/util/StringIntern.h" - -CL_NS_DEF(index) - -/* -A Term represents a word from text. This is the unit of search. It is -composed of two elements, the text of the word, as a string, and the name of -the field that the text occured in, an interned string. - -Note that terms may represent more than words from text fields, but also -things like dates, email addresses, urls, etc. - -IMPORTANT NOTE: -Term inherits from the template class LUCENE_REFBASE which tries to do -some garbage collection by counting the references an instance has. As a result -of this construction you MUST use _CLDECDELETE(obj) when you want to delete an -of Term! - -ABOUT intrn - -intrn indicates if field and text are interned or not. Interning of Strings -is the process of converting duplicated strings to shared ones. - -*/ -class Term : LUCENE_REFBASE -{ -private: - const TCHAR* _field; - bool internF; // Indicates if Term Field is interned(and therefore must be uninternd). - size_t cachedHashCode; - size_t textLen; // a cache of text len, this allows for a preliminary comparison of text lengths - -#ifdef LUCENE_TERM_TEXT_LENGTH - TCHAR _text[LUCENE_TERM_TEXT_LENGTH + 1]; -#else - TCHAR* _text; - size_t textLenBuf; //a cache of text len, this allows for a preliminary comparison of text lengths -#endif - - void init(); -public: - - //uses the specified fieldTerm's field. this saves on intern'ing time. - Term(const Term* fieldTerm, const TCHAR* txt); - - ///Constructs a blank term - Term(); - - // TODO: need to be private, a few other things need to be changed first... - Term(const TCHAR* fld, const TCHAR* txt, bool internField); - - /** - * Constructor. Constructs a Term with the given field and text. Field and - * text are not copied Field and text are deleted in destructor only if - * intern is false. - */ - Term(const TCHAR* fld, const TCHAR* txt); - - ///Destructor. - ~Term(); - - ///Returns the field of this term, an interned string. The field indicates - ///the part of a document which this term came from. - const TCHAR* field() const; /// - TCHAR* toString() const; - - size_t hashCode(); - - class Equals:public CL_NS_STD(binary_function) - { - public: - bool operator()( const Term* val1, const Term* val2 ) const - { - return val1->equals(val2); - } - }; - - class Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base // - { - public: - bool operator()(Term* t1, Term* t2) const - { - return (t1->compareTo(t2) < 0); - } - - size_t operator()(Term* t) const - { - return t->hashCode(); - } - }; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/TermInfo.cpp b/3rdparty/clucene/src/CLucene/index/TermInfo.cpp deleted file mode 100644 index ac1107317..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermInfo.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ - -#include "CLucene/StdHeader.h" -#include "TermInfo.h" - -CL_NS_DEF(index) - -TermInfo::TermInfo() -{ - set(0, 0, 0, 0); -} - -TermInfo::~TermInfo() -{ -} - -TermInfo::TermInfo(int32_t df, int64_t fp, int64_t pp) -{ - set(df, fp, pp, 0); -} - -TermInfo::TermInfo(const TermInfo* ti) -{ - if (ti) - set(ti); -} - -void TermInfo::set(const TermInfo* ti) -{ - if (ti) - set(ti->docFreq, ti->freqPointer, ti->proxPointer, ti->skipOffset); -} - -void TermInfo::set(int32_t df, int64_t fp, int64_t pp, int32_t so) -{ - CND_PRECONDITION(df >= 0, "df contains negative number"); - CND_PRECONDITION(fp >= 0, "fp contains negative number"); - CND_PRECONDITION(pp >= 0, "pp contains negative number"); - - docFreq = df; - freqPointer = fp; - proxPointer = pp; - skipOffset = so; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/TermInfo.h b/3rdparty/clucene/src/CLucene/index/TermInfo.h deleted file mode 100644 index 57b7a9a76..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermInfo.h +++ /dev/null @@ -1,61 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_TermInfo -#define _lucene_index_TermInfo - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(index) - -// A TermInfo is the record of information stored for a term. -class TermInfo : LUCENE_BASE -{ -public: - // The number of documents which contain the term. - int32_t docFreq; - - //A pointer into the TermFreqs file (.frq) - //The .frq file contains the lists of documents which contain each term, - //along with the frequency of the term in that document. - int64_t freqPointer; - - //A pointer into the TermPosition file (.prx). - //The .prx file contains the lists of positions that each term - //occurs at within documents. - int64_t proxPointer; - - int32_t skipOffset; - - //Constructor - TermInfo(); - - //Constructor - TermInfo(int32_t df, int64_t fp, int64_t pp); - - //Constructor - //Initialises this instance by copying the values of another TermInfo ti - TermInfo(const TermInfo* ti); - - //Destructor - ~TermInfo(); - - //Sets a new document frequency, a new freqPointer and a new proxPointer - void set(int32_t docFreq, int64_t freqPointer, int64_t proxPointer, - int32_t skipOffset); - - //Sets a new document frequency, a new freqPointer and a new proxPointer - //by copying these values from another instance of TermInfo - void set(const TermInfo* ti); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp b/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp deleted file mode 100644 index 8f9e43dec..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "TermInfosReader.h" - -#include "CLucene/store/Directory.h" -#include "CLucene/util/Misc.h" -#include "FieldInfos.h" -#include "Term.h" -#include "Terms.h" -#include "TermInfo.h" -#include "TermInfosWriter.h" - -CL_NS_USE(store) -CL_NS_USE(util) -CL_NS_DEF(index) - -TermInfosReader::TermInfosReader(Directory* dir, const QString& seg, - FieldInfos* fis) - : directory(dir) - , fieldInfos (fis) -{ - //Func - Constructor. - // Reads the TermInfos file (.tis) and eventually the Term Info Index file (.tii) - //Pre - dir is a reference to a valid Directory - // Fis contains a valid reference to an FieldInfos instance - // seg != NULL and contains the name of the segment - //Post - An instance has been created and the index named seg has been read. (Remember - // a segment is nothing more then an independently readable index) - - CND_PRECONDITION(!seg.isEmpty(), "seg is NULL"); - - //Initialize the name of the segment - segment = seg; - //There are no indexTerms yet - indexTerms = NULL; - //So there are no indexInfos - indexInfos = NULL; - //So there are no indexPointers - indexPointers = NULL; - //Create a filname fo a Term Info File - QString tisFile = Misc::segmentname(segment, QLatin1String(".tis")); - QString tiiFile = Misc::segmentname(segment, QLatin1String(".tii")); - - //Create an SegmentTermEnum for storing all the terms read of the segment - origEnum = _CLNEW SegmentTermEnum( directory->openInput( tisFile ), fieldInfos, false); - indexEnum = _CLNEW SegmentTermEnum( directory->openInput( tiiFile ), fieldInfos, true); - - //Check if enumerator points to a valid instance - CND_CONDITION(origEnum != NULL, "No memory could be allocated for orig enumerator"); - CND_CONDITION(indexEnum != NULL, "No memory could be allocated for index enumerator"); - - //Get the size of the enumeration and store it in size - _size = origEnum->size; -} - -TermInfosReader::~TermInfosReader() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - //Close the TermInfosReader to be absolutly sure that enumerator has been closed - //and the arrays indexTerms, indexPointers and indexInfos and their elements - //have been destroyed - close(); -} - -void TermInfosReader::close() -{ - //Func - Close the enumeration of TermInfos - //Pre - true - //Post - The _enumeration has been closed and the arrays - - //Check if indexTerms and indexInfos exist - if (indexTerms && indexInfos){ - //Iterate through arrays indexTerms and indexPointer to - //destroy their elements -#ifdef _DEBUG - for (int32_t i = 0; i < indexTermsLength; ++i) { - if (indexTerms[i].__cl_refcount != 1) { - CND_PRECONDITION(indexTerms[i].__cl_refcount == 1, - "TermInfosReader term was references more than internally"); - } - // _CLDECDELETE(indexTerms[i]); - //_CLDELETE(indexInfos[i]); - } -#endif - //Delete the arrays - _CLDELETE_ARRAY(indexTerms); - _CLDELETE_ARRAY(indexInfos); - } - - //Delete the arrays - _CLDELETE_ARRAY(indexPointers); - - if (origEnum != NULL) { - origEnum->close(); - - //Get a pointer to IndexInput used by the enumeration but - //instantiated in the constructor by directory.open( tisFile ) - IndexInput *is = origEnum->input; - - //Delete the enumuration enumerator - _CLDELETE(origEnum); - - //Delete the IndexInput - _CLDELETE(is); - } - - if (indexEnum != NULL){ - indexEnum->close(); - - //Get a pointer to IndexInput used by the enumeration but - //instantiated in the constructor by directory.open( tiiFile ) - IndexInput *is = indexEnum->input; - - //Delete the enumuration enumerator - _CLDELETE(indexEnum); - - //Delete the IndexInput - _CLDELETE(is); - } -} - -int64_t TermInfosReader::size() const -{ - //Func - Return the size of the enumeration of TermInfos - //Pre - true - //Post - size has been returened - - return _size; -} - -Term* TermInfosReader::get(const int32_t position) -{ - //Func - Returns the nth term in the set - //Pre - position > = 0 - //Post - The n-th term in the set has been returned - - //Check if the size is 0 because then there are no terms - if (_size == 0) - return NULL; - - SegmentTermEnum* enumerator = getEnum(); - - if (enumerator != NULL //an enumeration exists - && enumerator->term(false) != NULL // term is at or past current - && position >= enumerator->position - && position < (enumerator->position + enumerator->indexInterval)) { - return scanEnum(position); // can avoid seek - } - - //random-access: must seek - seekEnum(position / enumerator->indexInterval); - - //Get the Term at position - return scanEnum(position); -} - -// TODO: currently there is no way of cleaning up a thread, if the thread ends. -// we are stuck with the terminfosreader of that thread. Hopefully this won't -// be too big a problem... solutions anyone? -SegmentTermEnum* TermInfosReader::getEnum() -{ - SegmentTermEnum* termEnum = enumerators.get(); - if (termEnum == NULL) { - termEnum = terms(); - enumerators.set(termEnum); - } - return termEnum; -} - -TermInfo* TermInfosReader::get(const Term* term) -{ - //Func - Returns a TermInfo for a term - //Pre - term holds a valid reference to term - //Post - if term can be found its TermInfo has been returned otherwise NULL - - //If the size of the enumeration is 0 then no Terms have been read - if (_size == 0) - return NULL; - - ensureIndexIsRead(); - - // optimize sequential access: first try scanning cached enum w/o seeking - SegmentTermEnum* enumerator = getEnum(); - - // optimize sequential access: first try scanning cached enumerator w/o seeking - // if the current term of the enumeration enumerator is not at the end - if (enumerator->term(false) != NULL - // AND there exists a previous current called prev and term is - // positioned after this prev - && ((enumerator->prev != NULL && term->compareTo(enumerator->prev) > 0) - // OR term is positioned at the same position as the current of - // enumerator or at a higher position - || term->compareTo(enumerator->term(false)) >= 0)) { - //Calculate the offset for the position - int32_t _enumOffset = (int32_t) - (enumerator->position / enumerator->indexInterval) + 1; - - // but before end of block the length of indexTerms (the number of - // terms in enumerator) equals _enum_offset - if (indexTermsLength == _enumOffset - // OR term is positioned in front of term found at _enumOffset in - // indexTerms - || term->compareTo(&indexTerms[_enumOffset]) < 0) { - //no need to seek, retrieve the TermInfo for term - return scanEnum(term); - } - } - - //Reposition current term in the enumeration - seekEnum(getIndexOffset(term)); - //Return the TermInfo for term - return scanEnum(term); -} - -int64_t TermInfosReader::getPosition(const Term* term) -{ - //Func - Returns the position of a Term in the set - //Pre - term holds a valid reference to a Term - // enumerator != NULL - //Post - If term was found then its position is returned otherwise -1 - - //if the enumeration is empty then return -1 - if (_size == 0) - return -1; - - ensureIndexIsRead(); - - //Retrieve the indexOffset for term - int32_t indexOffset = getIndexOffset(term); - seekEnum(indexOffset); - - SegmentTermEnum* enumerator = getEnum(); - - while(term->compareTo(enumerator->term(false)) > 0 && enumerator->next()) {} - - if (term->equals(enumerator->term(false))) - return enumerator->position; - - return -1; -} - -SegmentTermEnum* TermInfosReader::terms(const Term* term) -{ - //Func - Returns an enumeration of terms starting at or after the named term. - // If term is null then enumerator is set to the beginning - //Pre - term holds a valid reference to a Term - // enumerator != NULL - //Post - An enumeration of terms starting at or after the named term has been returned - - SegmentTermEnum* enumerator = NULL; - if (term != NULL) { - //Seek enumerator to term; delete the new TermInfo that's returned. - TermInfo* ti = get(term); - _CLDELETE(ti); - enumerator = getEnum(); - } else { - enumerator = origEnum; - } - //Clone the entire enumeration - SegmentTermEnum* cln = enumerator->clone(); - - //Check if cln points to a valid instance - CND_CONDITION(cln != NULL, "cln is NULL"); - - return cln; -} - -void TermInfosReader::ensureIndexIsRead() -{ - //Func - Reads the term info index file or .tti file. - // This file contains every IndexInterval-th entry from the .tis file, - // along with its location in the "tis" file. This is designed to be - // read entirely into memory and used to provide random access to the - // "tis" file. - //Pre - indexTerms = NULL - // indexInfos = NULL - // indexPointers = NULL - //Post - The term info index file has been read into memory - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - if ( indexTerms != NULL ) - return; - - try { - indexTermsLength = (size_t)indexEnum->size; - - // Instantiate an block of Term's,so that each one doesn't have to be new'd - indexTerms = _CL_NEWARRAY(Term,indexTermsLength); - - // Check if is indexTerms is a valid array - CND_CONDITION(indexTerms != NULL, - "No memory could be allocated for indexTerms"); - - // Instantiate an big block of TermInfo's, so that each one doesn't - // have to be new'd - indexInfos = _CL_NEWARRAY(TermInfo,indexTermsLength); - - // Check if is indexInfos is a valid array - CND_CONDITION(indexInfos != NULL, - "No memory could be allocated for indexInfos"); - - // Instantiate an array indexPointers that contains pointers to the - // term info index file - indexPointers = _CL_NEWARRAY(int64_t,indexTermsLength); - - // Check if is indexPointers is a valid array - CND_CONDITION(indexPointers != NULL, - "No memory could be allocated for indexPointers"); - - //Iterate through the terms of indexEnum - for (int32_t i = 0; indexEnum->next(); ++i) { - indexTerms[i].set(indexEnum->term(false), indexEnum->term(false)->text()); - indexEnum->getTermInfo(&indexInfos[i]); - indexPointers[i] = indexEnum->indexPointer; - } - } _CLFINALLY ( - indexEnum->close(); - // Close and delete the IndexInput is. The close is done by the destructor. - _CLDELETE( indexEnum->input ); - _CLDELETE( indexEnum ); - ); -} - -int32_t TermInfosReader::getIndexOffset(const Term* term) -{ - //Func - Returns the offset of the greatest index entry which is less than - // or equal to term. - //Pre - term holds a reference to a valid term - // indexTerms != NULL - //Post - The new offset has been returned - - //Check if is indexTerms is a valid array - CND_PRECONDITION(indexTerms != NULL, "indexTerms is NULL"); - - int32_t lo = 0; - int32_t hi = indexTermsLength - 1; - int32_t mid; - int32_t delta; - - while (hi >= lo) { - //Start in the middle betwee hi and lo - mid = (lo + hi) >> 1; - - //Check if is indexTerms[mid] is a valid instance of Term - CND_PRECONDITION(&indexTerms[mid] != NULL, "indexTerms[mid] is NULL"); - CND_PRECONDITION(mid < indexTermsLength, "mid >= indexTermsLength"); - - //Determine if term is before mid or after mid - delta = term->compareTo(&indexTerms[mid]); - if (delta < 0) { - //Calculate the new hi - hi = mid - 1; - } else if (delta > 0) { - //Calculate the new lo - lo = mid + 1; - } else { - //term has been found so return its position - return mid; - } - } - // the new starting offset - return hi; -} - -void TermInfosReader::seekEnum(const int32_t indexOffset) -{ - //Func - Reposition the current Term and TermInfo to indexOffset - //Pre - indexOffset >= 0 - // indexTerms != NULL - // indexInfos != NULL - // indexPointers != NULL - //Post - The current Term and Terminfo have been repositioned to indexOffset - - CND_PRECONDITION(indexOffset >= 0, "indexOffset contains a negative number"); - CND_PRECONDITION(indexTerms != NULL, "indexTerms is NULL"); - CND_PRECONDITION(indexInfos != NULL, "indexInfos is NULL"); - CND_PRECONDITION(indexPointers != NULL, "indexPointers is NULL"); - - SegmentTermEnum* enumerator = getEnum(); - enumerator->seek(indexPointers[indexOffset], - (indexOffset * enumerator->indexInterval) - 1, - &indexTerms[indexOffset], &indexInfos[indexOffset]); -} - -TermInfo* TermInfosReader::scanEnum(const Term* term) -{ - //Func - Scans the Enumeration of terms for term and returns the - // corresponding TermInfo instance if found. The search is started - // from the current term. - //Pre - term contains a valid reference to a Term - // enumerator != NULL - //Post - if term has been found the corresponding TermInfo has been returned - // otherwise NULL has been returned - - SegmentTermEnum* enumerator = getEnum(); - enumerator->scanTo(term); - - //Check if the at the position the Term term can be found - if (enumerator->term(false) != NULL && term->equals(enumerator->term(false))) { - //Return the TermInfo instance about term - return enumerator->getTermInfo(); - } - - //term was not found so no TermInfo can be returned - return NULL; -} - -Term* TermInfosReader::scanEnum(const int32_t position) -{ - //Func - Scans the enumeration to the requested position and returns the - // Term located at that position - //Pre - position > = 0 - // enumerator != NULL - //Post - The Term at the requested position has been returned - - SegmentTermEnum* enumerator = getEnum(); - - // As long the position of the enumeration enumerator is smaller than the - // requested one - while(enumerator->position < position) { - //Move the current of enumerator to the next - if (!enumerator->next()) { - //If there is no next it means that the requested position was to big - return NULL; - } - } - - //Return the Term a the requested position - return enumerator->term(); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/TermInfosReader.h b/3rdparty/clucene/src/CLucene/index/TermInfosReader.h deleted file mode 100644 index ed202e750..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermInfosReader.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_TermInfosReader_ -#define _lucene_index_TermInfosReader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/util/ThreadLocal.h" -#include "SegmentTermEnum.h" - -CL_NS_DEF(index) - -class FieldInfos; -class Term; -class TermInfo; -class TermInfos; -class TermInfosWriter; - -// PORT STATUS: 365707 (jlucene 1.9) -// This stores a monotonically increasing set of pairs in a -// Directory. Pairs are accessed either by Term or by ordinal position the set. -class TermInfosReader : LUCENE_BASE -{ -private: - CL_NS(store)::Directory* directory; - QString segment; - FieldInfos* fieldInfos; - - CL_NS(util)::ThreadLocal > enumerators; - - SegmentTermEnum* getEnum(); - SegmentTermEnum* origEnum; - SegmentTermEnum* indexEnum; - int64_t _size; - - Term* indexTerms; - int32_t indexTermsLength; - TermInfo* indexInfos; - int64_t* indexPointers; - - DEFINE_MUTEX(THIS_LOCK) - -public: - // Reads the TermInfos file(.tis) and eventually the Term Info Index(.tii) - TermInfosReader(CL_NS(store)::Directory* dir, const QString& segment, - FieldInfos* fis); - ~TermInfosReader(); - - //Close the enumeration of TermInfos - void close(); - - //Return the size of the enumeration of TermInfos - int64_t size() const; - - int32_t getSkipInterval() { - return origEnum->skipInterval; } - - // Returns an enumeration of terms starting at or after the named term. - // If no term is specified, an enumeration of all the Terms - // and TermInfos in the set is returned. - SegmentTermEnum* terms(const Term* term = NULL); - - // Returns the TermInfo for a Term in the set - // synchronized - TermInfo* get(const Term* term); - -private: - // Reads the term info index file or .tti file. - void ensureIndexIsRead(); - - // Returns the offset of the greatest index entry which is less than term. - int32_t getIndexOffset(const Term* term); - - // Reposition the current Term and TermInfo to indexOffset - void seekEnum(const int32_t indexOffset); - - // Scans the Enumeration of terms for term and returns the corresponding - // TermInfo instance if found. The search is started from the current term. - TermInfo* scanEnum(const Term* term); - - // Scans the enumeration to the requested position and returns the Term - // located at that position - Term* scanEnum(const int32_t position); - - // Returns the position of a Term in the set. synchronized - int64_t getPosition(const Term* term); - - // Returns the nth term in the set. synchronized - Term* get(const int32_t position); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp b/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp deleted file mode 100644 index c5b5340c3..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "TermInfosWriter.h" - -#include "CLucene/store/Directory.h" -#include "CLucene/util/Misc.h" -#include "FieldInfos.h" -#include "Term.h" -#include "TermInfo.h" -#include "IndexWriter.h" - -CL_NS_USE(util) -CL_NS_USE(store) -CL_NS_DEF(index) - -TermInfosWriter::TermInfosWriter(Directory* directory, const QString& segment, - FieldInfos* fis, int32_t interval) - : fieldInfos(fis) -{ - //Func - Constructor - //Pre - directory contains a valid reference to a Directory - // segment != NULL - // fis contains a valid reference to a reference FieldInfos - //Post - The instance has been created - - CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); - //Initialize instance - initialise(directory, segment, interval, false); - - other = _CLNEW TermInfosWriter(directory, segment, fieldInfos, interval, true); - - CND_CONDITION(other != NULL, "other is NULL"); - - other->other = this; -} - -TermInfosWriter::TermInfosWriter(Directory* directory, const QString& segment, - FieldInfos* fis, int32_t interval, bool isIndex) - : fieldInfos(fis) -{ - //Func - Constructor - //Pre - directory contains a valid reference to a Directory - // segment != NULL - // fis contains a valid reference to a reference FieldInfos - // isIndex is true or false - //Post - The instance has been created - - CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); - initialise(directory, segment, interval, isIndex); -} - -void TermInfosWriter::initialise(Directory* directory, const QString& segment, - int32_t interval, bool IsIndex) -{ - //Func - Helps constructors to initialize Instance - //Pre - directory contains a valid reference to a Directory - // segment != NULL - // fis contains a valid reference to a reference FieldInfos - //Post - The instance has been initialized - - lastTerm = _CLNEW Term; - - CND_CONDITION(lastTerm != NULL, "Could not allocate memory for lastTerm"); - - lastTi = _CLNEW TermInfo(); - - CND_CONDITION(lastTi != NULL, "Could not allocate memory for lastTi"); - - lastIndexPointer = 0; - size = 0; - isIndex = IsIndex; - indexInterval = interval; - skipInterval = LUCENE_DEFAULT_TERMDOCS_SKIP_INTERVAL; - - QString buf = Misc::segmentname(segment, QLatin1String(isIndex ? ".tii" : ".tis")); - output = directory->createOutput(buf); - - output->writeInt(FORMAT); // write format - output->writeLong(0); // leave space for size - output->writeInt(indexInterval);// write indexInterval - output->writeInt(skipInterval); // write skipInterval - - //Set other to NULL by Default - other = NULL; -} - -TermInfosWriter::~TermInfosWriter() -{ - //Func - Destructor - //Pre - true - //Post - de instance has been destroyed - - close(); -} - -void TermInfosWriter::add(Term* term, const TermInfo* ti) -{ - //Func - Writes a Term and TermInfo to the outputstream - //Pre - Term must be lexicographically greater than all previous Terms added. - // Pointers of TermInfo ti (freqPointer and proxPointer) must be - // positive and greater than all previous. - - CND_PRECONDITION(isIndex || (!isIndex && term->compareTo(lastTerm) > 0),"term out of order"); - CND_PRECONDITION(ti->freqPointer >= lastTi->freqPointer,"freqPointer out of order"); - CND_PRECONDITION(ti->proxPointer >= lastTi->proxPointer,"proxPointer out of order"); - - if (!isIndex && size % indexInterval == 0) { - //add an index term - other->add(lastTerm, lastTi); - } - - //write term - writeTerm(term); - // write doc freq - output->writeVInt(ti->docFreq); - //write pointers - output->writeVLong(ti->freqPointer - lastTi->freqPointer); - output->writeVLong(ti->proxPointer - lastTi->proxPointer); - if (ti->docFreq >= skipInterval) { - output->writeVInt(ti->skipOffset); - } - - if (isIndex){ - output->writeVLong(other->output->getFilePointer() - lastIndexPointer); - lastIndexPointer = other->output->getFilePointer(); // write pointer - } - - lastTi->set(ti); - size++; -} - -void TermInfosWriter::close() { - //Func - Closes the TermInfosWriter - //Pre - true - //Post - The TermInfosWriter has been closed - - if (output){ - //write size at start - output->seek(4); // write size after format - output->writeLong(size); - output->close(); - _CLDELETE(output); - - if (!isIndex){ - if(other){ - other->close(); - _CLDELETE( other ); - } - } - _CLDECDELETE(lastTerm); - - _CLDELETE(lastTi); - } -} - -void TermInfosWriter::writeTerm(Term* term) -{ - int32_t start = Misc::stringDifference(lastTerm->text(),lastTerm->textLength(), - term->text(),term->textLength()); - int32_t length = term->textLength() - start; - - output->writeVInt(start); // write shared prefix length - output->writeVInt(length); // write delta length - output->writeChars(term->text(), start, length); // write delta chars - - int32_t fieldnum = fieldInfos->fieldNumber(term->field()); - CND_PRECONDITION(fieldnum>=-1&&fieldnumsize(),"Fieldnum is out of range"); - output->writeVInt(fieldnum); // write field num - - if ( lastTerm->__cl_refcount == 1 ){ - lastTerm->set(term,term->text()); - }else{ - _CLDECDELETE(lastTerm); - lastTerm = _CL_POINTER(term); - } -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h b/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h deleted file mode 100644 index 7e3c68699..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_TermInfosWriter_ -#define _lucene_index_TermInfosWriter_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "FieldInfos.h" -#include "TermInfo.h" -#include "Term.h" - -CL_NS_DEF(index) - - -// This stores a monotonically increasing set of pairs in a -// Directory. A TermInfos can be written once, in order. -class TermInfosWriter : LUCENE_BASE -{ -private: - FieldInfos* fieldInfos; - CL_NS(store)::IndexOutput* output; - Term* lastTerm; - TermInfo* lastTi; - int64_t size; - int64_t lastIndexPointer; - bool isIndex; - TermInfosWriter* other; - - //inititalize - TermInfosWriter(CL_NS(store)::Directory* directory, - const QString& segment, FieldInfos* fis, int32_t interval, bool isIndex); -public: - /** The file format version, a negative number. */ - LUCENE_STATIC_CONSTANT(int32_t,FORMAT=-2); - - /** - * Expert: The fraction of terms in the "dictionary" which should be stored - * in RAM. Smaller values use more memory, but make searching slightly - * faster, while larger values use less memory and make searching slightly - * slower. Searching is typically not dominated by dictionary lookup, so - * tweaking this is rarely useful. - */ - int32_t indexInterval;// = 128 - - /** - * Expert: The fraction of {@link TermDocs} entries stored in skip tables, - * used to accellerate {@link TermDocs#SkipTo(int32_t)}. Larger values result in - * smaller indexes, greater acceleration, but fewer accelerable cases, while - * smaller values result in bigger indexes, less acceleration and more - * accelerable cases. More detailed experiments would be useful here. - */ - int32_t skipInterval;// = 16 - - TermInfosWriter(CL_NS(store)::Directory* directory, - const QString& segment, FieldInfos* fis, int32_t interval); - - ~TermInfosWriter(); - - /** - * Adds a new pair to the set. - * Term must be lexicographically greater than all previous Terms added. - * TermInfo pointers must be positive and greater than all previous. - */ - void add(Term* term, const TermInfo* ti); - - /** Called to complete TermInfos creation. */ - void close(); - -private: - /** Helps constructors to initialize instances */ - void initialise(CL_NS(store)::Directory* directory, - const QString& segment, int32_t interval, bool IsIndex); - void writeTerm(Term* term); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/TermVector.h b/3rdparty/clucene/src/CLucene/index/TermVector.h deleted file mode 100644 index 8601fbf53..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermVector.h +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_index_termvector_h -#define _lucene_index_termvector_h - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" -#include "CLucene/store/IndexOutput.h" -#include "FieldInfos.h" - -CL_NS_DEF(index) - -struct TermVectorOffsetInfo; -class TermPositionVector; - -// Provides access to stored term vector of a document field. -class TermFreqVector : LUCENE_BASE -{ -public: - virtual ~TermFreqVector() {} - - // @return The field this vector is associated with. - virtual const TCHAR* getField() = 0; - - // @return The number of terms in the term vector. - virtual int32_t size() = 0; - - // @return An Array of term texts in ascending order. - virtual const TCHAR** getTerms() = 0; - - - /* Array of term frequencies. Locations of the array correspond one to one - * to the terms in the array obtained from getTerms - * method. Each location in the array contains the number of times this - * term occurs in the document or the document field. - * - * The size of the returned array is size() - * @memory Returning a pointer to internal data. Do not delete. - */ - virtual const Array* getTermFrequencies() = 0; - - - /* Return an index in the term numbers array returned from - * getTerms at which the term with the specified - * term appears. If this term does not appear in the array, - * return -1. - */ - virtual int32_t indexOf(const TCHAR* term) = 0; - - - /* Just like indexOf(int32_t) but searches for a number of terms - * at the same time. Returns an array that has the same size as the number - * of terms searched for, each slot containing the result of searching for - * that term number. - * - * @param terms array containing terms to look for - * @param start index in the array where the list of terms starts - * @param len the number of terms in the list - */ - virtual void indexesOf(const TCHAR** terms, const int32_t start, - const int32_t len, Array& ret) = 0; - - // Solve the diamond inheritence problem by providing a reinterpret function. - // No dynamic casting is required and no RTTI data is needed to do this - virtual TermPositionVector* __asTermPositionVector() = 0; -}; - - -/** -* Writer works by opening a document and then opening the fields within the document and then -* writing out the vectors for each field. -* -* Rough usage: -* - -for each document -{ -writer.openDocument(); -for each field on the document -{ -writer.openField(field); -for all of the terms -{ -writer.addTerm(...) -} -writer.closeField -} -writer.closeDocument() -} - -*/ -class TermVectorsWriter : LUCENE_BASE -{ -private: - class TVField : LUCENE_BASE - { - public: - int32_t number; - int64_t tvfPointer; - int32_t length; // number of distinct term positions - bool storePositions; - bool storeOffsets; - - TVField(int32_t number, bool storePos, bool storeOff) - : tvfPointer(0) - , length(0) - { - this->number = number; - this->storePositions = storePos; - this->storeOffsets = storeOff; - } - ~TVField() {} - }; - - class TVTerm : LUCENE_BASE - { - const TCHAR* termText; - int32_t termTextLen; //textlen cache - - public: - TVTerm(); - ~TVTerm(); - - int32_t freq; - Array* positions; - Array* offsets; - - const TCHAR* getTermText() const; - size_t getTermTextLen(); - void setTermText(const TCHAR* val); - }; - - CL_NS(store)::IndexOutput* tvx, *tvd, *tvf; - CL_NS(util)::CLVector > fields; - CL_NS(util)::CLVector > terms; - FieldInfos* fieldInfos; - - TVField* currentField; - int64_t currentDocPointer; - - void addTermInternal(const TCHAR* termText, const int32_t freq, - Array* positions, Array* offsets); - - void writeField(); - void writeDoc(); - - void openField(int32_t fieldNumber, bool storePositionWithTermVector, - bool storeOffsetWithTermVector); - -public: - LUCENE_STATIC_CONSTANT(int32_t, FORMAT_VERSION = 2); - - // The size in bytes that the FORMAT_VERSION will take up at the beginning - // of each file - LUCENE_STATIC_CONSTANT(int32_t, FORMAT_SIZE = 4); - - LUCENE_STATIC_CONSTANT(uint8_t, STORE_POSITIONS_WITH_TERMVECTOR = 0x1); - LUCENE_STATIC_CONSTANT(uint8_t, STORE_OFFSET_WITH_TERMVECTOR = 0x2); - - static const QLatin1String LUCENE_TVX_EXTENSION; - static const QLatin1String LUCENE_TVD_EXTENSION; - static const QLatin1String LUCENE_TVF_EXTENSION; - - TermVectorsWriter(CL_NS(store)::Directory* directory, const QString& segment, - FieldInfos* fieldInfos); - - ~TermVectorsWriter(); - void openDocument(); - void closeDocument(); - - /** Close all streams. */ - void close(); - bool isDocumentOpen() const; - - /** Start processing a field. This can be followed by a number of calls to - * addTerm, and a final call to closeField to indicate the end of - * processing of this field. If a field was previously open, it is - * closed automatically. - */ - void openField(const TCHAR* field); - - /** Finished processing current field. This should be followed by a call to - * openField before future calls to addTerm. - */ - void closeField(); - - /** Return true if a field is currently open. */ - bool isFieldOpen() const; - - /** - * Add a complete document specified by all its term vectors. If document has no - * term vectors, add value for tvx. - * - * @param vectors - * @throws IOException - */ - void addAllDocVectors(Array& vectors); - - /** Add term to the field's term vector. Field must already be open. - * Terms should be added in - * increasing order of terms, one call per unique termNum. ProxPointer - * is a pointer into the TermPosition file (prx). Freq is the number of - * times this term appears in this field, in this document. - * @throws IllegalStateException if document or field is not open - */ - void addTerm(const TCHAR* termText, int32_t freq, - Array* positions = NULL, Array* offsets = NULL); -}; - -class SegmentTermVector : public virtual TermFreqVector -{ -private: - const TCHAR* field; - TCHAR** terms; - int32_t termsLen; //cache - Array* termFreqs; - - int32_t binarySearch(TCHAR** a, const int32_t arraylen, const TCHAR* key) const; -public: - //note: termFreqs must be the same length as terms - SegmentTermVector(const TCHAR* field, TCHAR** terms, Array* termFreqs); - virtual ~SegmentTermVector(); - - /** - * - * @return The number of the field this vector is associated with - */ - const TCHAR* getField(); - TCHAR* toString() const; - int32_t size(); - const TCHAR** getTerms(); - const Array* getTermFrequencies(); - int32_t indexOf(const TCHAR* termText); - void indexesOf(const TCHAR** termNumbers, const int32_t start, const int32_t len, Array& ret); - - virtual TermPositionVector* __asTermPositionVector(); -}; - -class TermVectorsReader : LUCENE_BASE -{ -private: - FieldInfos* fieldInfos; - - CL_NS(store)::IndexInput* tvx; - CL_NS(store)::IndexInput* tvd; - CL_NS(store)::IndexInput* tvf; - int64_t _size; - - int32_t tvdFormat; - int32_t tvfFormat; - - - int32_t checkValidFormat(CL_NS(store)::IndexInput* in); - - void readTermVectors(const TCHAR** fields, const int64_t* tvfPointers, - const int32_t len, Array& _return); - - /** - * - * @param field The field to read in - * @param tvfPointer The pointer within the tvf file where we should start reading - * @return The TermVector located at that position - * @throws IOException - */ - SegmentTermVector* readTermVector(const TCHAR* field, const int64_t tvfPointer); - - int64_t size(); - - - DEFINE_MUTEX(THIS_LOCK) - TermVectorsReader(const TermVectorsReader& copy); -public: - TermVectorsReader(CL_NS(store)::Directory* d, const QString& segment, - FieldInfos* fieldInfos); - ~TermVectorsReader(); - - void close(); - TermVectorsReader* clone() const; - - /** - * Retrieve the term vector for the given document and field - * @param docNum The document number to retrieve the vector for - * @param field The field within the document to retrieve - * @return The TermFreqVector for the document and field or null if there is no termVector for this field. - * @throws IOException if there is an error reading the term vector files - */ - TermFreqVector* get(const int32_t docNum, const TCHAR* field); - - - /** - * Return all term vectors stored for this document or null if the could not be read in. - * - * @param docNum The document number to retrieve the vector for - * @return All term frequency vectors - * @throws IOException if there is an error reading the term vector files - */ - bool get(int32_t docNum, Array& result); -}; - - -struct TermVectorOffsetInfo -{ - int startOffset; - int endOffset; - -public: - static Array EMPTY_OFFSET_INFO; - TermVectorOffsetInfo(); - ~TermVectorOffsetInfo(); - TermVectorOffsetInfo(int32_t startOffset, int32_t endOffset); - int32_t getEndOffset() const; - void setEndOffset(int32_t endOffset); - int32_t getStartOffset() const; - void setStartOffset(int32_t startOffset); - bool equals(TermVectorOffsetInfo* o); - size_t hashCode() const; -}; - - -/* Extends TermFreqVector to provide additional information about - * positions in which each of the terms is found. A TermPositionVector not - * necessarily contains both positions and offsets, but at least one of these - * arrays exists. -*/ -class TermPositionVector : public virtual TermFreqVector -{ -public: - - /** Returns an array of positions in which the term is found. - * Terms are identified by the index at which its number appears in the - * term String array obtained from the indexOf method. - * May return null if positions have not been stored. - */ - virtual Array* getTermPositions(int32_t index) = 0; - - /** - * Returns an array of TermVectorOffsetInfo in which the term is found. - * May return null if offsets have not been stored. - * - * @see org.apache.lucene.analysis.Token - * - * @param index The position in the array to get the offsets from - * @return An array of TermVectorOffsetInfo objects or the empty list - */ - virtual Array* getOffsets(int32_t index) = 0; - - virtual ~TermPositionVector(){ - } -}; - - -class SegmentTermPositionVector: public SegmentTermVector, public TermPositionVector -{ -protected: - Array< Array >* positions; - Array< Array >* offsets; - static Array EMPTY_TERM_POS; -public: - SegmentTermPositionVector(const TCHAR* field, TCHAR** terms, - Array* termFreqs, Array< Array >* positions, - Array< Array >* offsets); - ~SegmentTermPositionVector(); - - /** - * Returns an array of TermVectorOffsetInfo in which the term is found. - * - * @param index The position in the array to get the offsets from - * @return An array of TermVectorOffsetInfo objects or the empty list - * @see org.apache.lucene.analysis.Token - */ - Array* getOffsets(int32_t index); - - /** - * Returns an array of positions in which the term is found. - * Terms are identified by the index at which its number appears in the - * term String array obtained from the indexOf method. - */ - Array* getTermPositions(int32_t index); - - const TCHAR* getField() { - return SegmentTermVector::getField(); } - - TCHAR* toString() const { - return SegmentTermVector::toString(); } - - int32_t size() { - return SegmentTermVector::size(); } - - const TCHAR** getTerms() { - return SegmentTermVector::getTerms(); } - - const Array* getTermFrequencies() { - return SegmentTermVector::getTermFrequencies(); } - - int32_t indexOf(const TCHAR* termText) { - return SegmentTermVector::indexOf(termText); } - - void indexesOf(const TCHAR** termNumbers, const int32_t start, - const int32_t len, Array& ret) { - SegmentTermVector::indexesOf(termNumbers, start, len, ret); } - - virtual TermPositionVector* __asTermPositionVector(); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp b/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp deleted file mode 100644 index 53d909b29..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "TermVector.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(index) - -TermVectorsReader::TermVectorsReader(CL_NS(store)::Directory* d, - const QString& segment, FieldInfos* fieldInfos) -{ - if (d->fileExists(segment + TermVectorsWriter::LUCENE_TVX_EXTENSION)) { - tvx = d->openInput(segment + TermVectorsWriter::LUCENE_TVX_EXTENSION); - checkValidFormat(tvx); - - tvd = d->openInput(segment + TermVectorsWriter::LUCENE_TVD_EXTENSION); - tvdFormat = checkValidFormat(tvd); - - tvf = d->openInput(segment + TermVectorsWriter::LUCENE_TVF_EXTENSION); - tvfFormat = checkValidFormat(tvf); - - _size = tvx->length() / 8; - }else{ - tvx = NULL; - tvd = NULL; - tvf = NULL; - _size = 0; - } - - this->fieldInfos = fieldInfos; -} - -TermVectorsReader::TermVectorsReader(const TermVectorsReader& copy) -{ - tvx = copy.tvx->clone(); - tvd = copy.tvd->clone(); - tvf = copy.tvf->clone(); - - tvdFormat = copy.tvdFormat; - tvfFormat = copy.tvfFormat; - _size = copy._size; - fieldInfos = copy.fieldInfos; -} -TermVectorsReader* TermVectorsReader::clone() const{ - if (tvx == NULL || tvd == NULL || tvf == NULL) - return NULL; - return _CLNEW TermVectorsReader(*this); -} - -TermVectorsReader::~TermVectorsReader(){ - close(); -} - -void TermVectorsReader::close(){ - // why don't we trap the exception and at least make sure that - // all streams that we can close are closed? - CLuceneError keep(0,"",false); - bool thrown = false; - - if (tvx != NULL){ - try{ - tvx->close(); - }catch(CLuceneError& err){ - if ( err.number() == CL_ERR_IO ){ - keep = err; - thrown = true; - }else - throw err; - } - _CLDELETE(tvx);//delete even if error thrown - } - if (tvd != NULL){ - try{ - tvd->close(); - }catch(CLuceneError& err){ - if ( err.number() == CL_ERR_IO ){ - keep = err; - thrown = true; - }else - throw err; - } - _CLDELETE(tvd); - } - if (tvf != NULL){ - try{ - tvf->close(); - }catch(CLuceneError& err){ - if ( err.number() == CL_ERR_IO ){ - keep = err; - thrown = true; - }else - throw err; - } - _CLDELETE(tvf); - } - - if ( thrown ) - throw keep; -} - -TermFreqVector* TermVectorsReader::get(const int32_t docNum, const TCHAR* field){ - // Check if no term vectors are available for this segment at all - int32_t fieldNumber = fieldInfos->fieldNumber(field); - TermFreqVector* result = NULL; - if (tvx != NULL) { - //We need to account for the FORMAT_SIZE at when seeking in the tvx - //We don't need to do this in other seeks because we already have the - // file pointer - //that was written in another file - tvx->seek((docNum * 8L) + TermVectorsWriter::FORMAT_SIZE); - int64_t position = tvx->readLong(); - - tvd->seek(position); - int32_t fieldCount = tvd->readVInt(); - // There are only a few fields per document. We opt for a full scan - // rather then requiring that they be ordered. We need to read through - // all of the fields anyway to get to the tvf pointers. - int32_t number = 0; - int32_t found = -1; - for (int32_t i = 0; i < fieldCount; ++i) { - if(tvdFormat == TermVectorsWriter::FORMAT_VERSION) - number = tvd->readVInt(); - else - number += tvd->readVInt(); - if (number == fieldNumber) - found = i; - } - - // This field, although valid in the segment, was not found in this - // document - if (found != -1) { - // Compute position in the tvf file - position = 0; - for (int32_t i = 0; i <= found; ++i) - position += tvd->readVLong(); - result = readTermVector(field, position); - } - } - return result; -} - - -bool TermVectorsReader::get(int32_t docNum, Array& result){ - // Check if no term vectors are available for this segment at all - if (tvx != NULL) { - //We need to offset by - tvx->seek((docNum * 8L) + TermVectorsWriter::FORMAT_SIZE); - int64_t position = tvx->readLong(); - - tvd->seek(position); - int32_t fieldCount = tvd->readVInt(); - - // No fields are vectorized for this document - if (fieldCount != 0) { - int32_t number = 0; - const TCHAR** fields = _CL_NEWARRAY(const TCHAR*,fieldCount+1); - - { //msvc6 scope fix - for (int32_t i = 0; i < fieldCount; ++i) { - if(tvdFormat == TermVectorsWriter::FORMAT_VERSION) - number = tvd->readVInt(); - else - number += tvd->readVInt(); - fields[i] = fieldInfos->fieldName(number); - } - } - fields[fieldCount]=NULL; - - // Compute position in the tvf file - position = 0; - int64_t* tvfPointers = _CL_NEWARRAY(int64_t,fieldCount); - { //msvc6 scope fix - for (int32_t i = 0; i < fieldCount; ++i) { - position += tvd->readVLong(); - tvfPointers[i] = position; - } - } - - readTermVectors(fields, tvfPointers, fieldCount, result); - _CLDELETE_ARRAY(tvfPointers); - _CLDELETE_ARRAY(fields); - } - return true; - } - return false; -} - - -int32_t TermVectorsReader::checkValidFormat(CL_NS(store)::IndexInput* in) -{ - int32_t format = in->readInt(); - if (format > TermVectorsWriter::FORMAT_VERSION) - { - CL_NS(util)::StringBuffer err; - err.append(_T("Incompatible format version: ")); - err.appendInt(format); - err.append(_T(" expected ")); - err.appendInt(TermVectorsWriter::FORMAT_VERSION); - err.append(_T(" or less")); - _CLTHROWT(CL_ERR_Runtime,err.getBuffer()); - } - return format; -} - -void TermVectorsReader::readTermVectors(const TCHAR** fields, - const int64_t* tvfPointers, const int32_t len, Array& result) -{ - result.length = len; - result.values = _CL_NEWARRAY(TermFreqVector*,len); - for (int32_t i = 0; i < len; ++i) { - result.values[i] = readTermVector(fields[i], tvfPointers[i]); - } -} - -SegmentTermVector* TermVectorsReader::readTermVector(const TCHAR* field, - const int64_t tvfPointer) -{ - // Now read the data from specified position. We don't need to offset by - // the FORMAT here since the pointer already includes the offset - tvf->seek(tvfPointer); - - int32_t numTerms = tvf->readVInt(); - // If no terms - return a constant empty termvector. However, this should never occur! - if (numTerms == 0) - return _CLNEW SegmentTermVector(field, NULL, NULL); - - bool storePositions; - bool storeOffsets; - - if(tvfFormat == TermVectorsWriter::FORMAT_VERSION){ - uint8_t bits = tvf->readByte(); - storePositions = (bits & TermVectorsWriter::STORE_POSITIONS_WITH_TERMVECTOR) != 0; - storeOffsets = (bits & TermVectorsWriter::STORE_OFFSET_WITH_TERMVECTOR) != 0; - } - else{ - tvf->readVInt(); - storePositions = false; - storeOffsets = false; - } - - TCHAR** terms = _CL_NEWARRAY(TCHAR*,numTerms+1); - Array* termFreqs = _CLNEW Array(numTerms); - - // we may not need these, but declare them - Array< Array >* positions = NULL; - Array< Array >* offsets = NULL; - if(storePositions){ - Array* tmp = _CL_NEWARRAY(Array,numTerms); - positions = _CLNEW Array< Array >(tmp, numTerms); - } - if(storeOffsets){ - Array* tmp = _CL_NEWARRAY(Array,numTerms); - offsets = _CLNEW Array< Array >(tmp, numTerms); - } - - int32_t start = 0; - int32_t deltaLength = 0; - int32_t totalLength = 0; - int32_t bufferLen=10; // init the buffer with a length of 10 character - TCHAR* buffer = (TCHAR*)malloc(bufferLen * sizeof(TCHAR)); - - for (int32_t i = 0; i < numTerms; ++i) { - start = tvf->readVInt(); - deltaLength = tvf->readVInt(); - totalLength = start + deltaLength; - if (bufferLen < totalLength) // increase buffer - { - buffer=(TCHAR*)realloc(buffer,totalLength * sizeof(TCHAR)); - bufferLen = totalLength; - } - - //read the term - tvf->readChars(buffer, start, deltaLength); - terms[i] = _CL_NEWARRAY(TCHAR,totalLength+1); - _tcsncpy(terms[i],buffer,totalLength); - terms[i][totalLength] = '\0'; //null terminate term - - //read the frequency - int32_t freq = tvf->readVInt(); - termFreqs->values[i] = freq; - - if (storePositions) { //read in the positions - Array& pos = positions->values[i]; - pos.length = freq; - pos.values = _CL_NEWARRAY(int32_t,freq); - - int32_t prevPosition = 0; - for (int32_t j = 0; j < freq; ++j) - { - pos.values[j] = prevPosition + tvf->readVInt(); - prevPosition = pos.values[j]; - } - } - - if (storeOffsets) { - Array& offs = offsets->values[i]; - offs.length = freq; - offs.values = _CL_NEWARRAY(TermVectorOffsetInfo,freq); - - int32_t prevOffset = 0; - for (int32_t j = 0; j < freq; ++j) { - int32_t startOffset = prevOffset + tvf->readVInt(); - int32_t endOffset = startOffset + tvf->readVInt(); - offs.values[j].setStartOffset(startOffset); - offs.values[j].setEndOffset(endOffset); - prevOffset = endOffset; - } - } - } - free(buffer); - terms[numTerms]=NULL; //null terminate terms array - - SegmentTermVector* tv = NULL; - if (storePositions || storeOffsets){ - return _CLNEW SegmentTermPositionVector(field, terms, termFreqs, positions, offsets); - }else { - return _CLNEW SegmentTermVector(field, terms, termFreqs); - } -} - -int64_t TermVectorsReader::size() -{ - return _size; -} - - - - -Array TermVectorOffsetInfo::EMPTY_OFFSET_INFO; - -TermVectorOffsetInfo::TermVectorOffsetInfo() -{ - startOffset = 0; - endOffset=0; -} - -TermVectorOffsetInfo::~TermVectorOffsetInfo() -{ -} - -TermVectorOffsetInfo::TermVectorOffsetInfo(int32_t startOffset, int32_t endOffset) -{ - this->endOffset = endOffset; - this->startOffset = startOffset; -} - -int32_t TermVectorOffsetInfo::getEndOffset() const -{ - return endOffset; -} - -void TermVectorOffsetInfo::setEndOffset(int32_t endOffset) -{ - this->endOffset = endOffset; -} - -int32_t TermVectorOffsetInfo::getStartOffset() const -{ - return startOffset; -} - -void TermVectorOffsetInfo::setStartOffset(int32_t startOffset) -{ - this->startOffset = startOffset; -} - -bool TermVectorOffsetInfo::equals(TermVectorOffsetInfo* termVectorOffsetInfo) -{ - if (this == termVectorOffsetInfo) - return true; - - if (endOffset != termVectorOffsetInfo->endOffset) return false; - if (startOffset != termVectorOffsetInfo->startOffset) return false; - - return true; -} - -size_t TermVectorOffsetInfo::hashCode() const -{ - size_t result; - result = startOffset; - result = 29 * result + endOffset; - return result; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp b/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp deleted file mode 100644 index 276b1bbd0..000000000 --- a/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "TermVector.h" -#include "CLucene/util/Misc.h" - -CL_NS_USE(util) -CL_NS_DEF(index) - -const QLatin1String TermVectorsWriter::LUCENE_TVX_EXTENSION(".tvx"); -const QLatin1String TermVectorsWriter::LUCENE_TVD_EXTENSION(".tvd"); -const QLatin1String TermVectorsWriter::LUCENE_TVF_EXTENSION(".tvf"); - -TermVectorsWriter::TermVectorsWriter(CL_NS(store)::Directory* directory, - const QString& segment,FieldInfos* fieldInfos) -{ - // Open files for TermVector storage - tvx = directory->createOutput(segment + LUCENE_TVX_EXTENSION); - tvx->writeInt(FORMAT_VERSION); - - tvd = directory->createOutput(segment + LUCENE_TVD_EXTENSION); - tvd->writeInt(FORMAT_VERSION); - - tvf = directory->createOutput(segment + LUCENE_TVF_EXTENSION); - tvf->writeInt(FORMAT_VERSION); - - this->fieldInfos = fieldInfos; - - currentField = NULL; - currentDocPointer = -1; -} - -TermVectorsWriter::~TermVectorsWriter() -{ - if (tvx != NULL) { - tvx->close(); - _CLDELETE(tvx); - } - - if (tvd != NULL) { - tvd->close(); - _CLDELETE(tvd); - } - - if (tvf != NULL){ - tvf->close(); - _CLDELETE(tvf); - } -} - -void TermVectorsWriter::openDocument() -{ - closeDocument(); - currentDocPointer = tvd->getFilePointer(); -} - -void TermVectorsWriter::closeDocument() -{ - if (isDocumentOpen()) { - closeField(); - writeDoc(); - fields.clear(); - currentDocPointer = -1; - } -} - -bool TermVectorsWriter::isDocumentOpen() const -{ - return currentDocPointer != -1; -} - - -void TermVectorsWriter::openField(int32_t fieldNumber, - bool storePositionWithTermVector, bool storeOffsetWithTermVector) -{ - if (!isDocumentOpen()) - _CLTHROWA(CL_ERR_InvalidState,"Cannot open field when no document is open."); - - closeField(); - currentField = _CLNEW TVField(fieldNumber, storePositionWithTermVector, - storeOffsetWithTermVector); -} - -void TermVectorsWriter::openField(const TCHAR* field) -{ - FieldInfo* fieldInfo = fieldInfos->fieldInfo(field); - openField(fieldInfo->number, fieldInfo->storePositionWithTermVector, - fieldInfo->storeOffsetWithTermVector); -} - -void TermVectorsWriter::closeField() -{ - if (isFieldOpen()) { - /* DEBUG */ - //System.out.println("closeField()"); - /* DEBUG */ - - // save field and terms - writeField(); - fields.push_back(currentField); - terms.clear(); - currentField = NULL; - } -} - -bool TermVectorsWriter::isFieldOpen() const -{ - return currentField != NULL; -} - -void TermVectorsWriter::addTerm(const TCHAR* termText, int32_t freq, - Array* positions, Array* offsets) -{ - if (!isDocumentOpen()) - _CLTHROWA(CL_ERR_InvalidState, "Cannot add terms when document is not open"); - - if (!isFieldOpen()) - _CLTHROWA(CL_ERR_InvalidState, "Cannot add terms when field is not open"); - - addTermInternal(termText, freq, positions, offsets); -} - -void TermVectorsWriter::addTermInternal(const TCHAR* termText, int32_t freq, - Array* positions, Array* offsets) -{ - TVTerm* term = _CLNEW TVTerm(); - term->setTermText(termText); - term->freq = freq; - term->positions = positions; - term->offsets = offsets; - terms.push_back(term); -} - -void TermVectorsWriter::addAllDocVectors(Array& vectors) -{ - openDocument(); - - for (int32_t i = 0; i < vectors.length; ++i) { - bool storePositionWithTermVector = false; - bool storeOffsetWithTermVector = false; - - if ( vectors[i]->__asTermPositionVector() != NULL ) { - TermPositionVector* tpVector = vectors[i]->__asTermPositionVector(); - - if (tpVector->size() > 0 && tpVector->getTermPositions(0) != NULL) - storePositionWithTermVector = true; - if (tpVector->size() > 0 && tpVector->getOffsets(0) != NULL) - storeOffsetWithTermVector = true; - - FieldInfo* fieldInfo = fieldInfos->fieldInfo(tpVector->getField()); - openField(fieldInfo->number, storePositionWithTermVector, storeOffsetWithTermVector); - - for (int32_t j = 0; j < tpVector->size(); ++j) - addTermInternal(tpVector->getTerms()[j], - (*tpVector->getTermFrequencies())[j], - tpVector->getTermPositions(j), - tpVector->getOffsets(j)); - - closeField(); - - } else { - TermFreqVector* tfVector = vectors[i]; - - FieldInfo* fieldInfo = fieldInfos->fieldInfo(tfVector->getField()); - openField(fieldInfo->number, storePositionWithTermVector, storeOffsetWithTermVector); - - for (int32_t j = 0; j < tfVector->size(); ++j) - addTermInternal(tfVector->getTerms()[j], - (*tfVector->getTermFrequencies())[j], NULL, NULL); - - closeField(); - } - } - - closeDocument(); -} - - -void TermVectorsWriter::close() -{ - try { - closeDocument(); - - // make an effort to close all streams we can but remember and re-throw - // the first exception encountered in this process -#define _DOTVWCLOSE(x) \ - if (x != NULL) { \ - try { \ - x->close(); \ - _CLDELETE(x) \ - } catch (CLuceneError& e) { \ - if ( e.number() != CL_ERR_IO ) \ - throw e; \ - if (ikeep == 0) \ - ikeep = e.number(); \ - if (keep[0] == 0) \ - strcpy(keep,e.what()); \ - } catch (...) { \ - if (keep[0] == 0) \ - strcpy(keep, "Unknown error while closing " #x);\ - } \ - } - } _CLFINALLY ( \ - char keep[200]; - int32_t ikeep = 0; - keep[0] = 0; - _DOTVWCLOSE(tvx); - _DOTVWCLOSE(tvd); - _DOTVWCLOSE(tvf); - if (keep[0] != 0) - _CLTHROWA(ikeep, keep); - ); -} - -void TermVectorsWriter::writeField() -{ - // remember where this field is written - currentField->tvfPointer = tvf->getFilePointer(); - //System.out.println("Field Pointer: " + currentField.tvfPointer); - int32_t size = terms.size(); - - tvf->writeVInt(size); - - bool storePositions = currentField->storePositions; - bool storeOffsets = currentField->storeOffsets; - uint8_t bits = 0x0; - if (storePositions) - bits |= STORE_POSITIONS_WITH_TERMVECTOR; - if (storeOffsets) - bits |= STORE_OFFSET_WITH_TERMVECTOR; - tvf->writeByte(bits); - - const TCHAR* lastTermText = LUCENE_BLANK_STRING; - int32_t lastTermTextLen = 0; - - for (int32_t i = 0; i < size; ++i) { - TVTerm* term = terms[i]; - int32_t start = CL_NS(util)::Misc::stringDifference(lastTermText, - lastTermTextLen, term->getTermText(),term->getTermTextLen()); - int32_t length = term->getTermTextLen() - start; - tvf->writeVInt(start); // write shared prefix length - tvf->writeVInt(length); // write delta length - tvf->writeChars(term->getTermText(), start, length); // write delta chars - tvf->writeVInt(term->freq); - - lastTermText = term->getTermText(); - lastTermTextLen = term->getTermTextLen(); - - if (storePositions) { - if(term->positions == NULL) - _CLTHROWA(CL_ERR_IllegalState, "Trying to write positions that are NULL!"); - - // use delta encoding for positions - int32_t position = 0; - for (int32_t j = 0; j < term->freq; ++j){ - tvf->writeVInt((*term->positions)[j] - position); - position = (*term->positions)[j]; - } - } - - if (storeOffsets) { - if(term->offsets == NULL) - _CLTHROWA(CL_ERR_IllegalState, "Trying to write offsets that are NULL!"); - - // use delta encoding for offsets - int32_t position = 0; - for (int32_t j = 0; j < term->freq; ++j) { - tvf->writeVInt((*term->offsets)[j].getStartOffset() - position); - //Save the diff between the two. - tvf->writeVInt((*term->offsets)[j].getEndOffset() - - (*term->offsets)[j].getStartOffset()); - position = (*term->offsets)[j].getEndOffset(); - } - } - } -} - -void TermVectorsWriter::writeDoc() -{ - if (isFieldOpen()) { - _CLTHROWA(CL_ERR_InvalidState, - "Field is still open while writing document"); - } - - // write document index record - tvx->writeLong(currentDocPointer); - - // write document data record - int32_t size = fields.size(); - - // write the number of fields - tvd->writeVInt(size); - - // write field numbers - for (int32_t j = 0; j < size; ++j) { - tvd->writeVInt(fields[j]->number); - } - - // write field pointers - int64_t lastFieldPointer = 0; - for (int32_t i = 0; i < size; ++i) { - TVField* field = (TVField*) fields[i]; - tvd->writeVLong(field->tvfPointer - lastFieldPointer); - - lastFieldPointer = field->tvfPointer; - } -} - -const TCHAR* TermVectorsWriter::TVTerm::getTermText() const -{ - return termText; -} - -size_t TermVectorsWriter::TVTerm::getTermTextLen() -{ - if (termTextLen==-1) - termTextLen = _tcslen(termText); - return termTextLen; -} - -void TermVectorsWriter::TVTerm::setTermText(const TCHAR* val) -{ - _CLDELETE_CARRAY(termText); - termText = STRDUP_TtoT(val); - termTextLen = -1; - -} - -TermVectorsWriter::TVTerm::TVTerm() - : freq(0) - , positions(NULL) - , offsets(NULL) -{ - termText=NULL; - termTextLen=-1; -} - -TermVectorsWriter::TVTerm::~TVTerm() -{ - _CLDELETE_CARRAY(termText) -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/index/Terms.h b/3rdparty/clucene/src/CLucene/index/Terms.h deleted file mode 100644 index 806441876..000000000 --- a/3rdparty/clucene/src/CLucene/index/Terms.h +++ /dev/null @@ -1,174 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_index_Terms_ -#define _lucene_index_Terms_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Term.h" -CL_NS_DEF(index) - -class TermEnum; //predefine -class TermPositions; - -/** TermDocs provides an interface for enumerating <document, frequency> - pairs for a term.

The document portion names each document containing - the term. Documents are indicated by number. The frequency portion gives - the number of times the term occurred in each document.

The pairs are - ordered by document number. - - @see IndexReader#termDocs() - */ -class TermDocs: LUCENE_BASE { -public: - virtual ~TermDocs(){ - } - - // Sets this to the data for a term. - // The enumeration is reset to the start of the data for this term. - virtual void seek(Term* term)=0; - - /** Sets this to the data for the current term in a {@link TermEnum}. - * This may be optimized in some implementations. - */ - virtual void seek(TermEnum* termEnum)=0; - - // Returns the current document number.

This is invalid until {@link - // #next()} is called for the first time. - virtual int32_t doc() const=0; - - // Returns the frequency of the term within the current document.

This - // is invalid until {@link #next()} is called for the first time. - virtual int32_t freq() const=0; - - // Moves to the next pair in the enumeration.

Returns true iff there is - // such a next pair in the enumeration. - virtual bool next() =0; - - // Attempts to read multiple entries from the enumeration, up to length of - // docs. Document numbers are stored in docs, and term - // frequencies are stored in freqs. The freqs array must be as - // int64_t as the docs array. - // - //

Returns the number of entries read. Zero is only returned when the - // stream has been exhausted. - virtual int32_t read(int32_t* docs, int32_t* freqs, int32_t length)=0; - - // Skips entries to the first beyond the current whose document number is - // greater than or equal to target.

Returns true iff there is such - // an entry.

Behaves as if written:

-	//   bool skipTo(int32_t target) {
-	//     do {
-	//       if (!next())
-	// 	     return false;
-	//     } while (target > doc());
-	//     return true;
-	//   }
-	// 
- // Some implementations are considerably more efficient than that. - virtual bool skipTo(const int32_t target)=0; - - // Frees associated resources. - virtual void close() = 0; - - - /** Solve the diamond inheritence problem by providing a reinterpret function. - * No dynamic casting is required and no RTTI data is needed to do this - */ - virtual TermPositions* __asTermPositions()=0; -}; - - -// Abstract class for enumerating terms. -// -//

Term enumerations are always ordered by Term.compareTo(). Each term in -//the enumeration is greater than all that precede it. -class TermEnum: LUCENE_BASE { -public: - // Increments the enumeration to the next element. True if one exists. - virtual bool next()=0; - - // Returns a pointer to the current Term in the enumeration. - virtual Term* term()=0; - - // Returns the current Term in the enumeration. - virtual Term* term(bool pointer){ - Term* ret = term(); - if ( !pointer ) - ret->__cl_decref(); - return ret; - } - - // Returns the docFreq of the current Term in the enumeration. - virtual int32_t docFreq() const=0; - - // Closes the enumeration to further activity, freeing resources. - virtual void close() =0; - - virtual ~TermEnum(){ - } - - // Term Vector support - /** Skips terms to the first beyond the current whose value is - * greater or equal to target.

Returns true iff there is such - * an entry.

Behaves as if written:

-	*   public boolean skipTo(Term target) {
-	*     do {
-	*       if (!next())
-	* 	     return false;
-	*     } while (target > term());
-	*     return true;
-	*   }
-	* 
- * Some implementations are considerably more efficient than that. - */ - virtual bool skipTo(Term* target){ - do { - if (!next()) - return false; - } while (target->compareTo(term(false)) > 0); - return true; - } - - /** - * Because we need to know how to cast the object, we need the objects name. - */ - virtual const char* getObjectName() = 0; -}; - - - -/** - * TermPositions provides an interface for enumerating the <document, - * frequency, <position>* > tuples for a term.

The document and - * frequency are the same as for a TermDocs. The positions portion lists the ordinal - * positions of each occurrence of a term in a document. - * - * @see IndexReader#termPositions() - */ -class TermPositions: public virtual TermDocs { -public: - // Returns next position in the current document. It is an error to call - // this more than {@link #freq()} times - // without calling {@link #next()}

This is - // invalid until {@link #next()} is called for - // the first time. - virtual int32_t nextPosition() = 0; - - virtual ~TermPositions(){ - } - - /** Solve the diamond inheritence problem by providing a reinterpret function. - * No dynamic casting is required and no RTTI data is needed to do this - */ - virtual TermDocs* __asTermDocs()=0; - virtual TermPositions* __asTermPositions()=0; -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp b/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp deleted file mode 100644 index 861c5d3cb..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Lexer.h" - -#include "CLucene/util/FastCharStream.h" -#include "CLucene/util/Reader.h" -#include "CLucene/util/StringBuffer.h" -#include "TokenList.h" -#include "QueryToken.h" -#include "QueryParserBase.h" - -CL_NS_USE(util) - -CL_NS_DEF(queryParser) -Lexer::Lexer(QueryParserBase* queryparser, const TCHAR* query) { - //Func - Constructor - //Pre - query != NULL and contains the query string - //Post - An instance of Lexer has been created - - this->queryparser = queryparser; - - CND_PRECONDITION(query != NULL, "query is NULL"); - - //The InputStream of Reader must be destroyed in the destructor - delSR = true; - - StringReader *r = _CLNEW StringReader(query); - - //Check to see if r has been created properly - CND_CONDITION(r != NULL, "Could not allocate memory for StringReader r"); - - //Instantie a FastCharStream instance using r and assign it to reader - reader = _CLNEW FastCharStream(r); - - //Check to see if reader has been created properly - CND_CONDITION(reader != NULL, "Could not allocate memory for FastCharStream reader"); - - //The InputStream of Reader must be destroyed in the destructor - delSR = true; - -} - - -Lexer::Lexer(QueryParserBase* queryparser, Reader* source) { - //Func - Constructor - // Initializes a new instance of the Lexer class with the specified - // TextReader to lex. - //Pre - Source contains a valid reference to a Reader - //Post - An instance of Lexer has been created using source as the reader - - this->queryparser = queryparser; - - //Instantie a FastCharStream instance using r and assign it to reader - reader = _CLNEW FastCharStream(source); - - //Check to see if reader has been created properly - CND_CONDITION(reader != NULL, "Could not allocate memory for FastCharStream reader"); - - //The InputStream of Reader must not be destroyed in the destructor - delSR = false; -} - - -Lexer::~Lexer() { - //Func - Destructor - //Pre - true - //Post - if delSR was true the InputStream input of reader has been deleted - // The instance of Lexer has been destroyed - - if (delSR) { - _CLDELETE(reader->input); - } - - _CLDELETE(reader); -} - - -void Lexer::Lex(TokenList *tokenList) { - //Func - Breaks the input stream onto the tokens list tokens - //Pre - tokens != NULL and contains a TokenList in which the tokens can be stored - //Post - The tokens have been added to the TokenList tokens - - CND_PRECONDITION(tokenList != NULL, "tokens is NULL"); - - //Get all the tokens - while(true) { - //Add the token to the tokens list - - //Get the next token - QueryToken* token = _CLNEW QueryToken; - if ( !GetNextToken(token) ){ - _CLDELETE(token); - break; - } - tokenList->add(token); - } - - //The end has been reached so create an EOF_ token - //Add the final token to the TokenList _tokens - tokenList->add(_CLNEW QueryToken( QueryToken::EOF_)); -} - - -bool Lexer::GetNextToken(QueryToken* token) { - while(!reader->Eos()) { - int ch = reader->GetNext(); - - if ( ch == -1 ) - break; - - // skipping whitespaces - if( _istspace(ch)!=0 ) { - continue; - } - TCHAR buf[2] = {ch,'\0'}; - switch(ch) { - case '+': - token->set(buf, QueryToken::PLUS); - return true; - case '-': - token->set(buf, QueryToken::MINUS); - return true; - case '(': - token->set(buf, QueryToken::LPAREN); - return true; - case ')': - token->set(buf, QueryToken::RPAREN); - return true; - case ':': - token->set(buf, QueryToken::COLON); - return true; - case '!': - token->set(buf, QueryToken::NOT); - return true; - case '^': - token->set(buf, QueryToken::CARAT); - return true; - case '~': - if( _istdigit( reader->Peek() )!=0 ) { - TCHAR number[LUCENE_MAX_FIELD_LEN]; - ReadIntegerNumber(ch, number,LUCENE_MAX_FIELD_LEN); - token->set(number, QueryToken::SLOP); - return true; - }else{ - token->set(buf, QueryToken::FUZZY); - return true; - } - break; - case '"': - return ReadQuoted(ch, token); - case '[': - return ReadInclusiveRange(ch, token); - case '{': - return ReadExclusiveRange(ch, token); - case ']': - case '}': - case '*': - queryparser->throwParserException( _T("Unrecognized TCHAR %d at %d::%d."), - ch, reader->Column(), reader->Line() ); - return false; - default: - return ReadTerm(ch, token); - - // end of swith - } - - } - return false; -} - - -void Lexer::ReadIntegerNumber(const TCHAR ch, TCHAR* buf, int buflen) { - int bp=0; - buf[bp++] = ch; - - int c = reader->Peek(); - while( c!=-1 && _istdigit(c)!=0 && bpGetNext(); - c = reader->Peek(); - } - buf[bp++] = 0; -} - - -bool Lexer::ReadInclusiveRange(const TCHAR prev, QueryToken* token) { - int ch = prev; - StringBuffer range; - range.appendChar(ch); - - while(!reader->Eos()) { - ch = reader->GetNext(); - if ( ch == -1 ) - break; - range.appendChar(ch); - - if(ch == ']'){ - token->set(range.getBuffer(), QueryToken::RANGEIN); - return true; - } - } - queryparser->throwParserException(_T("Unterminated inclusive range! %d %d::%d"),' ', - reader->Column(),reader->Column()); - return false; -} - - -bool Lexer::ReadExclusiveRange(const TCHAR prev, QueryToken* token) { - int ch = prev; - StringBuffer range; - range.appendChar(ch); - - while(!reader->Eos()) { - ch = reader->GetNext(); - - if (ch==-1) - break; - range.appendChar(ch); - - if(ch == '}'){ - token->set(range.getBuffer(), QueryToken::RANGEEX); - return true; - } - } - queryparser->throwParserException(_T("Unterminated exclusive range! %d %d::%d"),' ', - reader->Column(),reader->Column() ); - return false; -} - -bool Lexer::ReadQuoted(const TCHAR prev, QueryToken* token) { - int ch = prev; - StringBuffer quoted; - quoted.appendChar(ch); - - while(!reader->Eos()) { - ch = reader->GetNext(); - - if (ch==-1) - break; - - quoted.appendChar(ch); - - if(ch == '"'){ - token->set(quoted.getBuffer(), QueryToken::QUOTED); - return true; - } - } - queryparser->throwParserException(_T("Unterminated string! %d %d::%d"),' ', - reader->Column(),reader->Column()); - return false; -} - - -bool Lexer::ReadTerm(const TCHAR prev, QueryToken* token) { - int ch = prev; - bool completed = false; - int32_t asteriskCount = 0; - bool hasQuestion = false; - - StringBuffer val; - TCHAR buf[3]; //used for readescaped - - while(true) { - switch(ch) { - case -1: - break; - case '\\': - { - if ( ReadEscape(ch, buf) ) - val.append( buf ); - else - return false; - } - break; - - case LUCENE_WILDCARDTERMENUM_WILDCARD_STRING: - asteriskCount++; - val.appendChar(ch); - break; - case LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR: - hasQuestion = true; - val.appendChar(ch); - break; - case '\n': - case '\t': - case ' ': - case '+': - case '-': - case '!': - case '(': - case ')': - case ':': - case '^': - case '[': - case ']': - case '{': - case '}': - case '~': - case '"': - // create new QueryToken - reader->UnGet(); - completed = true; - break; - default: - val.appendChar(ch); - break; - // end of switch - } - - if(completed || ch==-1 || reader->Eos() ) - break; - else - ch = reader->GetNext(); - } - - // create new QueryToken - if(hasQuestion) - token->set(val.getBuffer(), QueryToken::WILDTERM); - else if(asteriskCount == 1 && val.getBuffer()[val.length() - 1] == '*') - token->set(val.getBuffer(), QueryToken::PREFIXTERM); - else if(asteriskCount > 0) - token->set(val.getBuffer(), QueryToken::WILDTERM); - else if( _tcsicmp(val.getBuffer(), _T("AND"))==0 || _tcscmp(val.getBuffer(), _T("&&"))==0 ) - token->set(val.getBuffer(), QueryToken::AND_); - else if( _tcsicmp(val.getBuffer(), _T("OR"))==0 || _tcscmp(val.getBuffer(), _T("||"))==0) - token->set(val.getBuffer(), QueryToken::OR); - else if( _tcsicmp(val.getBuffer(), _T("NOT"))==0 ) - token->set(val.getBuffer(), QueryToken::NOT); - else { - bool isnum = true; - int32_t nlen=val.length(); - for (int32_t i=0;iset(val.getBuffer(), QueryToken::NUMBER); - else - token->set(val.getBuffer(), QueryToken::TERM); - } - return true; -} - - -bool Lexer::ReadEscape(TCHAR prev, TCHAR* buf) { - TCHAR ch = prev; - int bp=0; - buf[bp++] = ch; - - ch = reader->GetNext(); - int32_t idx = _tcscspn( buf, _T("\\+-!():^[]{}\"~*") ); - if(idx == 0) { - buf[bp++] = ch; - buf[bp++]=0; - return true; - } - queryparser->throwParserException(_T("Unrecognized escape sequence at %d %d::%d"), ' ', - reader->Column(),reader->Line()); - return false; -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/queryParser/Lexer.h b/3rdparty/clucene/src/CLucene/queryParser/Lexer.h deleted file mode 100644 index b3b55523e..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/Lexer.h +++ /dev/null @@ -1,67 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#ifndef _lucene_queryParser_Lexer_ -#define _lucene_queryParser_Lexer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/FastCharStream.h" -#include "CLucene/util/Reader.h" -#include "CLucene/util/StringBuffer.h" - -#include "TokenList.h" - -CL_NS_DEF(queryParser) -class QueryParserBase; - // A simple Lexer that is used by QueryParser. - class Lexer:LUCENE_BASE - { - private: - CL_NS(util)::FastCharStream* reader; - QueryParserBase* queryparser; //holds the queryparser so that we can do callbacks - bool delSR; //Indicates if the reader must be deleted or not - - public: - // Initializes a new instance of the Lexer class with the specified - // query to lex. - Lexer(QueryParserBase* queryparser, const TCHAR* query); - - // Initializes a new instance of the Lexer class with the specified - // TextReader to lex. - Lexer(QueryParserBase* queryparser, CL_NS(util)::Reader* source); - - //Breaks the input stream onto the tokens list tokens - void Lex(TokenList *tokens); - - ~Lexer(); - - private: - bool GetNextToken(QueryToken* token); - - // Reads an integer number. buf should quite large, probably as large as a field should ever be - void ReadIntegerNumber(const TCHAR ch, TCHAR* buf, int buflen); - - // Reads an inclusive range like [some words] - bool ReadInclusiveRange(const TCHAR prev, QueryToken* token); - - // Reads an exclusive range like {some words} - bool ReadExclusiveRange(const TCHAR prev, QueryToken* token); - - // Reads quoted string like "something else" - bool ReadQuoted(const TCHAR prev, QueryToken* token); - - bool ReadTerm(const TCHAR prev, QueryToken* token); - - //reads an escaped character into the buf. Buf requires at least 3 characters - bool ReadEscape(const TCHAR prev, TCHAR* buf); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp b/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp deleted file mode 100644 index b57896b66..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "MultiFieldQueryParser.h" -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/search/BooleanQuery.h" -#include "CLucene/search/PhraseQuery.h" -#include "CLucene/search/SearchHeader.h" -#include "QueryParser.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_USE(search) -CL_NS_USE(analysis) - -CL_NS_DEF(queryParser) - -MultiFieldQueryParser::MultiFieldQueryParser(const TCHAR** fields, - CL_NS(analysis)::Analyzer* analyzer, BoostMap* boosts) - : QueryParser(NULL, analyzer) -{ - this->fields = fields; - this->boosts = boosts; -} - -MultiFieldQueryParser::~MultiFieldQueryParser() -{ -} - -//static -Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, - Analyzer* analyzer) -{ - BooleanQuery* bQuery = _CLNEW BooleanQuery(); - int32_t i = 0; - while (fields[i] != NULL){ - Query* q = QueryParser::parse(query, fields[i], analyzer); - if (q && (q->getQueryName() != _T("BooleanQuery") - || ((BooleanQuery*)q)->getClauseCount() > 0)) { - bQuery->add(q , true, false, false); - } else { - _CLDELETE(q); - } - i++; - } - return bQuery; -} - -//static -Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, - const uint8_t* flags, Analyzer* analyzer) -{ - BooleanQuery* bQuery = _CLNEW BooleanQuery(); - int32_t i = 0; - while ( fields[i] != NULL ) { - Query* q = QueryParser::parse(query, fields[i], analyzer); - if (q && (q->getQueryName() != _T("BooleanQuery") - || ((BooleanQuery*)q)->getClauseCount() > 0)) { - uint8_t flag = flags[i]; - switch (flag) { - case MultiFieldQueryParser::REQUIRED_FIELD: - bQuery->add(q, true, true, false); - break; - case MultiFieldQueryParser::PROHIBITED_FIELD: - bQuery->add(q, true, false, true); - break; - default: - bQuery->add(q, true, false, false); - break; - } - } else { - _CLDELETE(q); - } - i++; - } - return bQuery; -} - - -Query* MultiFieldQueryParser::GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop){ - if (field == NULL) { - CL_NS_STD(vector) clauses; - for (int i = 0; fields[i]!=NULL; ++i) { - Query* q = QueryParser::GetFieldQuery(fields[i], queryText); - if (q != NULL) { - //If the user passes a map of boosts - if (boosts != NULL) { - //Get the boost from the map and apply them - BoostMap::const_iterator itr = boosts->find(fields[i]); - if (itr != boosts->end()) { - q->setBoost(itr->second); - } - } - if (q->getQueryName() == PhraseQuery::getClassName()) { - ((PhraseQuery*)q)->setSlop(slop); - } - //if (q instanceof MultiPhraseQuery) { - // ((MultiPhraseQuery) q).setSlop(slop); - //} - q = QueryAddedCallback(fields[i], q); - if ( q ) - clauses.push_back(_CLNEW BooleanClause(q, true, false,false)); - } - } - if (clauses.size() == 0) // happens for stopwords - return NULL; - Query* q = QueryParser::GetBooleanQuery(clauses); - return q; - }else{ - Query* q = QueryParser::GetFieldQuery(field, queryText); - if ( q ) - q = QueryAddedCallback(field,q); - return q; - } -} - - -Query* MultiFieldQueryParser::GetFieldQuery(const TCHAR* field, TCHAR* queryText){ - return GetFieldQuery(field, queryText, 0); -} - - -CL_NS(search)::Query* MultiFieldQueryParser::GetFuzzyQuery(const TCHAR* field, TCHAR* termStr){ - if (field == NULL) { - CL_NS_STD(vector) clauses; - for (int i = 0; fields[i]!=NULL; ++i) { - Query* q = QueryParser::GetFuzzyQuery(fields[i], termStr); //todo: , minSimilarity - if ( q ){ - q = QueryAddedCallback(fields[i], q); - if ( q ){ - clauses.push_back(_CLNEW BooleanClause(q,true,false,false) ); - } - } - } - return QueryParser::GetBooleanQuery(clauses); - }else{ - Query* q = QueryParser::GetFuzzyQuery(field, termStr);//todo: , minSimilarity - if ( q ) - q = QueryAddedCallback(field,q); - return q; - } -} - -Query* MultiFieldQueryParser::GetPrefixQuery(const TCHAR* field, TCHAR* termStr){ - if (field == NULL) { - CL_NS_STD(vector) clauses; - for (int i = 0; fields[i]!=NULL; ++i) { - Query* q = QueryParser::GetPrefixQuery(fields[i], termStr); - if ( q ){ - q = QueryAddedCallback(fields[i],q); - if ( q ){ - clauses.push_back(_CLNEW BooleanClause(q,true,false,false)); - } - } - } - return QueryParser::GetBooleanQuery(clauses); - }else{ - Query* q = QueryParser::GetPrefixQuery(field, termStr); - if ( q ) - q = QueryAddedCallback(field,q); - return q; - } -} - -Query* MultiFieldQueryParser::GetWildcardQuery(const TCHAR* field, TCHAR* termStr){ - if (field == NULL) { - CL_NS_STD(vector) clauses; - for (int i = 0; fields[i]!=NULL; ++i) { - Query* q = QueryParser::GetWildcardQuery(fields[i], termStr); - if ( q ){ - q = QueryAddedCallback(fields[i],q); - if ( q ){ - clauses.push_back(_CLNEW BooleanClause(q,true,false,false)); - } - } - } - return QueryParser::GetBooleanQuery(clauses); - }else{ - Query* q = QueryParser::GetWildcardQuery(field, termStr); - if ( q ) - q = QueryAddedCallback(field,q); - return q; - } -} - - -Query* MultiFieldQueryParser::GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive){ - if (field == NULL) { - CL_NS_STD(vector) clauses; - for (int i = 0; fields[i]!=NULL; ++i) { - Query* q = QueryParser::GetRangeQuery(fields[i], part1, part2, inclusive); - if ( q ){ - q = QueryAddedCallback(fields[i],q); - if ( q ){ - clauses.push_back(_CLNEW BooleanClause(q,true,false,false)); - } - } - } - return QueryParser::GetBooleanQuery(clauses); - }else{ - Query* q = QueryParser::GetRangeQuery(field, part1, part2, inclusive); - if ( q ) - q = QueryAddedCallback(field,q); - return q; - } -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h b/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h deleted file mode 100644 index bf7d652a7..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h +++ /dev/null @@ -1,136 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef MultiFieldQueryParser_H -#define MultiFieldQueryParser_H - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/search/SearchHeader.h" -#include "QueryParser.h" - - -CL_NS_DEF(queryParser) - -typedef CL_NS(util)::CLHashMap BoostMap; - - /** - * A QueryParser which constructs queries to search multiple fields. - * - */ - class MultiFieldQueryParser: public QueryParser - { - protected: - const TCHAR** fields; - BoostMap* boosts; - public: - LUCENE_STATIC_CONSTANT(uint8_t, NORMAL_FIELD=0); - LUCENE_STATIC_CONSTANT(uint8_t, REQUIRED_FIELD=1); - LUCENE_STATIC_CONSTANT(uint8_t, PROHIBITED_FIELD=2); - - /** - * Creates a MultiFieldQueryParser. - * - *

It will, when parse(String query) - * is called, construct a query like this (assuming the query consists of - * two terms and you specify the two fields title and body):

- * - * - * (title:term1 body:term1) (title:term2 body:term2) - * - * - *

When setDefaultOperator(AND_OPERATOR) is set, the result will be:

- * - * - * +(title:term1 body:term1) +(title:term2 body:term2) - * - * - *

In other words, all the query's terms must appear, but it doesn't matter in - * what fields they appear.

- */ - MultiFieldQueryParser(const TCHAR** fields, CL_NS(analysis)::Analyzer* a, BoostMap* boosts = NULL); - virtual ~MultiFieldQueryParser(); - - /** - *

- * Parses a query which searches on the fields specified. - *

- * If x fields are specified, this effectively constructs: - *

-         * 
-         * (field1:query) (field2:query) (field3:query)...(fieldx:query)
-         * 
-         * 
- * - * @param query Query string to parse - * @param fields Fields to search on - * @param analyzer Analyzer to use - * @throws ParserException if query parsing fails - * @throws TokenMgrError if query parsing fails - */ - static CL_NS(search)::Query* parse(const TCHAR* query, const TCHAR** fields, CL_NS(analysis)::Analyzer* analyzer); - - /** - *

- * Parses a query, searching on the fields specified. - * Use this if you need to specify certain fields as required, - * and others as prohibited. - *

-         * Usage:
-         * 
-         * String[] fields = {"filename", "contents", "description"};
-         * int32_t[] flags = {MultiFieldQueryParser.NORMAL FIELD,
-         *                MultiFieldQueryParser.REQUIRED FIELD,
-         *                MultiFieldQueryParser.PROHIBITED FIELD,};
-         * parse(query, fields, flags, analyzer);
-         * 
-         * 
- *

- * The code above would construct a query: - *

-         * 
-         * (filename:query) +(contents:query) -(description:query)
-         * 
-         * 
- * - * @param query Query string to parse - * @param fields Fields to search on - * @param flags Flags describing the fields - * @param analyzer Analyzer to use - * @throws ParserException if query parsing fails - * @throws TokenMgrError if query parsing fails - */ - static CL_NS(search)::Query* parse(const TCHAR* query, const TCHAR** fields, const uint8_t* flags, CL_NS(analysis)::Analyzer* analyzer); - - - - protected: - CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText); - CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop); - CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field, TCHAR* termStr); - CL_NS(search)::Query* GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive); - CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field, TCHAR* termStr); - CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr); - - /** - * A special virtual function for the MultiFieldQueryParser which can be used - * to clean up queries. Once the field name is known and the query has been - * created, its passed to this function. - * An example of this usage is to set boosts. - */ - virtual CL_NS(search)::Query* QueryAddedCallback(const TCHAR* field, CL_NS(search)::Query* query){ return query; } - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp b/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp deleted file mode 100644 index b11eec0bb..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp +++ /dev/null @@ -1,509 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "QueryParser.h" - -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/util/Reader.h" -#include "CLucene/search/SearchHeader.h" -#include "CLucene/index/Term.h" - -#include "TokenList.h" -#include "QueryToken.h" -#include "QueryParserBase.h" -#include "Lexer.h" - -CL_NS_USE(util) -CL_NS_USE(index) -CL_NS_USE(analysis) -CL_NS_USE(search) - -CL_NS_DEF(queryParser) - - QueryParser::QueryParser(const TCHAR* _field, Analyzer* _analyzer) : QueryParserBase(_analyzer){ - //Func - Constructor. - // Instantiates a QueryParser for the named field _field - //Pre - _field != NULL - //Post - An instance has been created - - if ( _field ) - field = STRDUP_TtoT(_field); - else - field = NULL; - tokens = NULL; - lowercaseExpandedTerms = true; - } - - QueryParser::~QueryParser() { - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - _CLDELETE_CARRAY(field); - } - - //static - Query* QueryParser::parse(const TCHAR* query, const TCHAR* field, Analyzer* analyzer){ - //Func - Returns a new instance of the Query class with a specified query, field and - // analyzer values. - //Pre - query != NULL and holds the query to parse - // field != NULL and holds the default field for query terms - // analyzer holds a valid reference to an Analyzer and is used to - // find terms in the query text - //Post - query has been parsed and an instance of Query has been returned - - CND_PRECONDITION(query != NULL, "query is NULL"); - CND_PRECONDITION(field != NULL, "field is NULL"); - - QueryParser parser(field, analyzer); - return parser.parse(query); - } - - Query* QueryParser::parse(const TCHAR* query){ - //Func - Returns a parsed Query instance - //Pre - query != NULL and contains the query value to be parsed - //Post - Returns a parsed Query Instance - - CND_PRECONDITION(query != NULL, "query is NULL"); - - //Instantie a Stringer that can read the query string - Reader* r = _CLNEW StringReader(query); - - //Check to see if r has been created properly - CND_CONDITION(r != NULL, "Could not allocate memory for StringReader r"); - - //Pointer for the return value - Query* ret = NULL; - - try{ - //Parse the query managed by the StringReader R and return a parsed Query instance - //into ret - ret = parse(r); - }_CLFINALLY ( - _CLDELETE(r); - ); - - return ret; - } - - Query* QueryParser::parse(Reader* reader){ - //Func - Returns a parsed Query instance - //Pre - reader contains a valid reference to a Reader and manages the query string - //Post - A parsed Query instance has been returned or - - //instantiate the TokenList tokens - TokenList _tokens; - this->tokens = &_tokens; - - //Instantiate a lexer - Lexer lexer(this, reader); - - //tokens = lexer.Lex(); - //Lex the tokens - lexer.Lex(tokens); - - //Peek to the first token and check if is an EOF - if (tokens->peek()->Type == QueryToken::EOF_){ - // The query string failed to yield any tokens. We discard the - // TokenList tokens and raise an exceptioin. - QueryToken* token = this->tokens->extract(); - _CLDELETE(token); - _CLTHROWA(CL_ERR_Parse, "No query given."); - } - - //Return the parsed Query instance - Query* ret = MatchQuery(field); - this->tokens = NULL; - return ret; - } - - int32_t QueryParser::MatchConjunction(){ - //Func - matches for CONJUNCTION - // CONJUNCTION ::= | - //Pre - tokens != NULL - //Post - if the first token is an AND or an OR then - // the token is extracted and deleted and CONJ_AND or CONJ_OR is returned - // otherwise CONJ_NONE is returned - - CND_PRECONDITION(tokens != NULL, "tokens is NULL"); - - switch(tokens->peek()->Type){ - case QueryToken::AND_ : - //Delete the first token of tokenlist - ExtractAndDeleteToken(); - return CONJ_AND; - case QueryToken::OR : - //Delete the first token of tokenlist - ExtractAndDeleteToken(); - return CONJ_OR; - default : - return CONJ_NONE; - } - } - - int32_t QueryParser::MatchModifier(){ - //Func - matches for MODIFIER - // MODIFIER ::= | | - //Pre - tokens != NULL - //Post - if the first token is a PLUS the token is extracted and deleted and MOD_REQ is returned - // if the first token is a MINUS or NOT the token is extracted and deleted and MOD_NOT is returned - // otherwise MOD_NONE is returned - CND_PRECONDITION(tokens != NULL, "tokens is NULL"); - - switch(tokens->peek()->Type){ - case QueryToken::PLUS : - //Delete the first token of tokenlist - ExtractAndDeleteToken(); - return MOD_REQ; - case QueryToken::MINUS : - case QueryToken::NOT : - //Delete the first token of tokenlist - ExtractAndDeleteToken(); - return MOD_NOT; - default : - return MOD_NONE; - } - } - - Query* QueryParser::MatchQuery(const TCHAR* field){ - //Func - matches for QUERY - // QUERY ::= [MODIFIER] QueryParser::CLAUSE ( [MODIFIER] CLAUSE)* - //Pre - field != NULL - //Post - - - CND_PRECONDITION(tokens != NULL, "tokens is NULL"); - - CL_NS_STD(vector) clauses; - - Query* q = NULL; - - int32_t mods = MOD_NONE; - int32_t conj = CONJ_NONE; - - //match for MODIFIER - mods = MatchModifier(); - - //match for CLAUSE - q = MatchClause(field); - AddClause(clauses, CONJ_NONE, mods, q); - - // match for CLAUSE* - while(true){ - QueryToken* p = tokens->peek(); - if(p->Type == QueryToken::EOF_){ - QueryToken* qt = MatchQueryToken(QueryToken::EOF_); - _CLDELETE(qt); - break; - } - - if(p->Type == QueryToken::RPAREN){ - //MatchQueryToken(QueryToken::RPAREN); - break; - } - - //match for a conjuction (AND OR NOT) - conj = MatchConjunction(); - //match for a modifier - mods = MatchModifier(); - - q = MatchClause(field); - if ( q != NULL ) - AddClause(clauses, conj, mods, q); - } - - // finalize query - if(clauses.size() == 1){ //bvk: removed this && firstQuery != NULL - BooleanClause* c = clauses[0]; - Query* q = c->query; - - //Condition check to be sure clauses[0] is valid - CND_CONDITION(c != NULL, "c is NULL"); - - //Tell the boolean clause not to delete its query - c->deleteQuery=false; - //Clear the clauses list - clauses.clear(); - _CLDELETE(c); - - return q; - }else{ - return GetBooleanQuery(clauses); - } - } - - Query* QueryParser::MatchClause(const TCHAR* field){ - //Func - matches for CLAUSE - // CLAUSE ::= [TERM ] ( TERM | ( QUERY )) - //Pre - field != NULL - //Post - - - Query* q = NULL; - const TCHAR* sfield = field; - bool delField = false; - - QueryToken *DelToken = NULL; - - //match for [TERM ] - QueryToken* term = tokens->extract(); - if(term->Type == QueryToken::TERM && tokens->peek()->Type == QueryToken::COLON){ - DelToken = MatchQueryToken(QueryToken::COLON); - - CND_CONDITION(DelToken != NULL,"DelToken is NULL"); - _CLDELETE(DelToken); - - TCHAR* tmp = STRDUP_TtoT(term->Value); - discardEscapeChar(tmp); - delField = true; - sfield = tmp; - _CLDELETE(term); - }else{ - tokens->push(term); - term = NULL; - } - - // match for - // TERM | ( QUERY ) - if(tokens->peek()->Type == QueryToken::LPAREN){ - DelToken = MatchQueryToken(QueryToken::LPAREN); - - CND_CONDITION(DelToken != NULL,"DelToken is NULL"); - _CLDELETE(DelToken); - - q = MatchQuery(sfield); - //DSR:2004.11.01: - //If exception is thrown while trying to match trailing parenthesis, - //need to prevent q from leaking. - - try{ - DelToken = MatchQueryToken(QueryToken::RPAREN); - - CND_CONDITION(DelToken != NULL,"DelToken is NULL"); - _CLDELETE(DelToken); - - }catch(...) { - _CLDELETE(q); - throw; - } - }else{ - q = MatchTerm(sfield); - } - - if ( delField ) - _CLDELETE_CARRAY(sfield); - return q; - } - - - Query* QueryParser::MatchTerm(const TCHAR* field){ - //Func - matches for TERM - // TERM ::= TERM | PREFIXTERM | WILDTERM | NUMBER - // [ ] [ []] - // | ( | ) [ ] - // | [SLOP] [ ] - //Pre - field != NULL - //Post - - - QueryToken* term = NULL; - QueryToken* slop = NULL; - QueryToken* boost = NULL; - - bool prefix = false; - bool wildcard = false; - bool fuzzy = false; - bool rangein = false; - Query* q = NULL; - - term = tokens->extract(); - QueryToken* DelToken = NULL; //Token that is about to be deleted - - switch(term->Type){ - case QueryToken::TERM: - case QueryToken::NUMBER: - case QueryToken::PREFIXTERM: - case QueryToken::WILDTERM: - { //start case - //Check if type of QueryToken term is a prefix term - if(term->Type == QueryToken::PREFIXTERM){ - prefix = true; - } - //Check if type of QueryToken term is a wildcard term - if(term->Type == QueryToken::WILDTERM){ - wildcard = true; - } - //Peek to see if the type of the next token is fuzzy term - if(tokens->peek()->Type == QueryToken::FUZZY){ - DelToken = MatchQueryToken(QueryToken::FUZZY); - - CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); - _CLDELETE(DelToken); - - fuzzy = true; - } - if(tokens->peek()->Type == QueryToken::CARAT){ - DelToken = MatchQueryToken(QueryToken::CARAT); - - CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); - _CLDELETE(DelToken); - - boost = MatchQueryToken(QueryToken::NUMBER); - - if(tokens->peek()->Type == QueryToken::FUZZY){ - DelToken = MatchQueryToken(QueryToken::FUZZY); - - CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); - _CLDELETE(DelToken); - - fuzzy = true; - } - } //end if type==CARAT - - discardEscapeChar(term->Value); //clean up - if(wildcard){ - q = GetWildcardQuery(field,term->Value); - break; - }else if(prefix){ - //Create a PrefixQuery - term->Value[_tcslen(term->Value)-1] = 0; //discard the * - q = GetPrefixQuery(field,term->Value); - break; - }else if(fuzzy){ - //Create a FuzzyQuery - - //Check if the last char is a ~ - if(term->Value[_tcslen(term->Value)-1] == '~'){ - //remove the ~ - term->Value[_tcslen(term->Value)-1] = '\0'; - } - - q = GetFuzzyQuery(field,term->Value); - break; - }else{ - q = GetFieldQuery(field, term->Value); - break; - } - } - - - case QueryToken::RANGEIN: - case QueryToken::RANGEEX:{ - if(term->Type == QueryToken::RANGEIN){ - rangein = true; - } - - if(tokens->peek()->Type == QueryToken::CARAT){ - DelToken = MatchQueryToken(QueryToken::CARAT); - - CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); - _CLDELETE(DelToken); - - boost = MatchQueryToken(QueryToken::NUMBER); - } - - TCHAR* noBrackets = term->Value + 1; - noBrackets[_tcslen(noBrackets)-1] = 0; - q = ParseRangeQuery(field, noBrackets, rangein); - break; - } - - - case QueryToken::QUOTED:{ - if(tokens->peek()->Type == QueryToken::SLOP){ - slop = MatchQueryToken(QueryToken::SLOP); - } - - if(tokens->peek()->Type == QueryToken::CARAT){ - DelToken = MatchQueryToken(QueryToken::CARAT); - - CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); - _CLDELETE(DelToken); - - boost = MatchQueryToken(QueryToken::NUMBER); - } - - //remove the quotes - TCHAR* quotedValue = term->Value+1; - quotedValue[_tcslen(quotedValue)-1] = '\0'; - - int32_t islop = phraseSlop; - if(slop != NULL ){ - try { - TCHAR* end; //todo: should parse using float... - islop = (int32_t)_tcstoi64(slop->Value+1, &end, 10); - }catch(...){ - //ignored - } - } - - q = GetFieldQuery(field, quotedValue, islop); - _CLDELETE(slop); - } - } // end of switch - - _CLDELETE(term); - - - if( q!=NULL && boost != NULL ){ - qreal f = 1.0F; - try { - TCHAR* tmp; - f = _tcstod(boost->Value, &tmp); - }catch(...){ - //ignored - } - _CLDELETE(boost); - - q->setBoost( f); - } - - return q; - } - - QueryToken* QueryParser::MatchQueryToken(QueryToken::Types expectedType){ - //Func - matches for QueryToken of the specified type and returns it - // otherwise Exception throws - //Pre - tokens != NULL - //Post - - - CND_PRECONDITION(tokens != NULL,"tokens is NULL"); - - if(tokens->count() == 0){ - throwParserException(_T("Error: Unexpected end of program"),' ',0,0); - } - - //Extract a token form the TokenList tokens - QueryToken* t = tokens->extract(); - //Check if the type of the token t matches the expectedType - if (expectedType != t->Type){ - TCHAR buf[200]; - _sntprintf(buf,200,_T("Error: Unexpected QueryToken: %d, expected: %d"),t->Type,expectedType); - _CLDELETE(t); - throwParserException(buf,' ',0,0); - } - - //Return the matched token - return t; - } - - void QueryParser::ExtractAndDeleteToken(void){ - //Func - Extracts the first token from the Tokenlist tokenlist - // and destroys it - //Pre - true - //Post - The first token has been extracted and destroyed - - CND_PRECONDITION(tokens != NULL, "tokens is NULL"); - - //Extract the token from the TokenList tokens - QueryToken* t = tokens->extract(); - //Condition Check Token may not be NULL - CND_CONDITION(t != NULL, "Token is NULL"); - //Delete Token - _CLDELETE(t); - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h b/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h deleted file mode 100644 index a2fc85c89..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h +++ /dev/null @@ -1,165 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_queryParser_QueryParser_ -#define _lucene_queryParser_QueryParser_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/analysis/AnalysisHeader.h" -#include "CLucene/util/Reader.h" -#include "CLucene/search/SearchHeader.h" -#include "CLucene/index/Term.h" - -#include "TokenList.h" -#include "QueryToken.h" -#include "QueryParserBase.h" -#include "Lexer.h" - -CL_NS_DEF(queryParser) - -/** -* @brief CLucene's default query parser. -* -*

It's a query parser. -* The only method that clients should need to call is Parse(). -* The syntax for query const TCHAR*s is as follows: -* A Query is a series of clauses. A clause may be prefixed by:

-*
    -*
  • a plus (+) or a minus (-) sign, indicating that the -* clause is required or prohibited respectively; or
  • -*
  • a term followed by a colon, indicating the field to be searched. -* This enables one to construct queries which search multiple fields.
  • -*
-*

-* A clause may be either:

-*
    -*
  • a term, indicating all the documents that contain this term; or
  • -*
  • a nested query, enclosed in parentheses. Note that this may be -* used with a +/- prefix to require any of a set of terms.
  • -*
-*

-* Thus, in BNF, the query grammar is:

-* -* Query ::= ( Clause )* -* Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" ) -* -*

-* Examples of appropriately formatted queries can be found in the test cases. -*

-*/ -class QueryParser : public QueryParserBase -{ -private: - const TCHAR* field; - TokenList* tokens; -public: - /** - * Initializes a new instance of the QueryParser class with a specified field and - * analyzer values. - */ - QueryParser(const TCHAR* field, CL_NS(analysis)::Analyzer* analyzer); - ~QueryParser(); - - /** - * Returns a parsed Query instance. - * Note: this call is not threadsafe, either use a seperate QueryParser for each thread, or use a thread lock - * The query value to be parsed. - * A parsed Query instance. - */ - virtual CL_NS(search)::Query* parse(const TCHAR* query); - - /** - * Returns a parsed Query instance. - * Note: this call is not threadsafe, either use a seperate QueryParser for each thread, or use a thread lock - * The TextReader value to be parsed. - * A parsed Query instance. - */ - virtual CL_NS(search)::Query* parse(CL_NS(util)::Reader* reader); - - /** - * Returns a new instance of the Query class with a specified query, field and - * analyzer values. - */ - static CL_NS(search)::Query* parse(const TCHAR* query, const TCHAR* field, CL_NS(analysis)::Analyzer* analyzer); - - CL_NS(analysis)::Analyzer* getAnalyzer() { return analyzer; } - - /** - * @return Returns the field. - */ - const TCHAR* getField() { return field; } - - //deprecated functions - _CL_DEPRECATED( setLowercaseExpandedTerms ) void setLowercaseWildcardTerms(bool lowercaseWildcardTerms){ setLowercaseExpandedTerms(lowercaseWildcardTerms); } - _CL_DEPRECATED( getLowercaseExpandedTerms ) bool getLowercaseWildcardTerms() const { return getLowercaseExpandedTerms(); } -protected: - //these functions may be defined under certain compilation conditions. - //note that this functionality is deprecated, you should create your own queryparser - //if you want to remove this functionality...it will be removed... be warned! -#ifdef NO_PREFIX_QUERY - virtual CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field,const TCHAR* termStr){ return NULL; } -#endif -#ifdef NO_FUZZY_QUERY - virtual CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field,const TCHAR* termStr){ return NULL; } -#endif -#ifdef NO_RANGE_QUERY - virtual CL_NS(search)::Query* GetRangeQuery(const TCHAR* field, const TCHAR* part1, const TCHAR* part2, bool inclusive) { return NULL; } -#endif -#ifdef NO_WILDCARD_QUERY - virtual CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr) { return NULL; } -#endif -private: - /** - * matches for CONJUNCTION - * CONJUNCTION ::= | - */ - int32_t MatchConjunction(); - - /** - * matches for MODIFIER - * MODIFIER ::= | | - */ - int32_t MatchModifier(); - - /** - * matches for QUERY - * QUERY ::= [MODIFIER] CLAUSE ( [MODIFIER] CLAUSE)* - */ - CL_NS(search)::Query* MatchQuery(const TCHAR* field); - - /** - * matches for CLAUSE - * CLAUSE ::= [TERM ] ( TERM | ( QUERY )) - */ - CL_NS(search)::Query* MatchClause(const TCHAR* field); - - /** - * matches for TERM - * TERM ::= TERM | PREFIXTERM | WILDTERM | NUMBER - * [ ] [ []] - * - * | ( | ) [ ] - * | [SLOP] [ ] - */ - CL_NS(search)::Query* MatchTerm(const TCHAR* field); - - /** - * matches for QueryToken of the specified type and returns it - * otherwise Exception throws - */ - QueryToken* MatchQueryToken(QueryToken::Types expectedType); - - /** - * Extracts the first token from the Tokenlist tokenlist - * and destroys it - */ - void ExtractAndDeleteToken(void); -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp b/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp deleted file mode 100644 index 7b95b30f9..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "QueryParserBase.h" - -#include "CLucene/search/TermQuery.h" -#include "CLucene/search/PhraseQuery.h" -#include "CLucene/search/RangeQuery.h" -#include "CLucene/search/FuzzyQuery.h" -#include "CLucene/search/WildcardQuery.h" -#include "CLucene/search/PrefixQuery.h" - - -CL_NS_USE(search) -CL_NS_USE(util) -CL_NS_USE(analysis) -CL_NS_USE(index) - -CL_NS_DEF(queryParser) - -QueryParserBase::QueryParserBase(Analyzer* analyzer){ -//Func - Constructor -//Pre - true -//Post - instance has been created with PhraseSlop = 0 - this->analyzer = analyzer; - this->defaultOperator = OR_OPERATOR; - this->phraseSlop = 0; - this->lowercaseExpandedTerms = true; -} - -QueryParserBase::~QueryParserBase(){ -//Func - Destructor -//Pre - true -//Post - The instance has been destroyed -} - - -void QueryParserBase::discardEscapeChar(TCHAR* source) const{ - int len = _tcslen(source); - int j = 0; - for (int i = 0; i < len; i++) { - if (source[i] == '\\' && source[i+1] != '\0' ) { - _tcscpy(source+i,source+i+1); - len--; - } - } -} - -void QueryParserBase::AddClause(CL_NS_STD(vector)& clauses, int32_t conj, int32_t mods, Query* q){ -//Func - Adds the next parsed clause. -//Pre - -//Post - - - bool required, prohibited; - - // If this term is introduced by AND, make the preceding term required, - // unless it's already prohibited. - const uint32_t nPreviousClauses = clauses.size(); - if (nPreviousClauses > 0 && conj == CONJ_AND) { - BooleanClause* c = clauses[nPreviousClauses-1]; - if (!c->prohibited) - c->required = true; - } - - if (nPreviousClauses > 0 && defaultOperator == AND_OPERATOR && conj == CONJ_OR) { - // If this term is introduced by OR, make the preceding term optional, - // unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b) - // notice if the input is a OR b, first term is parsed as required; without - // this modification a OR b would parse as +a OR b - BooleanClause* c = clauses[nPreviousClauses-1]; - if (!c->prohibited){ - c->required = false; - c->prohibited = false; - } - } - - // We might have been passed a NULL query; the term might have been - // filtered away by the analyzer. - if (q == NULL) - return; - - if (defaultOperator == OR_OPERATOR) { - // We set REQUIRED if we're introduced by AND or +; PROHIBITED if - // introduced by NOT or -; make sure not to set both. - prohibited = (mods == MOD_NOT); - required = (mods == MOD_REQ); - if (conj == CONJ_AND && !prohibited) { - required = true; - } - } else { - // We set PROHIBITED if we're introduced by NOT or -; We set REQUIRED - // if not PROHIBITED and not introduced by OR - prohibited = (mods == MOD_NOT); - required = (!prohibited && conj != CONJ_OR); - } - - if ( required && prohibited ) - throwParserException( _T("Clause cannot be both required and prohibited"), ' ',0,0); - clauses.push_back(_CLNEW BooleanClause(q,true, required, prohibited)); -} - -void QueryParserBase::throwParserException(const TCHAR* message, TCHAR ch, int32_t col, int32_t line ) -{ - TCHAR msg[1024]; - _sntprintf(msg,1024,message,ch,col,line); - _CLTHROWT (CL_ERR_Parse, msg ); -} - - -Query* QueryParserBase::GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop){ - Query* ret = GetFieldQuery(field,queryText); - if ( ret && ret->getQueryName() == PhraseQuery::getClassName() ) - ((PhraseQuery*)ret)->setSlop(slop); - - return ret; -} - -Query* QueryParserBase::GetFieldQuery(const TCHAR* field, TCHAR* queryText){ -//Func - Returns a query for the specified field. -// Use the analyzer to get all the tokens, and then build a TermQuery, -// PhraseQuery, or nothing based on the term count -//Pre - field != NULL -// analyzer contains a valid reference to an Analyzer -// queryText != NULL and contains the query -//Post - A query instance has been returned for the specified field - - CND_PRECONDITION(field != NULL, "field is NULL"); - CND_PRECONDITION(queryText != NULL, "queryText is NULL"); - - //Instantiate a stringReader for queryText - StringReader reader(queryText); - TokenStream* source = analyzer->tokenStream(field, &reader); - CND_CONDITION(source != NULL,"source is NULL"); - - StringArrayConstWithDeletor v; - - Token t; - int positionCount = 0; - bool severalTokensAtSamePosition = false; - - //Get the tokens from the source - try{ - while (source->next(&t)){ - v.push_back(STRDUP_TtoT(t.termText())); - - if (t.getPositionIncrement() != 0) - positionCount += t.getPositionIncrement(); - else - severalTokensAtSamePosition = true; - } - }catch(CLuceneError& err){ - if ( err.number() != CL_ERR_IO ) - throw err; - } - _CLDELETE(source); - - //Check if there are any tokens retrieved - if (v.size() == 0){ - return NULL; - }else{ - if (v.size() == 1){ - Term* t = _CLNEW Term(field, v[0]); - Query* ret = _CLNEW TermQuery( t ); - _CLDECDELETE(t); - return ret; - }else{ - if (severalTokensAtSamePosition) { - if (positionCount == 1) { - // no phrase query: - BooleanQuery* q = _CLNEW BooleanQuery; //todo: disableCoord=true here, but not implemented in BooleanQuery - StringArrayConst::iterator itr = v.begin(); - while ( itr != v.end() ){ - Term* t = _CLNEW Term(field, *itr); - q->add(_CLNEW TermQuery(t),true, false,false);//should occur... - _CLDECDELETE(t); - ++itr; - } - return q; - }else { - _CLTHROWA(CL_ERR_UnsupportedOperation, "MultiPhraseQuery NOT Implemented"); - } - }else{ - PhraseQuery* q = _CLNEW PhraseQuery; - q->setSlop(phraseSlop); - - StringArrayConst::iterator itr = v.begin(); - while ( itr != v.end() ){ - const TCHAR* data = *itr; - Term* t = _CLNEW Term(field, data); - q->add(t); - _CLDECDELETE(t); - ++itr; - } - return q; - } - } - } -} - -void QueryParserBase::setLowercaseExpandedTerms(bool lowercaseExpandedTerms){ - this->lowercaseExpandedTerms = lowercaseExpandedTerms; -} -bool QueryParserBase::getLowercaseExpandedTerms() const { - return lowercaseExpandedTerms; -} -void QueryParserBase::setDefaultOperator(int oper){ - this->defaultOperator=oper; -} -int QueryParserBase::getDefaultOperator() const{ - return defaultOperator; -} - - -Query* QueryParserBase::ParseRangeQuery(const TCHAR* field, TCHAR* queryText, bool inclusive) -{ - //todo: this must be fixed, [-1--5] (-1 to -5) should yield a result, but won't parse properly - //because it uses an analyser, should split it up differently... - - // Use the analyzer to get all the tokens. There should be 1 or 2. - StringReader reader(queryText); - TokenStream* source = analyzer->tokenStream(field, &reader); - - TCHAR* terms[2]; - terms[0]=NULL;terms[1]=NULL; - Token t; - bool tret=true; - bool from=true; - while(tret) - { - try{ - tret = source->next(&t); - }catch (CLuceneError& err){ - if ( err.number() == CL_ERR_IO ) - tret=false; - else - throw err; - } - if (tret) - { - if ( !from && _tcscmp(t.termText(),_T("TO"))==0 ) - continue; - - - TCHAR* tmp = STRDUP_TtoT(t.termText()); - discardEscapeChar(tmp); - terms[from? 0 : 1] = tmp; - - if (from) - from = false; - else - break; - } - } - Query* ret = GetRangeQuery(field, terms[0], terms[1],inclusive); - _CLDELETE_CARRAY(terms[0]); - _CLDELETE_CARRAY(terms[1]); - _CLDELETE(source); - - return ret; -} - -Query* QueryParserBase::GetPrefixQuery(const TCHAR* field, TCHAR* termStr){ -//Pre - field != NULL and field contains the name of the field that the query will use -// termStr != NULL and is the token to use for building term for the query -// (WITH or WITHOUT a trailing '*' character!) -//Post - A PrefixQuery instance has been returned - - CND_PRECONDITION(field != NULL,"field is NULL"); - CND_PRECONDITION(termStr != NULL,"termStr is NULL"); - - if ( lowercaseExpandedTerms ) - _tcslwr(termStr); - - Term* t = _CLNEW Term(field, termStr); - CND_CONDITION(t != NULL,"Could not allocate memory for term t"); - - Query *q = _CLNEW PrefixQuery(t); - CND_CONDITION(q != NULL,"Could not allocate memory for PrefixQuery q"); - - _CLDECDELETE(t); - return q; -} - -Query* QueryParserBase::GetFuzzyQuery(const TCHAR* field, TCHAR* termStr){ -//Func - Factory method for generating a query (similar to getPrefixQuery}). Called when parser parses -// an input term token that has the fuzzy suffix (~) appended. -//Pre - field != NULL and field contains the name of the field that the query will use -// termStr != NULL and is the token to use for building term for the query -// (WITH or WITHOUT a trailing '*' character!) -//Post - A FuzzyQuery instance has been returned - - CND_PRECONDITION(field != NULL,"field is NULL"); - CND_PRECONDITION(termStr != NULL,"termStr is NULL"); - - if ( lowercaseExpandedTerms ) - _tcslwr(termStr); - - Term* t = _CLNEW Term(field, termStr); - CND_CONDITION(t != NULL,"Could not allocate memory for term t"); - - Query *q = _CLNEW FuzzyQuery(t); - CND_CONDITION(q != NULL,"Could not allocate memory for FuzzyQuery q"); - - _CLDECDELETE(t); - return q; -} - - -Query* QueryParserBase::GetWildcardQuery(const TCHAR* field, TCHAR* termStr){ - CND_PRECONDITION(field != NULL,"field is NULL"); - CND_PRECONDITION(termStr != NULL,"termStr is NULL"); - - if ( lowercaseExpandedTerms ) - _tcslwr(termStr); - - Term* t = _CLNEW Term(field, termStr); - CND_CONDITION(t != NULL,"Could not allocate memory for term t"); - Query* q = _CLNEW WildcardQuery(t); - _CLDECDELETE(t); - - return q; -} - -Query* QueryParserBase::GetBooleanQuery(CL_NS_STD(vector)& clauses){ - if ( clauses.size() == 0 ) - return NULL; - - BooleanQuery* query = _CLNEW BooleanQuery(); - //Condition check to see if query has been allocated properly - CND_CONDITION(query != NULL, "No memory could be allocated for query"); - - //iterate through all the clauses - for( uint32_t i=0;iadd(clauses[i]); - } - return query; -} - - -CL_NS(search)::Query* QueryParserBase::GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive){ - //todo: does jlucene handle rangequeries differntly? if we are using - //a certain type of analyser, the terms may be filtered out, which - //is not necessarily what we want. - if (lowercaseExpandedTerms) { - _tcslwr(part1); - _tcslwr(part2); - } - //todo: should see if we can parse the strings as dates... currently we leave that up to the end-developer... - Term* t1 = _CLNEW Term(field,part1); - Term* t2 = _CLNEW Term(field,part2); - Query* ret = _CLNEW RangeQuery(t1, t2, inclusive); - _CLDECDELETE(t1); - _CLDECDELETE(t2); - - return ret; -} - - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h b/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h deleted file mode 100644 index 261e587b0..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h +++ /dev/null @@ -1,204 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_queryParser_QueryParserBase_ -#define _lucene_queryParser_QueryParserBase_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/VoidList.h" -#include "CLucene/search/BooleanClause.h" -#include "CLucene/analysis/Analyzers.h" -#include "QueryToken.h" - -CL_NS_DEF(queryParser) - - /** - * Contains default implementations used by QueryParser. - * You can override any of these to provide a customised QueryParser. - */ - class QueryParserBase:LUCENE_BASE - { - protected: - /* The actual operator the parser uses to combine query terms */ - int defaultOperator; - int32_t phraseSlop; - - bool lowercaseExpandedTerms; - - LUCENE_STATIC_CONSTANT(int, CONJ_NONE=0); - LUCENE_STATIC_CONSTANT(int, CONJ_AND=1); - LUCENE_STATIC_CONSTANT(int, CONJ_OR=2); - - LUCENE_STATIC_CONSTANT(int, MOD_NONE=0); - LUCENE_STATIC_CONSTANT(int, MOD_NOT=10); - LUCENE_STATIC_CONSTANT(int, MOD_REQ=11); - - CL_NS(analysis)::Analyzer* analyzer; - - public: - QueryParserBase(CL_NS(analysis)::Analyzer* analyzer); - ~QueryParserBase(); - - /** - * Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically - * lower-cased or not. Default is true. - */ - void setLowercaseExpandedTerms(bool lowercaseExpandedTerms); - - /** - * @see #setLowercaseExpandedTerms(boolean) - */ - bool getLowercaseExpandedTerms() const; - - //values used for setOperator - LUCENE_STATIC_CONSTANT(int, OR_OPERATOR=0); - LUCENE_STATIC_CONSTANT(int, AND_OPERATOR=1); - - /** - * Sets the boolean operator of the QueryParser. - * In default mode (OR_OPERATOR) terms without any modifiers - * are considered optional: for example capital of Hungary is equal to - * capital OR of OR Hungary.
- * In AND_OPERATOR mode terms are considered to be in conjuction: the - * above mentioned query is parsed as capital AND of AND Hungary - */ - void setDefaultOperator(int oper); - /** - * Gets implicit operator setting, which will be either AND_OPERATOR - * or OR_OPERATOR. - */ - int getDefaultOperator() const; - - //public so that the lexer can call this - virtual void throwParserException(const TCHAR* message, TCHAR ch, int32_t col, int32_t line ); - - /** - * Sets the default slop for phrases. If zero, then exact phrase matches - * are required. Default value is zero. - */ - void setPhraseSlop(int phraseSlop) { this->phraseSlop = phraseSlop; } - - /** - * Gets the default slop for phrases. - */ - int getPhraseSlop() { return phraseSlop; } - - protected: - - /** - * Removes the escaped characters - */ - void discardEscapeChar(TCHAR* token) const; - - //Analyzes the expanded term termStr with the StandardFilter and the LowerCaseFilter. - TCHAR* AnalyzeExpandedTerm(const TCHAR* field, TCHAR* termStr); - - // Adds the next parsed clause. - virtual void AddClause(std::vector& clauses, int32_t conj, int32_t mods, CL_NS(search)::Query* q); - - /** - * Returns a termquery, phrasequery for the specified field. - * Note: this is only a partial implementation, since MultiPhraseQuery is not implemented yet - * return NULL to disallow - */ - virtual CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText); - - /** - * Delegates to GetFieldQuery(string, string), and adds slop onto phrasequery. - * Can be used to remove slop functionality - */ - virtual CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop); - - /** - * Factory method for generating a query (similar to - * {@link #GetWildcardQuery}). Called when parser parses an input term - * token that uses prefix notation; that is, contains a single '*' wildcard - * character as its last character. Since this is a special case - * of generic wildcard term, and such a query can be optimized easily, - * this usually results in a different query object. - *

- * Depending on settings, a prefix term may be lower-cased - * automatically. It will not go through the default Analyzer, - * however, since normal Analyzers are unlikely to work properly - * with wildcard templates. - *

- * Can be overridden by extending classes, to provide custom handling for - * wild card queries, which may be necessary due to missing analyzer calls. - * - * @param field Name of the field query will use. - * @param termStr Term token to use for building term for the query - * (without trailing '*' character!) - * - * @return Resulting {@link Query} built for the term - * return NULL to disallow - */ - virtual CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field, TCHAR* termStr); - - /** - * Factory method for generating a query. Called when parser - * parses an input term token that contains one or more wildcard - * characters (? and *), but is not a prefix term token (one - * that has just a single * character at the end) - *

- * Depending on settings, prefix term may be lower-cased - * automatically. It will not go through the default Analyzer, - * however, since normal Analyzers are unlikely to work properly - * with wildcard templates. - *

- * Can be overridden by extending classes, to provide custom handling for - * wildcard queries, which may be necessary due to missing analyzer calls. - * - * @param field Name of the field query will use. - * @param termStr Term token that contains one or more wild card - * characters (? or *), but is not simple prefix term - * - * @return Resulting {@link Query} built for the term - * return NULL to disallow - */ - virtual CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr); - - /** - * Factory method for generating a query (similar to - * {@link #GetWildcardQuery}). Called when parser parses - * an input term token that has the fuzzy suffix (~) appended. - * - * @param field Name of the field query will use. - * @param termStr Term token to use for building term for the query - * - * @return Resulting {@link Query} built for the term - * return NULL to disallow - */ - virtual CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field, TCHAR* termStr); - - /** - * Factory method for generating query, given a set of clauses. - * By default creates a boolean query composed of clauses passed in. - * - * Can be overridden by extending classes, to modify query being - * returned. - * - * @param clauses Vector that contains {@link BooleanClause} instances - * to join. - * - * @return Resulting {@link Query} object. - * return NULL to disallow - * - * Memory: clauses must all be cleaned up by this function. - */ - virtual CL_NS(search)::Query* GetBooleanQuery(std::vector& clauses); - - /** - * return NULL to disallow - */ - virtual CL_NS(search)::Query* GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive); - virtual CL_NS(search)::Query* ParseRangeQuery(const TCHAR* field, TCHAR* str, bool inclusive); - - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp b/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp deleted file mode 100644 index ee88a3cb6..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "QueryToken.h" - -CL_NS_DEF(queryParser) - - -QueryToken::QueryToken(): - Value(NULL) -{ - set(UNKNOWN_); -} -QueryToken::QueryToken(TCHAR* value, const int32_t start, const int32_t end, const QueryToken::Types type): - Value(NULL) -{ - set(value,start,end,type); -} - -QueryToken::~QueryToken(){ -//Func - Destructor -//Pre - true -//Post - Instance has been destroyed - - #ifndef LUCENE_TOKEN_WORD_LENGTH - _CLDELETE_CARRAY( Value ); - #endif -} - -// Initializes a new instance of the Token class LUCENE_EXPORT. -// -QueryToken::QueryToken(TCHAR* value, const QueryToken::Types type): - Value(NULL) -{ - set(value,type); -} - -// Initializes a new instance of the Token class LUCENE_EXPORT. -// -QueryToken::QueryToken(QueryToken::Types type): - Value(NULL) -{ - set(type); -} - - -void QueryToken::set(TCHAR* value, const Types type){ - set(value,0,-1,type); -} -void QueryToken::set(TCHAR* value, const int32_t start, const int32_t end, const Types type){ - #ifndef LUCENE_TOKEN_WORD_LENGTH - _CLDELETE_CARRAY(Value); - Value = STRDUP_TtoT(value); - #else - _tcsncpy(Value,value,LUCENE_TOKEN_WORD_LENGTH); - Value[LUCENE_TOKEN_WORD_LENGTH]; - #endif - this->Start = start; - this->End = end; - this->Type = type; - - if ( this->End < 0 ) - this->End = _tcslen(Value); -} -void QueryToken::set(Types type){ - set(LUCENE_BLANK_STRING,0,0,type); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h b/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h deleted file mode 100644 index 739a667ba..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h +++ /dev/null @@ -1,76 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_queryParser_QueryToken_ -#define _lucene_queryParser_QueryToken_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "QueryParserBase.h" - -CL_NS_DEF(queryParser) - - // Token class that used by QueryParser. - class QueryToken:LUCENE_BASE - { - public: - enum Types - { - AND_, - OR, - NOT, - PLUS, - MINUS, - LPAREN, - RPAREN, - COLON, - CARAT, - QUOTED, - TERM, - SLOP, - FUZZY, - PREFIXTERM, - WILDTERM, - RANGEIN, - RANGEEX, - NUMBER, - EOF_, - UNKNOWN_ - }; - - - #ifdef LUCENE_TOKEN_WORD_LENGTH - TCHAR Value[LUCENE_TOKEN_WORD_LENGTH+1]; - #else - TCHAR* Value; - #endif - - int32_t Start; - int32_t End; - QueryToken::Types Type; - - // Initializes a new instance of the Token class. - QueryToken(TCHAR* value, const int32_t start, const int32_t end, const Types type); - - // Initializes a new instance of the Token class. - QueryToken(TCHAR* value, const Types type); - - // Initializes a new instance of the Token class. - QueryToken(Types type); - - // Initializes an empty instance of the Token class. - QueryToken(); - - ~QueryToken(); - - void set(TCHAR* value, const int32_t start, const int32_t end, const Types type); - void set(TCHAR* value, const Types type); - void set(Types type); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp b/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp deleted file mode 100644 index 7d30b931f..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "TokenList.h" - -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/VoidList.h" -#include "QueryToken.h" - -CL_NS_DEF(queryParser) - - TokenList::TokenList(){ - //Func - Constructor - //Pre - true - //Post - Instance has been created - } - - TokenList::~TokenList(){ - //Func - Destructor - //Pre - true - //Post - The tokenlist has been destroyed - - tokens.clear(); - } - - void TokenList::add(QueryToken* token){ - //Func - Adds a QueryToken token to the TokenList - //Pre - token != NULL - //Post - token has been added to the token list - - CND_PRECONDITION(token != NULL, "token != NULL"); - - tokens.insert(tokens.begin(),token); - } - - void TokenList::push(QueryToken* token){ - //Func - - //Pre - token != NULL - //Post - - - CND_PRECONDITION(token != NULL, "token is NULL"); - - tokens.push_back(token); - } - - QueryToken* TokenList::peek() { - /* DSR:2004.11.01: Reverted my previous (circa April 2004) fix (which - ** raised an exception if Peek was called when there were no tokens) in - ** favor of returning the EOF token. This solution is much better - ** integrated with the rest of the code in the queryParser subsystem. */ - size_t nTokens = tokens.size(); - if (nTokens == 0) { - push(_CLNEW QueryToken(QueryToken::EOF_)); - nTokens++; - } - return tokens[nTokens-1]; - } - - QueryToken* TokenList::extract(){ - //Func - Extract token from the TokenList - //Pre - true - //Post - Retracted token has been returned - - QueryToken* token = peek(); - //Retract the current peeked token - tokens.delete_back(); - - return token; - } - - int32_t TokenList::count() const - { - return tokens.size(); - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/queryParser/TokenList.h b/3rdparty/clucene/src/CLucene/queryParser/TokenList.h deleted file mode 100644 index 3166bba78..000000000 --- a/3rdparty/clucene/src/CLucene/queryParser/TokenList.h +++ /dev/null @@ -1,38 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_queryParser_TokenList_ -#define _lucene_queryParser_TokenList_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/VoidList.h" -#include "QueryToken.h" -CL_NS_DEF(queryParser) - - // Represents a list of the tokens. - class TokenList:LUCENE_BASE - { - private: - CL_NS(util)::CLVector tokens; //todo:,CL_NS(util)::Deletor::Object - public: - TokenList(); - ~TokenList(); - - void add(QueryToken* token); - - void push(QueryToken* token); - - QueryToken* peek(); - - QueryToken* extract(); - - int32_t count() const; - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/BooleanClause.h b/3rdparty/clucene/src/CLucene/search/BooleanClause.h deleted file mode 100644 index b89cb31d7..000000000 --- a/3rdparty/clucene/src/CLucene/search/BooleanClause.h +++ /dev/null @@ -1,90 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_BooleanClause_ -#define _lucene_search_BooleanClause_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif -#include "SearchHeader.h" - -CL_NS_DEF(search) - // A clause in a BooleanQuery. - class BooleanClause:LUCENE_BASE { - public: - class Compare:public CL_NS_STD(binary_function) - { - public: - bool operator()( const BooleanClause* val1, const BooleanClause* val2 ) const{ - return val1->equals(val2); - } - }; - - // The query whose matching documents are combined by the boolean query. - Query* query; - - int32_t getClauseCount(); - - // If true, documents documents which do not - // match this sub-query will not match the boolean query. - bool required; - - // If true, documents documents which do - // match this sub-query will not match the boolean query. - bool prohibited; - - bool deleteQuery; - - // Constructs a BooleanClause with query q, required - // r and prohibited p. - BooleanClause(Query* q, const bool DeleteQuery,const bool req, const bool p): - query(q), - required(req), - prohibited(p), - deleteQuery(DeleteQuery) - { - } - - BooleanClause(const BooleanClause& clone): -#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) -#elif defined(LUCENE_ENABLE_REFCOUNT) -#else - LuceneVoidBase(), -#endif - query(clone.query->clone()), - required(clone.required), - prohibited(clone.prohibited), - deleteQuery(true) - { - } - - BooleanClause* clone() const{ - BooleanClause* ret = _CLNEW BooleanClause(*this); - return ret; - } - - ~BooleanClause(){ - if ( deleteQuery ) - _CLDELETE( query ); - } - - /** Returns true iff o is equal to this. */ - bool equals(const BooleanClause* other) const { - return this->query->equals(other->query) - && (this->required == other->required) - && (this->prohibited == other->prohibited); - } - - size_t hashCode() const{ - return query->hashCode() ^ (this->required?1:0) ^ (this->prohibited?2:0); - } - }; - - -CL_NS_END -#endif - diff --git a/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp b/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp deleted file mode 100644 index 3fd36d847..000000000 --- a/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp +++ /dev/null @@ -1,363 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "BooleanQuery.h" - -#include "BooleanClause.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/StringBuffer.h" -#include "CLucene/util/Arrays.h" -#include "SearchHeader.h" -#include "BooleanScorer.h" -#include "Scorer.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - BooleanQuery::BooleanQuery(): - clauses(true) - { - } - - BooleanQuery::BooleanQuery(const BooleanQuery& clone): - Query(clone) - { - for ( uint32_t i=0;iclone(); - clause->deleteQuery=true; - add(clause); - } - } - - BooleanQuery::~BooleanQuery(){ - clauses.clear(); - } - - size_t BooleanQuery::hashCode() const { - //todo: do cachedHashCode, and invalidate on add/remove clause - size_t ret = 0; - for (uint32_t i = 0 ; i < clauses.size(); i++) { - BooleanClause* c = clauses[i]; - ret = 31 * ret + c->hashCode(); - } - ret = ret ^ Similarity::floatToByte(getBoost()); - return ret; - } - - const TCHAR* BooleanQuery::getQueryName() const{ - return getClassName(); - } - const TCHAR* BooleanQuery::getClassName(){ - return _T("BooleanQuery"); - } - - /** - * Default value is 1024. Use org.apache.lucene.maxClauseCount - * system property to override. - */ - size_t BooleanQuery::maxClauseCount = LUCENE_BOOLEANQUERY_MAXCLAUSECOUNT; - size_t BooleanQuery::getMaxClauseCount(){ - return maxClauseCount; - } - - void BooleanQuery::setMaxClauseCount(size_t maxClauseCount){ - BooleanQuery::maxClauseCount = maxClauseCount; - } - - void BooleanQuery::add(Query* query, const bool deleteQuery, const bool required, const bool prohibited) { - BooleanClause* bc = _CLNEW BooleanClause(query,deleteQuery,required, prohibited); - try{ - add(bc); - }catch(...){ - _CLDELETE(bc); - throw; - } - } - - void BooleanQuery::add(BooleanClause* clause) { - if (clauses.size() >= getMaxClauseCount()) - _CLTHROWA(CL_ERR_TooManyClauses,"Too Many Clauses"); - - clauses.push_back(clause); - } - - - size_t BooleanQuery::getClauseCount() const { - return (int32_t) clauses.size(); - } - - TCHAR* BooleanQuery::toString(const TCHAR* field) const{ - StringBuffer buffer; - if (getBoost() != 1.0) { - buffer.append(_T("(")); - } - - for (uint32_t i = 0 ; i < clauses.size(); i++) { - BooleanClause* c = clauses[i]; - if (c->prohibited) - buffer.append(_T("-")); - else if (c->required) - buffer.append(_T("+")); - - if ( c->query->instanceOf(BooleanQuery::getClassName()) ) { // wrap sub-bools in parens - buffer.append(_T("(")); - - TCHAR* buf = c->query->toString(field); - buffer.append(buf); - _CLDELETE_CARRAY( buf ); - - buffer.append(_T(")")); - } else { - TCHAR* buf = c->query->toString(field); - buffer.append(buf); - _CLDELETE_CARRAY( buf ); - } - if (i != clauses.size()-1) - buffer.append(_T(" ")); - - if (getBoost() != 1.0) { - buffer.append(_T(")^")); - buffer.appendFloat(getBoost(),1); - } - } - return buffer.toString(); - } - - - - - BooleanClause** BooleanQuery::getClauses() const - { - CND_MESSAGE(false, "Warning: BooleanQuery::getClauses() is deprecated") - BooleanClause** ret = _CL_NEWARRAY(BooleanClause*, clauses.size()+1); - getClauses(ret); - return ret; - } - - void BooleanQuery::getClauses(BooleanClause** ret) const - { - size_t size=clauses.size(); - for ( uint32_t i=0;iprohibited) { // just return clause - Query* query = c->query->rewrite(reader); // rewrite first - - //if the query doesn't actually get re-written, - //then return a clone (because the BooleanQuery - //will register different to the returned query. - if ( query == c->query ) - query = query->clone(); - - if (getBoost() != 1.0f) { // incorporate boost - query->setBoost(getBoost() * query->getBoost()); - } - - return query; - } - } - - BooleanQuery* clone = NULL; // recursively rewrite - for (uint32_t i = 0 ; i < clauses.size(); i++) { - BooleanClause* c = clauses[i]; - Query* query = c->query->rewrite(reader); - if (query != c->query) { // clause rewrote: must clone - if (clone == NULL) - clone = (BooleanQuery*)this->clone(); - //todo: check if delete query should be on... - //in fact we should try and get rid of these - //for compatibility sake - clone->clauses.set (i, _CLNEW BooleanClause(query, true, c->required, c->prohibited)); - } - } - if (clone != NULL) { - return clone; // some clauses rewrote - } else - return this; // no clauses rewrote - } - - - Query* BooleanQuery::clone() const{ - BooleanQuery* clone = _CLNEW BooleanQuery(*this); - return clone; - } - - /** Returns true iff o is equal to this. */ - bool BooleanQuery::equals(Query* o)const { - if (!(o->instanceOf(BooleanQuery::getClassName()))) - return false; - const BooleanQuery* other = (BooleanQuery*)o; - - bool ret = (this->getBoost() == other->getBoost()); - if ( ret ){ - CLListEquals comp; - ret = comp.equals(&this->clauses,&other->clauses); - } - return ret; - } - - qreal BooleanQuery::BooleanWeight::getValue() { return parentQuery->getBoost(); } - Query* BooleanQuery::BooleanWeight::getQuery() { return (Query*)parentQuery; } - - - - - - BooleanQuery::BooleanWeight::BooleanWeight(Searcher* searcher, - CLVector >* clauses, BooleanQuery* parentQuery) - { - this->searcher = searcher; - this->parentQuery = parentQuery; - this->clauses = clauses; - for (uint32_t i = 0 ; i < clauses->size(); i++) { - weights.push_back((*clauses)[i]->query->_createWeight(searcher)); - } - } - BooleanQuery::BooleanWeight::~BooleanWeight(){ - this->weights.clear(); - } - - qreal BooleanQuery::BooleanWeight::sumOfSquaredWeights() { - qreal sum = 0.0f; - for (uint32_t i = 0 ; i < weights.size(); i++) { - BooleanClause* c = (*clauses)[i]; - Weight* w = weights[i]; - if (!c->prohibited) - sum += w->sumOfSquaredWeights(); // sum sub weights - } - sum *= parentQuery->getBoost() * parentQuery->getBoost(); // boost each sub-weight - return sum ; - } - - void BooleanQuery::BooleanWeight::normalize(qreal norm) { - norm *= parentQuery->getBoost(); // incorporate boost - for (uint32_t i = 0 ; i < weights.size(); i++) { - BooleanClause* c = (*clauses)[i]; - Weight* w = weights[i]; - if (!c->prohibited) - w->normalize(norm); - } - } - - Scorer* BooleanQuery::BooleanWeight::scorer(IndexReader* reader){ - // First see if the (faster) ConjunctionScorer will work. This can be - // used when all clauses are required. Also, at this point a - // BooleanScorer cannot be embedded in a ConjunctionScorer, as the hits - // from a BooleanScorer are not always sorted by document number (sigh) - // and hence BooleanScorer cannot implement skipTo() correctly, which is - // required by ConjunctionScorer. - bool allRequired = true; - bool noneBoolean = true; - { //msvc6 scope fix - for (uint32_t i = 0 ; i < weights.size(); i++) { - BooleanClause* c = (*clauses)[i]; - if (!c->required) - allRequired = false; - if (c->query->instanceOf(BooleanQuery::getClassName())) - noneBoolean = false; - } - } - - if (allRequired && noneBoolean) { // ConjunctionScorer is okay - ConjunctionScorer* result = - _CLNEW ConjunctionScorer(parentQuery->getSimilarity(searcher)); - for (uint32_t i = 0 ; i < weights.size(); i++) { - Weight* w = weights[i]; - Scorer* subScorer = w->scorer(reader); - if (subScorer == NULL) - return NULL; - result->add(subScorer); - } - return result; - } - - // Use good-old BooleanScorer instead. - BooleanScorer* result = _CLNEW BooleanScorer(parentQuery->getSimilarity(searcher)); - - { //msvc6 scope fix - for (uint32_t i = 0 ; i < weights.size(); i++) { - BooleanClause* c = (*clauses)[i]; - Weight* w = weights[i]; - Scorer* subScorer = w->scorer(reader); - if (subScorer != NULL) - result->add(subScorer, c->required, c->prohibited); - else if (c->required) - return NULL; - } - } - - return result; - } - - void BooleanQuery::BooleanWeight::explain(IndexReader* reader, int32_t doc, Explanation* result){ - int32_t coord = 0; - int32_t maxCoord = 0; - qreal sum = 0.0f; - Explanation* sumExpl = _CLNEW Explanation; - for (uint32_t i = 0 ; i < weights.size(); i++) { - BooleanClause* c = (*clauses)[i]; - Weight* w = weights[i]; - Explanation* e = _CLNEW Explanation; - w->explain(reader, doc, e); - if (!c->prohibited) - maxCoord++; - if (e->getValue() > 0) { - if (!c->prohibited) { - sumExpl->addDetail(e); - sum += e->getValue(); - coord++; - e = NULL; //prevent e from being deleted - } else { - //we want to return something else... - _CLDELETE(sumExpl); - result->setValue(0.0f); - result->setDescription(_T("match prohibited")); - return; - } - } else if (c->required) { - _CLDELETE(sumExpl); - result->setValue(0.0f); - result->setDescription(_T("match prohibited")); - return; - } - - _CLDELETE(e); - } - sumExpl->setValue(sum); - - if (coord == 1){ // only one clause matched - Explanation* tmp = sumExpl; - sumExpl = sumExpl->getDetail(0)->clone(); // eliminate wrapper - _CLDELETE(tmp); - } - - sumExpl->setDescription(_T("sum of:")); - qreal coordFactor = parentQuery->getSimilarity(searcher)->coord(coord, maxCoord); - if (coordFactor == 1.0f){ // coord is no-op - result->set(*sumExpl); // eliminate wrapper - _CLDELETE(sumExpl); - } else { - result->setDescription( _T("product of:")); - result->addDetail(sumExpl); - - StringBuffer explbuf; - explbuf.append(_T("coord(")); - explbuf.appendInt(coord); - explbuf.append(_T("/")); - explbuf.appendInt(maxCoord); - explbuf.append(_T(")")); - result->addDetail(_CLNEW Explanation(coordFactor, explbuf.getBuffer())); - result->setValue(sum*coordFactor); - } - } - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/BooleanQuery.h b/3rdparty/clucene/src/CLucene/search/BooleanQuery.h deleted file mode 100644 index 27b67d1e5..000000000 --- a/3rdparty/clucene/src/CLucene/search/BooleanQuery.h +++ /dev/null @@ -1,126 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_BooleanQuery_ -#define _lucene_search_BooleanQuery_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "ConjunctionScorer.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/StringBuffer.h" -#include "SearchHeader.h" -#include "BooleanClause.h" -#include "BooleanScorer.h" -#include "Scorer.h" - -CL_NS_DEF(search) - - - // A Query that matches documents matching boolean combinations of other - // queries, typically {@link TermQuery}s or {@link PhraseQuery}s. - class BooleanQuery:public Query { - public: - typedef CL_NS(util)::CLVector > ClausesType; - private: - BooleanQuery::ClausesType clauses; - static size_t maxClauseCount; - - class BooleanWeight: public Weight { - private: - Searcher* searcher; - CL_NS(util)::CLVector > weights; - ClausesType* clauses; - BooleanQuery* parentQuery; - public: - BooleanWeight(Searcher* searcher, - CL_NS(util)::CLVector >* clauses, - BooleanQuery* parentQuery); - ~BooleanWeight(); - Query* getQuery(); - qreal getValue(); - qreal sumOfSquaredWeights(); - void normalize(qreal norm); - Scorer* scorer(CL_NS(index)::IndexReader* reader); - void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret); - };//booleanweight - - protected: - Weight* _createWeight(Searcher* searcher) { - return _CLNEW BooleanWeight(searcher,&clauses,this); - } - BooleanQuery(const BooleanQuery& clone); - public: - /** Constructs an empty boolean query. */ - BooleanQuery(); - - ~BooleanQuery(); - - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); - - /** Return the maximum number of clauses permitted, 1024 by default. - * Attempts to add more than the permitted number of clauses cause {@link - * TooManyClauses} to be thrown.*/ - static size_t getMaxClauseCount(); - - /** Set the maximum number of clauses permitted. */ - static void setMaxClauseCount(size_t maxClauseCount); - - /** Adds a clause to a boolean query. Clauses may be: - *

    - *
  • required which means that documents which do not - * match this sub-query will not match the boolean query; - *
  • prohibited which means that documents which do - * match this sub-query will not match the boolean query; or - *
  • neither, in which case matched documents are neither prohibited from - * nor required to match the sub-query. However, a document must match at - * least 1 sub-query to match the boolean query. - *
- * It is an error to specify a clause as both required and - * prohibited. - * - * @see #getMaxClauseCount() - */ - void add(Query* query, const bool required, const bool prohibited){ - add(query,false,required,prohibited); - } - void add(Query* query, const bool deleteQuery, const bool required, const bool prohibited); - - /** Copies the clauses of this query into the array. - * The array must be at least as long as getClauseCount() - * If you want to use the clauses, make sure you null terminate it. - */ - void getClauses(BooleanClause** clauses) const; - - ///@deprecated - _CL_DEPRECATED( getClauses(clauses) ) BooleanClause** getClauses() const; - - /** - * Give client code access to clauses.size() so we know how - * large the array returned by getClauses is. - */ - size_t getClauseCount() const; - - /** Adds a clause to a boolean query. - * @see #getMaxClauseCount() - */ - void add(BooleanClause* clause); - - Query* rewrite(CL_NS(index)::IndexReader* reader); - Query* clone() const; - bool equals(Query* o) const; - - /** Prints a user-readable version of this query. */ - TCHAR* toString(const TCHAR* field) const; - /** Returns a hash code value for this object.*/ - size_t hashCode() const; - }; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp b/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp deleted file mode 100644 index ae7ee40d6..000000000 --- a/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "BooleanScorer.h" - -#include "Scorer.h" -#include "Similarity.h" - -CL_NS_USE(util) -CL_NS_DEF(search) - - BooleanScorer::BooleanScorer(Similarity* similarity): - Scorer(similarity), - scorers(NULL), - maxCoord (1), - nextMask (1), - end(0), - current(NULL), - requiredMask (0), - prohibitedMask (0), - coordFactors (NULL) - { - bucketTable = _CLNEW BucketTable(this); - } - - BooleanScorer::~BooleanScorer(){ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - _CLDELETE(bucketTable); - _CLDELETE_ARRAY(coordFactors); - _CLDELETE(scorers); - } - - - bool BooleanScorer::next() { - bool more; - do { - while (bucketTable->first != NULL) { // more queued - current = bucketTable->first; - bucketTable->first = current->next; // pop the queue - - // check prohibited & required - if ((current->bits & prohibitedMask) == 0 && - (current->bits & requiredMask) == requiredMask) { - return true; - } - } - - // refill the queue - more = false; - end += BooleanScorer::BucketTable_SIZE; - for (SubScorer* sub = scorers; sub != NULL; sub = sub->next) { - Scorer* scorer = sub->scorer; - int32_t doc; - while (!sub->done && (doc=scorer->doc()) < end) { - sub->collector->collect(doc, scorer->score()); - sub->done = !scorer->next(); - } - if (!sub->done) { - more = true; - } - } - } while (bucketTable->first != NULL || more); - - return false; - } - - qreal BooleanScorer::score(){ - if (coordFactors == NULL) - computeCoordFactors(); - return current->score * coordFactors[current->coord]; - } - - bool BooleanScorer::skipTo(int32_t target) { - _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: BooleanScorer::skipTo"); - } - - void BooleanScorer::explain(int32_t doc, Explanation* ret) { - _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: BooleanScorer::explain"); - } - - TCHAR* BooleanScorer::toString() { - CL_NS(util)::StringBuffer buffer; - buffer.append(_T("boolean(")); - for (SubScorer* sub = scorers; sub != NULL; sub = sub->next) { - buffer.append(sub->scorer->toString()); - buffer.append(_T(" ")); - } - buffer.appendChar(')'); - return buffer.toString(); - } - - void BooleanScorer::add(Scorer* scorer, const bool required, const bool prohibited) { - int32_t mask = 0; - if (required || prohibited) { - if (nextMask == 0) - _CLTHROWA(CL_ERR_IndexOutOfBounds, "More than 32 required/prohibited clauses in query."); - mask = nextMask; - nextMask = ( nextMask << 1 ); - } else - mask = 0; - - if (!prohibited) - maxCoord++; - - if (prohibited) - prohibitedMask |= mask; // update prohibited mask - else if (required) - requiredMask |= mask; // update required mask - - //scorer, HitCollector, and scorers is delete in the SubScorer - scorers = _CLNEW SubScorer(scorer, required, prohibited, - bucketTable->newCollector(mask), scorers); - } - - void BooleanScorer::computeCoordFactors(){ - coordFactors = _CL_NEWARRAY(qreal,maxCoord); - for (int32_t i = 0; i < maxCoord; i++) - coordFactors[i] = getSimilarity()->coord(i, maxCoord-1); - } - - /*void BooleanScorer::score(HitCollector* results, const int32_t maxDoc) { - if (coordFactors == NULL) - computeCoordFactors(); - - while (currentDoc < maxDoc) { - currentDoc = (currentDoc+BucketTable_SIZEnext) - t->scorer->score((t->collector), currentDoc); - bucketTable->collectHits(results); - } - }*/ - - - - - BooleanScorer::SubScorer::SubScorer(Scorer* scr, const bool r, const bool p, HitCollector* c, SubScorer* nxt): - scorer(scr), - required(r), - prohibited(p), - collector(c), - next(nxt) - { - //Func - Constructor - //Pre - scr != NULL, - // c != NULL - // nxt may or may not be NULL - //Post - The instance has been created - - CND_PRECONDITION(scr != NULL,"scr is NULL"); - CND_PRECONDITION(c != NULL,"c is NULL"); - - done = !scorer->next(); - } - - BooleanScorer::SubScorer::~SubScorer(){ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - for (SubScorer * ptr = next; ptr; ){ - SubScorer* next = ptr->next; - ptr->next = NULL; - _CLDELETE(ptr); - ptr = next; - } - _CLDELETE(scorer); - _CLDELETE(collector); - } - - BooleanScorer::Bucket::Bucket(): - doc(-1), - score(0.0), - bits(0), - coord(0), - next(NULL) - { - } - BooleanScorer::Bucket::~Bucket(){ - } - - - - - BooleanScorer::BucketTable::BucketTable(BooleanScorer* scr): - scorer(scr), - first(NULL) - { - buckets = _CL_NEWARRAY(Bucket,BucketTable_SIZE); - } - BooleanScorer::BucketTable::~BucketTable(){ - clear(); - _CLDELETE_ARRAY(buckets); - } - - void BooleanScorer::BucketTable::clear(){ - //delete first; - first = NULL; - } - int32_t BooleanScorer::BucketTable::size() const { return BooleanScorer::BucketTable_SIZE; } - - HitCollector* BooleanScorer::BucketTable::newCollector(const int32_t mask) { - return _CLNEW Collector(mask, this); - } - - - - - - - - - - BooleanScorer::Collector::Collector(const int32_t msk, BucketTable* bucketTbl): - bucketTable(bucketTbl), - mask(msk) - { - } - - void BooleanScorer::Collector::collect(const int32_t doc, const qreal score){ - BucketTable* table = bucketTable; - int32_t i = doc & (BooleanScorer::BucketTable_SIZE-1); - Bucket* bucket = &table->buckets[i]; - - if (bucket->doc != doc) { // invalid bucket - bucket->doc = doc; // set doc - bucket->score = score; // initialize score - bucket->bits = mask; // initialize mask - bucket->coord = 1; // initialize coord - - bucket->next = table->first; // push onto valid list - table->first = bucket; - } else { // valid bucket - bucket->score += score; // increment score - bucket->bits |= mask; // add bits in mask - bucket->coord++; // increment coord - } - } - - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/BooleanScorer.h b/3rdparty/clucene/src/CLucene/search/BooleanScorer.h deleted file mode 100644 index 2147bc516..000000000 --- a/3rdparty/clucene/src/CLucene/search/BooleanScorer.h +++ /dev/null @@ -1,99 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_BooleanScorer_ -#define _lucene_search_BooleanScorer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Scorer.h" - -CL_NS_DEF(search) - -class BooleanScorer : public Scorer { -public: - class Bucket : LUCENE_BASE { - public: - int32_t doc; // tells if bucket is valid - qreal score; // incremental score - int32_t bits; // used for bool constraints - int32_t coord; // count of terms in score - Bucket* next; // next valid bucket - - Bucket(); - ~Bucket(); - }; - - class SubScorer: LUCENE_BASE { - public: - bool done; - Scorer* scorer; - bool required; - bool prohibited; - HitCollector* collector; - SubScorer* next; - SubScorer(Scorer* scr, const bool r, const bool p, HitCollector* c, SubScorer* nxt); - ~SubScorer(); - }; - - class BucketTable:LUCENE_BASE { - private: - BooleanScorer* scorer; - public: - Bucket* buckets; - Bucket* first; // head of valid list - - BucketTable(BooleanScorer* scr); - int32_t size() const; - HitCollector* newCollector(const int32_t mask); - void clear(); - ~BucketTable(); - - }; - - class Collector: public HitCollector { - private: - BucketTable* bucketTable; - int32_t mask; - public: - Collector(const int32_t mask, BucketTable* bucketTable); - - void collect(const int32_t doc, const qreal score); - }; - - SubScorer* scorers; - BucketTable* bucketTable; - - int32_t maxCoord; - int32_t nextMask; - - int32_t end; - Bucket* current; - -public: - LUCENE_STATIC_CONSTANT(int32_t,BucketTable_SIZE=1024); - int32_t requiredMask; - int32_t prohibitedMask; - qreal* coordFactors; - - BooleanScorer(Similarity* similarity); - ~BooleanScorer(); - void add(Scorer* scorer, const bool required, const bool prohibited); - int32_t doc() const { return current->doc; } - bool next(); - qreal score(); - bool skipTo(int32_t target); - void explain(int32_t doc, Explanation* ret); - TCHAR* toString(); - void computeCoordFactors(); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp b/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp deleted file mode 100644 index 694556ca7..000000000 --- a/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CachingWrapperFilter.h" - -CL_NS_DEF(search) -CL_NS_USE(index) -CL_NS_USE(util) - -AbstractCachingFilter::AbstractCachingFilter(): - cache(false,true) -{ -} -AbstractCachingFilter::AbstractCachingFilter(const AbstractCachingFilter& copy): - cache(false,true) -{ -} -AbstractCachingFilter::~AbstractCachingFilter(){ -} -AbstractCachingFilter::BitSetHolder::BitSetHolder(CL_NS(util)::BitSet* bits, bool deleteBs){ - this->bits = bits; - this->deleteBs = deleteBs; -} -AbstractCachingFilter::BitSetHolder::~BitSetHolder(){ - if ( deleteBs ) - _CLDELETE(bits); -} - - -BitSet* AbstractCachingFilter::bits(IndexReader* reader){ - SCOPED_LOCK_MUTEX(cache.THIS_LOCK) - BitSetHolder* cached = cache.get(reader); - if ( cached != NULL ) - return cached->bits; - BitSet* bs = doBits(reader); - BitSetHolder* bsh = _CLNEW BitSetHolder(bs, doShouldDeleteBitSet(bs)); - cache.put(reader,bsh); - return bs; -} -void AbstractCachingFilter::closeCallback(CL_NS(index)::IndexReader* reader, void*){ - SCOPED_LOCK_MUTEX(cache.THIS_LOCK) - cache.remove(reader); -} - - - - -CachingWrapperFilter::CachingWrapperFilter(Filter* filter, bool deleteFilter){ - this->filter = filter; - this->deleteFilter = deleteFilter; -} -CachingWrapperFilter::CachingWrapperFilter(const CachingWrapperFilter& copy): - AbstractCachingFilter(copy) -{ - this->filter = copy.filter->clone(); - this->deleteFilter = true; -} -Filter* CachingWrapperFilter::clone() const{ - return _CLNEW CachingWrapperFilter(*this); -} -TCHAR* CachingWrapperFilter::toString(){ - TCHAR* fs = filter->toString(); - int len = _tcslen(fs)+23; - TCHAR* ret = _CL_NEWARRAY(TCHAR,len); - _sntprintf(ret,len,_T("CachingWrapperFilter(%s)"),fs); - _CLDELETE_CARRAY(fs); - return ret; -} -BitSet* CachingWrapperFilter::doBits(IndexReader* reader){ - return filter->bits(reader); -} -bool CachingWrapperFilter::doShouldDeleteBitSet( CL_NS(util)::BitSet* bits ){ - return filter->shouldDeleteBitSet(bits); -} -CachingWrapperFilter::~CachingWrapperFilter(){ - if ( deleteFilter ){ - _CLDELETE(filter); - }else - filter=NULL; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h b/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h deleted file mode 100644 index e48a18292..000000000 --- a/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_CachingWrapperFilter_ -#define _lucene_search_CachingWrapperFilter_ - -#include "CLucene/util/BitSet.h" -#include "CLucene/index/IndexReader.h" -#include "Filter.h" - -CL_NS_DEF(search) -/** - * Wraps another filter's result and caches it. The purpose is to allow - * filters to implement this and allow itself to be cached. Alternatively, - * use the CachingWrapperFilter to cache the filter. - */ -class AbstractCachingFilter: public Filter -{ - class BitSetHolder: LUCENE_BASE{ - bool deleteBs; - public: - BitSetHolder(CL_NS(util)::BitSet* bits, bool deleteBs); - ~BitSetHolder(); - CL_NS(util)::BitSet* bits; - }; - void closeCallback(CL_NS(index)::IndexReader* reader, void* param); - typedef CL_NS(util)::CLHashMap, - CL_NS(util)::Equals::Void, - CL_NS(util)::Deletor::Object, - CL_NS(util)::Deletor::Object > CacheType; - - CacheType cache; - -protected: - AbstractCachingFilter( const AbstractCachingFilter& copy ); - virtual CL_NS(util)::BitSet* doBits( CL_NS(index)::IndexReader* reader ) = 0; - virtual bool doShouldDeleteBitSet( CL_NS(util)::BitSet* bits ){ return false; } - AbstractCachingFilter(); -public: - virtual ~AbstractCachingFilter(); - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); - - virtual Filter *clone() const = 0; - virtual TCHAR *toString() = 0; - - bool shouldDeleteBitSet( const CL_NS(util)::BitSet* bits ) const{ return false; } -}; - -/** - * Wraps another filter's result and caches it. The purpose is to allow - * filters to simply filter, and then wrap with this class to add - * caching, keeping the two concerns decoupled yet composable. - */ -class CachingWrapperFilter: public AbstractCachingFilter -{ -private: - Filter* filter; - bool deleteFilter; -protected: - CachingWrapperFilter( const CachingWrapperFilter& copy ); - CL_NS(util)::BitSet* doBits( CL_NS(index)::IndexReader* reader ); - bool doShouldDeleteBitSet( CL_NS(util)::BitSet* bits ); -public: - CachingWrapperFilter( Filter* filter, bool deleteFilter=true ); - ~CachingWrapperFilter(); - - Filter *clone() const; - TCHAR *toString(); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp b/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp deleted file mode 100644 index 4b6389c0f..000000000 --- a/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -#include -#include -#include "ChainedFilter.h" - -CL_NS_DEF(search) -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_USE(document) - - -ChainedFilter::ChainedFilter( Filter ** _filters, int _op ): - filters(_filters), - logicArray(NULL), - logic(_op) -{ -} -ChainedFilter::ChainedFilter( Filter** _filters, int* _array ): - filters(_filters), - logicArray(_array), - logic(-1) -{ -} -ChainedFilter::ChainedFilter( const ChainedFilter& copy ) : - logicArray( copy.logicArray ), - logic( copy.logic ) -{ - filters = copy.filters; -} -ChainedFilter::~ChainedFilter(void) -{ - -} - -Filter* ChainedFilter::clone() const { - return _CLNEW ChainedFilter(*this ); -} - -const TCHAR* ChainedFilter::getLogicString(int logic){ - if ( logic == ChainedFilter::OR ) - return _T("OR"); - else if ( logic == ChainedFilter::AND ) - return _T("AND"); - else if ( logic == ChainedFilter::ANDNOT ) - return _T("ANDNOT"); - else if ( logic == ChainedFilter::XOR ) - return _T("XOR"); - else if ( logic >= ChainedFilter::USER ){ - return _T("USER"); - } - return _T(""); -} - -TCHAR* ChainedFilter::toString() -{ - - Filter** filter = filters; - - StringBuffer buf(_T("ChainedFilter: [")); - int* la = logicArray; - while(*filter ) - { - if ( filter != filters ) - buf.appendChar(' '); - buf.append(getLogicString(logic==-1?*la:logic)); - buf.appendChar(' '); - - TCHAR* filterstr = (*filter)->toString(); - buf.append(filterstr); - _CLDELETE_ARRAY( filterstr ); - - filter++; - if ( logic == -1 ) - la++; - } - - buf.appendChar(']'); - - return buf.toString(); -} - - -/** Returns a BitSet with true for documents which should be permitted in -search results, and false for those that should not. */ -BitSet* ChainedFilter::bits( IndexReader* reader ) -{ - if( logic != -1 ) - return bits( reader, logic ); - else if( logicArray != NULL ) - return bits( reader, logicArray ); - else - return bits( reader, DEFAULT ); -} - - -BitSet* ChainedFilter::bits( IndexReader* reader, int logic ) -{ - BitSet* bts = NULL; - - Filter** filter = filters; - - // see discussion at top of file - if( *filter ) { - BitSet* tmp = (*filter)->bits( reader ); - if ( (*filter)->shouldDeleteBitSet(tmp) ) //if we are supposed to delete this BitSet, then - bts = tmp; //we can safely call it our own - else if ( tmp == NULL ){ - int32_t len = reader->maxDoc(); - bts = _CLNEW BitSet( len ); //bitset returned null, which means match _all_ - for (int32_t i=0;iset(i); - }else{ - bts = tmp->clone(); //else it is probably cached, so we need to copy it before using it. - } - filter++; - } - else - bts = _CLNEW BitSet( reader->maxDoc() ); - - while( *filter ) { - doChain( bts, reader, logic, *filter ); - filter++; - } - - return bts; -} - - -BitSet* ChainedFilter::bits( IndexReader* reader, int* _logicArray ) -{ - BitSet* bts = NULL; - - Filter** filter = filters; - int* logic = _logicArray; - - // see discussion at top of file - if( *filter ) { - BitSet* tmp = (*filter)->bits( reader ); - if ( (*filter)->shouldDeleteBitSet(tmp) ) //if we are supposed to delete this BitSet, then - bts = tmp; //we can safely call it our own - else if ( tmp == NULL ){ - int32_t len = reader->maxDoc(); - bts = _CLNEW BitSet( len ); //bitset returned null, which means match _all_ - for (int32_t i=0;iset(i); //todo: this could mean that we can skip certain types of filters - } - else - { - bts = tmp->clone(); //else it is probably cached, so we need to copy it before using it. - } - filter++; - logic++; - } - else - bts = _CLNEW BitSet( reader->maxDoc() ); - - while( *filter ) { - doChain( bts, reader, *logic, *filter ); - filter++; - logic++; - } - - return bts; -} - -void ChainedFilter::doUserChain( CL_NS(util)::BitSet* chain, CL_NS(util)::BitSet* filter, int logic ){ - _CLTHROWA(CL_ERR_Runtime,"User chain logic not implemented by superclass"); -} - -BitSet* ChainedFilter::doChain( BitSet* resultset, IndexReader* reader, int logic, Filter* filter ) -{ - BitSet* filterbits = filter->bits( reader ); - int32_t maxDoc = reader->maxDoc(); - int32_t i=0; - if ( logic >= ChainedFilter::USER ){ - doUserChain(resultset,filterbits,logic); - }else{ - switch( logic ) - { - case OR: - for( i=0; i < maxDoc; i++ ) - resultset->set( i, (resultset->get(i) || (filterbits==NULL || filterbits->get(i) ))?1:0 ); - break; - case AND: - for( i=0; i < maxDoc; i++ ) - resultset->set( i, (resultset->get(i) && (filterbits==NULL || filterbits->get(i) ))?1:0 ); - break; - case ANDNOT: - for( i=0; i < maxDoc; i++ ) - resultset->set( i, (resultset->get(i) && (filterbits==NULL || filterbits->get(i)))?0:1 ); - break; - case XOR: - for( i=0; i < maxDoc; i++ ) - resultset->set( i, resultset->get(i) ^ ((filterbits==NULL || filterbits->get(i) )?1:0) ); - break; - default: - doChain( resultset, reader, DEFAULT, filter ); - } - } - - if ( filter->shouldDeleteBitSet(filterbits) ) - _CLDELETE( filterbits ); - - return resultset; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/ChainedFilter.h b/3rdparty/clucene/src/CLucene/search/ChainedFilter.h deleted file mode 100644 index f4d9d0049..000000000 --- a/3rdparty/clucene/src/CLucene/search/ChainedFilter.h +++ /dev/null @@ -1,86 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_ChainedFilter_ -#define _lucene_search_ChainedFilter_ - -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/BitSet.h" -#include "CLucene/search/Filter.h" - -CL_NS_DEF(search) - -/* -Discussion - brian@unixpoet.com - -From ChainedFilter.java: - -... - -// First AND operation takes place against a completely false -// bitset and will always return zero results. Thanks to -// Daniel Armbrust for pointing this out and suggesting workaround. - -if (logic[0] == AND) -{ - result = (BitSet) chain[i].bits(reader).clone(); - ++i; -} - -... - -The observation is correct and it was buggy. The problem is that the same -issue remains for the ANDNOT logic op but with the inverse result: all bits -set to 1. The result of the other ops, i.e. OR, AND, XOR for the first filter -ends up just copying the bitset of the first filter (explicitly in the case of the AND). - -Why not do the same for the NAND? This will have the side effect of rendering the first op -in the logic array superflous - not a big problem. - -The only "problem" is that we will return different results then the Java -Lucene code - though I prefer CLucene to be a correct implementation and only maintain -API compat rather than full 100% compat with Lucene. -*/ -class ChainedFilter: public Filter -{ -public: - LUCENE_STATIC_CONSTANT(int, OR = 0); //set current bit if the chain is set OR if the filter bit is set - LUCENE_STATIC_CONSTANT(int, AND = 1); //set current bit if the chain is set AND the filter bit is set - LUCENE_STATIC_CONSTANT(int, ANDNOT = 2); //set current bit if the chain is not set AND the filter bit is not set - LUCENE_STATIC_CONSTANT(int, XOR = 3); //set current bit if the chain is set OR the filter bit is set BUT not both is set - - LUCENE_STATIC_CONSTANT(int, USER = 5); //add this value to user defined value, then override doUserChain - - LUCENE_STATIC_CONSTANT(int, DEFAULT = OR); - -protected: - Filter **filters; - int *logicArray; - int logic; - - ChainedFilter( const ChainedFilter& copy ); - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader, int logic ); - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader, int* logicArray ); - CL_NS(util)::BitSet* doChain( CL_NS(util)::BitSet* result, CL_NS(index)::IndexReader* reader, int logic, Filter* filter ); - - virtual void doUserChain( CL_NS(util)::BitSet* chain, CL_NS(util)::BitSet* filter, int logic ); - virtual const TCHAR* getLogicString(int logic); -public: - ChainedFilter( Filter** filters, int op = DEFAULT ); - ChainedFilter( Filter** filters, int* _array ); - virtual ~ChainedFilter(); - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); - - virtual Filter* clone() const; - - TCHAR* toString(); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/Compare.h b/3rdparty/clucene/src/CLucene/search/Compare.h deleted file mode 100644 index ab38b17f1..000000000 --- a/3rdparty/clucene/src/CLucene/search/Compare.h +++ /dev/null @@ -1,161 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_Compare_ -#define _lucene_search_Compare_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "FieldSortedHitQueue.h" - -CL_NS_DEF(search) - - -class ScoreDocComparators:LUCENE_BASE { -protected: - ScoreDocComparators(){} -public: - ~ScoreDocComparators(){ - } - - class Relevance:public ScoreDocComparator { - public: - int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { - if (i->score > j->score) return -1; - if (i->score < j->score) return 1; - return 0; - } - CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { - return _CLNEW CL_NS(util)::Compare::Float (i->score); - } - int32_t sortType() { - return SortField::DOCSCORE; - } - }; - - class IndexOrder:public ScoreDocComparator{ - public: - IndexOrder(): - ScoreDocComparator() - { - - } - int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { - if (i->doc < j->doc) return -1; - if (i->doc > j->doc) return 1; - return 0; - } - CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { - return _CLNEW CL_NS(util)::Compare::Int32(i->doc); - } - int32_t sortType() { - return SortField::DOC; - } - }; - - - class String: public ScoreDocComparator { - FieldCache::StringIndex* index; -#ifdef _CL__CND_DEBUG - int32_t length; -#endif - public: - String(FieldCache::StringIndex* index, int32_t len) - { -#ifdef _CL__CND_DEBUG - this->length = len; -#endif - this->index = index; - } - - int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { - CND_PRECONDITION(i->docdoc>=length") - CND_PRECONDITION(j->docdoc>=length") - if (index->order[i->doc] < index->order[j->doc]) return -1; - if (index->order[i->doc] > index->order[j->doc]) return 1; - return 0; - } - - CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { - return _CLNEW CL_NS(util)::Compare::TChar(index->lookup[index->order[i->doc]]); - } - - int32_t sortType() { - return SortField::STRING; - } - }; - - class Int32:public ScoreDocComparator{ - int32_t* fieldOrder; -#ifdef _CL__CND_DEBUG - int32_t length; -#endif - public: - Int32(int32_t* fieldOrder, int32_t len) - { - this->fieldOrder = fieldOrder; -#ifdef _CL__CND_DEBUG - this->length = len; -#endif - } - - - int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { - CND_PRECONDITION(i->docdoc>=length") - CND_PRECONDITION(j->docdoc>=length") - if (fieldOrder[i->doc] < fieldOrder[j->doc]) return -1; - if (fieldOrder[i->doc] > fieldOrder[j->doc]) return 1; - return 0; - } - - CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { - CND_PRECONDITION(i->docdoc>=length") - return _CLNEW CL_NS(util)::Compare::Int32(fieldOrder[i->doc]); - } - - int32_t sortType() { - return SortField::INT; - } - }; - - class Float:public ScoreDocComparator { - qreal* fieldOrder; -#ifdef _CL__CND_DEBUG - int32_t length; -#endif - public: - Float(qreal* fieldOrder, int32_t len) - { - this->fieldOrder = fieldOrder; -#ifdef _CL__CND_DEBUG - this->length = len; -#endif - } - - int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { - CND_PRECONDITION(i->docdoc>=length") - CND_PRECONDITION(j->docdoc>=length") - if (fieldOrder[i->doc] < fieldOrder[j->doc]) return -1; - if (fieldOrder[i->doc] > fieldOrder[j->doc]) return 1; - return 0; - } - - CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { - CND_PRECONDITION(i->docdoc>=length") - return _CLNEW CL_NS(util)::Compare::Float(fieldOrder[i->doc]); - } - - int32_t sortType() { - return SortField::FLOAT; - } - }; -}; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp b/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp deleted file mode 100644 index 9b7846f8e..000000000 --- a/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "ConjunctionScorer.h" -#include "CLucene/util/Arrays.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - Scorer* ConjunctionScorer::first() const{ - if ( scorers.end() == scorers.begin() ) - return NULL; - - return *scorers.begin(); - } //get First - Scorer* ConjunctionScorer::last() { - if ( scorers.end() == scorers.begin() ) - return NULL; - - CL_NS_STD(list)::iterator i = scorers.end(); - --i; - return *i; - } //get Last - - class _ScorerSorter:public CL_NS(util)::Arrays::_Arrays{ - public: - bool equals(Scorer* o1,Scorer* o2) const{ - return o1->doc() == o2->doc(); - } - int32_t compare(Scorer* o1,Scorer* o2) const{ - return o1->doc() - o2->doc(); - } - }; - _ScorerSorter __ScorerSorter; - - void ConjunctionScorer::sortScorers() { - // move scorers to an array - int32_t size = scorers.size(); - Scorer** array = _CL_NEWARRAY(Scorer*,size+1); - scorers.toArray(array); - scorers.clear(); // empty the list - - // note that this comparator is not consistent with equals! - __ScorerSorter.sort(array,size,0,size); - - for (int32_t i = 0; idoc() < last()->doc()) { // find doc w/ all clauses - more = first()->skipTo(last()->doc()); // skip first upto last - Scorer* scorer = *scorers.begin(); - scorers.delete_front(); - scorers.push_back(scorer); // move first to last - } - return more; // found a doc with all clauses - } - - - void ConjunctionScorer::init() { - more = scorers.size() > 0; - - // compute coord factor - coord = getSimilarity()->coord(scorers.size(), scorers.size()); - - // move each scorer to its first entry - CL_NS_STD(list)::iterator i = scorers.begin(); - while (more && i!=scorers.end()) { - more = ((Scorer*)*i)->next(); - ++i; - } - - if (more) - sortScorers(); // initial sort of list - - firstTime = false; - } - - ConjunctionScorer::ConjunctionScorer(Similarity* similarity): - Scorer(similarity), - scorers(false), - firstTime(true), - more(true), - coord(0.0) - { - } - ConjunctionScorer::~ConjunctionScorer(){ - scorers.setDoDelete(true); - } - - TCHAR *CL_NS(search)::Scorer::toString(void){ - return STRDUP_TtoT(_T("ConjunctionScorer")); - } - - - void ConjunctionScorer::add(Scorer* scorer){ - scorers.push_back(scorer); - } - - - int32_t ConjunctionScorer::doc() const{ return first()->doc(); } - - bool ConjunctionScorer::next() { - if (firstTime) { - init(); - } else if (more) { - more = last()->next(); // trigger further scanning - } - return doNext(); - } - - bool ConjunctionScorer::skipTo(int32_t target) { - CL_NS_STD(list)::iterator i = scorers.begin(); - while (more && i!=scorers.end()) { - more = ((Scorer*)*i)->skipTo(target); - ++i; - } - if (more) - sortScorers(); // re-sort scorers - return doNext(); - } - - qreal ConjunctionScorer::score(){ - qreal score = 0.0f; // sum scores - CL_NS_STD(list)::const_iterator i = scorers.begin(); - while (i!=scorers.end()){ - score += (*i)->score(); - ++i; - } - score *= coord; - return score; - } - - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h b/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h deleted file mode 100644 index 4b6807209..000000000 --- a/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h +++ /dev/null @@ -1,50 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_ConjunctionScorer_ -#define _lucene_search_ConjunctionScorer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif -#include "Scorer.h" -#include "Similarity.h" - -CL_NS_DEF(search) - -/** Scorer for conjunctions, sets of queries, all of which are required. */ -class ConjunctionScorer: public Scorer { -private: - CL_NS(util)::CLLinkedList > scorers; - bool firstTime; - bool more; - qreal coord; - - Scorer* first() const; - Scorer* last(); - void sortScorers(); - bool doNext(); - void init(); -public: - ConjunctionScorer(Similarity* similarity); - virtual ~ConjunctionScorer(); - TCHAR* toString(void){ - return STRDUP_TtoT(_T("ConjunctionScorer")); - } - void add(Scorer* scorer); - int32_t doc() const; - bool next(); - bool skipTo(int32_t target); - qreal score(); - virtual void explain(int32_t doc, Explanation* ret) { - _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: ConjunctionScorer::explain"); - } - - -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/DateFilter.cpp b/3rdparty/clucene/src/CLucene/search/DateFilter.cpp deleted file mode 100644 index 925858204..000000000 --- a/3rdparty/clucene/src/CLucene/search/DateFilter.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "DateFilter.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_USE(document) -CL_NS_DEF(search) - - DateFilter::~DateFilter(){ - _CLDECDELETE( start ); - _CLDECDELETE( end ); - } - - DateFilter::DateFilter(const DateFilter& copy): - start( _CL_POINTER(copy.start) ), - end ( _CL_POINTER(copy.end) ) - { - } - - /** Constructs a filter for field f matching times between - from and to. */ - DateFilter::DateFilter(const TCHAR* f, int64_t from, int64_t to) - { - TCHAR* tmp = DateField::timeToString(from); - start = _CLNEW Term(f, tmp); - _CLDELETE_CARRAY(tmp); - - tmp = DateField::timeToString(to); - end = _CLNEW Term(start, tmp); - _CLDELETE_CARRAY(tmp); - } - - /** Constructs a filter for field f matching times before - time. */ - DateFilter* DateFilter::Before(const TCHAR* field, int64_t time) { - return _CLNEW DateFilter(field, 0,time); - } - - /** Constructs a filter for field f matching times after - time. */ - DateFilter* DateFilter::After(const TCHAR* field, int64_t time) { - return _CLNEW DateFilter(field,time, DATEFIELD_DATE_MAX ); - } - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - BitSet* DateFilter::bits(IndexReader* reader) { - BitSet* bts = _CLNEW BitSet(reader->maxDoc()); - - TermEnum* enumerator = reader->terms(start); - if (enumerator->term(false) == NULL){ - _CLDELETE(enumerator); - return bts; - } - TermDocs* termDocs = reader->termDocs(); - - try { - while (enumerator->term(false)->compareTo(end) <= 0) { - termDocs->seek(enumerator->term(false)); - while (termDocs->next()) { - bts->set(termDocs->doc()); - } - if (!enumerator->next()) { - break; - } - } - } _CLFINALLY ( - termDocs->close(); - _CLDELETE(termDocs); - enumerator->close(); - _CLDELETE(enumerator); - ); - return bts; - } - - Filter* DateFilter::clone() const{ - return _CLNEW DateFilter(*this); - } - - TCHAR* DateFilter::toString(){ - size_t len = _tcslen(start->field()) + start->textLength() + end->textLength() + 8; - TCHAR* ret = _CL_NEWARRAY(TCHAR,len); - ret[0]=0; - _sntprintf(ret,len,_T("%s: [%s-%s]"), start->field(),start->text(),end->text()); - return ret; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/DateFilter.h b/3rdparty/clucene/src/CLucene/search/DateFilter.h deleted file mode 100644 index b37272b84..000000000 --- a/3rdparty/clucene/src/CLucene/search/DateFilter.h +++ /dev/null @@ -1,59 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_DateFilter_ -#define _lucene_search_DateFilter_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/document/DateField.h" -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/BitSet.h" -#include "Filter.h" - -CL_NS_DEF(search) - /** - * A Filter that restricts search results to a range of time. - * - *

For this to work, documents must have been indexed with a - * {@link DateField}. - */ - class DateFilter: public Filter { - private: - CL_NS(index)::Term* start; - CL_NS(index)::Term* end; - - protected: - DateFilter(const DateFilter& copy); - public: - ~DateFilter(); - - /** Constructs a filter for field f matching times between - from and to. */ - DateFilter(const TCHAR* f, int64_t from, int64_t to); - - /** Constructs a filter for field f matching times before - time. */ - static DateFilter* Before(const TCHAR* field, int64_t time) ; - - /** Constructs a filter for field f matching times after - time. */ - static DateFilter* After(const TCHAR* field, int64_t time) ; - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - CL_NS(util)::BitSet* bits(CL_NS(index)::IndexReader* reader) ; - - Filter* clone() const; - - TCHAR* toString(); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp b/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp deleted file mode 100644 index 1fbf2e99d..000000000 --- a/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "ExactPhraseScorer.h" - -#include "PhraseScorer.h" -#include "CLucene/index/Terms.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - ExactPhraseScorer::ExactPhraseScorer(Weight* weight, TermPositions** tps, - int32_t* positions, Similarity* similarity, uint8_t* norms): - PhraseScorer(weight, tps, positions, similarity, norms){ - //Func - Constructor - //Pre - tps != NULL - // tpsLength >= 0 - // n != NULL - //Post - Instance has been created - - CND_PRECONDITION(tps != NULL,"tps is NULL"); - CND_PRECONDITION(tps[0] != NULL,"tps is NULL"); - //CND_PRECONDITION(n != NULL,"n is NULL") =this is checked already in PhraseScorer - - } - - qreal ExactPhraseScorer::phraseFreq(){ - //Func - Returns the freqency of the phrase - //Pre - first != NULL - // last != NULL - // pq != NULL - // size of the PhraseQueue pq is 0 - //Post - The frequency of the phrase has been returned - - CND_PRECONDITION(first != NULL,"first is NULL"); - CND_PRECONDITION(last != NULL,"last is NULL"); - CND_PRECONDITION(pq != NULL,"pq is NULL"); - CND_PRECONDITION(pq->size()==0,"pq is not empty"); - - //build pq from list - - //Add the nodes of the list of PhrasePositions and store them - //into the PhraseQueue pq so it can used to build - //a list of sorted nodes - for (PhrasePositions* pp = first; pp != NULL; pp = pp->_next) { - //Read the first TermPosition of the current PhrasePositions pp - pp->firstPosition(); - //Store the current PhrasePositions pp into the PhraseQueue pq - pq->put(pp); - } - //pqToList requires that first and last be NULL when it's called. - //This is done at the beginning of pqToList() - //In this case, the nodes of the linked list are referenced by pq (see - //above loop), so we can clear our pointers to the head and tail of the - //linked list without fear of leaking the nodes. - - //rebuild list from pq - pqToList(); - - //Initialize freq at 0 - int32_t freq = 0; - - //find position with all terms - do { - //scan forward in first - while (first->position < last->position){ - do{ - if (!first->nextPosition()){ - return (qreal)freq; - } - } while (first->position < last->position); - //Make the current first node the last node in the list - firstToLast(); - } - //all equal: a match has been found - freq++; - } while (last->nextPosition()); - - return (qreal)freq; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h b/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h deleted file mode 100644 index d82aa9e9a..000000000 --- a/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h +++ /dev/null @@ -1,31 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_ExactPhraseScorer_ -#define _lucene_search_ExactPhraseScorer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "PhraseScorer.h" -#include "CLucene/index/Terms.h" - -CL_NS_DEF(search) - - class ExactPhraseScorer: public PhraseScorer { - public: - ExactPhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, int32_t* positions, - Similarity* similarity, uint8_t* norms ); - - ~ExactPhraseScorer(){ - } - protected: - //Returns the exact freqency of the phrase - qreal phraseFreq(); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/Explanation.cpp b/3rdparty/clucene/src/CLucene/search/Explanation.cpp deleted file mode 100644 index 87189b71b..000000000 --- a/3rdparty/clucene/src/CLucene/search/Explanation.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Explanation.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_USE(util) -CL_NS_DEF(search) - - -Explanation::Explanation(qreal value, const TCHAR* description) { - this->value = value; - _tcsncpy(this->description,description,LUCENE_SEARCH_EXPLANATION_DESC_LEN); -} - -Explanation::Explanation() { - this->value = 0; - this->description[0]=0; -} - -Explanation::Explanation(const Explanation& copy){ - set(copy); -} -void Explanation::set(const Explanation& copy){ - this->value = copy.value; - STRCPY_TtoT(description,copy.description,LUCENE_SEARCH_EXPLANATION_DESC_LEN); - - details.clear(); - typedef CL_NS(util)::Deletor::Object Deletor; - CL_NS(util)::CLArrayList::const_iterator itr; - itr = copy.details.begin(); - while ( itr != copy.details.end() ){ - details.push_back( (*itr)->clone() ); - ++itr; - } -} - -Explanation::~Explanation(){ -} - -void Explanation::setDescription(const TCHAR* description) { - _tcsncpy(this->description,description,LUCENE_SEARCH_EXPLANATION_DESC_LEN); -} - - -Explanation* Explanation::clone() const{ - return _CLNEW Explanation(*this); -} - -qreal Explanation::getValue() const{ - return value; -} - -void Explanation::setValue(qreal value) { - this->value = value; -} - -const TCHAR* Explanation::getDescription() const { - return description; -} - -///todo: mem leaks -TCHAR* Explanation::toString(int32_t depth) { - StringBuffer buffer; - for (int32_t i = 0; i < depth; i++) { - buffer.append(_T(" ")); - } - buffer.appendFloat(getValue(),2); - buffer.append(_T(" = ")); - buffer.append(getDescription()); - buffer.append(_T("\n")); - - for ( uint32_t j=0;jtoString(depth+1); - buffer.append(tmp); - _CLDELETE_CARRAY(tmp); - } - return buffer.toString(); -} - -int Explanation::getDetailsLength(){ - return details.size(); -} -Explanation* Explanation::getDetail(int i){ - return details[i]; -} -/** The sub-nodes of this explanation node. */ -void Explanation::getDetails(Explanation** ret) { - uint32_t size = details.size(); - for ( uint32_t i=0;iclone(); - } - ret[size] = NULL; -} - -/** Adds a sub-node to this explanation node. */ -void Explanation::addDetail(Explanation* detail) { - details.push_back(detail); -} - -/** Render an explanation as text. */ -TCHAR* Explanation::toString() { - return toString(0); -} - -/** Render an explanation as HTML. */ -///todo: mem leaks -TCHAR* Explanation::toHtml() { - StringBuffer buffer; - TCHAR* tmp; - buffer.append(_T("

    \n")); - - buffer.append(_T("
  • ")); - buffer.appendFloat(getValue(),2); - buffer.append(_T(" = ")); - - buffer.append(getDescription()); - buffer.append(_T("
  • \n")); - - for ( uint32_t i=0;itoHtml(); - buffer.append(tmp); - _CLDELETE_CARRAY(tmp); - } - buffer.append(_T("
\n")); - - return buffer.toString(); -} -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/Explanation.h b/3rdparty/clucene/src/CLucene/search/Explanation.h deleted file mode 100644 index 7c95822b6..000000000 --- a/3rdparty/clucene/src/CLucene/search/Explanation.h +++ /dev/null @@ -1,66 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_Explanation -#define _lucene_search_Explanation - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(search) - - #define LUCENE_SEARCH_EXPLANATION_DESC_LEN 200 - class Explanation :LUCENE_BASE { - private: - qreal value; // the value of this node - TCHAR description[LUCENE_SEARCH_EXPLANATION_DESC_LEN]; // what it represents - CL_NS(util)::CLArrayList > details; // sub-explanations - - TCHAR* toString(int32_t depth); - protected: - Explanation(const Explanation& copy); - public: - Explanation(); - ~Explanation(); - - Explanation(qreal value, const TCHAR* description); - void set(const Explanation& other); - - Explanation* clone() const; - - /** The value assigned to this explanation node. */ - qreal getValue() const; - - /** Sets the value assigned to this explanation node. */ - void setValue(qreal value); - - /** A description of this explanation node. */ - const TCHAR* getDescription() const; ///count = count; - this->order = values; - this->lookup = lookup; - } - - ~StringIndex(){ - _CLDELETE_ARRAY(order); - - for ( int i=0;ifield as integers and returns an array - * of size reader.maxDoc() of the value each document - * has in the given field. - * @param reader Used to get field values. - * @param field Which field contains the integers. - * @return The values in the given field for each document. - * @throws IOException If any error occurs. - */ - virtual FieldCacheAuto* getInts (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; - - /** Checks the internal cache for an appropriate entry, and if - * none is found, reads the terms in field as floats and returns an array - * of size reader.maxDoc() of the value each document - * has in the given field. - * @param reader Used to get field values. - * @param field Which field contains the floats. - * @return The values in the given field for each document. - * @throws IOException If any error occurs. - */ - virtual FieldCacheAuto* getFloats (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; - - /** Checks the internal cache for an appropriate entry, and if none - * is found, reads the term values in field and returns an array - * of size reader.maxDoc() containing the value each document - * has in the given field. - * @param reader Used to get field values. - * @param field Which field contains the strings. - * @return The values in the given field for each document. - * @throws IOException If any error occurs. - */ - virtual FieldCacheAuto* getStrings (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; - - /** Checks the internal cache for an appropriate entry, and if none - * is found reads the term values in field and returns - * an array of them in natural order, along with an array telling - * which element in the term array each document uses. - * @param reader Used to get field values. - * @param field Which field contains the strings. - * @return Array of terms and index into the array for each document. - * @throws IOException If any error occurs. - */ - virtual FieldCacheAuto* getStringIndex (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; - - /** Checks the internal cache for an appropriate entry, and if - * none is found reads field to see if it contains integers, floats - * or strings, and then calls one of the other methods in this class to get the - * values. For string values, a FieldCache::StringIndex is returned. After - * calling this method, there is an entry in the cache for both - * type AUTO and the actual found type. - * @param reader Used to get field values. - * @param field Which field contains the values. - * @return int32_t[], qreal[] or FieldCache::StringIndex. - * @throws IOException If any error occurs. - */ - virtual FieldCacheAuto* getAuto (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; - - /** Checks the internal cache for an appropriate entry, and if none - * is found reads the terms out of field and calls the given SortComparator - * to get the sort values. A hit in the cache will happen if reader, - * field, and comparator are the same (using equals()) - * as a previous call to this method. - * @param reader Used to get field values. - * @param field Which field contains the values. - * @param comparator Used to convert terms into something to sort by. - * @return Array of sort objects, one for each document. - * @throws IOException If any error occurs. - */ - virtual FieldCacheAuto* getCustom (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparator* comparator) = 0; -}; - -/** A class holding an AUTO field. In java lucene an Object - is used, but we use this. - contentType: - 1 - integer array - 2 - float array - 3 - FieldCache::StringIndex object - This class is also used when returning getInt, getFloat, etc - because we have no way of returning the size of the array and this - class can be used to determine the array size -*/ -class FieldCacheAuto:LUCENE_BASE{ -public: - enum{ - INT_ARRAY=1, - FLOAT_ARRAY=2, - STRING_INDEX=3, - STRING_ARRAY=4, - COMPARABLE_ARRAY=5, - SORT_COMPARATOR=6, - SCOREDOC_COMPARATOR=7 - }; - - FieldCacheAuto(int32_t len, int32_t type); - ~FieldCacheAuto(); - ///if contents should be deleted too, depending on type - bool ownContents; - int32_t contentLen; //number of items in the list - uint8_t contentType; - int32_t* intArray; //item 1 - qreal* floatArray; //item 2 - FieldCache::StringIndex* stringIndex; //item 3 - TCHAR** stringArray; //item 4 - CL_NS(util)::Comparable** comparableArray; //item 5 - SortComparator* sortComparator; //item 6 - ScoreDocComparator* scoreDocComparator; //item 7 - -}; - - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp b/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp deleted file mode 100644 index 62052097e..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "FieldCacheImpl.h" - -CL_NS_USE(util) -CL_NS_USE(index) -CL_NS_DEF(search) - -FieldCacheImpl::FieldCacheImpl(): - cache(false,true){ -} -FieldCacheImpl::~FieldCacheImpl(){ - cache.clear(); -} - -FieldCacheImpl::FileEntry::FileEntry (const TCHAR* field, int32_t type) { - this->field = CLStringIntern::intern(field CL_FILELINE); - this->type = type; - this->custom = NULL; - this->_hashCode = 0; - } - - /** Creates one of these objects for a custom comparator. */ - FieldCacheImpl::FileEntry::FileEntry (const TCHAR* field, SortComparatorSource* custom) { - this->field = CLStringIntern::intern(field CL_FILELINE); - this->type = SortField::CUSTOM; - this->custom = custom; - this->_hashCode = 0; - } - FieldCacheImpl::FileEntry::~FileEntry(){ - CLStringIntern::unintern(field); - } - - size_t FieldCacheImpl::FileEntry::hashCode(){ - if ( _hashCode == 0 ){ - //todo: cache hashcode? - size_t ret = Misc::thashCode(field); - if ( custom != NULL ) - ret = ret ^ custom->hashCode(); - ret = ret ^ (type*7); //type with a seed - _hashCode = ret; - } - return _hashCode; - } - int32_t FieldCacheImpl::FileEntry::compareTo(const FieldCacheImpl::FileEntry* other) const{ - if ( other->field == this->field ){ - if ( other->type == this->type ){ - if ( other->custom == NULL ){ - if ( this->custom == NULL ) - return 0; //both null - else - return 1; - }else if ( this->custom == NULL ) - return -1; - else if ( other->custom < this->custom ) - return -1; - else if ( other->custom > this->custom ) - return 1; - else - return 0; - }else if ( other->type > this->type ) - return 1; - else - return -1; - - }else - return _tcscmp(other->field,this->field); - } - - /** Two of these are equal iff they reference the same field and type. */ - /*bool FieldCacheImpl::FileEntry::equals (FileEntry* other) { - if (other->field == field && other->type == type) { - if (other->custom == NULL) { - if (custom == NULL) - return true; - } else if (other->custom->equals (custom)) { - return true; - } - } - }*/ - - /** Composes a hashcode based on the field and type. */ - /*size_t FieldCacheImpl::FileEntry::hashCode() { - return field->hashCode() ^ type ^ (custom==NULL ? 0 : custom->hashCode()); - }*/ - - - - - - /** See if an object is in the cache. */ - FieldCacheAuto* FieldCacheImpl::lookup (IndexReader* reader, const TCHAR* field, int32_t type) { - FieldCacheAuto* ret = NULL; - FileEntry* entry = _CLNEW FileEntry (field, type); - { - SCOPED_LOCK_MUTEX(THIS_LOCK) - fieldcacheCacheReaderType* readerCache = cache.get(reader); - if (readerCache != NULL) - ret = readerCache->get (entry); - _CLDELETE(entry); - } - return ret; - } - - - /** See if a custom object is in the cache. */ - FieldCacheAuto* FieldCacheImpl::lookup (IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer) { - FieldCacheAuto* ret = NULL; - FileEntry* entry = _CLNEW FileEntry (field, comparer); - { - SCOPED_LOCK_MUTEX(THIS_LOCK) - fieldcacheCacheReaderType* readerCache = cache.get(reader); - if (readerCache != NULL) - ret = readerCache->get (entry); - _CLDELETE(entry); -} - return ret; - } - - void FieldCacheImpl::closeCallback(CL_NS(index)::IndexReader* reader, void* fieldCacheImpl){ - FieldCacheImpl* fci = (FieldCacheImpl*)fieldCacheImpl; - SCOPED_LOCK_MUTEX(fci->THIS_LOCK) - fci->cache.remove(reader); - } - - /** Put an object into the cache. */ - void FieldCacheImpl::store (IndexReader* reader, const TCHAR* field, int32_t type, FieldCacheAuto* value) { - FileEntry* entry = _CLNEW FileEntry (field, type); - { - SCOPED_LOCK_MUTEX(THIS_LOCK) - fieldcacheCacheReaderType* readerCache = cache.get(reader); - if (readerCache == NULL) { - readerCache = _CLNEW fieldcacheCacheReaderType; - cache.put(reader,readerCache); - reader->addCloseCallback(closeCallback, this); - } - readerCache->put (entry, value); - //this is supposed to return the previous value, but it needs to be deleted!!! - } - } - - /** Put a custom object into the cache. */ - void FieldCacheImpl::store (IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer, FieldCacheAuto* value) { - FileEntry* entry = _CLNEW FileEntry (field, comparer); - { - SCOPED_LOCK_MUTEX(THIS_LOCK) - fieldcacheCacheReaderType* readerCache = cache.get(reader); - if (readerCache == NULL) { - readerCache = _CLNEW fieldcacheCacheReaderType; - cache.put(reader, readerCache); - reader->addCloseCallback(FieldCacheImpl::closeCallback, this); - } - readerCache->put(entry, value); - //this is supposed to return the previous value, but it needs to be deleted!!! - } - } - - - - - - // inherit javadocs - FieldCacheAuto* FieldCacheImpl::getInts (IndexReader* reader, const TCHAR* field) { - field = CLStringIntern::intern(field CL_FILELINE); - FieldCacheAuto* ret = lookup (reader, field, SortField::INT); - if (ret == NULL) { - int32_t retLen = reader->maxDoc(); - int32_t* retArray = _CL_NEWARRAY(int32_t,retLen); - memset(retArray,0,sizeof(int32_t)*retLen); - if (retLen > 0) { - TermDocs* termDocs = reader->termDocs(); - - Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); - TermEnum* termEnum = reader->terms (term); - _CLDECDELETE(term); - try { - if (termEnum->term(false) == NULL) { - _CLTHROWA(CL_ERR_Runtime,"no terms in field"); //todo: add detailed error: + field); - } - do { - Term* term = termEnum->term(false); - if (term->field() != field) - break; - - TCHAR* end; - int32_t termval = (int32_t)_tcstoi64(term->text(), &end, 10); - termDocs->seek (termEnum); - while (termDocs->next()) { - retArray[termDocs->doc()] = termval; - } - } while (termEnum->next()); - } _CLFINALLY( - termDocs->close(); - _CLDELETE(termDocs); - termEnum->close(); - _CLDELETE(termEnum); - ) - } - - FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::INT_ARRAY); - fa->intArray = retArray; - - store (reader, field, SortField::INT, fa); - CLStringIntern::unintern(field); - return fa; - } - CLStringIntern::unintern(field); - return ret; - } - - // inherit javadocs - FieldCacheAuto* FieldCacheImpl::getFloats (IndexReader* reader, const TCHAR* field){ - field = CLStringIntern::intern(field CL_FILELINE); - FieldCacheAuto* ret = lookup (reader, field, SortField::FLOAT); - if (ret == NULL) { - int32_t retLen = reader->maxDoc(); - qreal* retArray = _CL_NEWARRAY(qreal,retLen); - memset(retArray,0,sizeof(qreal)*retLen); - if (retLen > 0) { - TermDocs* termDocs = reader->termDocs(); - - Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); - TermEnum* termEnum = reader->terms (term); - _CLDECDELETE(term); - - try { - if (termEnum->term(false) == NULL) { - _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: make richer error + field); - } - do { - Term* term = termEnum->term(false); - if (term->field() != field) - break; - - TCHAR* tmp; - qreal termval = _tcstod(term->text(),&tmp); - termDocs->seek (termEnum); - while (termDocs->next()) { - retArray[termDocs->doc()] = termval; - } - } while (termEnum->next()); - } _CLFINALLY( - termDocs->close(); - _CLDELETE(termDocs); - termEnum->close(); - _CLDELETE(termEnum); - ) - } - - FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::FLOAT_ARRAY); - fa->floatArray = retArray; - - store (reader, field, SortField::FLOAT, fa); - CLStringIntern::unintern(field); - return fa; - } - CLStringIntern::unintern(field); - return ret; - } - - - // inherit javadocs - FieldCacheAuto* FieldCacheImpl::getStrings (IndexReader* reader, const TCHAR* field){ - //todo: this is not really used, i think? - field = CLStringIntern::intern(field CL_FILELINE); - FieldCacheAuto* ret = lookup (reader, field, SortField::STRING); - if (ret == NULL) { - int32_t retLen = reader->maxDoc(); - TCHAR** retArray = _CL_NEWARRAY(TCHAR*,retLen+1); - memset(retArray,0,sizeof(TCHAR*)*(retLen+1)); - if (retLen > 0) { - TermDocs* termDocs = reader->termDocs(); - - Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); - TermEnum* termEnum = reader->terms (term); - _CLDECDELETE(term); - - try { - if (termEnum->term(false) == NULL) { - _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: extend to + field); - } - do { - Term* term = termEnum->term(false); - if (term->field() != field) - break; - const TCHAR* termval = term->text(); - termDocs->seek (termEnum); - while (termDocs->next()) { - retArray[termDocs->doc()] = STRDUP_TtoT(termval); //todo: any better way of doing this??? - } - } while (termEnum->next()); - } _CLFINALLY( - retArray[retLen]=NULL; - termDocs->close(); - _CLDELETE(termDocs); - termEnum->close(); - _CLDELETE(termEnum); - ) - } - - - FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::STRING_ARRAY); - fa->stringArray = retArray; - fa->ownContents=true; - store (reader, field, SortField::STRING, fa); - CLStringIntern::unintern(field); - return fa; - } - CLStringIntern::unintern(field); - return ret; - } - - // inherit javadocs - FieldCacheAuto* FieldCacheImpl::getStringIndex (IndexReader* reader, const TCHAR* field){ - field = CLStringIntern::intern(field CL_FILELINE); - FieldCacheAuto* ret = lookup (reader, field, STRING_INDEX); - int32_t t = 0; // current term number - if (ret == NULL) { - int32_t retLen = reader->maxDoc(); - int32_t* retArray = _CL_NEWARRAY(int32_t,retLen); - memset(retArray,0,sizeof(int32_t)*retLen); - - TCHAR** mterms = _CL_NEWARRAY(TCHAR*,retLen+2); - mterms[0]=NULL; - if ( retLen > 0 ) { - TermDocs* termDocs = reader->termDocs(); - - Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); - TermEnum* termEnum = reader->terms (term); - _CLDECDELETE(term); - - - CND_PRECONDITION(t+1 <= retLen, "t out of bounds"); - - // an entry for documents that have no terms in this field - // should a document with no terms be at top or bottom? - // this puts them at the top - if it is changed, FieldDocSortedHitQueue - // needs to change as well. - mterms[t++] = NULL; - - try { - if (termEnum->term(false) == NULL) { - _CLTHROWA(CL_ERR_Runtime,"no terms in field"); //todo: make rich message " + field); - } - do { - Term* term = termEnum->term(false); - if (term->field() != field) - break; - - // store term text - // we expect that there is at most one term per document - if (t >= retLen+1) - _CLTHROWA(CL_ERR_Runtime,"there are more terms than documents in field"); //todo: rich error \"" + field + "\""); - mterms[t] = STRDUP_TtoT(term->text()); - - termDocs->seek (termEnum); - while (termDocs->next()) { - retArray[termDocs->doc()] = t; - } - - t++; - } while (termEnum->next()); - CND_PRECONDITION(tclose(); - _CLDELETE(termDocs); - termEnum->close(); - _CLDELETE(termEnum); - ); - - if (t == 0) { - // if there are no terms, make the term array - // have a single NULL entry - _CLDELETE_ARRAY(mterms); - mterms = _CL_NEWARRAY(TCHAR*,1); //todo: delete old mterms? - mterms[0]=NULL; - } else if (t < retLen) { //todo: check, was mterms.length - // if there are less terms than documents, - // trim off the dead array space - //const TCHAR** terms = _CL_NEWARRAY(TCHAR,t); - //System.arraycopy (mterms, 0, terms, 0, t); - //mterms = terms; - - //we simply shorten the length of the array... - - } - } - FieldCache::StringIndex* value = _CLNEW FieldCache::StringIndex (retArray, mterms,t); - - FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::STRING_INDEX); - fa->stringIndex = value; - fa->ownContents=true; - store (reader, field, STRING_INDEX, fa); - CLStringIntern::unintern(field); - return fa; - } - CLStringIntern::unintern(field); - return ret; - } - - // inherit javadocs - FieldCacheAuto* FieldCacheImpl::getAuto (IndexReader* reader, const TCHAR* field) { - field = CLStringIntern::intern(field CL_FILELINE); - FieldCacheAuto* ret = lookup (reader, field, SortField::AUTO); - if (ret == NULL) { - Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); - TermEnum* enumerator = reader->terms (term); - _CLDECDELETE(term); - - try { - Term* term = enumerator->term(false); - if (term == NULL) { - _CLTHROWA(CL_ERR_Runtime,"no terms in field - cannot determine sort type"); //todo: make rich error: " + field + " - } - if (term->field() == field) { - const TCHAR* termtext = term->text(); - size_t termTextLen = term->textLength(); - - bool isint=true; - for ( size_t i=0;iclose(); _CLDELETE(enumerator) ); - - } - CLStringIntern::unintern(field); - return ret; - } - - - // inherit javadocs - FieldCacheAuto* FieldCacheImpl::getCustom (IndexReader* reader, const TCHAR* field, SortComparator* comparator){ - field = CLStringIntern::intern(field CL_FILELINE); - - FieldCacheAuto* ret = lookup (reader, field, comparator); - if (ret == NULL) { - int32_t retLen = reader->maxDoc(); - Comparable** retArray = _CL_NEWARRAY(Comparable*,retLen); - memset(retArray,0,sizeof(Comparable*)*retLen); - if (retLen > 0) { - TermDocs* termDocs = reader->termDocs(); - TermEnum* termEnum = reader->terms (); - - try { - if (termEnum->term(false) == NULL) { - _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: make rich error + field); - } - do { - Term* term = termEnum->term(false); - if (term->field() != field) - break; - Comparable* termval = comparator->getComparable (term->text()); - termDocs->seek (termEnum); - while (termDocs->next()) { - retArray[termDocs->doc()] = termval; - } - } while (termEnum->next()); - } _CLFINALLY ( - termDocs->close(); - _CLDELETE(termDocs); - termEnum->close(); - _CLDELETE(termEnum); - ); - } - - FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::COMPARABLE_ARRAY); - fa->comparableArray = retArray; - fa->ownContents=true; - store (reader, field, SortField::CUSTOM, fa); - CLStringIntern::unintern(field); - return fa; - } - CLStringIntern::unintern(field); - return ret; - } - - - FieldCacheImpl::fieldcacheCacheReaderType::fieldcacheCacheReaderType(){ - setDeleteKey(false); - setDeleteValue(false); - } - FieldCacheImpl::fieldcacheCacheReaderType::~fieldcacheCacheReaderType(){ - iterator itr = begin(); - while ( itr != end() ){ - FileEntry* f = itr->first; - if ( f->getType() != SortField::AUTO ) - _CLDELETE( itr->second ); - _CLDELETE( f ); - ++itr; - } - clear(); - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h b/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h deleted file mode 100644 index ac3c4cabc..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h +++ /dev/null @@ -1,144 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_FieldCacheImpl_ -#define _lucene_search_FieldCacheImpl_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "FieldCache.h" -#include "Sort.h" - - -CL_NS_DEF(search) - - -/** - * Expert: The default cache implementation, storing all values in memory. - * - */ -class FieldCacheImpl: public FieldCache { -public: - DEFINE_MUTEX(THIS_LOCK) - - /** Expert: Every key in the internal cache is of this type. */ - class FileEntry:LUCENE_BASE { - const TCHAR* field; // which Field - int32_t type; // which SortField type - SortComparatorSource* custom; // which custom comparator - size_t _hashCode; - public: - /** Creates one of these objects. */ - FileEntry (const TCHAR* field, int32_t type); - - /** Creates one of these objects for a custom comparator. */ - FileEntry (const TCHAR* field, SortComparatorSource* custom); - ~FileEntry(); - - int32_t getType() const{ return type; } - - /** Two of these are equal iff they reference the same field and type. */ - bool equals (FileEntry* other) const; - - /** Composes a hashcode based on the field and type. */ - size_t hashCode(); - - int32_t compareTo(const FileEntry* other) const; - - class Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base // - { - public: - bool operator()( FileEntry* f1, FileEntry* f2 ) const{ - return ( f1->compareTo(f2) < 0 ); - } - size_t operator()( FileEntry* t ) const{ - return t->hashCode(); - } - }; - class Equals:LUCENE_BASE, public CL_NS(util)::Compare::_base // - { - public: - bool operator()( FileEntry* f1, FileEntry* f2 ) const{ - return ( f1->compareTo(f2) == 0 ); - } - }; - }; - - FieldCacheImpl(); - ~FieldCacheImpl(); -private: - - ///the type that is stored in the field cache. can't use a typedef because - ///the decorated name would become too long - class fieldcacheCacheReaderType: public CL_NS(util)::CLHashMap, - CL_NS(util)::Deletor::Object >{ - public: - fieldcacheCacheReaderType(); - ~fieldcacheCacheReaderType(); - }; - - //note: typename gets too long if using cacheReaderType as a typename - typedef CL_NS(util)::CLHashMap, - CL_NS(util)::Equals::Void, - CL_NS(util)::Deletor::Object, - CL_NS(util)::Deletor::Object > fieldcacheCacheType; - - /** The internal cache. Maps FileEntry to array of interpreted term values. **/ - //todo: make indexreader remove itself from here when the reader is shut - fieldcacheCacheType cache; - - /** See if an object is in the cache. */ - FieldCacheAuto* lookup (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type) ; - - /** See if a custom object is in the cache. */ - FieldCacheAuto* lookup (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer); - - /** Put an object into the cache. */ - void store (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type, FieldCacheAuto* value); - - /** Put a custom object into the cache. */ - void store (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer, FieldCacheAuto* value); - -public: - - // inherit javadocs - FieldCacheAuto* getInts (CL_NS(index)::IndexReader* reader, const TCHAR* field); - - // inherit javadocs - FieldCacheAuto* getFloats (CL_NS(index)::IndexReader* reader, const TCHAR* field); - - // inherit javadocs - FieldCacheAuto* getStrings (CL_NS(index)::IndexReader* reader, const TCHAR* field); - - // inherit javadocs - FieldCacheAuto* getStringIndex (CL_NS(index)::IndexReader* reader, const TCHAR* field); - - // inherit javadocs - FieldCacheAuto* getAuto (CL_NS(index)::IndexReader* reader, const TCHAR* field); - - // inherit javadocs - FieldCacheAuto* getCustom (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparator* comparator); - - - /** - * Callback for when IndexReader closes. This causes - * any cache to be removed for the specified reader. - */ - static void closeCallback(CL_NS(index)::IndexReader* reader, void* fieldCacheImpl); -}; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/FieldDoc.h b/3rdparty/clucene/src/CLucene/search/FieldDoc.h deleted file mode 100644 index 6ce915acf..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldDoc.h +++ /dev/null @@ -1,70 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_FieldDoc_ -#define _lucene_search_FieldDoc_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "ScoreDoc.h" - -CL_NS_DEF(search) - -/** - * Expert: A ScoreDoc which also contains information about - * how to sort the referenced document. In addition to the - * document number and score, this object contains an array - * of values for the document from the field(s) used to sort. - * For example, if the sort criteria was to sort by fields - * "a", "b" then "c", the fields object array - * will have three elements, corresponding respectively to - * the term values for the document in fields "a", "b" and "c". - * The class of each element in the array will be either - * Integer, Float or String depending on the type of values - * in the terms of each field. - * - * @see ScoreDoc - * @see TopFieldDocs - */ -class FieldDoc: public ScoreDoc { -public: - - /** Expert: The values which are used to sort the referenced document. - * The order of these will match the original sort criteria given by a - * Sort object. Each Object will be either an Integer, Float or String, - * depending on the type of values in the terms of the original field. - * @see Sort - * @see Searchable#search(Query,Filter,int32_t,Sort) - */ - CL_NS(util)::Comparable** fields; - - /** Expert: Creates one of these objects with empty sort information. */ - FieldDoc (int32_t doc, qreal score): - ScoreDoc(doc,score) { - fields=NULL; - } - - /** Expert: Creates one of these objects with the given sort information. */ - FieldDoc (int32_t doc, qreal score, CL_NS(util)::Comparable** fields): - ScoreDoc(doc,score) - { - this->fields = fields; - } - - ~FieldDoc(){ - if ( fields != NULL ){ - for ( int i=0;fields[i]!=NULL;i++ ) - _CLDELETE(fields[i]); - _CLDELETE_ARRAY(fields); - } - } -}; - -CL_NS_END -#endif - diff --git a/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp b/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp deleted file mode 100644 index 0a5210903..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "FieldDocSortedHitQueue.h" - - -CL_NS_USE(util) -CL_NS_DEF(search) - - -FieldDoc::FieldDoc (int32_t doc, qreal score) -{ - this->scoreDoc.doc = doc; - this->scoreDoc.score = score; - fields=NULL; -} - -FieldDoc::FieldDoc (int32_t doc, qreal score, CL_NS(util)::Comparable** fields) -{ - this->scoreDoc.doc = doc; - this->scoreDoc.score = score; - this->fields = fields; -} - -FieldDoc::~FieldDoc(){ - if ( fields != NULL ){ - for ( int i=0;fields[i]!=NULL;i++ ) - _CLDELETE(fields[i]); - _CLDELETE_ARRAY(fields); - } -} - - - -FieldDocSortedHitQueue::FieldDocSortedHitQueue (SortField** fields, int32_t size) { - this->fields = fields; - _countsize(); - //this->collators = hasCollators (fields); - initialize (size,true); -} - -bool FieldDocSortedHitQueue::lessThan (FieldDoc* docA, FieldDoc* docB) { - int32_t n = fieldsLen; - int32_t c = 0; - qreal f1,f2,r1,r2; - int32_t i1,i2; - const TCHAR *s1, *s2; - - for (int32_t i=0; igetType(); - if (fields[i]->getReverse()) { - switch (type) { - case SortField::DOCSCORE: - r1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); - r2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); - if (r1 < r2) c = -1; - if (r1 > r2) c = 1; - break; - case SortField::DOC: - case SortField::INT: - i1 = __REINTERPRET_CAST(Compare::Int32*, docA->fields[i])->getValue(); - i2 = __REINTERPRET_CAST(Compare::Int32*, docB->fields[i])->getValue(); - if (i1 > i2) c = -1; - if (i1 < i2) c = 1; - break; - case SortField::STRING: - s1 = __REINTERPRET_CAST(Compare::TChar*, docA->fields[i])->getValue(); - s2 = __REINTERPRET_CAST(Compare::TChar*, docB->fields[i])->getValue(); - if (s2 == NULL) c = -1; // could be NULL if there are - else if (s1 == NULL) c = 1; // no terms in the given field - else c = _tcscmp(s2,s1); //else if (fields[i].getLocale() == NULL) { - - /*todo: collators not impl - } else { - c = collators[i].compare (s2, s1); - }*/ - break; - case SortField::FLOAT: - f1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); - f2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); - if (f1 > f2) c = -1; - if (f1 < f2) c = 1; - break; - case SortField::CUSTOM: - c = docB->fields[i]->compareTo (docA->fields[i]); - break; - case SortField::AUTO: - // we cannot handle this - even if we determine the type of object (qreal or - // Integer), we don't necessarily know how to compare them (both SCORE and - // qreal both contain floats, but are sorted opposite of each other). Before - // we get here, each AUTO should have been replaced with its actual value. - _CLTHROWA (CL_ERR_Runtime,"FieldDocSortedHitQueue cannot use an AUTO SortField"); - default: - _CLTHROWA (CL_ERR_Runtime, "invalid SortField type"); //todo: rich error... : "+type); - } - } else { - switch (type) { - case SortField::DOCSCORE: - r1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); - r2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); - if (r1 > r2) c = -1; - if (r1 < r2) c = 1; - break; - case SortField::DOC: - case SortField::INT: - i1 = __REINTERPRET_CAST(Compare::Int32*, docA->fields[i])->getValue(); - i2 = __REINTERPRET_CAST(Compare::Int32*, docB->fields[i])->getValue(); - if (i1 < i2) c = -1; - if (i1 > i2) c = 1; - break; - case SortField::STRING: - s1 = __REINTERPRET_CAST(Compare::TChar*, docA->fields[i])->getValue(); - s2 = __REINTERPRET_CAST(Compare::TChar*, docB->fields[i])->getValue(); - // NULL values need to be sorted first, because of how FieldCache.getStringIndex() - // works - in that routine, any documents without a value in the given field are - // put first. - if (s1 == NULL) c = -1; // could be NULL if there are - else if (s2 == NULL) c = 1; // no terms in the given field - else c = _tcscmp(s1,s2); //else if (fields[i].getLocale() == NULL) { - - /* todo: collators not implemented } else { - c = collators[i].compare (s1, s2); - }*/ - break; - case SortField::FLOAT: - f1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); - f2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); - if (f1 < f2) c = -1; - if (f1 > f2) c = 1; - break; - case SortField::CUSTOM: - c = docA->fields[i]->compareTo (docB->fields[i]); - break; - case SortField::AUTO: - // we cannot handle this - even if we determine the type of object (qreal or - // Integer), we don't necessarily know how to compare them (both SCORE and - // qreal both contain floats, but are sorted opposite of each other). Before - // we get here, each AUTO should have been replaced with its actual value. - _CLTHROWA (CL_ERR_Runtime,"FieldDocSortedHitQueue cannot use an AUTO SortField"); - default: - _CLTHROWA (CL_ERR_Runtime,"invalid SortField type"); //todo: rich error... : "+type); - } - } - } - return c > 0; -} - -void FieldDocSortedHitQueue::setFields (SortField** fields) { - SCOPED_LOCK_MUTEX(THIS_LOCK) - if (this->fields == NULL) { - this->fields = fields; - _countsize(); - //this->collators = hasCollators (fields); - }else if ( fields == NULL ) - this->fields = NULL; -} - -FieldDocSortedHitQueue::~FieldDocSortedHitQueue(){ - if ( fields != NULL ){ - for ( int i=0;fields[i]!=NULL;i++ ) - _CLDELETE(fields[i]); - _CLDELETE_ARRAY(fields); - } -} - -CL_NS_END - diff --git a/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h b/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h deleted file mode 100644 index 5a46b3b65..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h +++ /dev/null @@ -1,159 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_FieldDocSortedHitQueue_ -#define _lucene_search_FieldDocSortedHitQueue_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Sort.h" -#include "CLucene/util/PriorityQueue.h" - -CL_NS_DEF(search) - -/** - * Expert: A ScoreDoc which also contains information about - * how to sort the referenced document. In addition to the - * document number and score, this object contains an array - * of values for the document from the field(s) used to sort. - * For example, if the sort criteria was to sort by fields - * "a", "b" then "c", the fields object array - * will have three elements, corresponding respectively to - * the term values for the document in fields "a", "b" and "c". - * The class of each element in the array will be either - * Integer, Float or String depending on the type of values - * in the terms of each field. - * - * @see ScoreDoc - * @see TopFieldDocs - */ -class FieldDoc: LUCENE_BASE { -public: - //FieldDoc did inherit from ScoreDoc, but now we make the scoredoc a member - struct ScoreDoc scoreDoc; - - /** Expert: The values which are used to sort the referenced document. - * The order of these will match the original sort criteria given by a - * Sort object. Each Object will be either an Integer, Float or String, - * depending on the type of values in the terms of the original field. - * @see Sort - * @see Searchable#search(Query,Filter,int32_t,Sort) - */ - CL_NS(util)::Comparable** fields; - - /** Expert: Creates one of these objects with empty sort information. */ - FieldDoc (int32_t doc, qreal score); - /** Expert: Creates one of these objects with the given sort information. */ - FieldDoc (int32_t doc, qreal score, CL_NS(util)::Comparable** fields); - ~FieldDoc(); -}; - -/** - * Expert: Collects sorted results from Searchable's and collates them. - * The elements put into this queue must be of type FieldDoc. - */ -class FieldDocSortedHitQueue: - public CL_NS(util)::PriorityQueue > -{ -private: - DEFINE_MUTEX(THIS_LOCK) - - // this cannot contain AUTO fields - any AUTO fields should - // have been resolved by the time this class is used. - SortField** fields; - int32_t fieldsLen; - - void _countsize(){ - fieldsLen=0; - while(fields[fieldsLen]!=NULL) - fieldsLen++; - } - - // used in the case where the fields are sorted by locale - // based strings - //todo: not implemented in clucene because locales has not been implemented - //Collator[] collators; //volatile - -public: - /** - * Creates a hit queue sorted by the given list of fields. - * @param fields Field names, in priority order (highest priority first). - * @param size The number of hits to retain. Must be greater than zero. - */ - FieldDocSortedHitQueue (SortField** fields, int32_t size); - ~FieldDocSortedHitQueue(); - - - /** - * Allows redefinition of sort fields if they are NULL. - * This is to handle the case using ParallelMultiSearcher where the - * original list contains AUTO and we don't know the actual sort - * type until the values come back. The fields can only be set once. - * This method is thread safe. - * @param fields - */ - void setFields (SortField** fields); - - /** Returns the fields being used to sort. */ - SortField** getFields() { - return fields; - } - - /** Returns an array of collators, possibly NULL. The collators - * correspond to any SortFields which were given a specific locale. - * @param fields Array of sort fields. - * @return Array, possibly NULL. - - private Collator[] hasCollators (SortField[] fields) { - if (fields == NULL) return NULL; - Collator[] ret = new Collator[fields.length]; - for (int32_t i=0; ia is less relevant than b. - * @param a FieldDoc - * @param b FieldDoc - * @return true if document a should be sorted after document b. - */ - bool lessThan (FieldDoc* docA, FieldDoc* docB); -}; - - -/** -* Expert: Returned by low-level sorted search implementations. -* -* @see Searchable#search(Query,Filter,int32_t,Sort) -*/ -class TopFieldDocs: public TopDocs { -public: - /// The fields which were used to sort results by. - SortField** fields; - - FieldDoc** fieldDocs; - - /** Creates one of these objects. - * @param totalHits Total number of hits for the query. - * @param fieldDocs The top hits for the query. - * @param scoreDocs The top hits for the query. - * @param scoreDocsLen Length of fieldDocs and scoreDocs - * @param fields The sort criteria used to find the top hits. - */ - TopFieldDocs (int32_t totalHits, FieldDoc** fieldDocs, int32_t scoreDocsLen, SortField** fields); - ~TopFieldDocs(); -}; - -CL_NS_END -#endif - diff --git a/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp b/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp deleted file mode 100644 index 04f45e931..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "FieldSortedHitQueue.h" -#include "FieldDocSortedHitQueue.h" -#include "Compare.h" - -CL_NS_USE(util) -CL_NS_USE(index) -CL_NS_DEF(search) - -FieldSortedHitQueue::hitqueueCacheType FieldSortedHitQueue::Comparators(false,true); - -FieldSortedHitQueue::FieldSortedHitQueue (IndexReader* reader, SortField** _fields, int32_t size): - fieldsLen(0), - maxscore(1.0f) -{ - while ( _fields[fieldsLen] != 0 ) - fieldsLen++; - - comparators = _CL_NEWARRAY(ScoreDocComparator*,fieldsLen+1); - SortField** tmp = _CL_NEWARRAY(SortField*,fieldsLen+1); - for (int32_t i=0; igetField(); - //todo: fields[i].getLocale(), not implemented - comparators[i] = getCachedComparator (reader, fieldname, _fields[i]->getType(), _fields[i]->getFactory()); - tmp[i] = _CLNEW SortField (fieldname, comparators[i]->sortType(), _fields[i]->getReverse()); - } - comparatorsLen = fieldsLen; - comparators[fieldsLen]=NULL; - tmp[fieldsLen] = NULL; - this->fields = tmp; - - initialize(size,true); -} - - -bool FieldSortedHitQueue::lessThan (FieldDoc* docA, FieldDoc* docB) { - // keep track of maximum score - if (docA->scoreDoc.score > maxscore) maxscore = docA->scoreDoc.score; - if (docB->scoreDoc.score > maxscore) maxscore = docB->scoreDoc.score; - - // run comparators - int32_t c = 0; - for ( int32_t i=0; c==0 && igetReverse()) ? comparators[i]->compare (&docB->scoreDoc, &docA->scoreDoc) : - comparators[i]->compare (&docA->scoreDoc, &docB->scoreDoc); - } - // avoid random sort order that could lead to duplicates (bug #31241): - if (c == 0) - return docA->scoreDoc.doc > docB->scoreDoc.doc; - return c > 0; -} - - -//static -ScoreDocComparator* FieldSortedHitQueue::comparatorString (IndexReader* reader, const TCHAR* field) { - //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); - FieldCacheAuto* fa = FieldCache::DEFAULT->getStringIndex (reader, field); - //CLStringIntern::unintern(field); - - CND_PRECONDITION(fa->contentType==FieldCacheAuto::STRING_INDEX,"Content type is incorrect"); - fa->ownContents = false; - return _CLNEW ScoreDocComparators::String(fa->stringIndex, fa->contentLen); -} - -//static -ScoreDocComparator* FieldSortedHitQueue::comparatorInt (IndexReader* reader, const TCHAR* field){ - //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); - FieldCacheAuto* fa = FieldCache::DEFAULT->getInts (reader, field); - //CLStringIntern::unintern(field); - - CND_PRECONDITION(fa->contentType==FieldCacheAuto::INT_ARRAY,"Content type is incorrect"); - return _CLNEW ScoreDocComparators::Int32(fa->intArray, fa->contentLen); - } - -//static - ScoreDocComparator* FieldSortedHitQueue::comparatorFloat (IndexReader* reader, const TCHAR* field) { - //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); - FieldCacheAuto* fa = FieldCache::DEFAULT->getFloats (reader, field); - //CLStringIntern::unintern(field); - - CND_PRECONDITION(fa->contentType==FieldCacheAuto::FLOAT_ARRAY,"Content type is incorrect"); - return _CLNEW ScoreDocComparators::Float (fa->floatArray, fa->contentLen); - } -//static - ScoreDocComparator* FieldSortedHitQueue::comparatorAuto (IndexReader* reader, const TCHAR* field){ - //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); - FieldCacheAuto* fa = FieldCache::DEFAULT->getAuto (reader, field); - //CLStringIntern::unintern(field); - - if (fa->contentType == FieldCacheAuto::STRING_INDEX ) { - return comparatorString (reader, field); - } else if (fa->contentType == FieldCacheAuto::INT_ARRAY) { - return comparatorInt (reader, field); - } else if (fa->contentType == FieldCacheAuto::FLOAT_ARRAY) { - return comparatorFloat (reader, field); - } else if (fa->contentType == FieldCacheAuto::STRING_ARRAY) { - return comparatorString (reader, field); - } else { - _CLTHROWA(CL_ERR_Runtime, "unknown data type in field"); //todo: rich error information: '"+field+"'"); - } - } - - - //todo: Locale locale, not implemented yet - ScoreDocComparator* FieldSortedHitQueue::getCachedComparator (IndexReader* reader, const TCHAR* fieldname, int32_t type, SortComparatorSource* factory){ - if (type == SortField::DOC) - return ScoreDocComparator::INDEXORDER; - if (type == SortField::DOCSCORE) - return ScoreDocComparator::RELEVANCE; - ScoreDocComparator* comparator = lookup (reader, fieldname, type, factory); - if (comparator == NULL) { - switch (type) { - case SortField::AUTO: - comparator = comparatorAuto (reader, fieldname); - break; - case SortField::INT: - comparator = comparatorInt (reader, fieldname); - break; - case SortField::FLOAT: - comparator = comparatorFloat (reader, fieldname); - break; - case SortField::STRING: - //if (locale != NULL) - // comparator = comparatorStringLocale (reader, fieldname, locale); - //else - comparator = comparatorString (reader, fieldname); - break; - case SortField::CUSTOM: - comparator = factory->newComparator (reader, fieldname); - break; - default: - _CLTHROWA(CL_ERR_Runtime,"unknown field type"); - //todo: extend error - //throw _CLNEW RuntimeException ("unknown field type: "+type); - } - store (reader, fieldname, type, factory, comparator); - } - return comparator; - } - - - FieldDoc* FieldSortedHitQueue::fillFields (FieldDoc* doc) const{ - int32_t n = comparatorsLen; - Comparable** fields = _CL_NEWARRAY(Comparable*,n+1); - for (int32_t i=0; isortValue(&doc->scoreDoc); - fields[n]=NULL; - doc->fields = fields; - if (maxscore > 1.0f) - doc->scoreDoc.score /= maxscore; // normalize scores - return doc; - } - - ScoreDocComparator* FieldSortedHitQueue::lookup (IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory) { - ScoreDocComparator* sdc = NULL; - FieldCacheImpl::FileEntry* entry = (factory != NULL) - ? _CLNEW FieldCacheImpl::FileEntry (field, factory) - : _CLNEW FieldCacheImpl::FileEntry (field, type); - - { - SCOPED_LOCK_MUTEX(Comparators.THIS_LOCK) - hitqueueCacheReaderType* readerCache = Comparators.get(reader); - if (readerCache == NULL){ - _CLDELETE(entry); - return NULL; - } - - sdc = readerCache->get (entry); - _CLDELETE(entry); - } - return sdc; - } - - void FieldSortedHitQueue::closeCallback(CL_NS(index)::IndexReader* reader, void*){ - SCOPED_LOCK_MUTEX(Comparators.THIS_LOCK) - Comparators.remove(reader); - } - - //static - void FieldSortedHitQueue::store (IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory, ScoreDocComparator* value) { - FieldCacheImpl::FileEntry* entry = (factory != NULL) - ? _CLNEW FieldCacheImpl::FileEntry (field, factory) - : _CLNEW FieldCacheImpl::FileEntry (field, type); - - { - SCOPED_LOCK_MUTEX(Comparators.THIS_LOCK) - hitqueueCacheReaderType* readerCache = Comparators.get(reader); - if (readerCache == NULL) { - readerCache = _CLNEW hitqueueCacheReaderType(true); - Comparators.put(reader,readerCache); - reader->addCloseCallback(FieldSortedHitQueue::closeCallback,NULL); - } - readerCache->put (entry, value); - //return NULL; //supposed to return previous value... - } - } - -FieldSortedHitQueue::~FieldSortedHitQueue(){ - _CLDELETE_ARRAY(comparators); - if ( fields != NULL ){ - for ( int i=0;fields[i]!=NULL;i++ ) - _CLDELETE(fields[i]); - _CLDELETE_ARRAY(fields); - } -} -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h b/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h deleted file mode 100644 index d7b16ce9e..000000000 --- a/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h +++ /dev/null @@ -1,216 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_FieldSortedHitQueue_ -#define _lucene_search_FieldSortedHitQueue_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "FieldCache.h" -#include "Sort.h" -#include "FieldDocSortedHitQueue.h" -#include "SearchHeader.h" -#include "FieldCacheImpl.h" -#include "CLucene/util/PriorityQueue.h" - -CL_NS_DEF(search) - - -/** - * Expert: A hit queue for sorting by hits by terms in more than one field. - * Uses FieldCache.DEFAULT for maintaining internal term lookup tables. - * - * @see Searchable#search(Query,Filter,int32_t,Sort) - * @see FieldCache - */ -class FieldSortedHitQueue: public CL_NS(util)::PriorityQueue > { - - ///the type that is stored in the field cache. can't use a typedef because - ///the decorated name would become too long - class hitqueueCacheReaderType: public CL_NS(util)::CLHashMap, - CL_NS(util)::Deletor::Object >{ - - public: - hitqueueCacheReaderType(bool deleteValue){ - setDeleteKey(true); - setDeleteValue(deleteValue); - } - ~hitqueueCacheReaderType(){ - clear(); - } - - }; - -public: //todo: remove this and below after close callback is implemented - //note: typename gets too long if using cacheReaderType as a typename - typedef CL_NS(util)::CLHashMap, - CL_NS(util)::Equals::Void, - CL_NS(util)::Deletor::Object, - CL_NS(util)::Deletor::Object > hitqueueCacheType; - - /** Internal cache of comparators. Similar to FieldCache, only - * caches comparators instead of term values. - */ - static hitqueueCacheType Comparators; -private: - - /** Returns a comparator if it is in the cache.*/ - static ScoreDocComparator* lookup (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory); - - /** Stores a comparator into the cache. - returns the valid ScoreDocComparator. - */ - static void store (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory, ScoreDocComparator* value); - - - //todo: Locale locale, not implemented yet - static ScoreDocComparator* getCachedComparator (CL_NS(index)::IndexReader* reader, - const TCHAR* fieldname, int32_t type, SortComparatorSource* factory); - - - /** - * Returns a comparator for sorting hits according to a field containing integers. - * @param reader Index to use. - * @param fieldname Field containg integer values. - * @return Comparator for sorting hits. - * @throws IOException If an error occurs reading the index. - */ - static ScoreDocComparator* comparatorInt (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); - - /** - * Returns a comparator for sorting hits according to a field containing floats. - * @param reader Index to use. - * @param fieldname Field containg float values. - * @return Comparator for sorting hits. - * @throws IOException If an error occurs reading the index. - */ - static ScoreDocComparator* comparatorFloat (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); - - /** - * Returns a comparator for sorting hits according to a field containing strings. - * @param reader Index to use. - * @param fieldname Field containg string values. - * @return Comparator for sorting hits. - * @throws IOException If an error occurs reading the index. - */ - static ScoreDocComparator* comparatorString (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); - - - //todo: - /** - * Returns a comparator for sorting hits according to a field containing strings. - * @param reader Index to use. - * @param fieldname Field containg string values. - * @return Comparator for sorting hits. - * @throws IOException If an error occurs reading the index. - - static ScoreDocComparator* comparatorStringLocale (IndexReader* reader, TCHAR* fieldname, Locale locale){ - Collator collator = Collator.getInstance (locale); - TCHAR* field = fieldname.intern(); - TCHAR** index = FieldCache.DEFAULT.getStrings (reader, field); - return _CLNEW ScoreDocComparator() { - - public int32_t compare (ScoreDoc i, ScoreDoc j) { - return collator.compare (index[i.doc], index[j.doc]); - } - - public Comparable sortValue (ScoreDoc i) { - return index[i.doc]; - } - - public int32_t sortType() { - return SortField.STRING; - } - }; - }*/ - - /** - * Returns a comparator for sorting hits according to values in the given field. - * The terms in the field are looked at to determine whether they contain integers, - * floats or strings. Once the type is determined, one of the other static methods - * in this class is called to get the comparator. - * @param reader Index to use. - * @param fieldname Field containg values. - * @return Comparator for sorting hits. - * @throws IOException If an error occurs reading the index. - */ - static ScoreDocComparator* comparatorAuto (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); - - -protected: - /** Stores a comparator corresponding to each field being sorted by */ - ScoreDocComparator** comparators; - int32_t comparatorsLen; - - /** Stores the sort criteria being used. */ - SortField** fields; - int32_t fieldsLen; - - /** Stores the maximum score value encountered, for normalizing. - * we only care about scores greater than 1.0 - if all the scores - * are less than 1.0, we don't have to normalize. */ - qreal maxscore; - - /** - * Returns whether a is less relevant than b. - * @param a ScoreDoc - * @param b ScoreDoc - * @return true if document a should be sorted after document b. - */ - bool lessThan (FieldDoc* docA, FieldDoc* docB); -public: - - /** - * Creates a hit queue sorted by the given list of fields. - * @param reader Index to use. - * @param fields Field names, in priority order (highest priority first). Cannot be null or empty. - * @param size The number of hits to retain. Must be greater than zero. - * @throws IOException - */ - FieldSortedHitQueue (CL_NS(index)::IndexReader* reader, SortField** fields, int32_t size); - - ~FieldSortedHitQueue(); - - /** - * Callback for when IndexReader closes. This causes - * any Comparators to be removed for the specified reader. - */ - static void closeCallback(CL_NS(index)::IndexReader* reader, void* param); - - /** - * Given a FieldDoc object, stores the values used - * to sort the given document. These values are not the raw - * values out of the index, but the internal representation - * of them. This is so the given search hit can be collated - * by a MultiSearcher with other search hits. - * @param doc The FieldDoc to store sort values into. - * @return The same FieldDoc passed in. - * @see Searchable#search(Query,Filter,int32_t,Sort) - */ - FieldDoc* fillFields (FieldDoc* doc) const; - - void setFields (SortField** fields){ - this->fields = fields; - } - - /** Returns the SortFields being used by this hit queue. */ - SortField** getFields() { - return fields; - } -}; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/Filter.h b/3rdparty/clucene/src/CLucene/search/Filter.h deleted file mode 100644 index 309c5a9d6..000000000 --- a/3rdparty/clucene/src/CLucene/search/Filter.h +++ /dev/null @@ -1,46 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_Filter_ -#define _lucene_search_Filter_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/BitSet.h" - -CL_NS_DEF(search) - // Abstract base class providing a mechanism to restrict searches to a subset - // of an index. - class Filter: LUCENE_BASE { - public: - virtual ~Filter(){ - } - - virtual Filter* clone() const = 0; - - /** - * Returns a BitSet with true for documents which should be permitted in - * search results, and false for those that should not. - * MEMORY: read shouldDeleteBitSet - */ - virtual CL_NS(util)::BitSet* bits(CL_NS(index)::IndexReader* reader)=0; - - /** - * Because of the problem of cached bitsets with the CachingWrapperFilter, - * CLucene has no way of knowing whether to delete the bitset returned from bits(). - * To properly clean memory from bits(), pass the bitset to this function. The - * Filter should be deleted if this function returns true. - */ - virtual bool shouldDeleteBitSet(const CL_NS(util)::BitSet* bs) const{ return true; } - - //Creates a user-readable version of this query and returns it as as string - virtual TCHAR* toString()=0; - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp b/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp deleted file mode 100644 index f90ceeaaf..000000000 --- a/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -#include "FilteredTermEnum.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - - FilteredTermEnum::FilteredTermEnum(){ - //Func - Constructor - //Pre - true - //Post - Instance has been created - - currentTerm = NULL; - actualEnum = NULL; - } - - FilteredTermEnum::~FilteredTermEnum() { - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - close(); - } - - int32_t FilteredTermEnum::docFreq() const { - //Func - Returns the docFreq of the current Term in the enumeration. - //Pre - next() must have been called at least once - //Post - if actualEnum is NULL result is -1 otherwise the frequencey is returned - - if (actualEnum == NULL){ - return -1; - } - return actualEnum->docFreq(); - } - - bool FilteredTermEnum::next() { - //Func - Increments the enumeration to the next element. - //Pre - true - //Post - Returns True if the enumeration has been moved to the next element otherwise false - - //The actual enumerator is not initialized! - if (actualEnum == NULL){ - return false; - } - - //Finalize the currentTerm and reset it to NULL - _CLDECDELETE( currentTerm ); - - //Iterate through the enumeration - while (currentTerm == NULL) { - if (endEnum()) - return false; - if (actualEnum->next()) { - //Order term not to return reference ownership here. */ - Term* term = actualEnum->term(false); - //Compare the retrieved term - if (termCompare(term)){ - //Matched so finalize the current - _CLDECDELETE(currentTerm); - //Get a reference to the matched term - currentTerm = _CL_POINTER(term); - return true; - } - }else - return false; - } - _CLDECDELETE(currentTerm); - currentTerm = NULL; - - return false; - } - - Term* FilteredTermEnum::term() { - //Func - Returns the current Term in the enumeration. - //Pre - next() must have been called at least once - // pointer is true or false - //Post - if pre(pointer) is true the reference counter of currentTerm is increased - // and current Term is returned otherwise currentTerm is only returned - - return _CL_POINTER(currentTerm); - } - Term* FilteredTermEnum::term(bool pointer) { - if ( pointer ) - return _CL_POINTER(currentTerm); - else - return currentTerm; - } - - void FilteredTermEnum::close(){ - //Func - Closes the enumeration to further activity, freeing resources. - //Pre - true - //Post - The Enumeration has been closed - - //Check if actualEnum is valid - if (actualEnum){ - //Close the enumeration - actualEnum->close(); - } - - //Destroy the enumeration - _CLDELETE(actualEnum); - - //Destroy currentTerm - _CLDECDELETE(currentTerm); - } - - void FilteredTermEnum::setEnum(TermEnum* actualEnum) { - //Func - Sets the actual Enumeration - //Pre - actualEnum != NULL - //Post - The instance has been created - - CND_PRECONDITION(actualEnum != NULL,"actualEnum is NULL"); - - _CLDELETE(this->actualEnum); - - this->actualEnum = actualEnum; - - // Find the first term that matches - //Ordered term not to return reference ownership here. - Term* term = actualEnum->term(false); - if (term != NULL && termCompare(term)){ - _CLDECDELETE(currentTerm); - currentTerm = _CL_POINTER(term); - }else{ - next(); - } - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h b/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h deleted file mode 100644 index 035ae384e..000000000 --- a/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h +++ /dev/null @@ -1,61 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_FilteredTermEnum_ -#define _lucene_search_FilteredTermEnum_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" - -CL_NS_DEF(search) - //FilteredTermEnum is an abstract class for enumerating a subset of all terms. - // - //Term enumerations are always ordered by term->compareTo(). Each term in - //the enumeration is greater than all that precede it. - - class FilteredTermEnum: public CL_NS(index)::TermEnum { - public: - //Constructor - FilteredTermEnum(); - //Destructor - virtual ~FilteredTermEnum(); - - //Equality measure on the term - virtual qreal difference() = 0; - - //Returns the docFreq of the current Term in the enumeration. - int32_t docFreq() const ; - - //Increments the enumeration to the next element - bool next() ; - - //Returns a pointer to the current Term in the enumeration. - CL_NS(index)::Term* term(); - CL_NS(index)::Term* term(bool pointer); - - //Closes the enumeration to further activity, freeing resources. - void close(); - - protected: - //Equality compare on the term */ - virtual bool termCompare(CL_NS(index)::Term* term) = 0; - - //Indiciates the end of the enumeration has been reached - virtual bool endEnum() = 0; - - void setEnum(CL_NS(index)::TermEnum* actualEnum) ; - - private: - CL_NS(index)::Term* currentTerm; - CL_NS(index)::TermEnum* actualEnum; - - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp b/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp deleted file mode 100644 index e95d48da3..000000000 --- a/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "FuzzyQuery.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - /** - * Constructor for enumeration of all terms from specified reader which share a prefix of - * length prefixLength with term and which have a fuzzy similarity > - * minSimilarity. - * - * @param reader Delivers terms. - * @param term Pattern term. - * @param minSimilarity Minimum required similarity for terms from the reader. Default value is 0.5f. - * @param prefixLength Length of required common prefix. Default value is 0. - * @throws IOException - */ - FuzzyTermEnum::FuzzyTermEnum(const IndexReader* reader, Term* term, qreal minSimilarity, size_t prefixLength): - distance(0), - _endEnum(false), - prefix(LUCENE_BLANK_STRING), - prefixLength(0), - minimumSimilarity(minSimilarity) - { - //Func - Constructor - //Pre - reader contains a valid reference to an IndexReader - // term != NULL - //Post - The instance has been created - - CND_PRECONDITION(term != NULL,"term is NULL"); - - scale_factor = 1.0f / (1.0f - minimumSimilarity); - searchTerm = _CL_POINTER(term); - - text = STRDUP_TtoT(term->text()); - textLen = term->textLength(); - - - //Initialize e to NULL - e = NULL; - eWidth = 0; - eHeight = 0; - - if(prefixLength > 0 && prefixLength < textLen){ - this->prefixLength = prefixLength; - - prefix = _CL_NEWARRAY(TCHAR,prefixLength+1); - _tcsncpy(prefix,text,prefixLength); - prefix[prefixLength]='\0'; - - textLen = prefixLength; - text[textLen]='\0'; - } - - - //Set the enumeration - Term* trm = _CLNEW Term(term, prefix); - setEnum(reader->terms(trm)); - _CLDECDELETE(trm); - } - - FuzzyTermEnum::~FuzzyTermEnum(){ - //Func - Destructor - //Pre - true - //Post - FuzzyTermEnum has been destroyed - - //Close the enumeration - close(); - } - - bool FuzzyTermEnum::endEnum() { - //Func - Returns the fact if the current term in the enumeration has reached the end - //Pre - true - //Post - The boolean value of endEnum has been returned - - return _endEnum; - } - - void FuzzyTermEnum::close(){ - //Func - Close the enumeration - //Pre - true - //Post - The enumeration has been closed - - FilteredTermEnum::close(); - - //Finalize the searchTerm - _CLDECDELETE(searchTerm); - //Destroy e - _CLDELETE_ARRAY(e); - - _CLDELETE_CARRAY(text); - - if ( prefix != LUCENE_BLANK_STRING ) - _CLDELETE_CARRAY(prefix); - } - - bool FuzzyTermEnum::termCompare(Term* term) { - //Func - Compares term with the searchTerm using the Levenshtein distance. - //Pre - term is NULL or term points to a Term - //Post - if pre(term) is NULL then false is returned otherwise - // if the distance of the current term in the enumeration is bigger than the FUZZY_THRESHOLD - // then true is returned - - if (term == NULL){ - return false; //Note that endEnum is not set to true! - } - - const TCHAR* termText = term->text(); - size_t termTextLen = term->textLength(); - - //Check if the field name of searchTerm of term match - //(we can use == because fields are interned) - if ( searchTerm->field() == term->field() && - (prefixLength==0 || _tcsncmp(termText,prefix,prefixLength)==0 )) { - - const TCHAR* target = termText+prefixLength; - size_t targetLen = termTextLen-prefixLength; - - //Calculate the Levenshtein distance - int32_t dist = editDistance(text, target, textLen, targetLen); - distance = 1 - ((qreal)dist / (qreal)min(textLen, targetLen)); - return (distance > minimumSimilarity); - } - _endEnum = true; - return false; - } - - qreal FuzzyTermEnum::difference() { - //Func - Returns the difference between the distance and the fuzzy threshold - // multiplied by the scale factor - //Pre - true - //Post - The difference is returned - - return (qreal)((distance - minimumSimilarity) * scale_factor ); - } - - - /** Finds and returns the smallest of three integers - precondition: Must define int32_t __t for temporary storage and result - */ - #define min3(a, b, c) __t = (a < b) ? a : b; __t = (__t < c) ? __t : c; - - int32_t FuzzyTermEnum::editDistance(const TCHAR* s, const TCHAR* t, const int32_t n, const int32_t m) { - //Func - Calculates the Levenshtein distance also known as edit distance is a measure of similiarity - // between two strings where the distance is measured as the number of character - // deletions, insertions or substitutions required to transform one string to - // the other string. - //Pre - s != NULL and contains the source string - // t != NULL and contains the target string - // n >= 0 and contains the length of the source string - // m >= 0 and containts the length of th target string - //Post - The distance has been returned - - CND_PRECONDITION(s != NULL, "s is NULL"); - CND_PRECONDITION(t != NULL, "t is NULL"); - CND_PRECONDITION(n >= 0," n is a negative number"); - CND_PRECONDITION(n >= 0," n is a negative number"); - - int32_t i; // iterates through s - int32_t j; // iterates through t - TCHAR s_i; // ith character of s - - if (n == 0) - return m; - if (m == 0) - return n; - - //Check if the array must be reallocated because it is too small or does not exist - if (e == NULL || eWidth <= n || eHeight <= m) { - //Delete e if possible - _CLDELETE_ARRAY(e); - //resize e - eWidth = max(eWidth, n+1); - eHeight = max(eHeight, m+1); - e = _CL_NEWARRAY(int32_t,eWidth*eHeight); - } - - CND_CONDITION(e != NULL,"e is NULL"); - - // init matrix e - for (i = 0; i <= n; i++){ - e[i + (0*eWidth)] = i; - } - for (j = 0; j <= m; j++){ - e[0 + (j*eWidth)] = j; - } - - int32_t __t; //temporary variable for min3 - - // start computing edit distance - for (i = 1; i <= n; i++) { - s_i = s[i - 1]; - for (j = 1; j <= m; j++) { - if (s_i != t[j-1]){ - min3(e[i + (j*eWidth) - 1], e[i + ((j-1)*eWidth)], e[i + ((j-1)*eWidth)-1]); - e[i + (j*eWidth)] = __t+1; - }else{ - min3(e[i + (j*eWidth) -1]+1, e[i + ((j-1)*eWidth)]+1, e[i + ((j-1)*eWidth)-1]); - e[i + (j*eWidth)] = __t; - } - } - } - - // we got the result! - return e[n + ((m)*eWidth)]; - } - - - /** - * Create a new FuzzyQuery that will match terms with a similarity - * of at least minimumSimilarity to term. - * If a prefixLength > 0 is specified, a common prefix - * of that length is also required. - * - * @param term the term to search for - * @param minimumSimilarity a value between 0 and 1 to set the required similarity - * between the query term and the matching terms. For example, for a - * minimumSimilarity of 0.5 a term of the same length - * as the query term is considered similar to the query term if the edit distance - * between both terms is less than length(term)*0.5 - * @param prefixLength length of common (non-fuzzy) prefix - * @throws IllegalArgumentException if minimumSimilarity is > 1 or < 0 - * or if prefixLength < 0 or > term.text().length(). - */ - FuzzyQuery::FuzzyQuery(Term* term, qreal minimumSimilarity, size_t prefixLength): - MultiTermQuery(term) - { - //Func - Constructor - //Pre - term != NULL - //Post - The instance has been created - - CND_PRECONDITION(term != NULL,"term is NULL"); - - if (minimumSimilarity > 1.0f) - _CLTHROWA(CL_ERR_IllegalArgument,"minimumSimilarity > 1"); - else if (minimumSimilarity < 0.0f) - _CLTHROWA(CL_ERR_IllegalArgument,"minimumSimilarity < 0"); - - this->minimumSimilarity = minimumSimilarity; - - if(prefixLength >= term->textLength()) - _CLTHROWA(CL_ERR_IllegalArgument,"prefixLength >= term.textLength()"); - this->prefixLength = prefixLength; - - } - - - qreal FuzzyQuery::defaultMinSimilarity = 0.5f; - - FuzzyQuery::~FuzzyQuery(){ - //Func - Destructor - //Pre - true - //Post - Instance has been destroyed - } - - TCHAR* FuzzyQuery::toString(const TCHAR* field) const{ - //Func - Returns the query string - //Pre - field != NULL - //Post - The query string has been returned - - CND_PRECONDITION(field != NULL,"field is NULL"); - - StringBuffer buffer; - const TCHAR* b = MultiTermQuery::toString(field); - - buffer.append ( b ); - _CLDELETE_CARRAY(b); - buffer.append( _T("~") ); - - buffer.appendFloat(minimumSimilarity,1); - - return buffer.toString(); - } - - const TCHAR* FuzzyQuery::getQueryName() const{ - //Func - Returns the name of the query - //Pre - true - //post - The string FuzzyQuery has been returned - - return getClassName(); - } - const TCHAR* FuzzyQuery::getClassName(){ - //Func - Returns the name of the query - //Pre - true - //post - The string FuzzyQuery has been returned - - return _T("FuzzyQuery"); - } - - - /** - * Returns the minimum similarity that is required for this query to match. - * @return float value between 0.0 and 1.0 - */ - qreal FuzzyQuery::getMinSimilarity() const { - return minimumSimilarity; - } - - FuzzyQuery::FuzzyQuery(const FuzzyQuery& clone): - MultiTermQuery(clone) - { - this->minimumSimilarity = clone.getMinSimilarity(); - this->prefixLength = clone.getPrefixLength(); - - //if(prefixLength < 0) - // _CLTHROWA(CL_ERR_IllegalArgument,"prefixLength < 0"); - //else - if(prefixLength >= clone.getTerm()->textLength()) - _CLTHROWA(CL_ERR_IllegalArgument,"prefixLength >= term.textLength()"); - - } - - Query* FuzzyQuery::clone() const{ - return _CLNEW FuzzyQuery(*this); - } - size_t FuzzyQuery::hashCode() const{ - //todo: we should give the query a seeding value... but - //need to do it for all hascode functions - size_t val = Similarity::floatToByte(getBoost()) ^ getTerm()->hashCode(); - val ^= Similarity::floatToByte(this->getMinSimilarity()); - val ^= this->getPrefixLength(); - return val; - } - bool FuzzyQuery::equals(Query* other) const{ - if (!(other->instanceOf(FuzzyQuery::getClassName()))) - return false; - - FuzzyQuery* fq = (FuzzyQuery*)other; - return (this->getBoost() == fq->getBoost()) - && this->getMinSimilarity() == fq->getMinSimilarity() - && this->getPrefixLength() == fq->getPrefixLength() - && getTerm()->equals(fq->getTerm()); - } - - /** - * Returns the prefix length, i.e. the number of characters at the start - * of a term that must be identical (not fuzzy) to the query term if the query - * is to match that term. - */ - size_t FuzzyQuery::getPrefixLength() const { - return prefixLength; - } - - FilteredTermEnum* FuzzyQuery::getEnum(IndexReader* reader){ - Term* term = getTerm(false); - FuzzyTermEnum* ret = _CLNEW FuzzyTermEnum(reader, term, minimumSimilarity, prefixLength); - return ret; - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h b/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h deleted file mode 100644 index e58637bb9..000000000 --- a/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h +++ /dev/null @@ -1,156 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_FuzzyQuery_ -#define _lucene_search_FuzzyQuery_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "MultiTermQuery.h" - - -CL_NS_DEF(search) - - // class FuzzyQuery implements the fuzzy search query - class FuzzyQuery: public MultiTermQuery { - private: - qreal minimumSimilarity; - size_t prefixLength; - protected: - FuzzyQuery(const FuzzyQuery& clone); - public: - static qreal defaultMinSimilarity; - - /** - * Create a new FuzzyQuery that will match terms with a similarity - * of at least minimumSimilarity to term. - * If a prefixLength > 0 is specified, a common prefix - * of that length is also required. - * - * @param term the term to search for - * @param minimumSimilarity a value between 0 and 1 to set the required similarity - * between the query term and the matching terms. For example, for a - * minimumSimilarity of 0.5 a term of the same length - * as the query term is considered similar to the query term if the edit distance - * between both terms is less than length(term)*0.5 - * @param prefixLength length of common (non-fuzzy) prefix - * @throws IllegalArgumentException if minimumSimilarity is > 1 or < 0 - * or if prefixLength < 0 or > term.text().length(). - */ - FuzzyQuery(CL_NS(index)::Term* term, qreal minimumSimilarity=defaultMinSimilarity, size_t prefixLength=0); - //Destructor - ~FuzzyQuery(); - - TCHAR* toString(const TCHAR* field) const; - - //Returns the name "FuzzyQuery" - static const TCHAR* getClassName(); - const TCHAR* getQueryName() const; - - Query* clone() const; - bool equals(Query * other) const; - size_t hashCode() const; - - /** - * Returns the minimum similarity that is required for this query to match. - * @return float value between 0.0 and 1.0 - */ - qreal getMinSimilarity() const; - - /** - * Returns the prefix length, i.e. the number of characters at the start - * of a term that must be identical (not fuzzy) to the query term if the query - * is to match that term. - */ - size_t getPrefixLength() const; - - protected: - FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader); - }; - - /** FuzzyTermEnum is a subclass of FilteredTermEnum for enumerating all - * terms that are similiar to the specified filter term. - * - * Term enumerations are always ordered by Term.compareTo(). Each term in - * the enumeration is greater than all that precede it. - */ - class FuzzyTermEnum: public FilteredTermEnum { - private: - qreal distance; - bool _endEnum; - - CL_NS(index)::Term* searchTerm; - TCHAR* text; - size_t textLen; - TCHAR* prefix; - size_t prefixLength; - qreal minimumSimilarity; - double scale_factor; - - - /** - * This static array saves us from the time required to create a new array - * everytime editDistance is called. - */ - int32_t* e; - int32_t eWidth; - int32_t eHeight; - - /****************************** - * Compute Levenshtein distance - ******************************/ - - /** - Levenshtein distance also known as edit distance is a measure of similiarity - between two strings where the distance is measured as the number of character - deletions, insertions or substitutions required to transform one string to - the other string. -

This method takes in four parameters; two strings and their respective - lengths to compute the Levenshtein distance between the two strings. - The result is returned as an integer. - */ - int32_t editDistance(const TCHAR* s, const TCHAR* t, const int32_t n, const int32_t m) ; - - protected: - /** - The termCompare method in FuzzyTermEnum uses Levenshtein distance to - calculate the distance between the given term and the comparing term. - */ - bool termCompare(CL_NS(index)::Term* term) ; - - ///Returns the fact if the current term in the enumeration has reached the end - bool endEnum(); - public: - - /** - * Empty prefix and minSimilarity of 0.5f are used. - * - * @param reader - * @param term - * @throws IOException - * @see #FuzzyTermEnum(IndexReader, Term, qreal, int32_t) - */ - FuzzyTermEnum(const CL_NS(index)::IndexReader* reader, CL_NS(index)::Term* term, qreal minSimilarity=FuzzyQuery::defaultMinSimilarity, size_t prefixLength=0); - /** Destructor */ - ~FuzzyTermEnum(); - /** Close the enumeration */ - void close(); - - /** Returns the difference between the distance and the fuzzy threshold - * multiplied by the scale factor - */ - qreal difference(); - - - const char* getObjectName(){ return FuzzyTermEnum::getClassName(); } - static const char* getClassName(){ return "FuzzyTermEnum"; } - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/HitQueue.cpp b/3rdparty/clucene/src/CLucene/search/HitQueue.cpp deleted file mode 100644 index c9aecc6b4..000000000 --- a/3rdparty/clucene/src/CLucene/search/HitQueue.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "HitQueue.h" - -CL_NS_DEF(search) - -void HitQueue::upHeap(){ - size_t i = _size; - ScoreDoc node = heap[i]; // save bottom node (WAS object) - int32_t j = ((uint32_t)i) >> 1; - while (j > 0 && lessThan(node,heap[j])) { - heap[i] = heap[j]; // shift parents down - i = j; - j = ((uint32_t)j) >> 1; - } - heap[i] = node; // install saved node -} -void HitQueue::downHeap(){ - size_t i = 1; - ScoreDoc node = heap[i]; // save top node - size_t j = i << 1; // find smaller child - size_t k = j + 1; - if (k <= _size && lessThan(heap[k], heap[j])) { - j = k; - } - while (j <= _size && lessThan(heap[j],node)) { - heap[i] = heap[j]; // shift up child - i = j; - j = i << 1; - k = j + 1; - if (k <= _size && lessThan(heap[k], heap[j])) { - j = k; - } - } - heap[i] = node; // install saved node -} - -void HitQueue::adjustTop(){ - downHeap(); -} -size_t HitQueue::size(){ - return _size; -} - -struct ScoreDoc& HitQueue::top(){ - if ( _size == 0 ) - _CLTHROWA(CL_ERR_IndexOutOfBounds, "Attempted to access empty hitqueue::top"); - return heap[1]; -} - -void HitQueue::put(struct ScoreDoc& element){ - if ( _size>=maxSize ) - _CLTHROWA(CL_ERR_IndexOutOfBounds,"add is out of bounds"); - - _size++; - heap[_size] = element; - upHeap(); -} - -ScoreDoc HitQueue::pop(){ - if (_size > 0) { - ScoreDoc result = heap[1]; // save first value - heap[1] = heap[_size]; // move last to first - - _size--; - downHeap(); // adjust heap - return result; - } else - _CLTHROWA(CL_ERR_IndexOutOfBounds, "Attempted to access empty hitqueue::top"); -} - -bool HitQueue::insert(struct ScoreDoc& element){ - if(_size < maxSize){ - put(element); - return true; - }else if(_size > 0 && !lessThan(element, heap[1])){ - heap[1] = element; - adjustTop(); - return true; - }else - return false; -} - -HitQueue::HitQueue(const int32_t maxSize){ - _size = 0; - this->maxSize = maxSize; - int32_t heapSize = maxSize + 1; - heap = _CL_NEWARRAY(ScoreDoc,heapSize); -} -HitQueue::~HitQueue(){ - _CLDELETE_ARRAY(heap); -} - -bool HitQueue::lessThan(struct ScoreDoc& hitA, struct ScoreDoc& hitB){ - if (hitA.score == hitB.score) - return hitA.doc > hitB.doc; - else - return hitA.score < hitB.score; -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/HitQueue.h b/3rdparty/clucene/src/CLucene/search/HitQueue.h deleted file mode 100644 index 0bd196a7f..000000000 --- a/3rdparty/clucene/src/CLucene/search/HitQueue.h +++ /dev/null @@ -1,55 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_HitQueue_ -#define _lucene_search_HitQueue_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SearchHeader.h" - -CL_NS_DEF(search) - -/** -* An optimised PriorityQueue which takes ScoreDoc structs. Some by-ref passing -* and memory related optimisations have been done. -*/ -class HitQueue: LUCENE_BASE { -private: - ScoreDoc* heap; - size_t _size; - size_t maxSize; - - void upHeap(); - void downHeap(); - -protected: - bool lessThan(struct ScoreDoc& hitA, struct ScoreDoc& hitB); - -public: - void adjustTop(); - struct ScoreDoc& top(); - void put(struct ScoreDoc& element); - ScoreDoc pop(); - /** - * Adds element to the PriorityQueue in log(size) time if either - * the PriorityQueue is not full, or not lessThan(element, top()). - * @param element - * @return true if element is added, false otherwise. - */ - bool insert(struct ScoreDoc& element); - /** - * Returns the number of elements currently stored in the PriorityQueue. - */ - size_t size(); - HitQueue(const int32_t maxSize); - ~HitQueue(); - -}; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/Hits.cpp b/3rdparty/clucene/src/CLucene/search/Hits.cpp deleted file mode 100644 index 38c489f44..000000000 --- a/3rdparty/clucene/src/CLucene/search/Hits.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -#include "SearchHeader.h" -#include "CLucene/document/Document.h" -#include "CLucene/index/IndexReader.h" -#include "Filter.h" -#include "CLucene/search/SearchHeader.h" - -CL_NS_USE(document) -CL_NS_USE(util) -CL_NS_USE(index) - -CL_NS_DEF(search) - - HitDoc::HitDoc(const qreal s, const int32_t i) - { - //Func - Constructor - //Pre - true - //Post - The instance has been created - - next = NULL; - prev = NULL; - doc = NULL; - score = s; - id = i; - } - - HitDoc::~HitDoc(){ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - _CLDELETE(doc); - } - - - Hits::Hits(Searcher* s, Query* q, Filter* f, const Sort* _sort): - query(q), searcher(s), filter(f), sort(_sort) - { - //Func - Constructor - //Pre - s contains a valid reference to a searcher s - // q contains a valid reference to a Query - // f is NULL or contains a pointer to a filter - //Post - The instance has been created - - _length = 0; - first = NULL; - last = NULL; - numDocs = 0; - maxDocs = 200; - - //retrieve 100 initially - getMoreDocs(50); - } - - Hits::~Hits(){ - - } - int32_t Hits::length() const { - return _length; - } - - Document& Hits::doc(const int32_t n){ - HitDoc* hitDoc = getHitDoc(n); - - // Update LRU cache of documents - remove(hitDoc); // remove from list, if there - addToFront(hitDoc); // add to front of list - if (numDocs > maxDocs) { // if cache is full - HitDoc* oldLast = last; - remove(last); // flush last - - _CLDELETE( oldLast->doc ); - oldLast->doc = NULL; - } - - if (hitDoc->doc == NULL){ - hitDoc->doc = _CLNEW Document; - searcher->doc(hitDoc->id, hitDoc->doc); // cache miss: read document - } - - return *hitDoc->doc; - } - - int32_t Hits::id (const int32_t n){ - return getHitDoc(n)->id; - } - - qreal Hits::score(const int32_t n){ - return getHitDoc(n)->score; - } - - void Hits::getMoreDocs(const size_t m){ - size_t _min = m; - { - size_t nHits = hitDocs.size(); - if ( nHits > _min) - _min = nHits; - } - - size_t n = _min * 2; // double # retrieved - TopDocs* topDocs = NULL; - if ( sort==NULL ) - topDocs = (TopDocs*)((Searchable*)searcher)->_search(query, filter, n); - else - topDocs = (TopDocs*)((Searchable*)searcher)->_search(query, filter, n, sort); - _length = topDocs->totalHits; - ScoreDoc* scoreDocs = topDocs->scoreDocs; - int32_t scoreDocsLength = topDocs->scoreDocsLength; - - qreal scoreNorm = 1.0f; - //Check that scoreDocs is a valid pointer before using it - if (scoreDocs != NULL){ - if (_length > 0 && scoreDocs[0].score > 1.0f){ - scoreNorm = 1.0f / scoreDocs[0].score; - } - - int32_t end = scoreDocsLength < _length ? scoreDocsLength : _length; - for (int32_t i = hitDocs.size(); i < end; i++) { - hitDocs.push_back(_CLNEW HitDoc(scoreDocs[i].score*scoreNorm, scoreDocs[i].doc)); - } - } - - _CLDELETE(topDocs); - } - - HitDoc* Hits::getHitDoc(const size_t n){ - if (n >= _length){ - TCHAR buf[100]; - _sntprintf(buf, 100,_T("Not a valid hit number: %d"),n); - _CLTHROWT(CL_ERR_IndexOutOfBounds, buf ); - } - if (n >= hitDocs.size()) - getMoreDocs(n); - - return hitDocs[n]; - } - - void Hits::addToFront(HitDoc* hitDoc) { // insert at front of cache - if (first == NULL) - last = hitDoc; - else - first->prev = hitDoc; - - hitDoc->next = first; - first = hitDoc; - hitDoc->prev = NULL; - - numDocs++; - } - - void Hits::remove(const HitDoc* hitDoc) { // remove from cache - if (hitDoc->doc == NULL) // it's not in the list - return; // abort - - if (hitDoc->next == NULL) - last = hitDoc->prev; - else - hitDoc->next->prev = hitDoc->prev; - - if (hitDoc->prev == NULL) - first = hitDoc->next; - else - hitDoc->prev->next = hitDoc->next; - - numDocs--; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp b/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp deleted file mode 100644 index c948cfa4b..000000000 --- a/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "IndexSearcher.h" - -#include "SearchHeader.h" -#include "Scorer.h" -#include "FieldDocSortedHitQueue.h" -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "CLucene/util/BitSet.h" -#include "FieldSortedHitQueue.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_USE(document) - -CL_NS_DEF(search) - -class SimpleTopDocsCollector : public HitCollector -{ -private: - qreal minScore; - const CL_NS(util)::BitSet* bits; - HitQueue* hq; - size_t nDocs; - int32_t* totalHits; - -public: - SimpleTopDocsCollector(const CL_NS(util)::BitSet* bs, HitQueue* hitQueue, - int32_t* totalhits, size_t ndocs, const qreal ms=-1.0f) - : minScore(ms), - bits(bs), - hq(hitQueue), - nDocs(ndocs), - totalHits(totalhits) {} - ~SimpleTopDocsCollector() {} - - void collect(const int32_t doc, const qreal score) - { - if (score > 0.0f // ignore zeroed buckets - && (bits == NULL || bits->get(doc))) { // skip docs not in bits - ++totalHits[0]; - if (hq->size() < nDocs || (minScore==-1.0f || score >= minScore)) { - ScoreDoc sd = {doc, score}; - hq->insert(sd); // update hit queue - if ( minScore != -1.0f ) - minScore = hq->top().score; // maintain minScore - } - } - } -}; - -class SortedTopDocsCollector : public HitCollector -{ -private: - const CL_NS(util)::BitSet* bits; - FieldSortedHitQueue* hq; - size_t nDocs; - int32_t* totalHits; -public: - SortedTopDocsCollector(const CL_NS(util)::BitSet* bs, - FieldSortedHitQueue* hitQueue, int32_t* totalhits, size_t _nDocs) - : bits(bs), - hq(hitQueue), - nDocs(_nDocs), - totalHits(totalhits) - { - } - ~SortedTopDocsCollector() {} - - void collect(const int32_t doc, const qreal score) - { - if (score > 0.0f && // ignore zeroed buckets - (bits==NULL || bits->get(doc))) { // skip docs not in bits - ++totalHits[0]; - // TODO: see jlucene way... with fields def??? - FieldDoc* fd = _CLNEW FieldDoc(doc, score); - if ( !hq->insert(fd) ) // update hit queue - _CLDELETE(fd); - } - } -}; - -class SimpleFilteredCollector : public HitCollector -{ -private: - CL_NS(util)::BitSet* bits; - HitCollector* results; -public: - SimpleFilteredCollector(CL_NS(util)::BitSet* bs, HitCollector* collector) - : bits(bs), - results(collector) {} - ~SimpleFilteredCollector() {} - -protected: - void collect(const int32_t doc, const qreal score) - { - // skip docs not in bits - if (bits->get(doc)) - results->collect(doc, score); - } -}; - - -IndexSearcher::IndexSearcher(const QString& path) -{ - //Func - Constructor - // Creates a searcher searching the index in the named directory. - //Pre - path != NULL - //Post - The instance has been created - - CND_PRECONDITION(!path.isEmpty(), "path is NULL"); - - reader = IndexReader::open(path); - readerOwner = true; -} - -IndexSearcher::IndexSearcher(CL_NS(store)::Directory* directory) -{ - //Func - Constructor - // Creates a searcher searching the index in the specified directory. - //Pre - path != NULL - //Post - The instance has been created - - CND_PRECONDITION(directory != NULL, "directory is NULL"); - - reader = IndexReader::open(directory); - readerOwner = true; -} - -IndexSearcher::IndexSearcher(IndexReader* r) -{ - //Func - Constructor - // Creates a searcher searching the index with the provide IndexReader - //Pre - path != NULL - //Post - The instance has been created - - reader = r; - readerOwner = false; -} - -IndexSearcher::~IndexSearcher() -{ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - close(); -} - -void IndexSearcher::close() -{ - //Func - Frees resources associated with this Searcher. - //Pre - true - //Post - The resources associated have been freed - if (readerOwner && reader){ - reader->close(); - _CLDELETE(reader); - } -} - -// inherit javadoc -int32_t IndexSearcher::docFreq(const Term* term) const -{ - //Func - - //Pre - reader != NULL - //Post - - - CND_PRECONDITION(reader != NULL, "reader is NULL"); - return reader->docFreq(term); -} - -// inherit javadoc -bool IndexSearcher::doc(int32_t i, CL_NS(document)::Document* d) -{ - //Func - Retrieves i-th document found - // For use by HitCollector implementations. - //Pre - reader != NULL - //Post - The i-th document has been returned - - CND_PRECONDITION(reader != NULL, "reader is NULL"); - return reader->document(i,d); -} - -// inherit javadoc -int32_t IndexSearcher::maxDoc() const -{ - //Func - Return total number of documents including the ones marked deleted - //Pre - reader != NULL - //Post - The total number of documents including the ones marked deleted - // has been returned - - CND_PRECONDITION(reader != NULL, "reader is NULL"); - return reader->maxDoc(); -} - -TopDocs* IndexSearcher::_search(Query* query, Filter* filter, const int32_t nDocs) -{ - //Func - - //Pre - reader != NULL - //Post - - - CND_PRECONDITION(reader != NULL, "reader is NULL"); - CND_PRECONDITION(query != NULL, "query is NULL"); - - Weight* weight = query->weight(this); - Scorer* scorer = weight->scorer(reader); - if (scorer == NULL){ - return _CLNEW TopDocs(0, NULL, 0); - } - - BitSet* bits = filter != NULL ? filter->bits(reader) : NULL; - HitQueue* hq = _CLNEW HitQueue(nDocs); - - //Check hq has been allocated properly - CND_CONDITION(hq != NULL, "Could not allocate memory for HitQueue hq"); - - int32_t* totalHits = _CL_NEWARRAY(int32_t,1); - totalHits[0] = 0; - - SimpleTopDocsCollector hitCol(bits,hq,totalHits,nDocs,0.0f); - scorer->score( &hitCol ); - _CLDELETE(scorer); - - int32_t scoreDocsLength = hq->size(); - - ScoreDoc* scoreDocs = _CL_NEWARRAY(ScoreDoc,scoreDocsLength); - - for (int32_t i = scoreDocsLength-1; i >= 0; --i) // put docs in array - scoreDocs[i] = hq->pop(); - - int32_t totalHitsInt = totalHits[0]; - - _CLDELETE(hq); - if ( bits != NULL && filter->shouldDeleteBitSet(bits) ) - _CLDELETE(bits); - _CLDELETE_ARRAY(totalHits); - Query* wq = weight->getQuery(); - if ( query != wq ) //query was re-written - _CLLDELETE(wq); - _CLDELETE(weight); - - return _CLNEW TopDocs(totalHitsInt, scoreDocs, scoreDocsLength); -} - -// inherit javadoc -TopFieldDocs* IndexSearcher::_search(Query* query, Filter* filter, - const int32_t nDocs, const Sort* sort) -{ - CND_PRECONDITION(reader != NULL, "reader is NULL"); - CND_PRECONDITION(query != NULL, "query is NULL"); - - Weight* weight = query->weight(this); - Scorer* scorer = weight->scorer(reader); - if (scorer == NULL) { - return _CLNEW TopFieldDocs(0, NULL, 0, NULL ); - } - - BitSet* bits = filter != NULL ? filter->bits(reader) : NULL; - FieldSortedHitQueue hq(reader, sort->getSort(), nDocs); - int32_t* totalHits = _CL_NEWARRAY(int32_t,1); - totalHits[0]=0; - - SortedTopDocsCollector hitCol(bits,&hq,totalHits,nDocs); - scorer->score(&hitCol); - _CLDELETE(scorer); - - int32_t hqLen = hq.size(); - FieldDoc** fieldDocs = _CL_NEWARRAY(FieldDoc*,hqLen); - for (int32_t i = hqLen-1; i >= 0; --i){ // put docs in array - fieldDocs[i] = hq.fillFields (hq.pop()); - } - - Query* wq = weight->getQuery(); - if ( query != wq ) //query was re-written - _CLLDELETE(wq); - _CLDELETE(weight); - - SortField** hqFields = hq.getFields(); - hq.setFields(NULL); //move ownership of memory over to TopFieldDocs - int32_t totalHits0 = totalHits[0]; - if ( bits != NULL && filter->shouldDeleteBitSet(bits) ) - _CLDELETE(bits); - _CLDELETE_ARRAY(totalHits); - return _CLNEW TopFieldDocs(totalHits0, fieldDocs, hqLen, hqFields ); -} - -void IndexSearcher::_search(Query* query, Filter* filter, HitCollector* results) -{ - //Func - _search an index and fetch the results - // Applications should only use this if they need all of the - // matching documents. The high-level search API (search(Query)) - // is usually more efficient, as it skips non-high-scoring hits. - //Pre - query is a valid reference to a query filter may or may not be NULL - // results is a valid reference to a HitCollector and used to store the results - //Post - filter if non-NULL, a bitset used to eliminate some documents - - CND_PRECONDITION(reader != NULL, "reader is NULL"); - CND_PRECONDITION(query != NULL, "query is NULL"); - - BitSet* bits = NULL; - SimpleFilteredCollector* fc = NULL; - - if (filter != NULL){ - bits = filter->bits(reader); - fc = _CLNEW SimpleFilteredCollector(bits, results); - } - - Weight* weight = query->weight(this); - Scorer* scorer = weight->scorer(reader); - if (scorer != NULL) { - if (fc == NULL){ - scorer->score(results); - }else{ - scorer->score((HitCollector*)fc); - } - _CLDELETE(scorer); - } - - _CLDELETE(fc); - _CLDELETE(weight); - if ( bits != NULL && filter->shouldDeleteBitSet(bits) ) - _CLDELETE(bits); -} - -Query* IndexSearcher::rewrite(Query* original) -{ - Query* query = original; - Query* last = original; - for (Query* rewrittenQuery = query->rewrite(reader); - rewrittenQuery != query; - rewrittenQuery = query->rewrite(reader)) { - query = rewrittenQuery; - if ( query != last && last != original) { - _CLDELETE(last); - } - last = query; - } - return query; -} - -void IndexSearcher::explain(Query* query, int32_t doc, Explanation* ret) -{ - Weight* weight = query->weight(this); - weight->explain(reader, doc, ret); - - Query* wq = weight->getQuery(); - if ( query != wq ) //query was re-written - _CLLDELETE(wq); - _CLDELETE(weight); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/IndexSearcher.h b/3rdparty/clucene/src/CLucene/search/IndexSearcher.h deleted file mode 100644 index 307e0266d..000000000 --- a/3rdparty/clucene/src/CLucene/search/IndexSearcher.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_search_IndexSearcher_ -#define _lucene_search_IndexSearcher_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "SearchHeader.h" -#include "CLucene/store/Directory.h" -#include "CLucene/document/Document.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "CLucene/util/BitSet.h" -#include "HitQueue.h" -#include "FieldSortedHitQueue.h" - -CL_NS_DEF(search) -/** Implements search over a single IndexReader. -* -*

Applications usually need only call the inherited {@link search(Query*)} -* or {@link search(Query*,Filter*)} methods. -*/ -class IndexSearcher:public Searcher{ - CL_NS(index)::IndexReader* reader; - bool readerOwner; - -public: - /// Creates a searcher searching the index in the named directory. - IndexSearcher(const QString& path); - - /// Creates a searcher searching the index in the specified directory. - IndexSearcher(CL_NS(store)::Directory* directory); - - /// Creates a searcher searching the provided index. - IndexSearcher(CL_NS(index)::IndexReader* r); - - ~IndexSearcher(); - - /// Frees resources associated with this Searcher. - void close(); - - int32_t docFreq(const CL_NS(index)::Term* term) const; - - bool doc(int32_t i, CL_NS(document)::Document* document); - - int32_t maxDoc() const; - - TopDocs* _search(Query* query, Filter* filter, const int32_t nDocs); - TopFieldDocs* _search(Query* query, Filter* filter, const int32_t nDocs, - const Sort* sort); - - void _search(Query* query, Filter* filter, HitCollector* results); - - CL_NS(index)::IndexReader* getReader() { - return reader; } - - Query* rewrite(Query* original); - void explain(Query* query, int32_t doc, Explanation* ret); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp b/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp deleted file mode 100644 index bed7f0d61..000000000 --- a/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "MultiSearcher.h" - -#include "SearchHeader.h" -#include "HitQueue.h" -#include "CLucene/document/Document.h" -#include "CLucene/index/Term.h" -#include "FieldDocSortedHitQueue.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_USE(document) - -CL_NS_DEF(search) - - /** Creates a searcher which searches searchers. */ - MultiSearcher::MultiSearcher(Searchable** _searchables): - _maxDoc(0) { - searchablesLen = 0; - while ( _searchables[searchablesLen] != NULL ) - ++searchablesLen; - - searchables=_CL_NEWARRAY(Searchable*,searchablesLen+1); - starts = _CL_NEWARRAY(int32_t,searchablesLen + 1); // build starts array - for (int32_t i = 0; i < searchablesLen; ++i) { - searchables[i]=_searchables[i]; - starts[i] = _maxDoc; - _maxDoc += searchables[i]->maxDoc(); // compute maxDocs - } - starts[searchablesLen] = _maxDoc; - } - - MultiSearcher::~MultiSearcher() { - _CLDELETE_ARRAY(searchables); - _CLDELETE_ARRAY(starts); - } - - - // inherit javadoc - void MultiSearcher::close() { - for (int32_t i = 0; i < searchablesLen; ++i){ - searchables[i]->close(); - searchables[i]=NULL; - } - } - - int32_t MultiSearcher::docFreq(const Term* term) const { - int32_t docFreq = 0; - for (int32_t i = 0; i < searchablesLen; ++i) - docFreq += searchables[i]->docFreq(term); - return docFreq; - } - - /** For use by {@link HitCollector} implementations. */ - bool MultiSearcher::doc(int32_t n, Document* d) { - int32_t i = subSearcher(n); // find searcher index - return searchables[i]->doc(n - starts[i], d); // dispatch to searcher - } - - int32_t MultiSearcher::searcherIndex(int32_t n) const{ - return subSearcher(n); - } - - /** Returns index of the searcher for document n in the array - * used to construct this searcher. */ - int32_t MultiSearcher::subSearcher(int32_t n) const{ - // replace w/ call to Arrays.binarySearch in Java 1.2 - int32_t lo = 0; // search starts array - int32_t hi = searchablesLen - 1; // for first element less - // than n, return its index - int32_t mid,midValue; - while (hi >= lo) { - mid = (lo + hi) >> 1; - midValue = starts[mid]; - if (n < midValue) - hi = mid - 1; - else if (n > midValue) - lo = mid + 1; - else{ // found a match - while (mid+1 < searchablesLen && starts[mid+1] == midValue) { - ++mid; // scan to last match - } - return mid; - } - } - return hi; - } - - /** Returns the document number of document n within its - * sub-index. */ - int32_t MultiSearcher::subDoc(int32_t n) const{ - return n - starts[subSearcher(n)]; - } - - int32_t MultiSearcher::maxDoc() const{ - return _maxDoc; - } - - TopDocs* MultiSearcher::_search(Query* query, Filter* filter, const int32_t nDocs) { - HitQueue* hq = _CLNEW HitQueue(nDocs); - int32_t totalHits = 0; - TopDocs* docs; - int32_t j; - ScoreDoc* scoreDocs; - for (int32_t i = 0; i < searchablesLen; i++) { // search each searcher - docs = searchables[i]->_search(query, filter, nDocs); - totalHits += docs->totalHits; // update totalHits - scoreDocs = docs->scoreDocs; - for ( j = 0; j scoreDocsLength; ++j) { // merge scoreDocs int_to hq - scoreDocs[j].doc += starts[i]; // convert doc - if ( !hq->insert(scoreDocs[j])) - break; // no more scores > minScore - } - - _CLDELETE(docs); - } - - int32_t scoreDocsLen = hq->size(); - scoreDocs = _CL_NEWARRAY(ScoreDoc, scoreDocsLen); - {//MSVC 6 scope fix - for (int32_t i = scoreDocsLen-1; i >= 0; --i) // put docs in array - scoreDocs[i] = hq->pop(); - } - - //cleanup - _CLDELETE(hq); - - return _CLNEW TopDocs(totalHits, scoreDocs, scoreDocsLen); - } - - /** Lower-level search API. - * - *

{@link HitCollector#collect(int32_t,qreal)} is called for every non-zero - * scoring document. - * - *

Applications should only use this if they need all of the - * matching documents. The high-level search API ({@link - * Searcher#search(Query)}) is usually more efficient, as it skips - * non-high-scoring hits. - * - * @param query to match documents - * @param filter if non-null, a bitset used to eliminate some documents - * @param results to receive hits - */ - void MultiSearcher::_search(Query* query, Filter* filter, HitCollector* results){ - for (int32_t i = 0; i < searchablesLen; ++i) { - /* DSR:CL_BUG: Old implementation leaked and was misconceived. We need - ** to have the original HitCollector ($results) collect *all* hits; - ** the MultiHitCollector instantiated below serves only to adjust - ** (forward by starts[i]) the docNo passed to $results. - ** Old implementation instead created a sort of linked list of - ** MultiHitCollectors that applied the adjustments in $starts - ** cumulatively (and was never deleted). */ - HitCollector *docNoAdjuster = _CLNEW MultiHitCollector(results, starts[i]); - searchables[i]->_search(query, filter, docNoAdjuster); - _CLDELETE(docNoAdjuster); - } - } - - TopFieldDocs* MultiSearcher::_search (Query* query, Filter* filter, const int32_t n, const Sort* sort){ - FieldDocSortedHitQueue* hq = NULL; - int32_t totalHits = 0; - TopFieldDocs* docs; - int32_t j; - FieldDoc** fieldDocs; - - for (int32_t i = 0; i < searchablesLen; ++i) { // search each searcher - docs = searchables[i]->_search (query, filter, n, sort); - if (hq == NULL){ - hq = _CLNEW FieldDocSortedHitQueue (docs->fields, n); - docs->fields = NULL; //hit queue takes fields memory - } - - totalHits += docs->totalHits; // update totalHits - fieldDocs = docs->fieldDocs; - for(j = 0;jscoreDocsLength;++j){ // merge scoreDocs into hq - fieldDocs[j]->scoreDoc.doc += starts[i]; // convert doc - if (!hq->insert (fieldDocs[j]) ) - break; // no more scores > minScore - } - for ( int32_t x=0;xsize(); - fieldDocs = _CL_NEWARRAY(FieldDoc*,hqlen); - for (j = hqlen - 1; j >= 0; j--) // put docs in array - fieldDocs[j] = hq->pop(); - - SortField** hqFields = hq->getFields(); - hq->setFields(NULL); //move ownership of memory over to TopFieldDocs - _CLDELETE(hq); - - return _CLNEW TopFieldDocs (totalHits, fieldDocs, hqlen, hqFields); - } - - Query* MultiSearcher::rewrite(Query* original) { - Query** queries = _CL_NEWARRAY(Query*,searchablesLen+1); - for (int32_t i = 0; i < searchablesLen; ++i) - queries[i] = searchables[i]->rewrite(original); - queries[searchablesLen]=NULL; - return original->combine(queries); - } - - void MultiSearcher::explain(Query* query, int32_t doc, Explanation* ret) { - int32_t i = subSearcher(doc); // find searcher index - searchables[i]->explain(query,doc-starts[i], ret); // dispatch to searcher - } - - MultiHitCollector::MultiHitCollector(HitCollector* _results, int32_t _start): - results(_results), - start(_start) { - } - - void MultiHitCollector::collect(const int32_t doc, const qreal score) { - results->collect(doc + start, score); - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/MultiSearcher.h b/3rdparty/clucene/src/CLucene/search/MultiSearcher.h deleted file mode 100644 index 1021fbbec..000000000 --- a/3rdparty/clucene/src/CLucene/search/MultiSearcher.h +++ /dev/null @@ -1,95 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_multisearcher -#define _lucene_search_multisearcher - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SearchHeader.h" -#include "CLucene/document/Document.h" -#include "CLucene/index/Term.h" - -CL_NS_DEF(search) - - class MultiHitCollector: public HitCollector{ - private: - HitCollector* results; - int32_t start; - public: - MultiHitCollector(HitCollector* _results, int32_t _start); - void collect(const int32_t doc, const qreal score) ; - }; - - - /** Implements search over a set of Searchables. - * - *

Applications usually need only call the inherited {@link #search(Query)} - * or {@link #search(Query,Filter)} methods. - */ - class MultiSearcher: public Searcher { - private: - Searchable** searchables; - int32_t searchablesLen; - int32_t* starts; - int32_t _maxDoc; - protected: - int32_t* getStarts() { - return starts; - } - - public: - /** Creates a searcher which searches Searchables. */ - MultiSearcher(Searchable** searchables); - - ~MultiSearcher(); - - /** Frees resources associated with this Searcher. */ - void close() ; - - int32_t docFreq(const CL_NS(index)::Term* term) const ; - - /** For use by {@link HitCollector} implementations. */ - bool doc(int32_t n, CL_NS(document)::Document* document); - - /** For use by {@link HitCollector} implementations to identify the - * index of the sub-searcher that a particular hit came from. */ - int32_t searcherIndex(int32_t n) const; - - int32_t subSearcher(int32_t n) const; - - int32_t subDoc(int32_t n) const; - - int32_t maxDoc() const; - - TopDocs* _search(Query* query, Filter* filter, const int32_t nDocs) ; - - TopFieldDocs* _search (Query* query, Filter* filter, const int32_t n, const Sort* sort); - - /** Lower-level search API. - * - *

{@link HitCollector#collect(int32_t,qreal)} is called for every non-zero - * scoring document. - * - *

Applications should only use this if they need all of the - * matching documents. The high-level search API ({@link - * Searcher#search(Query)}) is usually more efficient, as it skips - * non-high-scoring hits. - * - * @param query to match documents - * @param filter if non-null, a bitset used to eliminate some documents - * @param results to receive hits - */ - void _search(Query* query, Filter* filter, HitCollector* results); - - Query* rewrite(Query* original); - void explain(Query* query, int32_t doc, Explanation* ret); - }; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp b/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp deleted file mode 100644 index 3bf8d7a26..000000000 --- a/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "MultiTermQuery.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - -/** Constructs a query for terms matching term. */ - - MultiTermQuery::MultiTermQuery(Term* t){ - //Func - Constructor - //Pre - t != NULL - //Post - The instance has been created - - CND_PRECONDITION(t != NULL, "t is NULL"); - - term = _CL_POINTER(t); - - } - MultiTermQuery::MultiTermQuery(const MultiTermQuery& clone): - Query(clone) - { - term = _CLNEW Term(clone.getTerm(false),clone.getTerm(false)->text()); - } - - MultiTermQuery::~MultiTermQuery(){ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - _CLDECDELETE(term); - } - - Term* MultiTermQuery::getTerm(bool pointer) const{ - if ( pointer ) - return _CL_POINTER(term); - else - return term; - } - - Query* MultiTermQuery::rewrite(IndexReader* reader) { - FilteredTermEnum* enumerator = getEnum(reader); - BooleanQuery* query = _CLNEW BooleanQuery(); - try { - do { - Term* t = enumerator->term(false); - if (t != NULL) { - TermQuery* tq = _CLNEW TermQuery(t); // found a match - tq->setBoost(getBoost() * enumerator->difference()); // set the boost - query->add(tq,true, false, false); // add to q - } - } while (enumerator->next()); - } _CLFINALLY ( enumerator->close(); _CLDELETE(enumerator) ); - - //if we only added one clause and the clause is not prohibited then - //we can just return the query - if (query->getClauseCount() == 1) { // optimize 1-clause queries - BooleanClause* c=0; - query->getClauses(&c); - - if (!c->prohibited) { // just return clause - c->deleteQuery=false; - Query* ret = c->query; - - _CLDELETE(query); - return ret; - } - } - return query; - } - - Query* MultiTermQuery::combine(Query** queries) { - return Query::mergeBooleanQueries(queries); - } - - /** Prints a user-readable version of this query. */ - TCHAR* MultiTermQuery::toString(const TCHAR* field) const{ - StringBuffer buffer; - - if ( field==NULL || _tcscmp(term->field(),field)!=0 ) { - buffer.append(term->field()); - buffer.append( _T(":")); - } - buffer.append(term->text()); - if (getBoost() != 1.0f) { - buffer.appendChar ( '^' ); - buffer.appendFloat( getBoost(),1); - } - return buffer.toString(); - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h b/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h deleted file mode 100644 index d37645359..000000000 --- a/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h +++ /dev/null @@ -1,62 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_MultiTermQuery_ -#define _lucene_search_MultiTermQuery_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/StringBuffer.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "FilteredTermEnum.h" -#include "SearchHeader.h" -#include "BooleanQuery.h" -#include "TermQuery.h" - -CL_NS_DEF(search) - /** - * A {@link Query} that matches documents containing a subset of terms provided - * by a {@link FilteredTermEnum} enumeration. - *

- * MultiTermQuery is not designed to be used by itself. - *
- * The reason being that it is not intialized with a {@link FilteredTermEnum} - * enumeration. A {@link FilteredTermEnum} enumeration needs to be provided. - *

- * For example, {@link WildcardQuery} and {@link FuzzyQuery} extend - * MultiTermQuery to provide {@link WildcardTermEnum} and - * {@link FuzzyTermEnum}, respectively. - */ - class MultiTermQuery: public Query { - private: - CL_NS(index)::Term* term; - protected: - MultiTermQuery(const MultiTermQuery& clone); - - /** Construct the enumeration to be used, expanding the pattern term. */ - virtual FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader) = 0; - public: - /** Constructs a query for terms matching term. */ - MultiTermQuery(CL_NS(index)::Term* t); - - virtual ~MultiTermQuery(); - - /** Returns the pattern term. */ - CL_NS(index)::Term* getTerm(bool pointer=true) const; - - Query* combine(Query** queries); - - /** Prints a user-readable version of this query. */ - TCHAR* toString(const TCHAR* field) const; - - Query* rewrite(CL_NS(index)::IndexReader* reader); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp b/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp deleted file mode 100644 index 7611056e7..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "PhrasePositions.h" - -#include "CLucene/index/Terms.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - PhrasePositions::PhrasePositions(TermPositions* Tp, const int32_t OffSet){ - //Func - Constructor - //Pre - t != NULL - // OffSet != NULL - //Post - The instance has been created - - CND_PRECONDITION(Tp != NULL,"Tp is NULL"); - CND_PRECONDITION(OffSet >= 0 ,"OffSet is a negative number"); - - tp = Tp; - offset = OffSet; - position = 0; - count = 0; - doc = 0; - - _next = NULL; - } - - PhrasePositions::~PhrasePositions(){ - //Func - Destructor - //Pre - true - //Post - The instance has been deleted - - //delete next Phrase position and by doing that - //all PhrasePositions in the list - _CLDELETE(_next); - - //Check if tp is valid - if ( tp != NULL ){ - //Close TermPositions tp - tp->close(); - _CLDELETE(tp); - } - } - - bool PhrasePositions::next(){ - //Func - Increments to next doc - //Pre - tp != NULL - //Post - if there was no next then doc = INT_MAX otherwise - // doc contains the current document number - - CND_PRECONDITION(tp != NULL,"tp is NULL"); - - //Move to the next in TermPositions tp - if (!tp->next()) { - //There is no next so close the stream - tp->close(); - //delete tp and reset tp to NULL - _CLVDELETE(tp); //todo: not a clucene object... should be - //Assign Doc sentinel value - doc = INT_MAX; - return false; - }else{ - doc = tp->doc(); - position = 0; - return true; - } - } - bool PhrasePositions::skipTo(int32_t target){ - if (!tp->skipTo(target)) { - tp->close(); // close stream - doc = LUCENE_INT32_MAX_SHOULDBE; // sentinel value - return false; - } - doc = tp->doc(); - position = 0; - return true; - } - void PhrasePositions::firstPosition(){ - //Func - Read the first TermPosition - //Pre - tp != NULL - //Post - - - CND_PRECONDITION(tp != NULL,"tp is NULL"); - - //read first pos - count = tp->freq(); - //Move to the next TermPosition - nextPosition(); - } - - bool PhrasePositions::nextPosition(){ - //Func - Move to the next position - //Pre - tp != NULL - //Post - - - CND_PRECONDITION(tp != NULL,"tp is NULL"); - - if (count-- > 0) { - //read subsequent pos's - position = tp->nextPosition() - offset; - - //Check position always bigger than or equal to 0 - //bvk: todo, bug??? position < 0 occurs, cant figure out why, - //old version does it too and will fail the "SearchTest" test - //CND_CONDITION(position >= 0, "position has become a negative number"); - return true; - }else{ - return false; - } - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/PhrasePositions.h b/3rdparty/clucene/src/CLucene/search/PhrasePositions.h deleted file mode 100644 index b6c8437b9..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhrasePositions.h +++ /dev/null @@ -1,41 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_PhrasePositions_ -#define _lucene_search_PhrasePositions_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/Terms.h" - -CL_NS_DEF(search) - - class PhrasePositions:LUCENE_BASE { - public: - int32_t doc; // current doc - int32_t position; // position in doc - int32_t count; // remaining pos in this doc - int32_t offset; // position in phrase - CL_NS(index)::TermPositions* tp; // stream of positions - PhrasePositions* _next; // used to make lists - - - //Constructor - PhrasePositions(CL_NS(index)::TermPositions* Tp, const int32_t o); - //Destructor - ~PhrasePositions(); - - bool next(); - bool skipTo(int32_t target); - - void firstPosition(); - - bool nextPosition(); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp b/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp deleted file mode 100644 index 899cb3cfe..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp +++ /dev/null @@ -1,463 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "PhraseQuery.h" - -#include "SearchHeader.h" -#include "Scorer.h" -#include "BooleanQuery.h" -#include "TermQuery.h" - -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "CLucene/index/IndexReader.h" - -#include "CLucene/util/StringBuffer.h" -#include "CLucene/util/VoidList.h" -#include "CLucene/util/Arrays.h" - -#include "ExactPhraseScorer.h" -#include "SloppyPhraseScorer.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - PhraseQuery::PhraseQuery(): - terms(false) - { - //Func - Constructor - //Pre - true - //Post - An empty PhraseQuery has been created - - slop = 0; - - field = NULL; - } - PhraseQuery::PhraseQuery(const PhraseQuery& clone): - Query(clone), terms(false) - { - slop = clone.slop; - field = clone.field; - int32_t size=clone.positions.size(); - { //msvc6 scope fix - for ( int32_t i=0;ipositions.push_back( n ); - } - } - size=clone.terms.size(); - { //msvc6 scope fix - for ( int32_t i=0;iterms.push_back( _CL_POINTER(clone.terms[i])); - } - } - } - Query* PhraseQuery::clone() const{ - return _CLNEW PhraseQuery(*this); - } - bool PhraseQuery::equals(CL_NS(search)::Query *other) const{ - if (!(other->instanceOf(PhraseQuery::getClassName()))) - return false; - - PhraseQuery* pq = (PhraseQuery*)other; - bool ret = (this->getBoost() == pq->getBoost()) - && (this->slop == pq->slop); - - if ( ret ){ - CLListEquals, - const CL_NS(util)::CLVector > comp; - ret = comp.equals(&this->terms,&pq->terms); - } - - if ( ret ){ - CLListEquals, - const CL_NS(util)::CLVector > comp; - ret = comp.equals(&this->positions,&pq->positions); - } - return ret; - } - - - PhraseQuery::~PhraseQuery(){ - //Func - Destructor - //Pre - true - //Post 0 The instance has been destroyed - - //Iterate through all the terms - for (uint32_t i = 0; i < terms.size(); i++){ - _CLLDECDELETE(terms[i]); - } - positions.clear(); - } - - size_t PhraseQuery::hashCode() const { - //todo: do cachedHashCode, and invalidate on add/remove clause - size_t ret = Similarity::floatToByte(getBoost()) ^ Similarity::floatToByte(slop); - - { //msvc6 scope fix - for ( int32_t i=0;terms.size();i++ ) - ret = 31 * ret + terms[i]->hashCode(); - } - { //msvc6 scope fix - for ( int32_t i=0;positions.size();i++ ) - ret = 31 * ret + positions[i]; - } - return ret; - } - - const TCHAR* PhraseQuery::getClassName(){ - return _T("PhraseQuery"); - } - const TCHAR* PhraseQuery::getQueryName() const{ - //Func - Returns the string "PhraseQuery" - //Pre - true - //Post - The string "PhraseQuery" has been returned - return getClassName(); - } - - - /** - * Adds a term to the end of the query phrase. - * The relative position of the term is the one immediately after the last term added. - */ - void PhraseQuery::add(Term* term) { - CND_PRECONDITION(term != NULL,"term is NULL"); - - int32_t position = 0; - - if(positions.size() > 0) - position = (positions[positions.size()-1]) + 1; - - add(term, position); - } - - void PhraseQuery::add(Term* term, int32_t position) { - //Func - Adds a term to the end of the query phrase. - //Pre - term != NULL - //Post - The term has been added if its field matches the field of the PhraseQuery - // and true is returned otherwise false is returned - CND_PRECONDITION(term != NULL,"term is NULL"); - - if (terms.size() == 0) - field = term->field(); - else{ - //Check if the field of the _CLNEW term matches the field of the PhraseQuery - //can use != because fields are interned - if ( term->field() != field){ - //return false; - TCHAR buf[200]; - _sntprintf(buf,200,_T("All phrase terms must be in the same field: %s"),term->field()); - _CLTHROWT(CL_ERR_IllegalArgument,buf); - } - } - //Store the _CLNEW term - terms.push_back(_CL_POINTER(term)); - - positions.push_back(position); - } - - void PhraseQuery::getPositions(Array& result) const{ - result.length = positions.size(); - result.values = _CL_NEWARRAY(int32_t,result.length); - for(int32_t i = 0; i < result.length; i++){ - result.values[i] = positions[i]; - } - } - int32_t* PhraseQuery::getPositions() const{ - CND_WARNING(false,"getPositions() is deprecated") - - Array arr; - getPositions(arr); - return arr.values; - } - - Weight* PhraseQuery::_createWeight(Searcher* searcher) { - if (terms.size() == 1) { // optimize one-term case - Term* term = terms[0]; - Query* termQuery = _CLNEW TermQuery(term); - termQuery->setBoost(getBoost()); - Weight* ret = termQuery->_createWeight(searcher); - _CLDELETE(termQuery); - return ret; - } - return _CLNEW PhraseWeight(searcher,this); - } - - - Term** PhraseQuery::getTerms() const{ - //Func - added by search highlighter - //Pre - - //Post - - - //Let size contain the number of terms - int32_t size = terms.size(); - Term** ret = _CL_NEWARRAY(Term*,size+1); - - CND_CONDITION(ret != NULL,"Could not allocated memory for ret"); - - //Iterate through terms and copy each pointer to ret - for ( int32_t i=0;itext() ); - //Check if i is at the end of terms - if (i != terms.size()-1){ - buffer.append(_T(" ")); - } - } - - buffer.append( _T("\"") ); - - if (slop != 0) { - buffer.append(_T("~")); - buffer.appendFloat(slop,0); - } - - //Check if there is an other boost factor than 1.0 - if (getBoost() != 1.0f) { - buffer.append(_T("^")); - buffer.appendFloat( getBoost(),1 ); - } - - //return the query string - return buffer.toString(); - } - - - - - - - - - PhraseQuery::PhraseWeight::PhraseWeight(Searcher* searcher, PhraseQuery* _this) { - this->_this=_this; - this->value = 0; - this->idf = 0; - this->queryNorm = 0; - this->queryWeight = 0; - this->searcher = searcher; - } - - TCHAR* PhraseQuery::PhraseWeight::toString() { - return STRDUP_TtoT(_T("weight(PhraseQuery)")); - } - PhraseQuery::PhraseWeight::~PhraseWeight(){ - } - - - Query* PhraseQuery::PhraseWeight::getQuery() { return _this; } - qreal PhraseQuery::PhraseWeight::getValue() { return value; } - - qreal PhraseQuery::PhraseWeight::sumOfSquaredWeights(){ - idf = _this->getSimilarity(searcher)->idf(&_this->terms, searcher); - queryWeight = idf * _this->getBoost(); // compute query weight - return queryWeight * queryWeight; // square it - } - - void PhraseQuery::PhraseWeight::normalize(qreal queryNorm) { - this->queryNorm = queryNorm; - queryWeight *= queryNorm; // normalize query weight - value = queryWeight * idf; // idf for document - } - - Scorer* PhraseQuery::PhraseWeight::scorer(IndexReader* reader) { - //Func - - //Pre - - //Post - - - //Get the length of terms - int32_t tpsLength = _this->terms.size(); - - //optimize zero-term case - if (tpsLength == 0) - return NULL; - - TermPositions** tps = _CL_NEWARRAY(TermPositions*,tpsLength+1); - - //Check if tps has been allocated properly - CND_CONDITION(tps != NULL,"Could not allocate memory for tps"); - - TermPositions* p = NULL; - - //Iterate through all terms - int32_t size = _this->terms.size(); - for (int32_t i = 0; i < size; i++) { - //Get the termPostitions for the i-th term - p = reader->termPositions(_this->terms[i]); - - //Check if p is valid - if (p == NULL) { - //Delete previous retrieved termPositions - while (--i >= 0){ - _CLVDELETE(tps[i]); //todo: not a clucene object... should be - } - _CLDELETE_ARRAY(tps); - return NULL; - } - - //Store p at i in tps - tps[i] = p; - } - tps[tpsLength] = NULL; - - Scorer* ret = NULL; - - Array positions; - _this->getPositions(positions); - int32_t slop = _this->getSlop(); - if ( slop != 0) - // optimize exact case - //todo: need to pass these: this, tps, - ret = _CLNEW SloppyPhraseScorer(this,tps,positions.values, - _this->getSimilarity(searcher), - slop, reader->norms(_this->field)); - else - ret = _CLNEW ExactPhraseScorer(this, tps, positions.values, - _this->getSimilarity(searcher), - reader->norms(_this->field)); - positions.deleteArray(); - - CND_CONDITION(ret != NULL,"Could not allocate memory for ret"); - - //tps can be deleted safely. SloppyPhraseScorer or ExactPhraseScorer will take care - //of its values - - _CLDELETE_ARRAY(tps); - return ret; - } - - void PhraseQuery::PhraseWeight::explain(IndexReader* reader, int32_t doc, Explanation* result){ - TCHAR descbuf[LUCENE_SEARCH_EXPLANATION_DESC_LEN+1]; - TCHAR* tmp; - - tmp = getQuery()->toString(); - _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN,_T("weight(%s in %d), product of:"), - tmp,doc); - _CLDELETE_CARRAY(tmp); - result->setDescription(descbuf); - - StringBuffer docFreqs; - StringBuffer query; - query.appendChar('\"'); - for (uint32_t i = 0; i < _this->terms.size(); i++) { - if (i != 0) { - docFreqs.appendChar(' '); - query.appendChar(' '); - } - - Term* term = _this->terms[i]; - - docFreqs.append(term->text()); - docFreqs.appendChar('='); - docFreqs.appendInt(searcher->docFreq(term)); - - query.append(term->text()); - } - query.appendChar('\"'); - - _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("idf(%s: %s)"),_this->field,docFreqs.getBuffer()); - Explanation* idfExpl = _CLNEW Explanation(idf, descbuf); - - // explain query weight - Explanation* queryExpl = _CLNEW Explanation; - tmp = getQuery()->toString(); - _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("queryWeight(%s), product of:"),tmp); - _CLDELETE_CARRAY(tmp); - queryExpl->setDescription(descbuf); - - Explanation* boostExpl = _CLNEW Explanation(_this->getBoost(), _T("boost")); - if (_this->getBoost() != 1.0f) - queryExpl->addDetail(boostExpl); - queryExpl->addDetail(idfExpl); - - Explanation* queryNormExpl = _CLNEW Explanation(queryNorm,_T("queryNorm")); - queryExpl->addDetail(queryNormExpl); - - queryExpl->setValue(boostExpl->getValue() * - idfExpl->getValue() * - queryNormExpl->getValue()); - - result->addDetail(queryExpl); - - // explain field weight - Explanation* fieldExpl = _CLNEW Explanation; - _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("fieldWeight(%s:%s in %d), product of:"), - _this->field,query.getBuffer(),doc); - fieldExpl->setDescription(descbuf); - - - Explanation* tfExpl = _CLNEW Explanation; - scorer(reader)->explain(doc, tfExpl); - fieldExpl->addDetail(tfExpl); - fieldExpl->addDetail(idfExpl); - - Explanation* fieldNormExpl = _CLNEW Explanation(); - uint8_t* fieldNorms = reader->norms(_this->field); - qreal fieldNorm = - fieldNorms!=NULL ? Similarity::decodeNorm(fieldNorms[doc]) : 0.0f; - fieldNormExpl->setValue(fieldNorm); - - - _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("fieldNorm(field=%s, doc=%d)"),_this->field,doc); - fieldNormExpl->setDescription(descbuf); - fieldExpl->addDetail(fieldNormExpl); - - fieldExpl->setValue(tfExpl->getValue() * - idfExpl->getValue() * - fieldNormExpl->getValue()); - - result->addDetail(fieldExpl); - - // combine them - result->setValue(queryExpl->getValue() * fieldExpl->getValue()); - - if (queryExpl->getValue() == 1.0f){ - result->set(*fieldExpl); - _CLDELETE(fieldExpl); - } - } - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/PhraseQuery.h b/3rdparty/clucene/src/CLucene/search/PhraseQuery.h deleted file mode 100644 index 6b3255822..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhraseQuery.h +++ /dev/null @@ -1,127 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_PhraseQuery_ -#define _lucene_search_PhraseQuery_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SearchHeader.h" -#include "Scorer.h" -#include "BooleanQuery.h" -#include "TermQuery.h" - -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "CLucene/index/IndexReader.h" - -#include "CLucene/util/StringBuffer.h" -#include "CLucene/util/VoidList.h" - -#include "ExactPhraseScorer.h" -#include "SloppyPhraseScorer.h" - -CL_NS_DEF(search) - // A Query that matches documents containing a particular sequence of terms. - // This may be combined with other terms with a {@link BooleanQuery}. - class PhraseQuery: public Query { - private: - CL_NS(util)::CLVector positions; - int32_t slop; - - const TCHAR* field; - CL_NS(util)::CLVector terms; - - - class PhraseWeight: public Weight { - private: - Searcher* searcher; - qreal value; - qreal idf; - qreal queryNorm; - qreal queryWeight; - PhraseQuery* _this; - public: - PhraseWeight(Searcher* searcher, PhraseQuery* _this); - ~PhraseWeight(); - TCHAR* toString(); - - Query* getQuery(); - qreal getValue(); - - qreal sumOfSquaredWeights(); - void normalize(qreal queryNorm); - Scorer* scorer(CL_NS(index)::IndexReader* reader); - void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret); - TCHAR* toString(TCHAR* f); - bool equals(PhraseWeight* o); - }; - friend class PhraseWeight; - protected: - Weight* _createWeight(Searcher* searcher); - PhraseQuery(const PhraseQuery& clone); - public: - //Constructor - PhraseQuery(); - - //Destructor - ~PhraseQuery(); - - //Returns the string "PhraseQuery" - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); - - //Sets the number of other words permitted between words in query phrase. - //If zero, then this is an exact phrase search. For larger values this works - //like a WITHIN or NEAR operator. - // - //The slop is in fact an edit-distance, where the units correspond to - //moves of terms in the query phrase out of position. For example, to switch - //the order of two words requires two moves (the first move places the words - //atop one another), so to permit re-orderings of phrases, the slop must be - //at least two. - // - //More exact matches are scored higher than sloppier matches, thus search - //results are sorted by exactness. - // - //The slop is zero by default, requiring exact matches. - void setSlop(const int32_t s) { slop = s; } - - //Returns the slop. See setSlop(). - int32_t getSlop() const { return slop; } - - //Adds a term to the end of the query phrase. - void add(CL_NS(index)::Term* term); - void add(CL_NS(index)::Term* term, int32_t position); - - - - //Returns the sum of squared weights - qreal sumOfSquaredWeights(Searcher* searcher); - - //Normalizes the Weight - void normalize(const qreal norm); - - Scorer* scorer(CL_NS(index)::IndexReader* reader); - - //added by search highlighter - CL_NS(index)::Term** getTerms() const; - _CL_DEPRECATED( deleteDocuments ) int32_t* getPositions() const; ///@deprecated. use getPositions(Array& result) - void getPositions(Array& result) const; - const TCHAR* getFieldName() const{ return field; } - - //Prints a user-readable version of this query. - TCHAR* toString(const TCHAR* f) const; - - Query* clone() const; - bool equals(CL_NS(search)::Query *) const; - - size_t hashCode() const; - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/PhraseQueue.h b/3rdparty/clucene/src/CLucene/search/PhraseQueue.h deleted file mode 100644 index c0682fcaf..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhraseQueue.h +++ /dev/null @@ -1,36 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_PriorityQueue_ -#define _lucene_search_PriorityQueue_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/PriorityQueue.h" -#include "PhrasePositions.h" - -CL_NS_DEF(search) - class PhraseQueue: public CL_NS(util)::PriorityQueue > { - public: - PhraseQueue(const int32_t size) { - initialize(size,false); - } - ~PhraseQueue(){ - } - - protected: - bool lessThan(PhrasePositions* pp1, PhrasePositions* pp2) { - if (pp1->doc == pp2->doc) - return pp1->position < pp2->position; - else - return pp1->doc < pp2->doc; - } - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp b/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp deleted file mode 100644 index b2da2316a..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "PhraseScorer.h" - -#include "PhraseQueue.h" -#include "PhrasePositions.h" -#include "Scorer.h" -#include "Similarity.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - - PhraseScorer::PhraseScorer(Weight* weight, TermPositions** tps, - int32_t* positions, Similarity* similarity, uint8_t* norms): - Scorer(similarity) - { - //Func - Constructor - //Pre - tps != NULL and is an array of TermPositions - // tpsLength >= 0 - // n != NULL - //Post - The instance has been created - - CND_PRECONDITION(tps != NULL,"tps is NULL"); - - //norms are only used if phraseFreq returns more than 0.0 - //phraseFreq should only return more than 0.0 if norms != NULL - //CND_PRECONDITION(n != NULL,"n is NULL"); - - firstTime = true; - more = true; - this->norms = norms; - this->weight = weight; - this->value = weight->getValue(); - - //reset internal pointers - first = NULL; - last = NULL; - - //use pq to build a sorted list of PhrasePositions - int32_t i = 0; - while(tps[i] != NULL){ - PhrasePositions *pp = _CLNEW PhrasePositions(tps[i], positions[i]); - CND_CONDITION(pp != NULL,"Could not allocate memory for pp"); - - //Store PhrasePos into the PhrasePos pq - if (last != NULL) { // add next to end of list - last->_next = pp; - } else - first = pp; - last = pp; - - i++; - } - - pq = _CLNEW PhraseQueue(i); //i==tps.length - CND_CONDITION(pq != NULL,"Could not allocate memory for pq"); - } - - PhraseScorer::~PhraseScorer() { - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - //The PhraseQueue pq (which is a PriorityQueue) pq is actually empty at present, the elements - //having been transferred by pqToList() to the linked list starting with - //first. The nodes of that linked list are deleted by the destructor of - //first, rather than the destructor of pq. - _CLDELETE(first); - _CLDELETE(pq); - } - - bool PhraseScorer::next(){ - if (firstTime) { - init(); - firstTime = false; - } else if (more) { - more = last->next(); // trigger further scanning - } - return doNext(); - } - - // next without initial increment - bool PhraseScorer::doNext() { - while (more) { - while (more && first->doc < last->doc) { // find doc w/ all the terms - more = first->skipTo(last->doc); // skip first upto last - firstToLast(); // and move it to the end - } - - if (more) { - // found a doc with all of the terms - freq = phraseFreq(); // check for phrase - if (freq == 0.0f) // no match - more = last->next(); // trigger further scanning - else - return true; // found a match - } - } - return false; // no more matches - } - - qreal PhraseScorer::score(){ - //System.out.println("scoring " + first.doc); - qreal raw = getSimilarity()->tf(freq) * value; // raw score - return raw * Similarity::decodeNorm(norms[first->doc]); // normalize - } - - bool PhraseScorer::skipTo(int32_t target) { - for (PhrasePositions* pp = first; more && pp != NULL; pp = pp->_next) { - more = pp->skipTo(target); - } - if (more) - sort(); // re-sort - return doNext(); - } - - void PhraseScorer::init() { - for (PhrasePositions* pp = first; more && pp != NULL; pp = pp->_next) - more = pp->next(); - if(more) - sort(); - } - - void PhraseScorer::sort() { - pq->clear(); - for (PhrasePositions* pp = first; pp != NULL; pp = pp->_next) - pq->put(pp); - pqToList(); - } - - - - void PhraseScorer::pqToList(){ - //Func - Transfers the PhrasePositions from the PhraseQueue pq to - // the PhrasePositions list with first as its first element - //Pre - pq != NULL - // first = NULL - // last = NULL - //Post - All PhrasePositions have been transfered to the list - // of PhrasePositions of which the first element is pointed to by first - // and the last element is pointed to by last - - CND_PRECONDITION(pq != NULL,"pq is NULL"); - - last = first = NULL; - - PhrasePositions* PhrasePos = NULL; - - //As long pq is not empty - while (pq->top() != NULL){ - //Pop a PhrasePositions instance - PhrasePos = pq->pop(); - - // add next to end of list - if (last != NULL) { - last->_next = PhrasePos; - } else { - first = PhrasePos; - } - - //Let last point to the new last PhrasePositions instance just added - last = PhrasePos; - //Reset the next of last to NULL - last->_next = NULL; - } - - //Check to see that pq is empty now - CND_CONDITION(pq->size()==0, "pq is not empty while it should be"); - } - - void PhraseScorer::firstToLast(){ - //Func - Moves first to the end of the list - //Pre - first is NULL or points to an PhrasePositions Instance - // last is NULL or points to an PhrasePositions Instance - // first and last both are NULL or both are not NULL - //Post - The first element has become the last element in the list - - CND_PRECONDITION(((first==NULL && last==NULL) ||(first !=NULL && last != NULL)), - "Either first or last is NULL but not both"); - - //Check if first and last are valid pointers - if(first && last){ - last->_next = first; - last = first; - first = first->_next; - last->_next = NULL; - } - } - - - void PhraseScorer::explain(int32_t _doc, Explanation* tfExplanation) { - while (next() && doc() < _doc){ - } - - qreal phraseFreq = (doc() == _doc) ? freq : 0.0f; - tfExplanation->setValue(getSimilarity()->tf(phraseFreq)); - - StringBuffer buf; - buf.append(_T("tf(phraseFreq=")); - buf.appendFloat(phraseFreq,2); - buf.append(_T(")")); - tfExplanation->setDescription(buf.getBuffer()); - } - - TCHAR* PhraseScorer::toString() { - StringBuffer buf; - buf.append(_T("scorer(")); - - TCHAR* tmp = weight->toString(); - buf.append(tmp); - _CLDELETE_CARRAY(tmp); - - buf.append(_T(")")); - - return buf.toString(); - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/PhraseScorer.h b/3rdparty/clucene/src/CLucene/search/PhraseScorer.h deleted file mode 100644 index 89f7a1fbb..000000000 --- a/3rdparty/clucene/src/CLucene/search/PhraseScorer.h +++ /dev/null @@ -1,65 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_PhraseScorer_ -#define _lucene_search_PhraseScorer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "PhraseQueue.h" -#include "PhrasePositions.h" -#include "Scorer.h" -#include "Similarity.h" - -CL_NS_DEF(search) - - class PhraseScorer: public Scorer { - private: - Weight* weight; - qreal freq; - bool firstTime; - bool more; - - protected: - uint8_t* norms; - qreal value; - - PhraseQueue* pq; //is used to order the list point to by first and last - PhrasePositions* first; //Points to the first in the list of PhrasePositions - PhrasePositions* last; //Points to the last in the list of PhrasePositions - - public: - //Constructor - PhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, - int32_t* positions, Similarity* similarity, uint8_t* norms); - virtual ~PhraseScorer(); - - int32_t doc() const { return first->doc; } - bool next(); - qreal score(); - bool skipTo(int32_t target); - - - void explain(int32_t doc, Explanation* ret); - TCHAR* toString(); - protected: - virtual qreal phraseFreq() =0; - - //Transfers the PhrasePositions from the PhraseQueue pq to - //the PhrasePositions list with first as its first element - void pqToList(); - - //Moves first to the end of the list - void firstToLast(); - private: - bool doNext(); - void init(); - void sort(); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp b/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp deleted file mode 100644 index 6bb27d1ca..000000000 --- a/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp +++ /dev/null @@ -1,273 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "PrefixQuery.h" -#include "CLucene/util/BitSet.h" - -CL_NS_USE(util) -CL_NS_USE(index) -CL_NS_DEF(search) - - PrefixQuery::PrefixQuery(Term* Prefix){ - //Func - Constructor. - // Constructs a query for terms starting with prefix - //Pre - Prefix != NULL - //Post - The instance has been created - - //Get a pointer to Prefix - prefix = _CL_POINTER(Prefix); - } - - PrefixQuery::PrefixQuery(const PrefixQuery& clone):Query(clone){ - prefix = _CL_POINTER(clone.prefix); - } - Query* PrefixQuery::clone() const{ - return _CLNEW PrefixQuery(*this); - } - - Term* PrefixQuery::getPrefix(bool pointer){ - if ( pointer ) - return _CL_POINTER(prefix); - else - return prefix; - } - - PrefixQuery::~PrefixQuery(){ - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed. - - //Delete prefix by finalizing it - _CLDECDELETE(prefix); - } - - - /** Returns a hash code value for this object.*/ - size_t PrefixQuery::hashCode() const { - return Similarity::floatToByte(getBoost()) ^ prefix->hashCode(); - } - - const TCHAR* PrefixQuery::getQueryName()const{ - //Func - Returns the name "PrefixQuery" - //Pre - true - //Post - The string "PrefixQuery" has been returned - - return getClassName(); - } - const TCHAR* PrefixQuery::getClassName(){ - //Func - Returns the name "PrefixQuery" - //Pre - true - //Post - The string "PrefixQuery" has been returned - - return _T("PrefixQuery"); - } - - bool PrefixQuery::equals(Query * other) const{ - if (!(other->instanceOf(PrefixQuery::getClassName()))) - return false; - - PrefixQuery* rq = (PrefixQuery*)other; - bool ret = (this->getBoost() == rq->getBoost()) - && (this->prefix->equals(rq->prefix)); - - return ret; - } - - Query* PrefixQuery::rewrite(IndexReader* reader){ - BooleanQuery* query = _CLNEW BooleanQuery(); - TermEnum* enumerator = reader->terms(prefix); - Term* lastTerm = NULL; - try { - const TCHAR* prefixText = prefix->text(); - const TCHAR* prefixField = prefix->field(); - const TCHAR* tmp; - size_t i; - int32_t prefixLen = prefix->textLength(); - do { - lastTerm = enumerator->term(); - if (lastTerm != NULL && lastTerm->field() == prefixField ){ - - //now see if term->text() starts with prefixText - int32_t termLen = lastTerm->textLength(); - if ( prefixLen>termLen ) - break; //the prefix is longer than the term, can't be matched - - tmp = lastTerm->text(); - - //check for prefix match in reverse, since most change will be at the end - for ( i=prefixLen-1;i!=-1;--i ){ - if ( tmp[i] != prefixText[i] ){ - tmp=NULL;//signals inequality - break; - } - } - if ( tmp == NULL ) - break; - - TermQuery* tq = _CLNEW TermQuery(lastTerm); // found a match - tq->setBoost(getBoost()); // set the boost - query->add(tq,true,false, false); // add to query - } else - break; - _CLDECDELETE(lastTerm); - } while (enumerator->next()); - }_CLFINALLY( - enumerator->close(); - _CLDELETE(enumerator); - _CLDECDELETE(lastTerm); - ); - _CLDECDELETE(lastTerm); - - - //if we only added one clause and the clause is not prohibited then - //we can just return the query - if (query->getClauseCount() == 1) { // optimize 1-clause queries - BooleanClause* c=0; - query->getClauses(&c); - - if (!c->prohibited) { // just return clause - c->deleteQuery=false; - Query* ret = c->query; - - _CLDELETE(query); - return ret; - } - } - - return query; - } - - Query* PrefixQuery::combine(Query** queries) { - return Query::mergeBooleanQueries(queries); - } - - TCHAR* PrefixQuery::toString(const TCHAR* field) const{ - //Func - Creates a user-readable version of this query and returns it as as string - //Pre - field != NULL - //Post - a user-readable version of this query has been returned as as string - - //Instantiate a stringbuffer buffer to store the readable version temporarily - CL_NS(util)::StringBuffer buffer; - //check if field equal to the field of prefix - if( field==NULL || _tcscmp(prefix->field(),field) != 0 ) { - //Append the field of prefix to the buffer - buffer.append(prefix->field()); - //Append a colon - buffer.append(_T(":") ); - } - //Append the text of the prefix - buffer.append(prefix->text()); - //Append a wildchar character - buffer.append(_T("*")); - //if the boost factor is not eaqual to 1 - if (getBoost() != 1.0f) { - //Append ^ - buffer.append(_T("^")); - //Append the boost factor - buffer.appendFloat( getBoost(),1); - } - //Convert StringBuffer buffer to TCHAR block and return it - return buffer.toString(); - } - - - - - - - - -PrefixFilter::PrefixFilter( Term* prefix ) -{ - this->prefix = _CL_POINTER(prefix); -} - -PrefixFilter::~PrefixFilter() -{ - _CLDECDELETE(prefix); -} - -PrefixFilter::PrefixFilter( const PrefixFilter& copy ) : - prefix( _CL_POINTER(copy.prefix) ) -{ -} - -Filter* PrefixFilter::clone() const { - return _CLNEW PrefixFilter(*this ); -} - -TCHAR* PrefixFilter::toString() -{ - //Instantiate a stringbuffer buffer to store the readable version temporarily - CL_NS(util)::StringBuffer buffer; - //check if field equal to the field of prefix - if( prefix->field() != NULL ) { - //Append the field of prefix to the buffer - buffer.append(prefix->field()); - //Append a colon - buffer.append(_T(":") ); - } - //Append the text of the prefix - buffer.append(prefix->text()); - buffer.append(_T("*")); - - //Convert StringBuffer buffer to TCHAR block and return it - return buffer.toString(); -} - -/** Returns a BitSet with true for documents which should be permitted in -search results, and false for those that should not. */ -BitSet* PrefixFilter::bits( IndexReader* reader ) -{ - BitSet* bts = _CLNEW BitSet( reader->maxDoc() ); - TermEnum* enumerator = reader->terms(prefix); - TermDocs* docs = reader->termDocs(); - const TCHAR* prefixText = prefix->text(); - const TCHAR* prefixField = prefix->field(); - const TCHAR* tmp; - size_t i; - int32_t prefixLen = prefix->textLength(); - Term* lastTerm = NULL; - - try{ - do{ - lastTerm = enumerator->term(false); - if (lastTerm != NULL && lastTerm->field() == prefixField ){ - //now see if term->text() starts with prefixText - int32_t termLen = lastTerm->textLength(); - if ( prefixLen>termLen ) - break; //the prefix is longer than the term, can't be matched - - tmp = lastTerm->text(); - - //check for prefix match in reverse, since most change will be at the end - for ( i=prefixLen-1;i!=-1;--i ){ - if ( tmp[i] != prefixText[i] ){ - tmp=NULL;//signals inequality - break; - } - } - if ( tmp == NULL ) - break; - - docs->seek(enumerator); - while (docs->next()) { - bts->set(docs->doc()); - } - } - }while(enumerator->next()); - } _CLFINALLY( - docs->close(); - _CLDELETE(docs); - enumerator->close(); - _CLDELETE(enumerator); - ) - - return bts; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/PrefixQuery.h b/3rdparty/clucene/src/CLucene/search/PrefixQuery.h deleted file mode 100644 index 8e3f41352..000000000 --- a/3rdparty/clucene/src/CLucene/search/PrefixQuery.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_PrefixQuery -#define _lucene_search_PrefixQuery -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "CLucene/index/IndexReader.h" -#include "SearchHeader.h" -#include "BooleanQuery.h" -#include "TermQuery.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_DEF(search) - //PrefixQuery is a Query that matches documents containing terms with a specified prefix. - - class PrefixQuery: public Query { - private: - CL_NS(index)::Term* prefix; - protected: - PrefixQuery(const PrefixQuery& clone); - public: - - //Constructor. Constructs a query for terms starting with prefix - PrefixQuery(CL_NS(index)::Term* Prefix); - - //Destructor - ~PrefixQuery(); - - //Returns the name "PrefixQuery" - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); - - /** Returns the prefix of this query. */ - CL_NS(index)::Term* getPrefix(bool pointer=true); - - Query* combine(Query** queries); - Query* rewrite(CL_NS(index)::IndexReader* reader); - Query* clone() const; - bool equals(Query * other) const; - - //Creates a user-readable version of this query and returns it as as string - TCHAR* toString(const TCHAR* field) const; - - size_t hashCode() const; - }; - - - class PrefixFilter: public Filter - { - private: - CL_NS(index)::Term* prefix; - protected: - PrefixFilter( const PrefixFilter& copy ); - - public: - PrefixFilter(CL_NS(index)::Term* prefix); - ~PrefixFilter(); - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); - - Filter* clone() const; - TCHAR* toString(); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp b/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp deleted file mode 100644 index 2dbe2d7cd..000000000 --- a/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "QueryFilter.h" -#include "IndexSearcher.h" - -CL_NS_DEF(search) -CL_NS_USE(util) -CL_NS_USE(index) - - -QueryFilter::QueryFilter( const Query* query ) -{ - this->query = query->clone(); -} - - -QueryFilter::~QueryFilter() -{ - _CLDELETE( query ); -} - - -QueryFilter::QueryFilter( const QueryFilter& copy ) -{ - this->query = copy.query->clone(); -} - - -Filter* QueryFilter::clone() const { - return _CLNEW QueryFilter(*this ); -} - - -TCHAR* QueryFilter::toString() -{ - TCHAR* qt = query->toString(); - size_t len = _tcslen(qt) + 14; - TCHAR* ret = _CL_NEWARRAY( TCHAR, len ); - ret[0] = 0; - _sntprintf( ret, len, _T("QueryFilter(%s)"), qt ); - _CLDELETE_CARRAY(qt); - return ret; -} - - -/** Returns a BitSet with true for documents which should be permitted in -search results, and false for those that should not. */ -BitSet* QueryFilter::bits( IndexReader* reader ) -{ - BitSet* bits = _CLNEW BitSet(reader->maxDoc()); - - IndexSearcher s(reader); - QFHitCollector hc(bits); - s._search(query, NULL, &hc); - return bits; -} - - -QueryFilter::QFHitCollector::QFHitCollector(CL_NS(util)::BitSet* bits){ - this->bits = bits; -} - -void QueryFilter::QFHitCollector::collect(const int32_t doc, const qreal score) { - bits->set(doc); // set bit for hit -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/QueryFilter.h b/3rdparty/clucene/src/CLucene/search/QueryFilter.h deleted file mode 100644 index 8d423b2f7..000000000 --- a/3rdparty/clucene/src/CLucene/search/QueryFilter.h +++ /dev/null @@ -1,44 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_QueryFilter_ -#define _lucene_search_QueryFilter_ - -#include "CLucene/util/BitSet.h" -#include "CLucene/index/IndexReader.h" -#include "SearchHeader.h" -#include "CachingWrapperFilter.h" - -CL_NS_DEF(search) - -class QueryFilter: public Filter -{ -private: - Query* query; - - class QFHitCollector: public HitCollector{ - CL_NS(util)::BitSet* bits; - public: - QFHitCollector(CL_NS(util)::BitSet* bits); - void collect(const int32_t doc, const qreal score); - }; - -protected: - QueryFilter( const QueryFilter& copy ); -public: - QueryFilter( const Query* query ); - - ~QueryFilter(); - - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); - - Filter *clone() const; - - TCHAR *toString(); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp b/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp deleted file mode 100644 index 66ee5ce55..000000000 --- a/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "RangeFilter.h" - -CL_NS_DEF(search) -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_USE(document) - - -RangeFilter::RangeFilter( const TCHAR* fieldName, const TCHAR* lowerTerm, const TCHAR* upperTerm, bool includeLower, bool includeUpper ) -{ - this->field = STRDUP_TtoT(fieldName); - if ( lowerTerm != NULL ) - this->lowerValue = STRDUP_TtoT(lowerTerm); - else - this->lowerValue = NULL; - if ( upperTerm != NULL ) - this->upperValue = STRDUP_TtoT(upperTerm); - else - this->upperValue = NULL; - this->includeLower = includeLower; - this->includeUpper = includeUpper; -} - - -/** - * Constructs a filter for field fieldName matching - * less than or equal to upperTerm. - */ -RangeFilter* RangeFilter::Less( TCHAR* fieldName, TCHAR* upperTerm ) { - return new RangeFilter( fieldName, NULL, upperTerm, false, true ); -} - - -/** -* Constructs a filter for field fieldName matching -* more than or equal to lowerTerm. -*/ -RangeFilter* RangeFilter::More( TCHAR* fieldName, TCHAR* lowerTerm ) { - return new RangeFilter( fieldName, lowerTerm, NULL, true, false ); -} - - -RangeFilter::~RangeFilter() -{ - _CLDELETE_CARRAY( lowerValue ); - _CLDELETE_CARRAY( field ); - _CLDELETE_CARRAY( upperValue ); -} - - -RangeFilter::RangeFilter( const RangeFilter& copy ) : - field( STRDUP_TtoT(copy.field) ), - lowerValue( STRDUP_TtoT(copy.lowerValue) ), - upperValue( STRDUP_TtoT(copy.upperValue) ), - includeLower( copy.includeLower ), - includeUpper( copy.includeUpper ) -{ -} - - -Filter* RangeFilter::clone() const { - return _CLNEW RangeFilter(*this ); -} - - -TCHAR* RangeFilter::toString() -{ - size_t len = (field ? _tcslen(field) : 0) + (lowerValue ? _tcslen(lowerValue) : 0) + (upperValue ? _tcslen(upperValue) : 0) + 8; - TCHAR* ret = _CL_NEWARRAY( TCHAR, len ); - ret[0] = 0; - _sntprintf( ret, len, _T("%s: [%s-%s]"), field, (lowerValue?lowerValue:_T("")), (upperValue?upperValue:_T("")) ); - - return ret; -} - - -/** Returns a BitSet with true for documents which should be permitted in -search results, and false for those that should not. */ -BitSet* RangeFilter::bits( IndexReader* reader ) -{ - BitSet* bts = _CLNEW BitSet( reader->maxDoc() ); - Term* term = NULL; - - Term* t = _CLNEW Term( field, (lowerValue ? lowerValue : _T("")), false ); - TermEnum* enumerator = reader->terms( t ); // get enumeration of all terms after lowerValue - _CLDECDELETE( t ); - - if( enumerator->term(false) == NULL ) { - _CLDELETE( enumerator ); - return bts; - } - - bool checkLower = false; - if( !includeLower ) // make adjustments to set to exclusive - checkLower = true; - - TermDocs* termDocs = reader->termDocs(); - - try - { - do - { - term = enumerator->term(); - - if( term == NULL || _tcscmp(term->field(), field) ) - break; - - if( !checkLower || lowerValue == NULL || _tcscmp(term->text(), lowerValue) > 0 ) - { - checkLower = false; - if( upperValue != NULL ) - { - int compare = _tcscmp( upperValue, term->text() ); - - /* if beyond the upper term, or is exclusive and - * this is equal to the upper term, break out */ - if( (compare < 0) || (!includeUpper && compare == 0) ) - break; - } - - termDocs->seek( enumerator->term(false) ); - while( termDocs->next() ) { - bts->set( termDocs->doc() ); - } - } - - _CLDECDELETE( term ); - } - while( enumerator->next() ); - } - _CLFINALLY - ( - _CLDECDELETE( term ); - termDocs->close(); - _CLVDELETE( termDocs ); - enumerator->close(); - _CLDELETE( enumerator ); - ); - - return bts; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/RangeFilter.h b/3rdparty/clucene/src/CLucene/search/RangeFilter.h deleted file mode 100644 index 0865e356f..000000000 --- a/3rdparty/clucene/src/CLucene/search/RangeFilter.h +++ /dev/null @@ -1,51 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -#ifndef _lucene_search_RangeFilter_ -#define _lucene_search_RangeFilter_ - -#include "CLucene/document/DateField.h" -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/BitSet.h" -#include "CLucene/search/Filter.h" - -CL_NS_DEF(search) - -class RangeFilter: public Filter -{ -private: - const TCHAR* field; - TCHAR* lowerValue; - TCHAR* upperValue; - bool includeLower; - bool includeUpper; - -protected: - RangeFilter( const RangeFilter& copy ); - -public: - RangeFilter( const TCHAR* fieldName, const TCHAR* lowerValue, const TCHAR* upperValue, bool includeLower, bool includeUpper ); - - static RangeFilter* Less( TCHAR* fieldName, TCHAR* upperTerm ); - - static RangeFilter* More( TCHAR* fieldName, TCHAR* lowerTerm ); - - ~RangeFilter(); - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); - - Filter* clone() const; - - TCHAR* toString(); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp b/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp deleted file mode 100644 index 4fc242089..000000000 --- a/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "RangeQuery.h" - -#include "SearchHeader.h" -#include "Scorer.h" -#include "BooleanQuery.h" -#include "TermQuery.h" - -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/StringBuffer.h" - - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - RangeQuery::RangeQuery(Term* lowerTerm, Term* upperTerm, const bool Inclusive){ - //Func - Constructor - //Pre - (LowerTerm != NULL OR UpperTerm != NULL) AND - // if LowerTerm and UpperTerm are valid pointer then the fieldnames must be the same - //Post - The instance has been created - - if (lowerTerm == NULL && upperTerm == NULL) - { - _CLTHROWA(CL_ERR_IllegalArgument,"At least one term must be non-null"); - } - if (lowerTerm != NULL && upperTerm != NULL && lowerTerm->field() != upperTerm->field()) - { - _CLTHROWA(CL_ERR_IllegalArgument,"Both terms must be for the same field"); - } - - // if we have a lowerTerm, start there. otherwise, start at beginning - if (lowerTerm != NULL) { - this->lowerTerm = _CL_POINTER(lowerTerm); - } - else { - this->lowerTerm = _CLNEW Term(upperTerm, LUCENE_BLANK_STRING); - } - this->upperTerm = (upperTerm != NULL ? _CL_POINTER(upperTerm) : NULL); - this->inclusive = Inclusive; - } - RangeQuery::RangeQuery(const RangeQuery& clone): - Query(clone){ - this->inclusive = clone.inclusive; - this->upperTerm = (clone.upperTerm != NULL ? _CL_POINTER(clone.upperTerm) : NULL ); - this->lowerTerm = (clone.lowerTerm != NULL ? _CL_POINTER(clone.lowerTerm) : NULL ); - } - Query* RangeQuery::clone() const{ - return _CLNEW RangeQuery(*this); - } - - RangeQuery::~RangeQuery() { - //Func - Destructor - //Pre - true - //Post - The instance has been destroyed - - _CLDECDELETE(lowerTerm); - _CLDECDELETE(upperTerm); - } - - /** Returns a hash code value for this object.*/ - size_t RangeQuery::hashCode() const { - return Similarity::floatToByte(getBoost()) ^ - (lowerTerm != NULL ? lowerTerm->hashCode() : 0) ^ - (upperTerm != NULL ? upperTerm->hashCode() : 0) ^ - (this->inclusive ? 1 : 0); - } - - const TCHAR* RangeQuery::getQueryName() const{ - return getClassName(); - } - const TCHAR* RangeQuery::getClassName(){ - return _T("RangeQuery"); - } - - Query* RangeQuery::combine(Query** queries) { - return Query::mergeBooleanQueries(queries); - } - - bool RangeQuery::equals(Query * other) const{ - if (!(other->instanceOf(RangeQuery::getClassName()))) - return false; - - RangeQuery* rq = (RangeQuery*)other; - bool ret = (this->getBoost() == rq->getBoost()) - && (this->isInclusive() == rq->isInclusive()) - && (this->getLowerTerm()->equals(rq->getLowerTerm())) - && (this->getUpperTerm()->equals(rq->getUpperTerm())); - - return ret; - } - - - /** - * FIXME: Describe rewrite method here. - * - * @param reader an IndexReader value - * @return a Query value - * @exception IOException if an error occurs - */ - Query* RangeQuery::rewrite(IndexReader* reader){ - - BooleanQuery* query = _CLNEW BooleanQuery; - TermEnum* enumerator = reader->terms(lowerTerm); - Term* lastTerm = NULL; - try { - bool checkLower = false; - if (!inclusive) // make adjustments to set to exclusive - checkLower = true; - - const TCHAR* testField = getField(); - do { - lastTerm = enumerator->term(); - if (lastTerm != NULL && lastTerm->field() == testField ) { - if (!checkLower || _tcscmp(lastTerm->text(),lowerTerm->text()) > 0) { - checkLower = false; - if (upperTerm != NULL) { - int compare = _tcscmp(upperTerm->text(),lastTerm->text()); - /* if beyond the upper term, or is exclusive and - * this is equal to the upper term, break out */ - if ((compare < 0) || (!inclusive && compare == 0)) - break; - } - TermQuery* tq = _CLNEW TermQuery(lastTerm); // found a match - tq->setBoost(getBoost()); // set the boost - query->add(tq, true, false, false); // add to query - } - }else { - break; - } - _CLDECDELETE(lastTerm); - } - while (enumerator->next()); - }catch(...){ - _CLDECDELETE(lastTerm); //always need to delete this - _CLDELETE(query); //in case of error, delete the query - enumerator->close(); - _CLDELETE(enumerator); - throw; //rethrow - } - _CLDECDELETE(lastTerm); //always need to delete this - enumerator->close(); - _CLDELETE(enumerator); - - return query; - } - - /** Prints a user-readable version of this query. */ - TCHAR* RangeQuery::toString(const TCHAR* field) const - { - StringBuffer buffer; - if ( field==NULL || _tcscmp(getField(),field)!=0 ) - { - buffer.append( getField() ); - buffer.append( _T(":")); - } - buffer.append(inclusive ? _T("[") : _T("{")); - buffer.append(lowerTerm != NULL ? lowerTerm->text() : _T("NULL")); - buffer.append(_T(" TO ")); - buffer.append(upperTerm != NULL ? upperTerm->text() : _T("NULL")); - buffer.append(inclusive ? _T("]") : _T("}")); - if (getBoost() != 1.0f) - { - buffer.append( _T("^")); - buffer.appendFloat( getBoost(),1 ); - } - return buffer.toString(); - } - - - const TCHAR* RangeQuery::getField() const - { - return (lowerTerm != NULL ? lowerTerm->field() : upperTerm->field()); - } - - /** Returns the lower term of this range query */ - Term* RangeQuery::getLowerTerm(bool pointer) const { - if ( pointer ) - return _CL_POINTER(lowerTerm); - else - return lowerTerm; - } - - /** Returns the upper term of this range query */ - Term* RangeQuery::getUpperTerm(bool pointer) const { - if ( pointer ) - return _CL_POINTER(upperTerm); - else - return upperTerm; - } - - /** Returns true if the range query is inclusive */ - bool RangeQuery::isInclusive() const { return inclusive; } - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/RangeQuery.h b/3rdparty/clucene/src/CLucene/search/RangeQuery.h deleted file mode 100644 index 9a7733c33..000000000 --- a/3rdparty/clucene/src/CLucene/search/RangeQuery.h +++ /dev/null @@ -1,71 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_RangeQuery_ -#define _lucene_search_RangeQuery_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SearchHeader.h" -#include "Scorer.h" -#include "TermQuery.h" - -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" - -#include "CLucene/util/StringBuffer.h" - - -CL_NS_DEF(search) - /** Constructs a query selecting all terms greater than - * lowerTerm but less than upperTerm. - * There must be at least one term and either term may be null, - * in which case there is no bound on that side, but if there are - * two terms, both terms must be for the same field. - */ - class RangeQuery: public Query - { - private: - CL_NS(index)::Term* lowerTerm; - CL_NS(index)::Term* upperTerm; - bool inclusive; - protected: - RangeQuery(const RangeQuery& clone); - - public: - // Constructs a query selecting all terms greater than - // lowerTerm but less than upperTerm. - // There must be at least one term and either term may be NULL-- - // in which case there is no bound on that side, but if there are - // two term, both terms must be for the same field. - RangeQuery(CL_NS(index)::Term* LowerTerm, CL_NS(index)::Term* UpperTerm, const bool Inclusive); - ~RangeQuery(); - - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); - - Query* rewrite(CL_NS(index)::IndexReader* reader); - - Query* combine(Query** queries); - - // Prints a user-readable version of this query. - TCHAR* toString(const TCHAR* field) const; - - Query* clone() const; - - bool equals(Query * other) const; - - CL_NS(index)::Term* getLowerTerm(bool pointer=true) const; - CL_NS(index)::Term* getUpperTerm(bool pointer=true) const; - bool isInclusive() const; - const TCHAR* getField() const; - - size_t hashCode() const; - }; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/Scorer.h b/3rdparty/clucene/src/CLucene/search/Scorer.h deleted file mode 100644 index 0d1d4355a..000000000 --- a/3rdparty/clucene/src/CLucene/search/Scorer.h +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_Scorer_ -#define _lucene_search_Scorer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Similarity.h" -#include "SearchHeader.h" -#include "Explanation.h" - -CL_NS_DEF(search) - /** Expert: Implements scoring for a class of queries. */ -class Scorer: LUCENE_BASE { - private: - Similarity* similarity; - protected: - /** Constructs a Scorer. */ - Scorer(Similarity* similarity) { - this->similarity = similarity; - } - public: - virtual ~Scorer(){ - } - - /** Returns the Similarity implementation used by this scorer. */ - Similarity* getSimilarity() const{ - return this->similarity; - } - - /** Scores all documents and passes them to a collector. */ - void score(HitCollector* hc) { - while (next()) { - hc->collect(doc(), score()); - } - } - - /** Advance to the next document matching the query. Returns true iff there - * is another match. */ - virtual bool next() = 0; - - /** Returns the current document number. Initially invalid, until {@link - * #next()} is called the first time. */ - virtual int32_t doc() const = 0; - - /** Returns the score of the current document. Initially invalid, until - * {@link #next()} is called the first time. */ - virtual qreal score() = 0; - - /** Skips to the first match beyond the current whose document number is - * greater than or equal to target.

Returns true iff there is such - * a match.

Behaves as if written:

-         *   boolean skipTo(int32_t target) {
-         *     do {
-         *       if (!next())
-         * 	     return false;
-         *     } while (target > doc());
-         *     return true;
-         *   }
-         * 
- * Most implementations are considerably more efficient than that. - */ - virtual bool skipTo(int32_t target) = 0; - - /** Returns an explanation of the score for doc. */ - virtual void explain(int32_t doc, Explanation* ret) = 0; - - - /** Returns an string which explains the object */ - virtual TCHAR* toString() = 0; - - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp b/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp deleted file mode 100644 index 56e4ad585..000000000 --- a/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SearchHeader.h" -#include "BooleanQuery.h" -#include "FieldDocSortedHitQueue.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - -CL_NS(document)::Document* Searchable::doc(const int32_t i){ - CL_NS(document)::Document* ret = _CLNEW CL_NS(document)::Document; - if (!doc(i,ret) ) - _CLDELETE(ret); - return ret; -} - -//static -Query* Query::mergeBooleanQueries(Query** queries) { - CL_NS(util)::CLVector allClauses; - int32_t i = 0; - while ( queries[i] != NULL ){ - BooleanQuery* bq = (BooleanQuery*)queries[i]; - - int32_t size = bq->getClauseCount(); - BooleanClause** clauses = _CL_NEWARRAY(BooleanClause*, size); - bq->getClauses(clauses); - - for (int32_t j = 0;j::iterator itr = allClauses.begin(); - while (itr != allClauses.end() ) { - result->add(*itr); - } - return result; -} - -Query::Query(const Query& clone):boost(clone.boost){ - //constructor -} -Weight* Query::_createWeight(Searcher* searcher){ - _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: Query::_createWeight"); -} - -Query::Query(): - boost(1.0f) -{ - //constructor -} -Query::~Query(){ -} - -/** Expert: called to re-write queries into primitive queries. */ -Query* Query::rewrite(CL_NS(index)::IndexReader* reader){ - return this; -} - -Query* Query::combine(Query** queries){ - _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: Query::combine"); -} -Similarity* Query::getSimilarity(Searcher* searcher) { - return searcher->getSimilarity(); -} -bool Query::instanceOf(const TCHAR* other) const{ - const TCHAR* t = getQueryName(); - if ( t==other || _tcscmp( t, other )==0 ) - return true; - else - return false; -} -TCHAR* Query::toString() const{ - return toString(LUCENE_BLANK_STRING); -} - -void Query::setBoost(qreal b) { boost = b; } - -qreal Query::getBoost() const { return boost; } - -Weight* Query::weight(Searcher* searcher){ - Query* query = searcher->rewrite(this); - Weight* weight = query->_createWeight(searcher); - qreal sum = weight->sumOfSquaredWeights(); - qreal norm = getSimilarity(searcher)->queryNorm(sum); - weight->normalize(norm); - return weight; -} - -TopFieldDocs::TopFieldDocs (int32_t totalHits, FieldDoc** fieldDocs, int32_t scoreDocsLen, SortField** fields): - TopDocs (totalHits, NULL, scoreDocsLen) -{ - this->fields = fields; - this->fieldDocs = fieldDocs; - this->scoreDocs = _CL_NEWARRAY(ScoreDoc,scoreDocsLen); - for (int32_t i=0;iscoreDocs[i] = this->fieldDocs[i]->scoreDoc; -} -TopFieldDocs::~TopFieldDocs(){ - if ( fieldDocs ){ - for (int32_t i=0;i= 0 -//Post - The instance has been created - -} - -TopDocs::~TopDocs(){ -//Func - Destructor -//Pre - true -//Post - The instance has been destroyed - - _CLDELETE_ARRAY(scoreDocs); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/SearchHeader.h b/3rdparty/clucene/src/CLucene/search/SearchHeader.h deleted file mode 100644 index 4a896a5c5..000000000 --- a/3rdparty/clucene/src/CLucene/search/SearchHeader.h +++ /dev/null @@ -1,456 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_SearchHeader_ -#define _lucene_search_SearchHeader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "Filter.h" -#include "CLucene/document/Document.h" -#include "Sort.h" -#include "CLucene/util/VoidList.h" -#include "Explanation.h" -#include "Similarity.h" - -CL_NS_DEF(search) - - //predefine classes - class Scorer; - class Query; - class Hits; - class Sort; - class FieldDoc; - class TopFieldDocs; - - /** Expert: Returned by low-level search implementations. - * @see TopDocs */ - struct ScoreDoc { - /** Expert: A hit document's number. - * @see Searcher#doc(int32_t) - */ - int32_t doc; - - /** Expert: The score of this document for the query. */ - qreal score; - }; - - /** Expert: Returned by low-level search implementations. - * @see Searcher#search(Query,Filter,int32_t) */ - class TopDocs:LUCENE_BASE { - public: - /** Expert: The total number of hits for the query. - * @see Hits#length() - */ - int32_t totalHits; - - /** Expert: The top hits for the query. */ - ScoreDoc* scoreDocs; - int32_t scoreDocsLength; - - /** Expert: Constructs a TopDocs. TopDocs takes ownership of the ScoreDoc array*/ - TopDocs(const int32_t th, ScoreDoc* sds, int32_t scoreDocsLength); - ~TopDocs(); - }; - - // Lower-level search API. - // @see Searcher#search(Query,HitCollector) - class HitCollector: LUCENE_BASE { - public: - /** Called once for every non-zero scoring document, with the document number - * and its score. - * - *

If, for example, an application wished to collect all of the hits for a - * query in a BitSet, then it might:

-      *   Searcher searcher = new IndexSearcher(indexReader);
-      *   final BitSet bits = new BitSet(indexReader.maxDoc());
-      *   searcher.search(query, new HitCollector() {
-      *       public void collect(int32_t doc, float score) {
-      *         bits.set(doc);
-      *       }
-      *     });
-      * 
- * - *

Note: This is called in an inner search loop. For good search - * performance, implementations of this method should not call - * {@link Searcher#doc(int32_t)} or - * {@link IndexReader#document(int32_t)} on every - * document number encountered. Doing so can slow searches by an order - * of magnitude or more. - *

Note: The score passed to this method is a raw score. - * In other words, the score will not necessarily be a float whose value is - * between 0 and 1. - */ - virtual void collect(const int32_t doc, const qreal score) = 0; - virtual ~HitCollector(){} - }; - - /** Expert: Calculate query weights and build query scorers. - * - *

A Weight is constructed by a query, given a Searcher ({@link - * Query#_createWeight(Searcher)}). The {@link #sumOfSquaredWeights()} method - * is then called on the top-level query to compute the query normalization - * factor (@link Similarity#queryNorm(qreal)}). This factor is then passed to - * {@link #normalize(qreal)}. At this point the weighting is complete and a - * scorer may be constructed by calling {@link #scorer(IndexReader)}. - */ - class Weight: LUCENE_BASE { - public: - virtual ~Weight(){ - }; - - /** The query that this concerns. */ - virtual Query* getQuery() = 0; - - /** The weight for this query. */ - virtual qreal getValue() = 0; - - /** The sum of squared weights of contained query clauses. */ - virtual qreal sumOfSquaredWeights() = 0; - - /** Assigns the query normalization factor to this. */ - virtual void normalize(qreal norm) = 0; - - /** Constructs a scorer for this. */ - virtual Scorer* scorer(CL_NS(index)::IndexReader* reader) = 0; - - /** An explanation of the score computation for the named document. */ - virtual void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret) = 0; - - virtual TCHAR* toString(){ - return STRDUP_TtoT(_T("Weight")); - } - }; - - class HitDoc:LUCENE_BASE { - public: - qreal score; - int32_t id; - CL_NS(document)::Document* doc; - - HitDoc* next; // in doubly-linked cache - HitDoc* prev; // in doubly-linked cache - - HitDoc(const qreal s, const int32_t i); - ~HitDoc(); - }; - - - - // A ranked list of documents, used to hold search results. - class Hits:LUCENE_BASE { - private: - Query* query; - Searcher* searcher; - Filter* filter; - const Sort* sort; - - size_t _length; // the total number of hits - CL_NS(util)::CLVector > hitDocs; // cache of hits retrieved - - HitDoc* first; // head of LRU cache - HitDoc* last; // tail of LRU cache - int32_t numDocs; // number cached - int32_t maxDocs; // max to cache - - public: - Hits(Searcher* s, Query* q, Filter* f, const Sort* sort=NULL); - ~Hits(); - - /** Returns the total number of hits available in this set. */ - int32_t length() const; - - /** Returns the stored fields of the nth document in this set. -

Documents are cached, so that repeated requests for the same element may - return the same Document object. - * - * @memory Memory belongs to the hits object. Don't delete the return value. - */ - CL_NS(document)::Document& doc(const int32_t n); - - /** Returns the id for the nth document in this set. */ - int32_t id (const int32_t n); - - /** Returns the score for the nth document in this set. */ - qreal score(const int32_t n); - - private: - // Tries to add new documents to hitDocs. - // Ensures that the hit numbered _min has been retrieved. - void getMoreDocs(const size_t _min); - - HitDoc* getHitDoc(const size_t n); - - void addToFront(HitDoc* hitDoc); - - void remove(const HitDoc* hitDoc); - - }; - - /** The interface for search implementations. - * - *

Implementations provide search over a single index, over multiple - * indices, and over indices on remote servers. - */ - class Searchable: LUCENE_BASE { - public: - virtual ~Searchable(){ - } - - /** Lower-level search API. - * - *

{@link HitCollector#collect(int32_t,qreal)} is called for every non-zero - * scoring document. - * - *

Applications should only use this if they need all of the - * matching documents. The high-level search API ({@link - * Searcher#search(Query*)}) is usually more efficient, as it skips - * non-high-scoring hits. - * - * @param query to match documents - * @param filter if non-null, a bitset used to eliminate some documents - * @param results to receive hits - */ - virtual void _search(Query* query, Filter* filter, HitCollector* results) = 0; - - /** Frees resources associated with this Searcher. - * Be careful not to call this method while you are still using objects - * like {@link Hits}. - */ - virtual void close() = 0; - - /** Expert: Returns the number of documents containing term. - * Called by search code to compute term weights. - * @see IndexReader#docFreq(Term). - */ - virtual int32_t docFreq(const CL_NS(index)::Term* term) const = 0; - - /** Expert: Returns one greater than the largest possible document number. - * Called by search code to compute term weights. - * @see IndexReader#maxDoc(). - */ - virtual int32_t maxDoc() const = 0; - - /** Expert: Low-level search implementation. Finds the top n - * hits for query, applying filter if non-null. - * - *

Called by {@link Hits}. - * - *

Applications should usually call {@link Searcher#search(Query*)} or - * {@link Searcher#search(Query*,Filter*)} instead. - */ - virtual TopDocs* _search(Query* query, Filter* filter, const int32_t n) = 0; - - /** Expert: Returns the stored fields of document i. - * Called by {@link HitCollector} implementations. - * @see IndexReader#document(int32_t). - */ - virtual bool doc(int32_t i, CL_NS(document)::Document* d) = 0; - _CL_DEPRECATED( doc(i, document) ) CL_NS(document)::Document* doc(const int32_t i); - - /** Expert: called to re-write queries into primitive queries. */ - virtual Query* rewrite(Query* query) = 0; - - /** Returns an Explanation that describes how doc scored against - * query. - * - *

This is intended to be used in developing Similarity implementations, - * and, for good performance, should not be displayed with every hit. - * Computing an explanation is as expensive as executing the query over the - * entire index. - */ - virtual void explain(Query* query, int32_t doc, Explanation* ret) = 0; - - /** Expert: Low-level search implementation with arbitrary sorting. Finds - * the top n hits for query, applying - * filter if non-null, and sorting the hits by the criteria in - * sort. - * - *

Applications should usually call {@link - * Searcher#search(Query,Filter,Sort)} instead. - */ - virtual TopFieldDocs* _search(Query* query, Filter* filter, const int32_t n, const Sort* sort) = 0; - }; - - - - /** An abstract base class for search implementations. - * Implements some common utility methods. - */ - class Searcher:public Searchable { - private: - /** The Similarity implementation used by this searcher. */ - Similarity* similarity; - - public: - Searcher(){ - similarity = Similarity::getDefault(); - } - virtual ~Searcher(){ - } - - // Returns the documents matching query. - Hits* search(Query* query) { - return search(query, (Filter*)NULL ); - } - - // Returns the documents matching query and - // filter. - Hits* search(Query* query, Filter* filter) { - return _CLNEW Hits(this, query, filter); - } - - /** Returns documents matching query sorted by - * sort. - */ - Hits* search(Query* query, const Sort* sort){ - return _CLNEW Hits(this, query, NULL, sort); - } - - /** Returns documents matching query and filter, - * sorted by sort. - */ - Hits* search(Query* query, Filter* filter, const Sort* sort){ - return _CLNEW Hits(this, query, filter, sort); - } - - /** Lower-level search API. - * - *

{@link HitCollector#collect(int32_t ,qreal)} is called for every non-zero - * scoring document. - * - *

Applications should only use this if they need all of the - * matching documents. The high-level search API ({@link - * Searcher#search(Query*)}) is usually more efficient, as it skips - * non-high-scoring hits. - *

Note: The score passed to this method is a raw score. - * In other words, the score will not necessarily be a float whose value is - * between 0 and 1. - */ - void _search(Query* query, HitCollector* results) { - Searchable::_search(query, NULL, results); - } - - /** Expert: Set the Similarity implementation used by this Searcher. - * - * @see Similarity#setDefault(Similarity) - */ - void setSimilarity(Similarity* similarity) { - this->similarity = similarity; - } - - /** Expert: Return the Similarity implementation used by this Searcher. - * - *

This defaults to the current value of {@link Similarity#getDefault()}. - */ - Similarity* getSimilarity(){ - return this->similarity; - } - }; - - /** The abstract base class for queries. -

Instantiable subclasses are: -

    -
  • {@link TermQuery} -
  • {@link MultiTermQuery} -
  • {@link BooleanQuery} -
  • {@link WildcardQuery} -
  • {@link PhraseQuery} -
  • {@link PrefixQuery} -
  • {@link PhrasePrefixQuery} -
  • {@link FuzzyQuery} -
  • {@link RangeQuery} -
  • {@link spans.SpanQuery} -
-

A parser for queries is contained in: -

    -
  • {@link queryParser.QueryParser QueryParser} -
- */ - class Query :LUCENE_BASE { - private: - // query boost factor - qreal boost; - protected: - Query(const Query& clone); - public: - Query(); - virtual ~Query(); - - /** Sets the boost for this query clause to b. Documents - * matching this clause will (in addition to the normal weightings) have - * their score multiplied by b. - */ - void setBoost(qreal b); - - /** Gets the boost for this clause. Documents matching - * this clause will (in addition to the normal weightings) have their score - * multiplied by b. The boost is 1.0 by default. - */ - qreal getBoost() const; - - /** Expert: Constructs an initializes a Weight for a top-level query. */ - Weight* weight(Searcher* searcher); - - /** Expert: called to re-write queries into primitive queries. */ - virtual Query* rewrite(CL_NS(index)::IndexReader* reader); - - /** Expert: called when re-writing queries under MultiSearcher. - * - *

Only implemented by derived queries, with no - * {@link #_createWeight(Searcher)} implementatation. - */ - virtual Query* combine(Query** queries); - - /** Expert: merges the clauses of a set of BooleanQuery's into a single - * BooleanQuery. - * - *

A utility for use by {@link #combine(Query[])} implementations. - */ - static Query* mergeBooleanQueries(Query** queries); - - /** Expert: Returns the Similarity implementation to be used for this query. - * Subclasses may override this method to specify their own Similarity - * implementation, perhaps one that delegates through that of the Searcher. - * By default the Searcher's Similarity implementation is returned.*/ - Similarity* getSimilarity(Searcher* searcher); - - /** Returns a clone of this query. */ - virtual Query* clone() const = 0; - virtual const TCHAR* getQueryName() const = 0; - bool instanceOf(const TCHAR* other) const; - - /** Prints a query to a string, with field as the default field - * for terms.

The representation used is one that is readable by - * {@link queryParser.QueryParser QueryParser} - * (although, if the query was created by the parser, the printed - * representation may not be exactly what was parsed). - */ - virtual TCHAR* toString(const TCHAR* field) const = 0; - - virtual bool equals(Query* other) const = 0; - virtual size_t hashCode() const = 0; - - /** Prints a query to a string. */ - TCHAR* toString() const; - - - /** Expert: Constructs an appropriate Weight implementation for this query. - * - *

Only implemented by primitive queries, which re-write to themselves. - * This is an Internal function - */ - virtual Weight* _createWeight(Searcher* searcher); - - }; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/Similarity.cpp b/3rdparty/clucene/src/CLucene/search/Similarity.cpp deleted file mode 100644 index d33a036e4..000000000 --- a/3rdparty/clucene/src/CLucene/search/Similarity.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Similarity.h" - -#include "CLucene/index/Term.h" -#include "SearchHeader.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - -#ifdef _CL_HAVE_NO_FLOAT_BYTE - #if defined(_LUCENE_PRAGMA_WARNINGS) - #pragma message ("==================Using fallback float<->byte encodings!!!==================") - #else - #warning "==================Using fallback float<->byte encodings!!!==================" - #endif - - //if the autoconf figured out that we can't do the conversions properly, then - //we fall back on the old, inaccurate way of doing things. - qreal NORM_TABLE[] = { - 0.0,5.820766E-10,6.9849193E-10,8.1490725E-10,9.313226E-10,1.1641532E-9,1.3969839E-9, - 1.6298145E-9,1.8626451E-9,2.3283064E-9,2.7939677E-9,3.259629E-9,3.7252903E-9, - 4.656613E-9,5.5879354E-9,6.519258E-9,7.4505806E-9,9.313226E-9,1.1175871E-8,1.3038516E-8, - 1.4901161E-8,1.8626451E-8,2.2351742E-8,2.6077032E-8,2.9802322E-8,3.7252903E-8,4.4703484E-8, - 5.2154064E-8,5.9604645E-8,7.4505806E-8,8.940697E-8,1.0430813E-7,1.1920929E-7,1.4901161E-7, - 1.7881393E-7,2.0861626E-7,2.3841858E-7,2.9802322E-7,3.5762787E-7,4.172325E-7,4.7683716E-7, - 5.9604645E-7,7.1525574E-7,8.34465E-7,9.536743E-7,1.1920929E-6,1.4305115E-6,1.66893E-6, - 1.9073486E-6,2.3841858E-6,2.861023E-6,3.33786E-6,3.8146973E-6,4.7683716E-6,5.722046E-6, - 6.67572E-6,7.6293945E-6,9.536743E-6,1.1444092E-5,1.335144E-5,1.5258789E-5,1.9073486E-5, - 2.2888184E-5,2.670288E-5,3.0517578E-5,3.8146973E-5,4.5776367E-5,5.340576E-5,6.1035156E-5, - 7.6293945E-5,9.1552734E-5,1.0681152E-4,1.2207031E-4,1.5258789E-4,1.8310547E-4,2.1362305E-4, - 2.4414062E-4,3.0517578E-4,3.6621094E-4,4.272461E-4,4.8828125E-4,6.1035156E-4,7.324219E-4, - 8.544922E-4,9.765625E-4,0.0012207031,0.0014648438,0.0017089844,0.001953125,0.0024414062, - 0.0029296875,0.0034179688,0.00390625,0.0048828125,0.005859375,0.0068359375, - 0.0078125,0.009765625,0.01171875,0.013671875,0.015625,0.01953125,0.0234375, - 0.02734375,0.03125,0.0390625,0.046875,0.0546875,0.0625,0.078125,0.09375,0.109375, - 0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.625,0.75, - 0.875,1.0,1.25,1.5,1.75,2,2.5,3,3.5,4.0,5.0,6.0,7.0,8.0,10.0,12.0,14.0,16.0,20.0,24.0,28.0,32.0,40.0,48.0,56.0, - 64.0,80.0,96.0,112.0,128.0,160.0,192.0,224.0,256.0,320.0,384.0,448.0,512.0,640.0,768.0,896.0,1024.0,1280.0,1536.0,1792.0, - 2048.0,2560.0,3072.0,3584.0,4096.0,5120.0,6144.0,7168.0,8192.0,10240.0,12288.0,14336.0,16384.0,20480.0,24576.0, - 28672.0,32768.0,40960.0,49152.0,57344.0,65536.0,81920.0,98304.0,114688.0,131072.0,163840.0,196608.0, - 229376.0,262144.0,327680.0,393216.0,458752.0,524288.0,655360.0,786432.0,917504.0,1048576.0,1310720.0, - 1572864.0,1835008.0,2097152.0,2621440.0,3145728.0,3670016.0,4194304.0,5242880.0,6291456.0,7340032.0, - 8388608.0,10485760.0,12582912.0,14680064.0,16777216.0,20971520.0,25165824.0,29360128.0,33554432.0, - 41943040.0,50331648.0,58720256.0,67108864.0,83886080.0,100663296.0,117440512.0,134217728.0, - 167772160.0,201326592.0,234881024.0,268435456.0,335544320.0,402653184.0,469762048.0,536870912.0, - 671088640.0,805306368.0,939524096.0,1073741824.0,1342177280.0,1610612736.0,1879048192.0, - 2147483648.0,2684354560.0,3221225472.0,3758096384.0,4294967296.0,5368709120.0,6442450944.0,7516192768.0 - }; - - qreal Similarity::byteToFloat(uint8_t b) { - return NORM_TABLE[b]; - } - - uint8_t Similarity::floatToByte(qreal f) { - return Similarity::encodeNorm(f); - } - -#else - - /** Cache of decoded bytes. */ - qreal NORM_TABLE[256]; - bool NORM_TABLE_initd=false; - - //float to bits conversion utilities... - union clvalue { - int32_t i; - float f; //must use a float type, else types dont match up - }; - - int32_t floatToIntBits(qreal value) - { - clvalue u; - int32_t e, f; - u.f = (float)value; - e = u.i & 0x7f800000; - f = u.i & 0x007fffff; - - if (e == 0x7f800000 && f != 0) - u.i = 0x7fc00000; - - return u.i; - } - - qreal intBitsToFloat(int32_t bits) - { - clvalue u; - u.i = bits; - return u.f; - } - - - qreal Similarity::byteToFloat(uint8_t b) { - if (b == 0) // zero is a special case - return 0.0f; - int32_t mantissa = b & 7; - int32_t exponent = (b >> 3) & 31; - int32_t bits = ((exponent+(63-15)) << 24) | (mantissa << 21); - return intBitsToFloat(bits); - } - - uint8_t Similarity::floatToByte(qreal f) { - if (f < 0.0f) // round negatives up to zero - f = 0.0f; - - if (f == 0.0f) // zero is a special case - return 0; - - int32_t bits = floatToIntBits(f); // parse qreal into parts - int32_t mantissa = (bits & 0xffffff) >> 21; - int32_t exponent = (((bits >> 24) & 0x7f) - 63) + 15; - - if (exponent > 31) { // overflow: use max value - exponent = 31; - mantissa = 7; - } - - if (exponent < 0) { // underflow: use min value - exponent = 0; - mantissa = 1; - } - - return (uint8_t)((exponent << 3) | mantissa); // pack into a uint8_t - } -#endif - - /** The Similarity implementation used by default. */ - Similarity* _defaultImpl=NULL; - - void Similarity::setDefault(Similarity* similarity) { - _defaultImpl = similarity; - } - - Similarity* Similarity::getDefault() { - if ( _defaultImpl == NULL ){ - _defaultImpl = _CLNEW DefaultSimilarity(); - } - return _defaultImpl; - } - - qreal Similarity::decodeNorm(uint8_t b) { -#ifndef _CL_HAVE_NO_FLOAT_BYTE - if ( !NORM_TABLE_initd ){ - for (int i = 0; i < 256; i++) - NORM_TABLE[i] = byteToFloat(i); - NORM_TABLE_initd=true; - } -#endif - return NORM_TABLE[b]; - } - - uint8_t Similarity::encodeNorm(qreal f) { -#ifdef _CL_HAVE_NO_FLOAT_BYTE - int32_t i=0; - if ( f <= 0 ) - return 0; - - while ( i<256 && f > NORM_TABLE[i] ){ - i++; - } - if ( i == 0 ) - return 0; - else if ( i == 255 && f>NORM_TABLE[255] ) - return 255; - else - return i; -#else - return floatToByte(f); -#endif - } - - - qreal Similarity::idf(Term* term, Searcher* searcher) { - return idf(searcher->docFreq(term), searcher->maxDoc()); - } - - - qreal Similarity::idf(CL_NS(util)::CLVector* terms, Searcher* searcher) { - qreal _idf = 0.0f; - for (CL_NS(util)::CLVector::iterator i = terms->begin(); i != terms->end(); i++ ) { - _idf += idf((Term*)*i, searcher); - } - return _idf; - } - - Similarity::~Similarity(){ - } - - - - - DefaultSimilarity::DefaultSimilarity(){ - } - DefaultSimilarity::~DefaultSimilarity(){ - } - - qreal DefaultSimilarity::lengthNorm(const TCHAR* fieldName, int32_t numTerms) { - if ( numTerms == 0 ) //prevent div by zero - return 0; - qreal ret = (qreal)(1.0 / sqrt((qreal)numTerms)); - return ret; - } - - qreal DefaultSimilarity::queryNorm(qreal sumOfSquaredWeights) { - if ( sumOfSquaredWeights == 0 ) //prevent div by zero - return 0.0f; - qreal ret = (qreal)(1.0 / sqrt(sumOfSquaredWeights)); - return ret; - } - - qreal DefaultSimilarity::tf(qreal freq) { - return sqrt(freq); - } - - qreal DefaultSimilarity::sloppyFreq(int32_t distance) { - return 1.0f / (distance + 1); - } - - qreal DefaultSimilarity::idf(int32_t docFreq, int32_t numDocs) { - return (qreal)(log(numDocs/(qreal)(docFreq+1)) + 1.0); - } - - qreal DefaultSimilarity::coord(int32_t overlap, int32_t maxOverlap) { - if ( maxOverlap == 0 ) - return 0.0f; - return overlap / (qreal)maxOverlap; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/Similarity.h b/3rdparty/clucene/src/CLucene/search/Similarity.h deleted file mode 100644 index 426af6952..000000000 --- a/3rdparty/clucene/src/CLucene/search/Similarity.h +++ /dev/null @@ -1,268 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_Similarity_ -#define _lucene_search_Similarity_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/Term.h" - -CL_NS_DEF(search) - -class Searcher;//save including the searchheader.h -class DefaultSimilarity; - -/** Expert: Scoring API. -*

Subclasses implement search scoring. -* -*

The score of query q for document d is defined -* in terms of these methods as follows: -* -* -* -* -* -* -* -* -* -* -* -*
score(q,d) =
-* Σ -* {@link #tf(int32_t) tf}(t in d) * -* {@link #idf(Term,Searcher) idf}(t) * -* {@link Field#getBoost getBoost}(t.field in d) * -* {@link #lengthNorm(TCHAR*,int32_t) lengthNorm}(t.field in d) -*  * -* {@link #coord(int32_t,int32_t) coord}(q,d) * -* {@link #queryNorm(qreal) queryNorm}(q) -*
-* t in q -*
-* -* @see #setDefault(Similarity) -* @see IndexWriter#setSimilarity(Similarity) -* @see Searcher#setSimilarity(Similarity) -*/ -class Similarity:LUCENE_BASE { -public: - virtual ~Similarity(); - - /** Set the default Similarity implementation used by indexing and search - * code. - * - * @see Searcher#setSimilarity(Similarity) - * @see IndexWriter#setSimilarity(Similarity) - */ - static void setDefault(Similarity* similarity); - - /** Return the default Similarity implementation used by indexing and search - * code. - * - *

This is initially an instance of {@link DefaultSimilarity}. - * - * @see Searcher#setSimilarity(Similarity) - * @see IndexWriter#setSimilarity(Similarity) - */ - static Similarity* getDefault(); - - /** Encodes a normalization factor for storage in an index. - * - *

The encoding uses a five-bit exponent and three-bit mantissa, thus - * representing values from around 7x10^9 to 2x10^-9 with about one - * significant decimal digit of accuracy. Zero is also represented. - * Negative numbers are rounded up to zero. Values too large to represent - * are rounded down to the largest representable value. Positive values too - * small to represent are rounded up to the smallest positive representable - * value. - * - * @see Field#setBoost(qreal) - */ - static uint8_t encodeNorm(qreal f); - - /** Decodes a normalization factor stored in an index. - * @see #encodeNorm(qreal) - */ - static qreal decodeNorm(uint8_t b); - - static uint8_t floatToByte(qreal f); - static qreal byteToFloat(uint8_t b); - - /** Computes a score factor for a phrase. - * - *

The default implementation sums the {@link #idf(Term,Searcher)} factor - * for each term in the phrase. - * - * @param terms the terms in the phrase - * @param searcher the document collection being searched - * @return a score factor for the phrase - */ - qreal idf(CL_NS(util)::CLVector* terms, Searcher* searcher); - //qreal idf(Term** terms, Searcher* searcher); - - - /** Computes a score factor for a simple term. - * - *

The default implementation is:

-   *   return idf(searcher.docFreq(term), searcher.maxDoc());
-   * 
- * - * Note that {@link Searcher#maxDoc()} is used instead of - * {@link IndexReader#numDocs()} because it is proportional to - * {@link Searcher#docFreq(Term)} , i.e., when one is inaccurate, - * so is the other, and in the same direction. - * - * @param term the term in question - * @param searcher the document collection being searched - * @return a score factor for the term - */ - qreal idf(CL_NS(index)::Term* term, Searcher* searcher); - - - /** Computes a score factor based on a term or phrase's frequency in a - * document. This value is multiplied by the {@link #idf(Term, Searcher)} - * factor for each term in the query and these products are then summed to - * form the initial score for a document. - * - *

Terms and phrases repeated in a document indicate the topic of the - * document, so implementations of this method usually return larger values - * when freq is large, and smaller values when freq - * is small. - * - *

The default implementation calls {@link #tf(qreal)}. - * - * @param freq the frequency of a term within a document - * @return a score factor based on a term's within-document frequency - */ - inline qreal tf(int32_t freq){ return tf((qreal)freq); } - - /** Computes the normalization value for a field given the total number of - * terms contained in a field. These values, together with field boosts, are - * stored in an index and multipled into scores for hits on each field by the - * search code. - * - *

Matches in longer fields are less precise, so implemenations of this - * method usually return smaller values when numTokens is large, - * and larger values when numTokens is small. - * - *

That these values are computed under {@link - * IndexWriter#addDocument(Document)} and stored then using - * {#encodeNorm(qreal)}. Thus they have limited precision, and documents - * must be re-indexed if this method is altered. - * - * @param fieldName the name of the field - * @param numTokens the total number of tokens contained in fields named - * fieldName of doc. - * @return a normalization factor for hits on this field of this document - * - * @see Field#setBoost(qreal) - */ - virtual qreal lengthNorm(const TCHAR* fieldName, int32_t numTokens) = 0; - - /** Computes the normalization value for a query given the sum of the squared - * weights of each of the query terms. This value is then multipled into the - * weight of each query term. - * - *

This does not affect ranking, but rather just attempts to make scores - * from different queries comparable. - * - * @param sumOfSquaredWeights the sum of the squares of query term weights - * @return a normalization factor for query weights - */ - virtual qreal queryNorm(qreal sumOfSquaredWeights) = 0; - - /** Computes the amount of a sloppy phrase match, based on an edit distance. - * This value is summed for each sloppy phrase match in a document to form - * the frequency that is passed to {@link #tf(qreal)}. - * - *

A phrase match with a small edit distance to a document passage more - * closely matches the document, so implementations of this method usually - * return larger values when the edit distance is small and smaller values - * when it is large. - * - * @see PhraseQuery#setSlop(int32_t) - * @param distance the edit distance of this sloppy phrase match - * @return the frequency increment for this match - */ - virtual qreal sloppyFreq(int32_t distance) = 0; - - /** Computes a score factor based on a term or phrase's frequency in a - * document. This value is multiplied by the {@link #idf(Term, Searcher)} - * factor for each term in the query and these products are then summed to - * form the initial score for a document. - * - *

Terms and phrases repeated in a document indicate the topic of the - * document, so implemenations of this method usually return larger values - * when freq is large, and smaller values when freq - * is small. - * - * @param freq the frequency of a term within a document - * @return a score factor based on a term's within-document frequency - */ - virtual qreal tf(qreal freq) = 0; - - /** Computes a score factor based on a term's document frequency (the number - * of documents which contain the term). This value is multiplied by the - * {@link #tf(int32_t)} factor for each term in the query and these products are - * then summed to form the initial score for a document. - * - *

Terms that occur in fewer documents are better indicators of topic, so - * implemenations of this method usually return larger values for rare terms, - * and smaller values for common terms. - * - * @param docFreq the number of documents which contain the term - * @param numDocs the total number of documents in the collection - * @return a score factor based on the term's document frequency - */ - virtual qreal idf(int32_t docFreq, int32_t numDocs) = 0; - - /** Computes a score factor based on the fraction of all query terms that a - * document contains. This value is multiplied into scores. - * - *

The presence of a large portion of the query terms indicates a better - * match with the query, so implemenations of this method usually return - * larger values when the ratio between these parameters is large and smaller - * values when the ratio between them is small. - * - * @param overlap the number of query terms matched in the document - * @param maxOverlap the total number of terms in the query - * @return a score factor based on term overlap with the query - */ - virtual qreal coord(int32_t overlap, int32_t maxOverlap) = 0; -}; - - -/** Expert: Default scoring implementation. */ -class DefaultSimilarity: public Similarity { -public: - DefaultSimilarity(); - ~DefaultSimilarity(); - - /** Implemented as 1/sqrt(numTerms). */ - qreal lengthNorm(const TCHAR* fieldName, int32_t numTerms); - - /** Implemented as 1/sqrt(sumOfSquaredWeights). */ - qreal queryNorm(qreal sumOfSquaredWeights); - - /** Implemented as sqrt(freq). */ - inline qreal tf(qreal freq); - - /** Implemented as 1 / (distance + 1). */ - qreal sloppyFreq(int32_t distance); - - /** Implemented as log(numDocs/(docFreq+1)) + 1. */ - qreal idf(int32_t docFreq, int32_t numDocs); - - /** Implemented as overlap / maxOverlap. */ - qreal coord(int32_t overlap, int32_t maxOverlap); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp b/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp deleted file mode 100644 index b7683b018..000000000 --- a/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SloppyPhraseScorer.h" - -#include "PhraseScorer.h" -#include "CLucene/index/Terms.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - SloppyPhraseScorer::SloppyPhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, - int32_t* positions, Similarity* similarity, - int32_t slop, uint8_t* norms): - PhraseScorer(weight,tps,positions,similarity,norms){ - //Func - Constructor - //Pre - tps != NULL - // tpsLength >= 0 - // n != NULL - //Post - Instance has been created - - CND_PRECONDITION(tps != NULL, "tps is NULL"); - //CND_PRECONDITION(n != NULL, _T("n is NULL")) = checked in PhraseScorer; - - this->slop = slop; - } - - qreal SloppyPhraseScorer::phraseFreq() { - //Func - Returns the freqency of the phrase - //Pre - first != NULL - // last != NULL - // pq != NULL - //Post - The frequency of the phrase has been returned - - CND_PRECONDITION(first != NULL,"first is NULL"); - CND_PRECONDITION(last != NULL,"last is NULL"); - CND_PRECONDITION(pq != NULL,"pq is NULL"); - - //Clear the PhraseQueue pq; - pq->clear(); - - int32_t end = 0; - - //declare iterator - PhrasePositions* pp = NULL; - - // build pq from list - - //Sort the list of PhrasePositions using pq - for (pp = first; pp != NULL; pp = pp->_next) { - //Read the first TermPosition of the current PhrasePositions pp - pp->firstPosition(); - //Check if the position of the pp is bigger than end - if (pp->position > end){ - end = pp->position; - } - //Store the current PhrasePositions pp into the PhraseQueue pp - pq->put(pp); - } - - qreal freq = 0.0f; - - bool done = false; - - do { - //Pop a PhrasePositions pp from the PhraseQueue pp - pp = pq->pop(); - //Get start position - int32_t start = pp->position; - //Get next position - int32_t next = pq->top()->position; - - for (int32_t pos = start; pos <= next; pos = pp->position) { - //advance pp to min window - start = pos; - - if (!pp->nextPosition()) { - //ran out of a term -- done - done = true; - break; - } - } - - //Calculate matchLength - int32_t matchLength = end - start; - //Check if matchLength is smaller than slop - if (matchLength <= slop){ - // penalize longer matches - freq += 1.0 / (matchLength + 1); - } - - if (pp->position > end){ - end = pp->position; - } - - //restore pq - pq->put(pp); - }while (!done); - - return freq; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h b/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h deleted file mode 100644 index 31516e393..000000000 --- a/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h +++ /dev/null @@ -1,34 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_SloppyPhraseScorer_ -#define _lucene_search_SloppyPhraseScorer_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "PhraseScorer.h" -#include "CLucene/index/Terms.h" - - -CL_NS_DEF(search) - class SloppyPhraseScorer: public PhraseScorer { - private: - int32_t slop; - - public: - SloppyPhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, - int32_t* positions, Similarity* similarity, - int32_t slop, uint8_t* norms); - ~SloppyPhraseScorer(){ - } - - protected: - qreal phraseFreq(); - }; -CL_NS_END -#endif - diff --git a/3rdparty/clucene/src/CLucene/search/Sort.cpp b/3rdparty/clucene/src/CLucene/search/Sort.cpp deleted file mode 100644 index 5a17a784d..000000000 --- a/3rdparty/clucene/src/CLucene/search/Sort.cpp +++ /dev/null @@ -1,345 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Sort.h" -#include "Compare.h" - -CL_NS_USE(util) -CL_NS_DEF(search) - - - - /** Represents sorting by document score (relevancy). */ - SortField* SortField::FIELD_SCORE = _CLNEW SortField (NULL, DOCSCORE,false); - - /** Represents sorting by document number (index order). */ - SortField* SortField::FIELD_DOC = _CLNEW SortField (NULL, DOC,false); - - - /** Represents sorting by computed relevance. Using this sort criteria - * returns the same results as calling {@link Searcher#search(Query) Searcher#search()} - * without a sort criteria, only with slightly more overhead. */ - Sort* Sort::RELEVANCE = _CLNEW Sort(); - - /** Represents sorting by index order. */ - Sort* Sort::INDEXORDER = _CLNEW Sort (SortField::FIELD_DOC); - - - - - /** Creates a sort by terms in the given field where the type of term value - * is determined dynamically ({@link #AUTO AUTO}). - * @param field Name of field to sort by, cannot be null. - */ - SortField::SortField (const TCHAR* field) { - this->type = AUTO; - this->reverse = false; - this->field = CLStringIntern::intern(field CL_FILELINE); - this->factory = NULL; - } - - /** Creates a sort, possibly in reverse, by terms in the given field where - * the type of term value is determined dynamically ({@link #AUTO AUTO}). - * @param field Name of field to sort by, cannot be null. - * @param reverse True if natural order should be reversed. - - SortField::SortField (const TCHAR* field, bool reverse) { - this->field = CLStringIntern::intern(field CL_FILELINE); - this->reverse = reverse; - this->type = AUTO; - this->factory = NULL; - }*/ - - - /** Creates a sort, possibly in reverse, by terms in the given field with the - * type of term values explicitly given. - * @param field Name of field to sort by. Can be null if - * type is SCORE or DOC. - * @param type Type of values in the terms. - * @param reverse True if natural order should be reversed (default=false). - */ - SortField::SortField (const TCHAR* field, int32_t type, bool reverse) { - this->field = (field != NULL) ? CLStringIntern::intern(field CL_FILELINE) : field; - this->type = type; - this->reverse = reverse; - this->factory = NULL; - } - - SortField::SortField(const SortField& clone){ - this->field = (clone.field != NULL) ? CLStringIntern::intern(clone.field CL_FILELINE) : clone.field; - this->type = clone.type; - this->reverse = clone.reverse; - this->factory = clone.factory; - } - SortField* SortField::clone() const{ - return _CLNEW SortField(*this); - } - - /** Creates a sort by terms in the given field sorted - * according to the given locale. - * @param field Name of field to sort by, cannot be null. - * @param locale Locale of values in the field. - */ - /*SortField::SortField (TCHAR* field, Locale* locale) { - this->field = (field != NULL) ? CLStringIntern::intern(field): field; - this->type = STRING; - this->locale = locale; - }*/ - - /** Creates a sort, possibly in reverse, by terms in the given field sorted - * according to the given locale. - * @param field Name of field to sort by, cannot be null. - * @param locale Locale of values in the field. - */ - /*SortField::SortField (TCHAR* field, Locale* locale, bool reverse) { - this->field = (field != NULL) ? CLStringIntern::intern(field): field; - this->type = STRING; - this->locale = locale; - this->reverse = reverse; - }*/ - - - /** Creates a sort, possibly in reverse, with a custom comparison function. - * @param field Name of field to sort by; cannot be null. - * @param comparator Returns a comparator for sorting hits. - * @param reverse True if natural order should be reversed (default=false). - */ - SortField::SortField (const TCHAR* field, SortComparatorSource* comparator, bool reverse) { - this->field = (field != NULL) ? CLStringIntern::intern(field CL_FILELINE): field; - this->type = CUSTOM; - this->reverse = reverse; - this->factory = comparator; - } - - SortField::~SortField(){ - CLStringIntern::unintern(field); - } - - TCHAR* SortField::toString() const { - CL_NS(util)::StringBuffer buffer; - switch (type) { - case DOCSCORE: buffer.append(_T("")); - break; - - case DOC: buffer.append(_T("")); - break; - - case CUSTOM: buffer.append (_T("getName()); - buffer.append(_T(">")); - break; - - default: buffer.append( _T("\"")); - buffer.append( field ); - buffer.append( _T("\"") ); - break; - } - - //if (locale != null) buffer.append ("("+locale+")"); todo: - if (reverse) buffer.appendChar('!'); - - return buffer.toString(); - } - - - - - - - - - - - - - - /** Sorts by computed relevance. This is the same sort criteria as - * calling {@link Searcher#search(Query) Searcher#search()} without a sort criteria, only with - * slightly more overhead. */ - Sort::Sort() { - fields=NULL; - SortField** fields=_CL_NEWARRAY(SortField*,3); - fields[0]=SortField::FIELD_SCORE; - fields[1]=SortField::FIELD_DOC; - fields[2]=NULL; - setSort (fields); - _CLDELETE_ARRAY(fields); - } - - Sort::~Sort(){ - clear(); - } - void Sort::clear(){ - if ( fields != NULL ){ - int32_t i=0; - while ( fields[i] != NULL ){ - if ( fields[i] != SortField::FIELD_SCORE && - fields[i] != SortField::FIELD_DOC ){ - _CLDELETE(fields[i]); - } - i++; - } - _CLDELETE_ARRAY(fields); - } - } - - /** Sorts possibly in reverse by the terms in field then by - * index order (document number). The type of value in field is determined - * automatically. - * @see SortField#AUTO - */ - Sort::Sort (const TCHAR* field, bool reverse) { - this->fields=NULL; - setSort (field, reverse); - } - - - /** Sorts in succession by the terms in each field. - * The type of value in field is determined - * automatically. - * @see SortField#AUTO - */ - Sort::Sort (const TCHAR** fields) { - this->fields=NULL; - setSort (fields); - } - - - /** Sorts by the criteria in the given SortField. */ - Sort::Sort (SortField* field) { - this->fields=NULL; - setSort (field); - } - - - /** Sorts in succession by the criteria in each SortField. */ - Sort::Sort (SortField** fields) { - this->fields=NULL; - setSort (fields); - } - - - /** Sets the sort to the terms in field possibly in reverse, - * then by index order (document number). */ - void Sort::setSort (const TCHAR* field, bool reverse) { - clear(); - fields = _CL_NEWARRAY(SortField*,3); - fields[0] = _CLNEW SortField (field, SortField::AUTO, reverse); - fields[1] = SortField::FIELD_DOC; - fields[2] = NULL; - } - - - /** Sets the sort to the terms in each field in succession. */ - void Sort::setSort (const TCHAR** fieldnames) { - clear(); - - int32_t n = 0; - while ( fieldnames[n] != NULL ) - n++; - - fields = _CL_NEWARRAY(SortField*,n+1); - for (int32_t i = 0; i < n; ++i) { - fields[i] = _CLNEW SortField (fieldnames[i], SortField::AUTO,false); - } - fields[n]=NULL; - } - - - /** Sets the sort to the given criteria. */ - void Sort::setSort (SortField* field) { - clear(); - - this->fields = _CL_NEWARRAY(SortField*,2); - this->fields[0] = field; - this->fields[1] = NULL; - } - - - /** Sets the sort to the given criteria in succession. */ - void Sort::setSort (SortField** fields) { - clear(); - - int n=0; - while ( fields[n] != NULL ) - n++; - this->fields = _CL_NEWARRAY(SortField*,n+1); - for (int i=0;ifields[i]=fields[i]; - } - - TCHAR* Sort::toString() const { - CL_NS(util)::StringBuffer buffer; - - int32_t i = 0; - while ( fields[i] != NULL ){ - if (i>0) - buffer.appendChar(','); - - const TCHAR* p = fields[i]->toString(); - buffer.append(p); - _CLDELETE_CARRAY(p); - - i++; - } - - return buffer.toString(); - } - - - - - - ScoreDocComparator* ScoreDocComparator::INDEXORDER = _CLNEW ScoreDocComparators::IndexOrder; - ScoreDocComparator* ScoreDocComparator::RELEVANCE = _CLNEW ScoreDocComparators::Relevance; - - ScoreDocComparator::~ScoreDocComparator(){ - } - - -class ScoreDocComparatorImpl: public ScoreDocComparator{ - Comparable** cachedValues; - FieldCacheAuto* fca; - int32_t cachedValuesLen; -public: - ScoreDocComparatorImpl(FieldCacheAuto* fca){ - this->fca = fca; - if ( fca->contentType != FieldCacheAuto::COMPARABLE_ARRAY ) - _CLTHROWA(CL_ERR_InvalidCast,"Invalid field cache auto type"); - this->cachedValues = fca->comparableArray; - this->cachedValuesLen = fca->contentLen; - } - ~ScoreDocComparatorImpl(){ - } - int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j){ - CND_PRECONDITION(i->doc >= 0 && i->doc < cachedValuesLen, "i->doc out of range") - CND_PRECONDITION(j->doc >= 0 && j->doc < cachedValuesLen, "j->doc out of range") - return cachedValues[i->doc]->compareTo (cachedValues[j->doc]); - } - - CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i){ - CND_PRECONDITION(i->doc >= 0 && i->doc < cachedValuesLen, "i->doc out of range") - return cachedValues[i->doc]; - } - - int32_t sortType(){ - return SortField::CUSTOM; - } -}; - -ScoreDocComparator* SortComparator::newComparator (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname){ - return _CLNEW ScoreDocComparatorImpl(FieldCache::DEFAULT->getCustom (reader, fieldname, this)); -} -SortComparator::SortComparator(){ -} -SortComparator::~SortComparator(){ -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/Sort.h b/3rdparty/clucene/src/CLucene/search/Sort.h deleted file mode 100644 index cfe96d56c..000000000 --- a/3rdparty/clucene/src/CLucene/search/Sort.h +++ /dev/null @@ -1,356 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_Sort_ -#define _lucene_search_Sort_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "SearchHeader.h" - -CL_NS_DEF(search) - - class SortField; //predefine - class Sort; - -/** - * Expert: Compares two ScoreDoc objects for sorting. - * - */ - class ScoreDocComparator:LUCENE_BASE { - protected: - ScoreDocComparator(){} - public: - virtual ~ScoreDocComparator(); -// CL_NS(util)::Comparable** cachedValues; -// ScoreDocComparator(CL_NS(util)::Comparable** cachedValues); - - /** - * Compares two ScoreDoc objects and returns a result indicating their - * sort order. - * @param i First ScoreDoc - * @param j Second ScoreDoc - * @return -1 if i should come before j
1 if i should come after j
0 if they are equal - * @see java.util.Comparator - */ - virtual int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) = 0; - - /** - * Returns the value used to sort the given document. The - * object returned must implement the java.io.Serializable - * interface. This is used by multisearchers to determine how to collate results from their searchers. - * @see FieldDoc - * @param i Document - * @return Serializable object - */ - virtual CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) = 0; - - - /** - * Returns the type of sort. Should return SortField.SCORE, SortField.DOC, SortField.STRING, SortField.INTEGER, - * SortField::FLOAT or SortField.CUSTOM. It is not valid to return SortField.AUTO. - * This is used by multisearchers to determine how to collate results from their searchers. - * @return One of the constants in SortField. - * @see SortField - */ - virtual int32_t sortType() = 0; - - /** Special comparator for sorting hits according to computed relevance (document score). */ - static ScoreDocComparator* RELEVANCE; - - /** Special comparator for sorting hits according to index order (document number). */ - static ScoreDocComparator* INDEXORDER; - }; - -/** - * Expert: returns a comparator for sorting ScoreDocs. - * - */ -class SortComparatorSource:LUCENE_BASE { -public: - virtual ~SortComparatorSource(){ - } - - /** - * return a reference to a string describing the name of the comparator - * this is used in the explanation - */ - virtual TCHAR* getName() = 0; - - virtual size_t hashCode() = 0; - - /** - * Creates a comparator for the field in the given index. - * @param reader Index to create comparator for. - * @param fieldname Field to create comparator for. - * @return Comparator of ScoreDoc objects. - * @throws IOException If an error occurs reading the index. - */ - virtual ScoreDocComparator* newComparator (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname) = 0; -}; - - -/** - * Abstract base class for sorting hits returned by a Query. - * - *

This class should only be used if the other SortField - * types (SCORE, DOC, STRING, INT, FLOAT) do not provide an - * adequate sorting. It maintains an internal cache of values which - * could be quite large. The cache is an array of Comparable, - * one for each document in the index. There is a distinct - * Comparable for each unique term in the field - if - * some documents have the same term in the field, the cache - * array will have entries which reference the same Comparable. - * - */ -class SortComparator: public SortComparatorSource { -public: - virtual ScoreDocComparator* newComparator (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); - - SortComparator(); - virtual ~SortComparator(); - - /** - * Returns an object which, when sorted according to natural order, - * will order the Term values in the correct order. - *

For example, if the Terms contained integer values, this method - * would return new Integer(termtext). Note that this - * might not always be the most efficient implementation - for this - * particular example, a better implementation might be to make a - * ScoreDocLookupComparator that uses an internal lookup table of int. - * @param termtext The textual value of the term. - * @return An object representing termtext that sorts - * according to the natural order of termtext. - * @see Comparable - * @see ScoreDocComparator - */ - virtual CL_NS(util)::Comparable* getComparable (const TCHAR* termtext) = 0; - -}; - - -/** - * Stores information about how to sort documents by terms in an individual - * field. Fields must be indexed in order to sort by them. - * - */ -class SortField:LUCENE_BASE { -private: - const TCHAR* field; - int32_t type; // defaults to determining type dynamically - //Locale* locale; // defaults to "natural order" (no Locale) - bool reverse; // defaults to natural order - SortComparatorSource* factory; - -protected: - SortField (const SortField& clone); -public: - virtual ~SortField(); - - /** Sort by document score (relevancy). Sort values are Float and higher - * values are at the front. - * PORTING: this is the same as SCORE in java, it had to be renamed because - * SCORE is a system macro on some platforms (AIX). - */ - LUCENE_STATIC_CONSTANT(int32_t, DOCSCORE=0); - - /** Sort by document number (index order). Sort values are Integer and lower - * values are at the front. */ - LUCENE_STATIC_CONSTANT(int32_t, DOC=1); - - /** Guess type of sort based on field contents. A regular expression is used - * to look at the first term indexed for the field and determine if it - * represents an integer number, a floating point number, or just arbitrary - * string characters. */ - LUCENE_STATIC_CONSTANT(int32_t, AUTO=2); - - /** Sort using term values as Strings. Sort values are String and lower - * values are at the front. */ - LUCENE_STATIC_CONSTANT(int32_t, STRING=3); - - /** Sort using term values as encoded Integers. Sort values are Integer and - * lower values are at the front. */ - LUCENE_STATIC_CONSTANT(int32_t, INT=4); - - /** Sort using term values as encoded Floats. Sort values are Float and - * lower values are at the front. */ - LUCENE_STATIC_CONSTANT(int32_t, FLOAT=5); - - /** Sort using a custom Comparator. Sort values are any Comparable and - * sorting is done according to natural order. */ - LUCENE_STATIC_CONSTANT(int32_t, CUSTOM=9); - - // IMPLEMENTATION NOTE: the FieldCache.STRING_INDEX is in the same "namespace" - // as the above static int values. Any new values must not have the same value - // as FieldCache.STRING_INDEX. - - /** Represents sorting by document score (relevancy). */ - static SortField* FIELD_SCORE; - - /** Represents sorting by document number (index order). */ - static SortField* FIELD_DOC; - - SortField (const TCHAR* field); - //SortField (const TCHAR* field, bool reverse); - //todo: we cannot make reverse use default field of =false. - //because bool and int are the same type in c, overloading is not possible - SortField (const TCHAR* field, int32_t type, bool reverse); - - /* - SortField (TCHAR* field, Locale* locale) { - SortField (TCHAR* field, Locale* locale, bool reverse);*/ - - SortField (const TCHAR* field, SortComparatorSource* comparator, bool reverse=false); - - /** Returns the name of the field. Could return null - * if the sort is by SCORE or DOC. - * @return Name of field, possibly null. - */ - const TCHAR* getField() const { return field; } - - SortField* clone() const; - - /** Returns the type of contents in the field. - * @return One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. - */ - int32_t getType() const { return type; } - - /** Returns the Locale by which term values are interpreted. - * May return null if no Locale was specified. - * @return Locale, or null. - */ - /*Locale getLocale() { - return locale; - }*/ - - /** Returns whether the sort should be reversed. - * @return True if natural order should be reversed. - */ - bool getReverse() const { return reverse; } - - SortComparatorSource* getFactory() const { return factory; } - - TCHAR* toString() const; -}; - - - -/** - * Encapsulates sort criteria for returned hits. - * - *

The fields used to determine sort order must be carefully chosen. - * Documents must contain a single term in such a field, - * and the value of the term should indicate the document's relative position in - * a given sort order. The field must be indexed, but should not be tokenized, - * and does not need to be stored (unless you happen to want it back with the - * rest of your document data). In other words: - * - *

document.add (new Field ("byNumber", Integer.toString(x), false, true, false)); - *
- * - *

Valid Types of Values

- * - *

There are three possible kinds of term values which may be put into - * sorting fields: Integers, Floats, or Strings. Unless - * {@link SortField SortField} objects are specified, the type of value - * in the field is determined by parsing the first term in the field. - * - *

Integer term values should contain only digits and an optional - * preceeding negative sign. Values must be base 10 and in the range - * Integer.MIN_VALUE and Integer.MAX_VALUE inclusive. - * Documents which should appear first in the sort - * should have low value integers, later documents high values - * (i.e. the documents should be numbered 1..n where - * 1 is the first and n the last). - * - *

Float term values should conform to values accepted by - * {@link Float Float.valueOf(String)} (except that NaN - * and Infinity are not supported). - * Documents which should appear first in the sort - * should have low values, later documents high values. - * - *

String term values can contain any valid String, but should - * not be tokenized. The values are sorted according to their - * {@link Comparable natural order}. Note that using this type - * of term value has higher memory requirements than the other - * two types. - * - *

Object Reuse

- * - *

One of these objects can be - * used multiple times and the sort order changed between usages. - * - *

This class is thread safe. - * - *

Memory Usage

- * - *

Sorting uses of caches of term values maintained by the - * internal HitQueue(s). The cache is static and contains an integer - * or float array of length IndexReader.maxDoc() for each field - * name for which a sort is performed. In other words, the size of the - * cache in bytes is: - * - *

4 * IndexReader.maxDoc() * (# of different fields actually used to sort) - * - *

For String fields, the cache is larger: in addition to the - * above array, the value of every term in the field is kept in memory. - * If there are many unique terms in the field, this could - * be quite large. - * - *

Note that the size of the cache is not affected by how many - * fields are in the index and might be used to sort - only by - * the ones actually used to sort a result set. - * - *

The cache is cleared each time a new IndexReader is - * passed in, or if the value returned by maxDoc() - * changes for the current IndexReader. This class is not set up to - * be able to efficiently sort hits from more than one index - * simultaneously. - * - */ -class Sort:LUCENE_BASE { - // internal representation of the sort criteria - SortField** fields; - void clear(); -public: - ~Sort(); - - /** Represents sorting by computed relevance. Using this sort criteria - * returns the same results as calling {@link Searcher#search(Query) Searcher#search()} - * without a sort criteria, only with slightly more overhead. */ - static Sort* RELEVANCE; - - /** Represents sorting by index order. */ - static Sort* INDEXORDER; - - Sort(); - Sort (const TCHAR* field, bool reverse=false); - Sort (const TCHAR** fields); - Sort (SortField* field); - Sort (SortField** fields); - void setSort (const TCHAR* field, bool reverse=false); - void setSort (const TCHAR** fieldnames); - void setSort (SortField* field); - void setSort (SortField** fields); - - TCHAR* toString() const; - - /** - * Representation of the sort criteria. - * @return a pointer to the of SortField array used in this sort criteria - */ - SortField** getSort() const{ return fields; } -}; - - - - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/TermQuery.cpp b/3rdparty/clucene/src/CLucene/search/TermQuery.cpp deleted file mode 100644 index a04c20fec..000000000 --- a/3rdparty/clucene/src/CLucene/search/TermQuery.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "TermQuery.h" - -#include "SearchHeader.h" -#include "Scorer.h" -#include "CLucene/index/Term.h" -#include "TermScorer.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/StringBuffer.h" -#include "CLucene/index/Terms.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - - /** Constructs a query for the term t. */ - TermQuery::TermQuery(Term* t): - term( _CL_POINTER(t) ) - { - } - TermQuery::TermQuery(const TermQuery& clone): - Query(clone){ - this->term=_CL_POINTER(clone.term); - } - TermQuery::~TermQuery(){ - _CLDECDELETE(term); - } - - Query* TermQuery::clone() const{ - return _CLNEW TermQuery(*this); - } - - const TCHAR* TermQuery::getClassName(){ - return _T("TermQuery"); - } - const TCHAR* TermQuery::getQueryName() const{ - return getClassName(); - } - size_t TermQuery::hashCode() const { - return Similarity::floatToByte(getBoost()) ^ term->hashCode(); - } - - - //added by search highlighter - Term* TermQuery::getTerm(bool pointer) const - { - if ( pointer ) - return _CL_POINTER(term); - else - return term; - } - - - /** Prints a user-readable version of this query. */ - TCHAR* TermQuery::toString(const TCHAR* field) const{ - CL_NS(util)::StringBuffer buffer; - if ( field==NULL || _tcscmp(term->field(),field)!= 0 ) { - buffer.append(term->field()); - buffer.append(_T(":")); - } - buffer.append(term->text()); - if (getBoost() != 1.0f) { - buffer.append(_T("^")); - buffer.appendFloat( getBoost(),1 ); - } - return buffer.toString(); - } - - /** Returns true iff o is equal to this. */ - bool TermQuery::equals(Query* other) const { - if (!(other->instanceOf(TermQuery::getClassName()))) - return false; - - TermQuery* tq = (TermQuery*)other; - return (this->getBoost() == tq->getBoost()) - && this->term->equals(tq->term); - } - - - TermQuery::TermWeight::TermWeight(Searcher* searcher, TermQuery* _this, Term* _term) { - this->_this = _this; - this->_term = _term; - this->searcher = searcher; - value=0; - idf=0; - queryNorm=0; - queryWeight=0; - } - TermQuery::TermWeight::~TermWeight(){ - } - - //return a *new* string describing this object - TCHAR* TermQuery::TermWeight::toString() { - int32_t size=_tcslen(_this->getQueryName()) + 10; - TCHAR* tmp = _CL_NEWARRAY(TCHAR, size);//_tcslen(weight()) - _sntprintf(tmp,size,_T("weight(%s)"),_this->getQueryName()); - return tmp; - } - - qreal TermQuery::TermWeight::sumOfSquaredWeights() { - idf = _this->getSimilarity(searcher)->idf(_term, searcher); // compute idf - queryWeight = idf * _this->getBoost(); // compute query weight - return queryWeight * queryWeight; // square it - } - - void TermQuery::TermWeight::normalize(qreal queryNorm) { - this->queryNorm = queryNorm; - queryWeight *= queryNorm; // normalize query weight - value = queryWeight * idf; // idf for document - } - - Scorer* TermQuery::TermWeight::scorer(IndexReader* reader) { - TermDocs* termDocs = reader->termDocs(_term); - - if (termDocs == NULL) - return NULL; - - return _CLNEW TermScorer(this, termDocs, _this->getSimilarity(searcher), - reader->norms(_term->field())); - } - - void TermQuery::TermWeight::explain(IndexReader* reader, int32_t doc, Explanation* result){ - TCHAR buf[LUCENE_SEARCH_EXPLANATION_DESC_LEN]; - TCHAR* tmp; - - tmp = getQuery()->toString(); - _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("weight(%s in %d), product of:"),tmp,doc); - _CLDELETE_CARRAY(tmp); - result->setDescription(buf); - - _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("idf(docFreq=%d)"), searcher->docFreq(_term) ); - Explanation* idfExpl = _CLNEW Explanation(idf, buf); - - // explain query weight - Explanation* queryExpl = _CLNEW Explanation(); - tmp = getQuery()->toString(); - _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("queryWeight(%s), product of:"), tmp); - _CLDELETE_CARRAY(tmp); - queryExpl->setDescription(buf); - - Explanation* boostExpl = _CLNEW Explanation(_this->getBoost(), _T("boost")); - if (_this->getBoost() != 1.0f) - queryExpl->addDetail(boostExpl); - else - _CLDELETE(boostExpl); - - queryExpl->addDetail(idfExpl->clone()); - - Explanation* queryNormExpl = _CLNEW Explanation(queryNorm,_T("queryNorm")); - queryExpl->addDetail(queryNormExpl); - - queryExpl->setValue(_this->getBoost()* // always 1.0 - idfExpl->getValue() * - queryNormExpl->getValue()); - - // explain field weight - const TCHAR* field = _term->field(); - Explanation* fieldExpl = _CLNEW Explanation(); - - tmp = _term->toString(); - _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("fieldWeight(%s in %d), product of:"),tmp,doc); - _CLDELETE_CARRAY(tmp); - fieldExpl->setDescription(buf); - - Scorer* sc = scorer(reader); - Explanation* tfExpl = _CLNEW Explanation; - sc->explain(doc, tfExpl); - _CLDELETE(sc); - fieldExpl->addDetail(tfExpl); - fieldExpl->addDetail(idfExpl); - - Explanation* fieldNormExpl = _CLNEW Explanation(); - uint8_t* fieldNorms = reader->norms(field); - qreal fieldNorm = - fieldNorms!=NULL ? Similarity::decodeNorm(fieldNorms[doc]) : 0.0f; - fieldNormExpl->setValue(fieldNorm); - - _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, - _T("fieldNorm(field=%s, doc=%d)"),field,doc); - fieldNormExpl->setDescription(buf); - fieldExpl->addDetail(fieldNormExpl); - - fieldExpl->setValue(tfExpl->getValue() * - idfExpl->getValue() * - fieldNormExpl->getValue()); - - /*if (queryExpl->getValue() == 1.0f){ - _CLDELETE(result); - return fieldExpl; - }else{*/ - result->addDetail(queryExpl); - result->addDetail(fieldExpl); - - // combine them - result->setValue(queryExpl->getValue() * fieldExpl->getValue()); - //} - } - - Weight* TermQuery::_createWeight(Searcher* searcher) { - return _CLNEW TermWeight(searcher,this,term); - } -CL_NS_END - diff --git a/3rdparty/clucene/src/CLucene/search/TermQuery.h b/3rdparty/clucene/src/CLucene/search/TermQuery.h deleted file mode 100644 index a7dd8039b..000000000 --- a/3rdparty/clucene/src/CLucene/search/TermQuery.h +++ /dev/null @@ -1,81 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_TermQuery_ -#define _lucene_search_TermQuery_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "SearchHeader.h" -#include "Scorer.h" -#include "CLucene/index/Term.h" -#include "TermScorer.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/StringBuffer.h" -#include "CLucene/index/Terms.h" - -CL_NS_DEF(search) - - - /** A Query that matches documents containing a term. - This may be combined with other terms with a {@link BooleanQuery}. - */ - class TermQuery: public Query { - private: - CL_NS(index)::Term* term; - - - class TermWeight: public Weight { - private: - Searcher* searcher; - qreal value; - qreal idf; - qreal queryNorm; - qreal queryWeight; - TermQuery* _this; - CL_NS(index)::Term* _term; - - public: - TermWeight(Searcher* searcher, TermQuery* _this, CL_NS(index)::Term* _term); - ~TermWeight(); - TCHAR* toString(); - Query* getQuery() { return (Query*)_this; } - qreal getValue() { return value; } - - qreal sumOfSquaredWeights(); - void normalize(qreal queryNorm); - Scorer* scorer(CL_NS(index)::IndexReader* reader); - void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret); - }; - - protected: - Weight* _createWeight(Searcher* searcher); - TermQuery(const TermQuery& clone); - public: - // Constructs a query for the term t. - TermQuery(CL_NS(index)::Term* t); - ~TermQuery(); - - static const TCHAR* getClassName(); - const TCHAR* getQueryName() const; - - //added by search highlighter - CL_NS(index)::Term* getTerm(bool pointer=true) const; - - // Prints a user-readable version of this query. - TCHAR* toString(const TCHAR* field) const; - - bool equals(Query* other) const; - Query* clone() const; - - /** Returns a hash code value for this object.*/ - size_t hashCode() const; - }; -CL_NS_END -#endif - diff --git a/3rdparty/clucene/src/CLucene/search/TermScorer.cpp b/3rdparty/clucene/src/CLucene/search/TermScorer.cpp deleted file mode 100644 index ddd7f74ed..000000000 --- a/3rdparty/clucene/src/CLucene/search/TermScorer.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "TermScorer.h" - -#include "CLucene/index/Terms.h" -#include "TermQuery.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - //TermScorer takes TermDocs and delets it when TermScorer is cleaned up - TermScorer::TermScorer(Weight* w, CL_NS(index)::TermDocs* td, - Similarity* similarity,uint8_t* _norms): - Scorer(similarity), - termDocs(td), - norms(_norms), - weight(w), - weightValue(w->getValue()), - _doc(0), - pointer(0), - pointerMax(0) - { - memset(docs,0,32*sizeof(int32_t)); - memset(freqs,0,32*sizeof(int32_t)); - - for (int32_t i = 0; i < LUCENE_SCORE_CACHE_SIZE; i++) - scoreCache[i] = getSimilarity()->tf(i) * weightValue; - } - - TermScorer::~TermScorer(){ - _CLDELETE(termDocs); - } - bool TermScorer::next(){ - pointer++; - if (pointer >= pointerMax) { - pointerMax = termDocs->read(docs, freqs, 32); // refill buffer - if (pointerMax != 0) { - pointer = 0; - } else { - termDocs->close(); // close stream - _doc = LUCENE_INT32_MAX_SHOULDBE; // set to sentinel value - return false; - } - } - _doc = docs[pointer]; - return true; - } - - bool TermScorer::skipTo(int32_t target) { - // first scan in cache - for (pointer++; pointer < pointerMax; pointer++) { - if (docs[pointer] >= target) { - _doc = docs[pointer]; - return true; - } - } - - // not found in cache, seek underlying stream - bool result = termDocs->skipTo(target); - if (result) { - pointerMax = 1; - pointer = 0; - docs[pointer] = _doc = termDocs->doc(); - freqs[pointer] = termDocs->freq(); - } else { - _doc = LUCENE_INT32_MAX_SHOULDBE; - } - return result; - } - - void TermScorer::explain(int32_t doc, Explanation* tfExplanation) { - TermQuery* query = (TermQuery*)weight->getQuery(); - int32_t tf = 0; - while (pointer < pointerMax) { - if (docs[pointer] == doc) - tf = freqs[pointer]; - pointer++; - } - if (tf == 0) { - while (termDocs->next()) { - if (termDocs->doc() == doc) { - tf = termDocs->freq(); - } - } - } - termDocs->close(); - tfExplanation->setValue(getSimilarity()->tf(tf)); - - TCHAR buf[LUCENE_SEARCH_EXPLANATION_DESC_LEN+1]; - TCHAR* termToString = query->getTerm(false)->toString(); - _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN,_T("tf(termFreq(%s)=%d)"), termToString, tf); - _CLDELETE_CARRAY(termToString); - tfExplanation->setDescription(buf); - } - - TCHAR* TermScorer::toString() { - TCHAR* wb = weight->toString(); - int32_t rl = _tcslen(wb) + 9; //9=_tcslen("scorer(" ")") + 1 - TCHAR* ret = _CL_NEWARRAY(TCHAR,rl); - _sntprintf(ret,rl,_T("scorer(%s)"), wb); - _CLDELETE_ARRAY(wb); - return ret; - } - - qreal TermScorer::score(){ - int32_t f = freqs[pointer]; - qreal raw = // compute tf(f)*weight - f < LUCENE_SCORE_CACHE_SIZE // check cache - ? scoreCache[f] // cache hit - : getSimilarity()->tf(f) * weightValue; // cache miss - - return raw * Similarity::decodeNorm(norms[_doc]); // normalize for field - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/TermScorer.h b/3rdparty/clucene/src/CLucene/search/TermScorer.h deleted file mode 100644 index ccbf5f7ec..000000000 --- a/3rdparty/clucene/src/CLucene/search/TermScorer.h +++ /dev/null @@ -1,53 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_TermScorer_ -#define _lucene_search_TermScorer_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Scorer.h" -#include "CLucene/index/Terms.h" -#include "CLucene/search/Similarity.h" -#include "SearchHeader.h" - -CL_NS_DEF(search) - - class TermScorer: public Scorer { - private: - CL_NS(index)::TermDocs* termDocs; - uint8_t* norms; - Weight* weight; - const qreal weightValue; - int32_t _doc; - - int32_t docs[32]; // buffered doc numbers - int32_t freqs[32]; // buffered term freqs - int32_t pointer; - int32_t pointerMax; - - qreal scoreCache[LUCENE_SCORE_CACHE_SIZE]; - public: - - //TermScorer takes TermDocs and delets it when TermScorer is cleaned up - TermScorer(Weight* weight, CL_NS(index)::TermDocs* td, - Similarity* similarity, uint8_t* _norms); - - ~TermScorer(); - - int32_t doc() const { return _doc; } - - bool next(); - bool skipTo(int32_t target); - void explain(int32_t doc, Explanation* ret); - TCHAR* toString(); - - qreal score(); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp b/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp deleted file mode 100644 index 9373cef0a..000000000 --- a/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "WildcardQuery.h" -#include "CLucene/util/BitSet.h" - -CL_NS_USE(index) -CL_NS_USE(util) -CL_NS_DEF(search) - - - WildcardQuery::WildcardQuery(Term* term): - MultiTermQuery( term ){ - //Func - Constructor - //Pre - term != NULL - //Post - Instance has been created - - } - - WildcardQuery::~WildcardQuery(){ - //Func - Destructor - //Pre - true - //Post - true - - } - - const TCHAR* WildcardQuery::getQueryName() const{ - //Func - Returns the string "WildcardQuery" - //Pre - true - //Post - The string "WildcardQuery" has been returned - return getClassName(); - } - - const TCHAR* WildcardQuery::getClassName(){ - return _T("WildcardQuery"); - } - - - FilteredTermEnum* WildcardQuery::getEnum(IndexReader* reader) { - return _CLNEW WildcardTermEnum(reader, getTerm(false)); - } - - WildcardQuery::WildcardQuery(const WildcardQuery& clone): - MultiTermQuery(clone) - { - } - - Query* WildcardQuery::clone() const{ - return _CLNEW WildcardQuery(*this); - } - size_t WildcardQuery::hashCode() const{ - //todo: we should give the query a seeding value... but - //need to do it for all hascode functions - return Similarity::floatToByte(getBoost()) ^ getTerm()->hashCode(); - } - bool WildcardQuery::equals(Query* other) const{ - if (!(other->instanceOf(WildcardQuery::getClassName()))) - return false; - - WildcardQuery* tq = (WildcardQuery*)other; - return (this->getBoost() == tq->getBoost()) - && getTerm()->equals(tq->getTerm()); - } - - - - - - - - - - - - -WildcardFilter::WildcardFilter( Term* term ) -{ - this->term = _CL_POINTER(term); -} - -WildcardFilter::~WildcardFilter() -{ - _CLDECDELETE(term); -} - -WildcardFilter::WildcardFilter( const WildcardFilter& copy ) : - term( _CL_POINTER(copy.term) ) -{ -} - -Filter* WildcardFilter::clone() const { - return _CLNEW WildcardFilter(*this ); -} - - -TCHAR* WildcardFilter::toString() -{ - //Instantiate a stringbuffer buffer to store the readable version temporarily - CL_NS(util)::StringBuffer buffer; - //check if field equal to the field of prefix - if( term->field() != NULL ) { - //Append the field of prefix to the buffer - buffer.append(term->field()); - //Append a colon - buffer.append(_T(":") ); - } - //Append the text of the prefix - buffer.append(term->text()); - - //Convert StringBuffer buffer to TCHAR block and return it - return buffer.toString(); -} - - -/** Returns a BitSet with true for documents which should be permitted in -search results, and false for those that should not. */ -BitSet* WildcardFilter::bits( IndexReader* reader ) -{ - BitSet* bts = _CLNEW BitSet( reader->maxDoc() ); - - WildcardTermEnum termEnum (reader, term); - if (termEnum.term(false) == NULL) - return bts; - - TermDocs* termDocs = reader->termDocs(); - try{ - do{ - termDocs->seek(&termEnum); - - while (termDocs->next()) { - bts->set(termDocs->doc()); - } - }while(termEnum.next()); - } _CLFINALLY( - termDocs->close(); - _CLDELETE(termDocs); - termEnum.close(); - ) - - return bts; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/WildcardQuery.h b/3rdparty/clucene/src/CLucene/search/WildcardQuery.h deleted file mode 100644 index cfc38f648..000000000 --- a/3rdparty/clucene/src/CLucene/search/WildcardQuery.h +++ /dev/null @@ -1,69 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_WildcardQuery_ -#define _lucene_search_WildcardQuery_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "MultiTermQuery.h" -#include "WildcardTermEnum.h" - -CL_NS_DEF(search) - - /** Implements the wildcard search query. Supported wildcards are *, which - * matches any character sequence (including the empty one), and ?, - * which matches any single character. Note this query can be slow, as it - * needs to iterate over all terms. In order to prevent extremely slow WildcardQueries, - * a Wildcard term must not start with one of the wildcards * or - * ?. - * - * @see WildcardTermEnum - */ - class WildcardQuery: public MultiTermQuery { - protected: - FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader); - WildcardQuery(const WildcardQuery& clone); - public: - WildcardQuery(CL_NS(index)::Term* term); - ~WildcardQuery(); - - //Returns the string "WildcardQuery" - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); - - size_t hashCode() const; - bool equals(Query* other) const; - Query* clone() const; - }; - - - -class WildcardFilter: public Filter -{ -private: - CL_NS(index)::Term* term; -protected: - WildcardFilter( const WildcardFilter& copy ); - -public: - WildcardFilter(CL_NS(index)::Term* term); - ~WildcardFilter(); - - /** Returns a BitSet with true for documents which should be permitted in - search results, and false for those that should not. */ - CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); - - Filter* clone() const; - TCHAR* toString(); -}; - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp b/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp deleted file mode 100644 index bed9e6e0c..000000000 --- a/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "WildcardTermEnum.h" - -CL_NS_USE(index) -CL_NS_DEF(search) - - bool WildcardTermEnum::termCompare(Term* term) { - if ( term!=NULL && __term->field() == term->field() ) { - const TCHAR* searchText = term->text(); - const TCHAR* patternText = __term->text(); - if ( _tcsncmp( searchText, pre, preLen ) == 0 ){ - return wildcardEquals(patternText+preLen, __term->textLength()-preLen, 0, searchText, term->textLength(), preLen); - } - } - _endEnum = true; - return false; - } - - /** Creates new WildcardTermEnum */ - WildcardTermEnum::WildcardTermEnum(IndexReader* reader, Term* term): - FilteredTermEnum(), - __term(_CL_POINTER(term)), - fieldMatch(false), - _endEnum(false) - { - - pre = stringDuplicate(term->text()); - - const TCHAR* sidx = _tcschr( pre, LUCENE_WILDCARDTERMENUM_WILDCARD_STRING ); - const TCHAR* cidx = _tcschr( pre, LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR ); - const TCHAR* tidx = sidx; - if (tidx == NULL) - tidx = cidx; - else if ( cidx && cidx > pre) - tidx = min(sidx, cidx); - CND_PRECONDITION(tidx != NULL, "tidx==NULL"); - int32_t idx = (int32_t)(tidx - pre); - preLen = idx; - CND_PRECONDITION(preLentextLength(), "preLen >= term->textLength()"); - pre[preLen]=0; //trim end - - Term* t = _CLNEW Term(__term, pre); - setEnum( reader->terms(t) ); - _CLDECDELETE(t); - } - - void WildcardTermEnum::close() - { - if ( __term != NULL ){ - FilteredTermEnum::close(); - - _CLDECDELETE(__term); - __term = NULL; - - _CLDELETE_CARRAY( pre ); - } - } - WildcardTermEnum::~WildcardTermEnum() { - close(); - } - - qreal WildcardTermEnum::difference() { - return 1.0f; - } - - bool WildcardTermEnum::endEnum() { - return _endEnum; - } - - bool WildcardTermEnum::wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx) - { - for (int32_t p = patternIdx; ; ++p) - { - for (int32_t s = stringIdx; ; ++p, ++s) - { - // End of str yet? - bool sEnd = (s >= strLen); - // End of pattern yet? - bool pEnd = (p >= patternLen); - - // If we're looking at the end of the str... - if (sEnd) - { - // Assume the only thing left on the pattern is/are wildcards - bool justWildcardsLeft = true; - - // Current wildcard position - int32_t wildcardSearchPos = p; - // While we haven't found the end of the pattern, - // and haven't encountered any non-wildcard characters - while (wildcardSearchPos < patternLen && justWildcardsLeft) - { - // Check the character at the current position - TCHAR wildchar = pattern[wildcardSearchPos]; - // If it's not a wildcard character, then there is more - // pattern information after this/these wildcards. - - if (wildchar != LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR && - wildchar != LUCENE_WILDCARDTERMENUM_WILDCARD_STRING){ - justWildcardsLeft = false; - }else{ - // to prevent "cat" matches "ca??" - if (wildchar == LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR) - return false; - - wildcardSearchPos++; // Look at the next character - } - } - - // This was a prefix wildcard search, and we've matched, so - // return true. - if (justWildcardsLeft) - return true; - } - - // If we've gone past the end of the str, or the pattern, - // return false. - if (sEnd || pEnd) - break; - - // Match a single character, so continue. - if (pattern[p] == LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR) - continue; - - if (pattern[p] == LUCENE_WILDCARDTERMENUM_WILDCARD_STRING) - { - // Look at the character beyond the '*'. - ++p; - // Examine the str, starting at the last character. - for (int32_t i = strLen; i >= s; --i) - { - if (wildcardEquals(pattern, patternLen, p, str, strLen, i)) - return true; - } - break; - } - if (pattern[p] != str[s]) - break; - } - return false; - } - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h b/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h deleted file mode 100644 index 2a0373540..000000000 --- a/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h +++ /dev/null @@ -1,67 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_search_WildcardTermEnum_ -#define _lucene_search_WildcardTermEnum_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/index/IndexReader.h" -#include "CLucene/index/Term.h" -#include "CLucene/index/Terms.h" -#include "FilteredTermEnum.h" - -CL_NS_DEF(search) - /** - * Subclass of FilteredTermEnum for enumerating all terms that match the - * specified wildcard filter term-> - *

- * Term enumerations are always ordered by term->compareTo(). Each term in - * the enumeration is greater than all that precede it. - */ - class WildcardTermEnum: public FilteredTermEnum { - private: - CL_NS(index)::Term* __term; - TCHAR* pre; - int32_t preLen; - bool fieldMatch; - bool _endEnum; - - /******************************************** - * const TCHAR* equality with support for wildcards - ********************************************/ - - protected: - bool termCompare(CL_NS(index)::Term* term) ; - - public: - - /** - * Creates a new WildcardTermEnum. Passing in a - * {@link Term Term} that does not contain a - * LUCENE_WILDCARDTERMENUM_WILDCARD_STRING or - * LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR will cause an exception to be thrown. - */ - WildcardTermEnum(CL_NS(index)::IndexReader* reader, CL_NS(index)::Term* term); - ~WildcardTermEnum(); - - qreal difference() ; - - bool endEnum() ; - - /** - * Determines if a word matches a wildcard pattern. - */ - static bool wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx); - - void close(); - - const char* getObjectName(){ return WildcardTermEnum::getClassName(); } - static const char* getClassName(){ return "WildcardTermEnum"; } - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/store/Directory.h b/3rdparty/clucene/src/CLucene/store/Directory.h deleted file mode 100644 index 818bc7af9..000000000 --- a/3rdparty/clucene/src/CLucene/store/Directory.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#ifndef _lucene_store_Directory -#define _lucene_store_Directory - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Lock.h" -#include "CLucene/util/VoidList.h" -#include "CLucene/util/Misc.h" - -#include "IndexInput.h" -#include "IndexOutput.h" - -CL_NS_DEF(store) - -/** A Directory is a flat list of files. Files may be written once, when they -* are created. Once a file is created it may only be opened for read, or -* deleted. Random access is permitted both when reading and writing. -* -*

Direct i/o is not used directly, but rather all i/o is -* through this API. This permits things such as:

    -*
  • implementation of RAM-based indices; -*
  • implementation indices stored in a database, via a database; -*
  • implementation of an index as a single file; -*
-* -*/ -class Directory : LUCENE_REFBASE -{ -protected: - Directory() {} - // Removes an existing file in the directory. - virtual bool doDeleteFile(const QString& name) = 0; - -public: - DEFINE_MUTEX(THIS_LOCK) - - virtual ~Directory() {}; - - // Returns an array of strings, one for each file in the directory. - virtual QStringList list() const = 0; - - // Returns true iff a file with the given name exists. - virtual bool fileExists(const QString& name) const = 0; - - // Returns the time the named file was last modified. - virtual int64_t fileModified(const QString& name) const = 0; - - // Returns the length of a file in the directory. - virtual int64_t fileLength(const QString& name) const = 0; - - // Returns a stream reading an existing file. - virtual IndexInput* openInput(const QString& name) = 0; - virtual IndexInput* openInput(const QString& name, int32_t bufferSize) - { - // didnt overload bufferSize - return openInput(name); - } - - // Set the modified time of an existing file to now. - virtual void touchFile(const QString& name) = 0; - - // Removes an existing file in the directory. - virtual bool deleteFile(const QString& name, const bool throwError = true) { - bool ret = doDeleteFile(name); - if (!ret && throwError) { - char buffer[200]; - _snprintf(buffer, 200, "couldn't delete file %s", - name.toLocal8Bit().constData()); - _CLTHROWA(CL_ERR_IO, buffer); - } - return ret; - } - - // Renames an existing file in the directory. - // If a file already exists with the new name, then it is replaced. - virtual void renameFile(const QString& from, const QString& to) = 0; - - // Creates a new, empty file in the directory with the given name. - // Returns a stream writing this file. - virtual IndexOutput* createOutput(const QString& name) = 0; - - // Construct a {@link Lock}. - // @param name the name of the lock file - virtual LuceneLock* makeLock(const QString& name) = 0; - - // Closes the store. - virtual void close() = 0; - - virtual QString toString() const = 0; - - virtual QString getDirectoryType() const = 0; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp b/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp deleted file mode 100644 index 5f96e91cd..000000000 --- a/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp +++ /dev/null @@ -1,662 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#include -#include -#include -#include -#include - -#include "CLucene/StdHeader.h" -#include "FSDirectory.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/Misc.h" -#include "CLucene/debug/condition.h" - -CL_NS_DEF(store) -CL_NS_USE(util) - -bool FSDirectory::disableLocks = false; - -// This cache of directories ensures that there is a unique Directory instance -// per path, so that synchronization on the Directory can be used to synchronize -// access between readers and writers. -static CL_NS(util)::CLHashMap DIRECTORIES(false, false); - -// # pragma mark -- FSDirectory::FSLock - -FSDirectory::FSLock::FSLock(const QString& _lockDir, const QString& name) - : lockDir(_lockDir) - , lockFile(_lockDir + QDir::separator() + name) -{ -} - -FSDirectory::FSLock::~FSLock() -{ -} - -bool FSDirectory::FSLock::obtain() -{ - if (disableLocks) - return true; - - if (QFile::exists(lockFile)) - return false; - - QDir dir(lockDir); - if (!dir.exists()) { - if (!dir.mkpath(lockDir)) { - // 34: len of "Couldn't create lock directory: " - char* err = _CL_NEWARRAY( - char, 34 + strlen(lockDir.toLocal8Bit().constData()) + 1); - strcpy(err, "Couldn't create lock directory: "); - strcat(err, lockDir.toLocal8Bit().constData()); - _CLTHROWA_DEL(CL_ERR_IO, err); - } - } - - QFile file(lockFile); - return file.open(QIODevice::ReadWrite); -} - -void FSDirectory::FSLock::release() -{ - if (disableLocks) - return; - - QFile file(lockFile); - file.remove(); -} - -bool FSDirectory::FSLock::isLocked() -{ - if (disableLocks) - return false; - return QFile::exists(lockFile); -} - -QString FSDirectory::FSLock::toString() const -{ - QString ret(QLatin1String("Lock@")); - return ret.append(lockFile); -} - -// # pragma mark -- FSDirectory::FSIndexInput - -FSDirectory::FSIndexInput::FSIndexInput(const QString& path, int32_t bufferSize) - : BufferedIndexInput(bufferSize) -{ - CND_PRECONDITION(!path.isEmpty(), "path is NULL"); - - handle = _CLNEW SharedHandle(); - handle->fhandle.setFileName(path); - handle->fhandle.open(QIODevice::ReadOnly); - - if (handle->fhandle.error() != QFile::NoError) { - switch(handle->fhandle.error()) { - case 1: - _CLTHROWA(CL_ERR_IO, "An error occurred when reading from the file"); - break; - case 2: - _CLTHROWA(CL_ERR_IO, "An error occurred when writing to the file."); - break; - case 5: - _CLTHROWA(CL_ERR_IO, "The file could not be opened."); - break; - case 6: - _CLTHROWA(CL_ERR_IO, "The operation was aborted."); - break; - case 7: - _CLTHROWA(CL_ERR_IO, "A timeout occurred."); - break; - case 8: - _CLTHROWA(CL_ERR_IO, "An unspecified error occurred."); - break; - case 9: - _CLTHROWA(CL_ERR_IO, "The file could not be removed."); - break; - case 10: - _CLTHROWA(CL_ERR_IO, "The file could not be renamed."); - break; - case 11: - _CLTHROWA(CL_ERR_IO, "The position in the file could not be changed."); - break; - case 12: - _CLTHROWA(CL_ERR_IO, "The file could not be resized.e"); - break; - case 13: - _CLTHROWA(CL_ERR_IO, "The file could not be accessed."); - break; - case 14: - _CLTHROWA(CL_ERR_IO, "The file could not be copied."); - break; - case 4: - default: - _CLTHROWA(CL_ERR_IO, "A fatal error occurred."); - } - } - - //Store the file length - handle->_length = handle->fhandle.size(); - handle->_fpos = 0; - this->_pos = 0; -} - -FSDirectory::FSIndexInput::FSIndexInput(const FSIndexInput& other) - : BufferedIndexInput(other) -{ - if (other.handle == NULL) - _CLTHROWA(CL_ERR_NullPointer, "other handle is null"); - - SCOPED_LOCK_MUTEX(*other.handle->THIS_LOCK) - - _pos = other.handle->_fpos; - handle = _CL_POINTER(other.handle); -} - -FSDirectory::FSIndexInput::~FSIndexInput() -{ - FSIndexInput::close(); -} - -void FSDirectory::FSIndexInput::close() -{ - BufferedIndexInput::close(); -#ifdef _LUCENE_THREADMUTEX - if (handle != NULL) { - // Here we have a bit of a problem... We need to lock the handle to - // ensure that we can safely delete the handle... But if we delete the - // handle, then the scoped unlock, won't be able to unlock the mutex... - - // take a reference of the lock object... - _LUCENE_THREADMUTEX* mutex = handle->THIS_LOCK; - //lock the mutex - mutex->lock(); - - // determine if we are about to delete the handle... - bool doUnlock = (handle->__cl_refcount > 1); - // decdelete (deletes if refcount is down to 0) - _CLDECDELETE(handle); - - if (doUnlock) - mutex->unlock(); - else - delete mutex; - } -#else - _CLDECDELETE(handle); -#endif -} - -IndexInput* FSDirectory::FSIndexInput::clone() const -{ - return _CLNEW FSDirectory::FSIndexInput(*this); -} - -void FSDirectory::FSIndexInput::seekInternal(const int64_t position) -{ - CND_PRECONDITION(position >= 0 && position < handle->_length, - "Seeking out of range") - _pos = position; -} - -void FSDirectory::FSIndexInput::readInternal(uint8_t* b, const int32_t len) -{ - SCOPED_LOCK_MUTEX(*handle->THIS_LOCK) - - CND_PRECONDITION(handle != NULL, "shared file handle has closed"); - CND_PRECONDITION(handle->fhandle.isOpen(), "file is not open"); - - if (handle->_fpos != _pos) { - handle->fhandle.seek(_pos); - if (handle->fhandle.pos() != _pos) - _CLTHROWA( CL_ERR_IO, "File IO Seek error"); - handle->_fpos = _pos; - } - - bufferLength = (int32_t)handle->fhandle.read((char*)b, len); - if (bufferLength == 0) - _CLTHROWA(CL_ERR_IO, "read past EOF"); - - if (bufferLength == -1) - _CLTHROWA(CL_ERR_IO, "read error"); - - _pos += bufferLength; - handle->_fpos =_pos; -} - -// # pragma mark -- FSDirectory::FSIndexInput::SharedHandle - -FSDirectory::FSIndexInput::SharedHandle::SharedHandle() - : _fpos(0) - , _length(0) -{ -#ifdef _LUCENE_THREADMUTEX - THIS_LOCK = new _LUCENE_THREADMUTEX; -#endif -} - -FSDirectory::FSIndexInput::SharedHandle::~SharedHandle() -{ - if (fhandle.isOpen()) - fhandle.close(); -} - -// # pragma mark -- FSDirectory::FSIndexOutput - -FSDirectory::FSIndexOutput::FSIndexOutput(const QString& path) -{ - //O_BINARY - Opens file in binary (untranslated) mode - //O_CREAT - Creates and opens new file for writing. Has no effect if file specified by filename exists - //O_RANDOM - Specifies that caching is optimized for, but not restricted to, random access from disk. - //O_WRONLY - Opens file for writing only; - fhandle.setFileName(path); - fhandle.open(QIODevice::ReadWrite | QIODevice::Truncate); - - if (fhandle.error() != QFile::NoError) { - switch(fhandle.error()) { - case 1: - _CLTHROWA(CL_ERR_IO, "An error occurred when reading from the file"); - break; - case 2: - _CLTHROWA(CL_ERR_IO, "An error occurred when writing to the file."); - break; - case 5: - _CLTHROWA(CL_ERR_IO, "The file could not be opened."); - break; - case 6: - _CLTHROWA(CL_ERR_IO, "The operation was aborted."); - break; - case 7: - _CLTHROWA(CL_ERR_IO, "A timeout occurred."); - break; - case 8: - _CLTHROWA(CL_ERR_IO, "An unspecified error occurred."); - break; - case 9: - _CLTHROWA(CL_ERR_IO, "The file could not be removed."); - break; - case 10: - _CLTHROWA(CL_ERR_IO, "The file could not be renamed."); - break; - case 11: - _CLTHROWA(CL_ERR_IO, "The position in the file could not be changed."); - break; - case 12: - _CLTHROWA(CL_ERR_IO, "The file could not be resized.e"); - break; - case 13: - _CLTHROWA(CL_ERR_IO, "The file could not be accessed."); - break; - case 14: - _CLTHROWA(CL_ERR_IO, "The file could not be copied."); - break; - case 4: - default: - _CLTHROWA(CL_ERR_IO, "A fatal error occurred."); - } - } -} - -FSDirectory::FSIndexOutput::~FSIndexOutput() -{ - if (fhandle.isOpen()) { - try { - FSIndexOutput::close(); - } catch (CLuceneError& err) { - //ignore IO errors... - if (err.number() != CL_ERR_IO) - throw; - } - } -} - -void FSDirectory::FSIndexOutput::close() -{ - try { - BufferedIndexOutput::close(); - } catch (CLuceneError& err) { - //ignore IO errors... - if (err.number() != CL_ERR_IO) - throw; - } - fhandle.close(); -} - -int64_t FSDirectory::FSIndexOutput::length() -{ - CND_PRECONDITION(fhandle.isOpen(), "file is not open"); - return fhandle.size(); -} - -void FSDirectory::FSIndexOutput::seek(const int64_t pos) -{ - CND_PRECONDITION(fhandle.isOpen(), "file is not open"); - - BufferedIndexOutput::seek(pos); - fhandle.seek(pos); - if (fhandle.pos() != pos) - _CLTHROWA(CL_ERR_IO, "File IO Seek error"); -} - -void FSDirectory::FSIndexOutput::flushBuffer(const uint8_t* b, const int32_t size) -{ - CND_PRECONDITION(fhandle.isOpen(), "file is not open"); - - if (size > 0 && fhandle.write((const char*)b, size) != size) - _CLTHROWA(CL_ERR_IO, "File IO Write error"); -} - -// # pragma mark -- FSDirectory - -FSDirectory::FSDirectory(const QString& path, const bool createDir) - : Directory() - , refCount(0) - , useMMap(false) -{ - //set a realpath so that if we change directory, we can still function - directory = QFileInfo(path).absoluteFilePath(); - lockDir = directory; - - QDir dir(lockDir); - if (!dir.exists()) { - if (!dir.mkpath(lockDir)) - _CLTHROWA_DEL(CL_ERR_IO, "Cannot create temp directory"); - } - - QFileInfo info(lockDir); - if (info.isFile() || info.isSymLink()) - _CLTHROWA(CL_ERR_IO, "Found regular file where directory expected"); - - if (createDir) - create(); - - dir.setPath(directory); - if (!dir.exists()) { - //19: len of " is not a directory" - char* err = - _CL_NEWARRAY(char, 19 + strlen(path.toLocal8Bit().constData()) + 1); - strcpy(err, path.toLocal8Bit().constData()); - strcat(err, " is not a directory"); - _CLTHROWA_DEL(CL_ERR_IO, err); - } -} - -void FSDirectory::create() -{ - SCOPED_LOCK_MUTEX(THIS_LOCK) - - bool clear = false; - QDir dir(directory); - if (!dir.exists()) { - if (!dir.mkpath(directory)) { - char* err = _CL_NEWARRAY( // 27 len of "Couldn't create directory:" - char, 27 + strlen(directory.toLocal8Bit().constData()) + 1); - strcpy(err, "Couldn't create directory: "); - strcat(err, directory.toLocal8Bit().constData()); - _CLTHROWA_DEL(CL_ERR_IO, err); - } - } else { - clear = true; - } - - QFileInfo info(directory); - if (info.isFile() || info.isSymLink()) { - char tmp[1024]; - _snprintf(tmp, 1024, "%s not a directory", - directory.toLocal8Bit().constData()); - _CLTHROWA(CL_ERR_IO, tmp); - } - - if (clear) { - dir.setPath(directory); - // clear probably existing lucene index files - QStringList fileList = dir.entryList(QDir::Files | QDir::Hidden - | QDir::NoSymLinks); - foreach(const QString file, fileList) { - if (CL_NS(index)::IndexReader::isLuceneFile(file)) { - if (!dir.remove(file)) - _CLTHROWA(CL_ERR_IO, "Couldn't delete file "); - } - } - - // clear probably existing file locks - QFileInfo dirInfo(lockDir); - if (dirInfo.exists() && dirInfo.isReadable() && dirInfo.isWritable() - && !dirInfo.isFile() && !dirInfo.isSymLink()) { - QDir lockDirectory(lockDir); - fileList = dir.entryList(QStringList() << getLockPrefix() - + QLatin1Char('*'), QDir::Files | QDir::Hidden | QDir::NoSymLinks); - - foreach(const QString file, fileList) { - if (!lockDirectory.remove(file)) - _CLTHROWA(CL_ERR_IO, "Couldn't delete file "); - } - } - else { - //todo: richer error: + lockDir.getAbsolutePath()); - _CLTHROWA(CL_ERR_IO, "Cannot read lock directory"); - } - } -} - -void FSDirectory::priv_getFN(QString& buffer, const QString& name) const -{ - buffer.clear(); - buffer.append(directory); - buffer.append(QDir::separator()); - buffer.append(name); -} - -FSDirectory::~FSDirectory() -{ -} - -QStringList FSDirectory::list() const -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QDir dir(directory); - return dir.entryList(QDir::Files | QDir::Hidden); -} - -bool FSDirectory::fileExists(const QString& name) const -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QDir dir(directory); - return dir.entryList().contains(name); -} - -QString FSDirectory::getDirName() const -{ - return directory; -} - -//static -FSDirectory* FSDirectory::getDirectory(const QString& file, const bool _create) -{ - FSDirectory* dir = NULL; - { - if (file.isEmpty()) - _CLTHROWA(CL_ERR_IO, "Invalid directory"); - - SCOPED_LOCK_MUTEX(DIRECTORIES.THIS_LOCK) - dir = DIRECTORIES.get(file); - if ( dir == NULL ){ - dir = _CLNEW FSDirectory(file, _create); - DIRECTORIES.put(dir->directory, dir); - } else if (_create) { - dir->create(); - } - - { - SCOPED_LOCK_MUTEX(dir->THIS_LOCK) - dir->refCount++; - } - } - - return _CL_POINTER(dir); -} - -int64_t FSDirectory::fileModified(const QString& name) const -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QFileInfo fInfo(directory + QDir::separator() + name); - return fInfo.lastModified().toTime_t(); -} - -//static -int64_t FSDirectory::fileModified(const QString& dir, const QString& name) -{ - QFileInfo fInfo(dir + QDir::separator() + name); - return fInfo.lastModified().toTime_t(); -} - -void FSDirectory::touchFile(const QString& name) -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QFile file(directory + QDir::separator() + name); - if (!file.open(QIODevice::ReadWrite)) - _CLTHROWA(CL_ERR_IO, "IO Error while touching file"); -} - -int64_t FSDirectory::fileLength(const QString& name) const -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QFileInfo fInfo(directory + QDir::separator() + name); - return fInfo.size(); -} - -IndexInput* FSDirectory::openInput(const QString& name) -{ - return openInput(name, CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); -} - -IndexInput* FSDirectory::openInput(const QString& name, int32_t bufferSize ) -{ - CND_PRECONDITION(directory[0]!=0,"directory is not open") - - return _CLNEW FSIndexInput(directory + QDir::separator() + name, bufferSize); -} - -void FSDirectory::close() -{ - SCOPED_LOCK_MUTEX(DIRECTORIES.THIS_LOCK) - { - SCOPED_LOCK_MUTEX(THIS_LOCK) - - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - //refcount starts at 1 - if (--refCount <= 0) { - Directory* dir = DIRECTORIES.get(getDirName()); - if (dir) { - //this will be removed in ~FSDirectory - DIRECTORIES.remove(getDirName()); - _CLDECDELETE(dir); - } - } - } -} - -QString FSDirectory::getLockPrefix() const -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QString dirName(QFileInfo(directory).absoluteFilePath()); - if (dirName.isEmpty()) - _CLTHROWA(CL_ERR_Runtime, "Invalid directory path"); - - // to be compatible with jlucene, - // we need to make some changes ... - if (dirName.at(1) == QLatin1Char(':')) - dirName[0] = dirName.at(0).toUpper(); - - TCHAR tBuffer[2048] = { 0 }; - dirName.toWCharArray(tBuffer); - - char aBuffer[4096] = { 0 }; - STRCPY_TtoA(aBuffer, tBuffer, 4096); - - QString string(QLatin1String("lucene-")); - QByteArray hash(QCryptographicHash::hash(aBuffer, QCryptographicHash::Md5)); - - // TODO: verify this !!! - return string.append(QLatin1String(hash.toHex().constData())); -} - -bool FSDirectory::doDeleteFile(const QString& name) -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QDir dir(directory); - return dir.remove(name); -} - -void FSDirectory::renameFile(const QString& from, const QString& to) -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - SCOPED_LOCK_MUTEX(THIS_LOCK) - - if (fileExists(to)) - deleteFile(to, false); - - QFile file(directory + QDir::separator() + from); - QString newFile(directory + QDir::separator() + to); - if (!file.rename(newFile)) { - // try a second time if we fail - if (fileExists(to)) - deleteFile(to, false); - - if (!file.rename(newFile)) { - QString error(QLatin1String("Could not rename: %1 to %2!!!!")); - error.arg(from).arg(newFile); - QByteArray bArray(error.toLocal8Bit()); - _CLTHROWA(CL_ERR_IO, bArray.constData()); - } - } -} - -IndexOutput* FSDirectory::createOutput(const QString& name) -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - QString file = directory + QDir::separator() + name; - if (QFileInfo(file).exists()) { - if (!QFile::remove(file)) { - QByteArray bArray("Cannot overwrite: "); - bArray.append(name.toLocal8Bit()); - _CLTHROWA(CL_ERR_IO, bArray.constData()); - } - } - return _CLNEW FSIndexOutput(file); -} - -LuceneLock* FSDirectory::makeLock(const QString& name) -{ - CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); - - - QString lockFile(getLockPrefix()); - lockFile.append(QLatin1Char('-')).append(name); - - return _CLNEW FSLock(lockDir, lockFile); -} - -QString FSDirectory::toString() const -{ - return QString::fromLatin1("FSDirectory@").append(directory); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/store/FSDirectory.h b/3rdparty/clucene/src/CLucene/store/FSDirectory.h deleted file mode 100644 index e967380e0..000000000 --- a/3rdparty/clucene/src/CLucene/store/FSDirectory.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#ifndef _lucene_store_FSDirectory_ -#define _lucene_store_FSDirectory_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include -#include - -#include "Directory.h" -#include "Lock.h" -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/StringBuffer.h" - -CL_NS_DEF(store) - -/** -* Straightforward implementation of {@link Directory} as a directory of files. -*

If the system property 'disableLuceneLocks' has the String value of -* "true", lock creation will be disabled. -* -* @see Directory -*/ -class FSDirectory : public Directory -{ -public: - // Destructor - only call this if you are sure the directory - // is not being used anymore. Otherwise use the ref-counting - // facilities of _CLDECDELETE - ~FSDirectory(); - - // Get a list of strings, one for each file in the directory. - QStringList list() const; - - // Returns true iff a file with the given name exists. - bool fileExists(const QString& name) const; - - // Returns the text name of the directory - QString getDirName() const; ///Directories are cached, so that, for a given canonical path, the same - FSDirectory instance will always be returned. This permits - synchronization on directories. - - @param file the path to the directory. - @param create if true, create, or erase any existing contents. - @return the FSDirectory for the named file. - */ - static FSDirectory* getDirectory(const QString& file, const bool create); - - // Returns the time the named file was last modified. - int64_t fileModified(const QString& name) const; - - //static - // Returns the time the named file was last modified. - static int64_t fileModified(const QString& dir, const QString& name); - - // static - // Returns the length in bytes of a file in the directory. - int64_t fileLength(const QString& name) const; - - // Returns a stream reading an existing file. - IndexInput* openInput(const QString& name); - IndexInput* openInput(const QString& name, int32_t bufferSize); - - // Renames an existing file in the directory. - void renameFile(const QString& from, const QString& to); - - // Set the modified time of an existing file to now. - void touchFile(const QString& name); - - // Creates a new, empty file in the directory with the given name. - // Returns a stream writing this file. - IndexOutput* createOutput(const QString& name); - - // Construct a {@link Lock}. - // @param name the name of the lock file - LuceneLock* makeLock(const QString& name); - - // Decrease the ref-count to the directory by one. If the object is no - // longer needed, then the object is removed from the directory pool. - void close(); - - // If MMap is available, this can disable use of mmap reading. - void setUseMMap(bool value) { useMMap = value; } - - // Gets whether the directory is using MMap for inputstreams. - bool getUseMMap() const { return useMMap; } - - QString toString() const; - - static QString DirectoryType() { return QLatin1String("FS"); } - QString getDirectoryType() const { return QLatin1String("FS"); } - - // Set whether Lucene's use of lock files is disabled. By default, - // lock files are enabled. They should only be disabled if the index - // is on a read-only medium like a CD-ROM. - static void setDisableLocks(bool doDisableLocks) - { disableLocks = doDisableLocks; } - - // Returns whether Lucene's use of lock files is disabled. - // @return true if locks are disabled, false if locks are enabled. - static bool getDisableLocks() { return disableLocks; } - -protected: - FSDirectory(const QString& path, const bool createDir); - // Removes an existing file in the directory. - bool doDeleteFile(const QString& name); - -private: - class FSLock : public LuceneLock { - public: - FSLock (const QString& lockDir, const QString& name); - ~FSLock(); - - bool obtain(); - void release(); - bool isLocked(); - QString toString() const; - - QString lockDir; - QString lockFile; - }; - friend class FSDirectory::FSLock; - - class FSIndexInput : public BufferedIndexInput { - public: - FSIndexInput(const QString& path, int32_t bufferSize = - CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); - ~FSIndexInput(); - - void close(); - IndexInput* clone() const; - - int64_t length() - { return handle->_length; } - - QString getDirectoryType() const - { return FSDirectory::DirectoryType(); } - - protected: - FSIndexInput(const FSIndexInput& clone); - // Random-access methods - void seekInternal(const int64_t position); - // IndexInput methods - void readInternal(uint8_t* b, const int32_t len); - - private: - // We used a shared handle between all the fsindexinput clones. - // This reduces number of file handles we need, and it means - // we dont have to use file tell (which is slow) before doing a read. - class SharedHandle : LUCENE_REFBASE { - public: - SharedHandle(); - ~SharedHandle(); - - int64_t _fpos; - int64_t _length; - - QFile fhandle; - DEFINE_MUTEX(*THIS_LOCK) - }; - SharedHandle* handle; - int64_t _pos; - }; - friend class FSDirectory::FSIndexInput; - - class FSIndexOutput : public BufferedIndexOutput { - public: - FSIndexOutput(const QString& path); - ~FSIndexOutput(); - - void close(); - int64_t length(); - void seek(const int64_t pos); - - protected: - void flushBuffer(const uint8_t* b, const int32_t size); - - private: - QFile fhandle; - }; - friend class FSDirectory::FSIndexOutput; - -private: - QString directory; - int refCount; - void create(); - - QString lockDir; - QString getLockPrefix() const; - static bool disableLocks; - - void priv_getFN(QString& buffer, const QString& name) const; - bool useMMap; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/store/IndexInput.cpp b/3rdparty/clucene/src/CLucene/store/IndexInput.cpp deleted file mode 100644 index cf7bd16b7..000000000 --- a/3rdparty/clucene/src/CLucene/store/IndexInput.cpp +++ /dev/null @@ -1,233 +0,0 @@ - /*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "IndexInput.h" - -CL_NS_USE(util) -CL_NS_DEF(store) - - IndexInput::IndexInput() - { - } - IndexInput::IndexInput(const IndexInput& other) - { - } - - int32_t IndexInput::readInt() { - int32_t b = (readByte() << 24); - b |= (readByte() << 16); - b |= (readByte() << 8); - return (b | readByte()); - } - - int32_t IndexInput::readVInt() { - uint8_t b = readByte(); - int32_t i = b & 0x7F; - for (int32_t shift = 7; (b & 0x80) != 0; shift += 7) { - b = readByte(); - i |= (b & 0x7F) << shift; - } - return i; - } - - int64_t IndexInput::readLong() { - int64_t i = ((int64_t)readInt() << 32); - return (i | ((int64_t)readInt() & 0xFFFFFFFFL)); - } - - int64_t IndexInput::readVLong() { - uint8_t b = readByte(); - int64_t i = b & 0x7F; - for (int32_t shift = 7; (b & 0x80) != 0; shift += 7) { - b = readByte(); - i |= (((int64_t)b) & 0x7FL) << shift; - } - return i; - } - - void IndexInput::skipChars( const int32_t count) { - for (int32_t i = 0; i < count; i++) { - TCHAR b = readByte(); - if ((b & 0x80) == 0) { - // Do Nothing. - } else if ((b & 0xE0) != 0xE0) { - readByte(); - } else { - readByte(); - readByte(); - } - } - } - - int32_t IndexInput::readString(TCHAR* buffer, const int32_t maxLength){ - int32_t len = readVInt(); - int32_t ml=maxLength-1; - if ( len >= ml ){ - readChars(buffer, 0, ml); - buffer[ml] = 0; - //we have to finish reading all the data for this string! - if ( len-ml > 0 ){ - //seek(getFilePointer()+(len-ml)); <- that was the wrong way to "finish reading" - skipChars(len-ml); - } - return ml; - }else{ - readChars(buffer, 0, len); - buffer[len] = 0; - return len; - } - } - - TCHAR* IndexInput::readString(const bool _unique){ - int32_t len = readVInt(); - - if ( len == 0){ - if ( _unique ) //todo: does non unique ever occur? - return stringDuplicate(LUCENE_BLANK_STRING); - else - return LUCENE_BLANK_STRING; - } - - TCHAR* ret = _CL_NEWARRAY(TCHAR,len+1); - readChars(ret, 0, len); - ret[len] = 0; - - return ret; - } - - void IndexInput::readChars( TCHAR* buffer, const int32_t start, const int32_t len) { - const int32_t end = start + len; - TCHAR b; - for (int32_t i = start; i < end; ++i) { - b = readByte(); - if ((b & 0x80) == 0) { - b = (b & 0x7F); - } else if ((b & 0xE0) != 0xE0) { - b = (((b & 0x1F) << 6) - | (readByte() & 0x3F)); - } else { - b = ((b & 0x0F) << 12) | ((readByte() & 0x3F) << 6); - b |= (readByte() & 0x3F); - } - buffer[i] = b; - } - } - - - - - - -BufferedIndexInput::BufferedIndexInput(int32_t _bufferSize): - buffer(NULL), - bufferSize(_bufferSize), - bufferStart(0), - bufferLength(0), - bufferPosition(0) - { - } - - BufferedIndexInput::BufferedIndexInput(const BufferedIndexInput& other): - IndexInput(other), - buffer(NULL), - bufferSize(other.bufferSize), - bufferStart(other.bufferStart), - bufferLength(other.bufferLength), - bufferPosition(other.bufferPosition) - { - /* DSR: Does the fact that sometime clone.buffer is not NULL even when - ** clone.bufferLength is zero indicate memory corruption/leakage? - ** if ( clone.buffer != NULL) { */ - if (other.bufferLength != 0 && other.buffer != NULL) { - buffer = _CL_NEWARRAY(uint8_t,bufferLength); - memcpy(buffer,other.buffer,bufferLength * sizeof(uint8_t)); - } - } - - void BufferedIndexInput::readBytes(uint8_t* b, const int32_t len){ - if (len < bufferSize) { - for (int32_t i = 0; i < len; ++i) // read byte-by-byte - b[i] = readByte(); - } else { // read all-at-once - int64_t start = getFilePointer(); - seekInternal(start); - readInternal(b, len); - - bufferStart = start + len; // adjust stream variables - bufferPosition = 0; - bufferLength = 0; // trigger refill() on read - } - } - - int64_t BufferedIndexInput::getFilePointer() const{ - return bufferStart + bufferPosition; - } - - void BufferedIndexInput::seek(const int64_t pos) { - if ( pos < 0 ) - _CLTHROWA(CL_ERR_IO, "IO Argument Error. Value must be a positive value."); - if (pos >= bufferStart && pos < (bufferStart + bufferLength)) - bufferPosition = (int32_t)(pos - bufferStart); // seek within buffer - else { - bufferStart = pos; - bufferPosition = 0; - bufferLength = 0; // trigger refill() on read() - seekInternal(pos); - } - } - void BufferedIndexInput::close(){ - _CLDELETE_ARRAY(buffer); - bufferLength = 0; - bufferPosition = 0; - bufferStart = 0; - } - - - BufferedIndexInput::~BufferedIndexInput(){ - BufferedIndexInput::close(); - } - - void BufferedIndexInput::refill() { - int64_t start = bufferStart + bufferPosition; - int64_t end = start + bufferSize; - if (end > length()) // don't read past EOF - end = length(); - bufferLength = (int32_t)(end - start); - if (bufferLength == 0) - _CLTHROWA(CL_ERR_IO, "IndexInput read past EOF"); - - if (buffer == NULL){ - buffer = _CL_NEWARRAY(uint8_t,bufferSize); // allocate buffer lazily - } - readInternal(buffer, bufferLength); - - - bufferStart = start; - bufferPosition = 0; - } - - -IndexInputStream::IndexInputStream(IndexInput* input){ - this->input = input; - this->size = input->length(); - this->position = input->getFilePointer(); -} -IndexInputStream::~IndexInputStream(){ -} -int32_t IndexInputStream::fillBuffer(char* start, int32_t space){ - int64_t avail = input->length()-input->getFilePointer(); - if ( avail == 0 ) - return -1; - else if ( availreadBytes((uint8_t*)start,space); - return space; -} - -CL_NS_END - diff --git a/3rdparty/clucene/src/CLucene/store/IndexInput.h b/3rdparty/clucene/src/CLucene/store/IndexInput.h deleted file mode 100644 index 9453b5cf1..000000000 --- a/3rdparty/clucene/src/CLucene/store/IndexInput.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_store_IndexInput_ -#define _lucene_store_IndexInput_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/util/bufferedstream.h" -#include "IndexOutput.h" - -CL_NS_DEF(store) - - /** Abstract base class for input from a file in a {@link Directory}. A - * random-access input stream. Used for all Lucene index input operations. - * @see Directory - * @see IndexOutput - */ - class IndexInput: LUCENE_BASE { - private: - void skipChars( const int32_t count); - protected: - IndexInput(); - IndexInput(const IndexInput& clone); - public: - virtual ~IndexInput(){} - virtual IndexInput* clone() const =0; - - DEFINE_MUTEX(THIS_LOCK) - - /** Reads and returns a single byte. - * @see IndexOutput#writeByte(byte) - */ - virtual uint8_t readByte() =0; - - /** Reads a specified number of bytes into an array at the specified offset. - * @param b the array to read bytes into - * @param offset the offset in the array to start storing bytes - * @param len the number of bytes to read - * @see IndexOutput#writeBytes(byte[],int32_t) - */ - virtual void readBytes(uint8_t* b, const int32_t len) =0; - - /** Reads four bytes and returns an int. - * @see IndexOutput#writeInt(int32_t) - */ - int32_t readInt(); - - /** Reads an int stored in variable-length format. Reads between one and - * five bytes. Smaller values take fewer bytes. Negative numbers are not - * supported. - * @see IndexOutput#writeVInt(int32_t) - */ - virtual int32_t readVInt(); - - /** Reads eight bytes and returns a long. - * @see IndexOutput#writeLong(long) - */ - int64_t readLong(); - - /** Reads a long stored in variable-length format. Reads between one and - * nine bytes. Smaller values take fewer bytes. Negative numbers are not - * supported. */ - int64_t readVLong(); - - /** Reads a string. - * @see IndexOutput#writeString(String) - * maxLength is the amount read into the buffer, the whole string is still read from the stream - * returns the amount read - */ - int32_t readString(TCHAR* buffer, const int32_t maxlength); - - /** Reads a string. - * @see IndexOutput#writeString(String) - * If unique is true (default) the string will be duplicated. - * If false and the length is zero, LUCENE_BLANK_STRING is returned - */ - TCHAR* readString(const bool unique=true); - - - /** Reads UTF-8 encoded characters into an array. - * @param buffer the array to read characters into - * @param start the offset in the array to start storing characters - * @param length the number of characters to read - * @see IndexOutput#writeChars(String,int32_t,int32_t) - */ - void readChars( TCHAR* buffer, const int32_t start, const int32_t len); - - /** Closes the stream to futher operations. */ - virtual void close() =0; - - /** Returns the current position in this file, where the next read will - * occur. - * @see #seek(long) - */ - virtual int64_t getFilePointer() const =0; - - /** Sets current position in this file, where the next read will occur. - * @see #getFilePointer() - */ - virtual void seek(const int64_t pos) =0; - - /** The number of bytes in the file. */ - virtual int64_t length() = 0; - - virtual QString getDirectoryType() const = 0; - }; - - /** Abstract base class for input from a file in a {@link Directory}. A - * random-access input stream. Used for all Lucene index input operations. - * @see Directory - * @see IndexOutput - */ - class BufferedIndexInput: public IndexInput{ - private: - uint8_t* buffer; //array of bytes - void refill(); - protected: - int32_t bufferSize; //size of the buffer - int64_t bufferStart; // position in file of buffer - int32_t bufferLength; // end of valid l_byte_ts - int32_t bufferPosition; // next uint8_t to read - - /** Returns a clone of this stream. - * - *

Clones of a stream access the same data, and are positioned at the same - * point as the stream they were cloned from. - * - *

Expert: Subclasses must ensure that clones may be positioned at - * different points in the input from each other and from the stream they - * were cloned from. - */ - BufferedIndexInput(const BufferedIndexInput& clone); - BufferedIndexInput(int32_t bufferSize = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); - public: - - virtual ~BufferedIndexInput(); - virtual IndexInput* clone() const = 0; - void close(); - inline uint8_t readByte(){ - if (bufferPosition >= bufferLength) - refill(); - - return buffer[bufferPosition++]; - } - void readBytes(uint8_t* b, const int32_t len); - int64_t getFilePointer() const; - void seek(const int64_t pos); - - protected: - /** Expert: implements buffer refill. Reads bytes from the current position - * in the input. - * @param b the array to read bytes into - * @param offset the offset in the array to start storing bytes - * @param length the number of bytes to read - */ - virtual void readInternal(uint8_t* b, const int32_t len) = 0; - - /** Expert: implements seek. Sets current position in this file, where the - * next {@link #readInternal(byte[],int32_t,int32_t)} will occur. - * @see #readInternal(byte[],int32_t,int32_t) - */ - virtual void seekInternal(const int64_t pos) = 0; - }; - - /** - * JStream InputStream which reads from an IndexInput. This class is - * used by the FieldReader to create binary fields. You can then use - * a GZipInputStream to read compressed data or any of the other - * JStream stream types. - * - */ - class IndexInputStream: public jstreams::BufferedInputStream{ - IndexInput* input; - public: - IndexInputStream(IndexInput* input); - ~IndexInputStream(); - int32_t fillBuffer(char* start, int32_t space); - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp b/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp deleted file mode 100644 index 04f78c348..000000000 --- a/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "IndexOutput.h" - -CL_NS_USE(util) -CL_NS_DEF(store) - - - IndexOutput::IndexOutput() - { - } - - IndexOutput::~IndexOutput(){ - } - - BufferedIndexOutput::BufferedIndexOutput() - { - buffer = _CL_NEWARRAY(uint8_t, BUFFER_SIZE ); - bufferStart = 0; - bufferPosition = 0; - } - - BufferedIndexOutput::~BufferedIndexOutput(){ - if ( buffer != NULL ) - close(); - } - - void BufferedIndexOutput::close(){ - flush(); - _CLDELETE_ARRAY( buffer ); - - bufferStart = 0; - bufferPosition = 0; - } - - void BufferedIndexOutput::writeByte(const uint8_t b) { - CND_PRECONDITION(buffer!=NULL,"IndexOutput is closed") - if (bufferPosition >= BUFFER_SIZE) - flush(); - buffer[bufferPosition++] = b; - } - - void BufferedIndexOutput::writeBytes(const uint8_t* b, const int32_t length) { - if ( length < 0 ) - _CLTHROWA(CL_ERR_IllegalArgument, "IO Argument Error. Value must be a positive value."); - int32_t bytesLeft = BUFFER_SIZE - bufferPosition; - // is there enough space in the buffer? - if (bytesLeft >= length) { - // we add the data to the end of the buffer - memcpy(buffer + bufferPosition, b, length); - bufferPosition += length; - // if the buffer is full, flush it - if (BUFFER_SIZE - bufferPosition == 0) - flush(); - } else { - // is data larger then buffer? - if (length > BUFFER_SIZE) { - // we flush the buffer - if (bufferPosition > 0) - flush(); - // and write data at once - flushBuffer(b, length); - bufferStart += length; - } else { - // we fill/flush the buffer (until the input is written) - int64_t pos = 0; // position in the input data - int32_t pieceLength; - while (pos < length) { - if ( length - pos < bytesLeft ) - pieceLength = length - pos; - else - pieceLength = bytesLeft; - memcpy(buffer + bufferPosition, b + pos, pieceLength); - pos += pieceLength; - bufferPosition += pieceLength; - // if the buffer is full, flush it - bytesLeft = BUFFER_SIZE - bufferPosition; - if (bytesLeft == 0) { - flush(); - bytesLeft = BUFFER_SIZE; - } - } - } - } - } - - void IndexOutput::writeInt(const int32_t i) { - writeByte((uint8_t)(i >> 24)); - writeByte((uint8_t)(i >> 16)); - writeByte((uint8_t)(i >> 8)); - writeByte((uint8_t) i); - } - - void IndexOutput::writeVInt(const int32_t vi) { - uint32_t i = vi; - while ((i & ~0x7F) != 0) { - writeByte((uint8_t)((i & 0x7f) | 0x80)); - i >>= 7; //doing unsigned shift - } - writeByte( (uint8_t)i ); - } - - void IndexOutput::writeLong(const int64_t i) { - writeInt((int32_t) (i >> 32)); - writeInt((int32_t) i); - } - - void IndexOutput::writeVLong(const int64_t vi) { - uint64_t i = vi; - while ((i & ~0x7F) != 0) { - writeByte((uint8_t)((i & 0x7f) | 0x80)); - i >>= 7; //doing unsigned shift - } - writeByte((uint8_t)i); - } - - void IndexOutput::writeString(const TCHAR* s, const int32_t length ) { - writeVInt(length); - writeChars(s, 0, length); - } - - void IndexOutput::writeChars(const TCHAR* s, const int32_t start, const int32_t length){ - if ( length < 0 || start < 0 ) - _CLTHROWA(CL_ERR_IllegalArgument, "IO Argument Error. Value must be a positive value."); - - const int32_t end = start + length; - for (int32_t i = start; i < end; ++i) { - const int32_t code = (int32_t)s[i]; - if (code >= 0x01 && code <= 0x7F) - writeByte((uint8_t)code); - else if (((code >= 0x80) && (code <= 0x7FF)) || code == 0) { - writeByte((uint8_t)(0xC0 | (code >> 6))); - writeByte((uint8_t)(0x80 | (code & 0x3F))); - } else { - writeByte((uint8_t)(0xE0 | (((uint32_t)code) >> 12))); //unsigned shift - writeByte((uint8_t)(0x80 | ((code >> 6) & 0x3F))); - writeByte((uint8_t)(0x80 | (code & 0x3F))); - } - } - } - - - int64_t BufferedIndexOutput::getFilePointer() const{ - return bufferStart + bufferPosition; - } - - void BufferedIndexOutput::seek(const int64_t pos) { - flush(); - bufferStart = pos; - } - - void BufferedIndexOutput::flush() { - flushBuffer(buffer, bufferPosition); - bufferStart += bufferPosition; - bufferPosition = 0; - } - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/store/IndexOutput.h b/3rdparty/clucene/src/CLucene/store/IndexOutput.h deleted file mode 100644 index c47ee73a7..000000000 --- a/3rdparty/clucene/src/CLucene/store/IndexOutput.h +++ /dev/null @@ -1,152 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_store_IndexOutput_ -#define _lucene_store_IndexOutput_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(store) - - -/** Abstract class for output to a file in a Directory. A random-access output -* stream. Used for all Lucene index output operations. -* @see Directory -* @see IndexInput -*/ -class IndexOutput:LUCENE_BASE{ - bool isclosed; -public: - IndexOutput(); - virtual ~IndexOutput(); - - /** Writes a single byte. - * @see IndexInput#readByte() - */ - virtual void writeByte(const uint8_t b) = 0; - - /** Writes an array of bytes. - * @param b the bytes to write - * @param length the number of bytes to write - * @see IndexInput#readBytes(byte[],int32_t,int32_t) - */ - virtual void writeBytes(const uint8_t* b, const int32_t length) = 0; - - /** Writes an int as four bytes. - * @see IndexInput#readInt() - */ - void writeInt(const int32_t i); - - /** Writes an int in a variable-length format. Writes between one and - * five bytes. Smaller values take fewer bytes. Negative numbers are not - * supported. - * @see IndexInput#readVInt() - */ - void writeVInt(const int32_t vi); - - /** Writes a long as eight bytes. - * @see IndexInput#readLong() - */ - void writeLong(const int64_t i); - - /** Writes an long in a variable-length format. Writes between one and five - * bytes. Smaller values take fewer bytes. Negative numbers are not - * supported. - * @see IndexInput#readVLong() - */ - void writeVLong(const int64_t vi); - - /** Writes a string. - * @see IndexInput#readString() - */ - void writeString(const TCHAR* s, const int32_t length); - - /** Writes a sequence of UTF-8 encoded characters from a string. - * @param s the source of the characters - * @param start the first character in the sequence - * @param length the number of characters in the sequence - * @see IndexInput#readChars(char[],int32_t,int32_t) - */ - void writeChars(const TCHAR* s, const int32_t start, const int32_t length); - - /** Closes this stream to further operations. */ - virtual void close() = 0; - - /** Returns the current position in this file, where the next write will - * occur. - * @see #seek(long) - */ - virtual int64_t getFilePointer() const = 0; - - /** Sets current position in this file, where the next write will occur. - * @see #getFilePointer() - */ - virtual void seek(const int64_t pos) = 0; - - /** The number of bytes in the file. */ - virtual int64_t length() = 0; - - /** Forces any buffered output to be written. */ - virtual void flush() = 0; -}; - -/** Base implementation class for buffered {@link IndexOutput}. */ -class BufferedIndexOutput : public IndexOutput{ -public: - LUCENE_STATIC_CONSTANT(int32_t, BUFFER_SIZE=LUCENE_STREAM_BUFFER_SIZE); -private: - uint8_t* buffer; - int64_t bufferStart; // position in file of buffer - int32_t bufferPosition; // position in buffer - -public: - BufferedIndexOutput(); - virtual ~BufferedIndexOutput(); - - /** Writes a single byte. - * @see IndexInput#readByte() - */ - virtual void writeByte(const uint8_t b); - - /** Writes an array of bytes. - * @param b the bytes to write - * @param length the number of bytes to write - * @see IndexInput#readBytes(byte[],int32_t,int32_t) - */ - virtual void writeBytes(const uint8_t* b, const int32_t length); - - /** Closes this stream to further operations. */ - virtual void close(); - - /** Returns the current position in this file, where the next write will - * occur. - * @see #seek(long) - */ - int64_t getFilePointer() const; - - /** Sets current position in this file, where the next write will occur. - * @see #getFilePointer() - */ - virtual void seek(const int64_t pos); - - /** The number of bytes in the file. */ - virtual int64_t length() = 0; - - /** Forces any buffered output to be written. */ - void flush(); - -protected: - /** Expert: implements buffer write. Writes bytes at the current position in - * the output. - * @param b the bytes to write - * @param len the number of bytes to write - */ - virtual void flushBuffer(const uint8_t* b, const int32_t len) = 0; -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/store/InputStream.h b/3rdparty/clucene/src/CLucene/store/InputStream.h deleted file mode 100644 index f56819eeb..000000000 --- a/3rdparty/clucene/src/CLucene/store/InputStream.h +++ /dev/null @@ -1,21 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_store_InputStream_ -#define _lucene_store_InputStream_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(store) - -deprecated... please use IndexInput.h header -and change InputStream to IndexInput - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/store/Lock.cpp b/3rdparty/clucene/src/CLucene/store/Lock.cpp deleted file mode 100644 index a66e784b0..000000000 --- a/3rdparty/clucene/src/CLucene/store/Lock.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Lock.h" - -CL_NS_DEF(store) - - bool LuceneLock::obtain(int64_t lockWaitTimeout) { - bool locked = obtain(); - int maxSleepCount = (int)(lockWaitTimeout / LOCK_POLL_INTERVAL); - int sleepCount = 0; - while (!locked) { - if (sleepCount++ == maxSleepCount) { - _CLTHROWA(CL_ERR_IO,"Lock obtain timed out"); - } - _LUCENE_SLEEP(LOCK_POLL_INTERVAL); - locked = obtain(); - } - return locked; - } - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/store/Lock.h b/3rdparty/clucene/src/CLucene/store/Lock.h deleted file mode 100644 index b5dda3b06..000000000 --- a/3rdparty/clucene/src/CLucene/store/Lock.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_store_Lock_ -#define _lucene_store_Lock_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(store) - -class LuceneLock : LUCENE_BASE -{ -public: - LUCENE_STATIC_CONSTANT(int64_t, LOCK_POLL_INTERVAL = 1000); - - virtual ~LuceneLock() {} - - // Attempts to obtain exclusive access and immediately return upon success - // or failure. Return true if exclusive access is obtained. - virtual bool obtain() = 0; - - // Attempts to obtain an exclusive lock within amount of time given. - // Currently polls once per second until lockWaitTimeout is passed. - // @param lockWaitTimeout length of time to wait in ms - // @return true if lock was obtained - // @throws IOException if lock wait times out or obtain() throws an IOException - bool obtain(int64_t lockWaitTimeout); - - // Release exclusive access. - virtual void release() = 0; - - // Returns true if the resource is currently locked. Note that one must - // still call {@link #obtain()} before using the resource. - virtual bool isLocked() = 0; - - virtual QString toString() const = 0; -}; - - -// Utility class for executing code with exclusive access. -template -class LuceneLockWith -{ -public: - // Constructs an executor that will grab the named lock. Defaults - // lockWaitTimeout to LUCENE_COMMIT_LOCK_TIMEOUT. - // @deprecated Kept only to avoid breaking existing code. - LuceneLockWith(LuceneLock* lock, int64_t lockWaitTimeout) - { - this->lock = lock; - this->lockWaitTimeout = lockWaitTimeout; - } - - virtual ~LuceneLockWith() {} - - // Calls {@link #doBody} while lock is obtained. Blocks if lock - // cannot be obtained immediately. Retries to obtain lock once per second - // until it is obtained, or until it has tried ten times. Lock is released - // when {@link #doBody} exits. - T runAndReturn() - { - bool locked = false; - T ret = NULL; - try { - locked = lock->obtain(lockWaitTimeout); - ret = doBody(); - } _CLFINALLY ( - if (locked) - lock->release(); - ); - return ret; - } - - // @see runAndReturn - // Same as runAndReturn, except doesn't return any value. The only - // difference is that no void values are used - void run() - { - bool locked = false; - try { - locked = lock->obtain(lockWaitTimeout); - doBody(); - } _CLFINALLY ( - if (locked) - lock->release(); - ); - } - -protected: - virtual T doBody() = 0; - -private: - LuceneLock* lock; - int64_t lockWaitTimeout; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/store/MMapInput.cpp b/3rdparty/clucene/src/CLucene/store/MMapInput.cpp deleted file mode 100644 index d660032c6..000000000 --- a/3rdparty/clucene/src/CLucene/store/MMapInput.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#if defined(LUCENE_FS_MMAP) - -#include "FSDirectory.h" -#include "CLucene/util/Misc.h" -#include "CLucene/debug/condition.h" - -#ifndef _CLCOMPILER_MSVC - #include -#endif - -CL_NS_DEF(store) -CL_NS_USE(util) - - FSDirectory::MMapIndexInput::MMapIndexInput(const char* path): - pos(0), - data(NULL), - _length(0), - isClone(false) - { - //Func - Constructor. - // Opens the file named path - //Pre - path != NULL - //Post - if the file could not be opened an exception is thrown. - - CND_PRECONDITION(path != NULL, "path is NULL"); - -#ifdef _CLCOMPILER_MSVC - mmaphandle = NULL; - fhandle = CreateFileA(path,GENERIC_READ,FILE_SHARE_READ, 0,OPEN_EXISTING,0,0); - - //Check if a valid fhandle was retrieved - if (fhandle < 0){ - DWORD err = GetLastError(); - if ( err == ERROR_FILE_NOT_FOUND ) - _CLTHROWA(CL_ERR_IO, "File does not exist"); - else if ( err == EACCES ) - _CLTHROWA(ERROR_ACCESS_DENIED, "File Access denied"); - else if ( err == ERROR_TOO_MANY_OPEN_FILES ) - _CLTHROWA(CL_ERR_IO, "Too many open files"); - else - _CLTHROWA(CL_ERR_IO, "File IO Error"); - } - - DWORD dummy=0; - _length = GetFileSize(fhandle,&dummy); - - if ( _length > 0 ){ - mmaphandle = CreateFileMappingA(fhandle,NULL,PAGE_READONLY,0,0,NULL); - if ( mmaphandle != NULL ){ - void* address = MapViewOfFile(mmaphandle,FILE_MAP_READ,0,0,0); - if ( address != NULL ){ - data = (uint8_t*)address; - return; //SUCCESS! - } - } - CloseHandle(mmaphandle); - - char* lpMsgBuf=0; - DWORD dw = GetLastError(); - - FormatMessageA( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - dw, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - lpMsgBuf, - 0, NULL ); - - char* errstr = _CL_NEWARRAY(char, strlen(lpMsgBuf)+40); - sprintf(errstr, "MMapIndexInput::MMapIndexInput failed with error %d: %s", dw, lpMsgBuf); - LocalFree(lpMsgBuf); - - _CLTHROWA_DEL(CL_ERR_IO,errstr); - } - -#else //_CLCOMPILER_MSVC - fhandle = ::open (path, O_RDONLY); - if (fhandle < 0){ - _CLTHROWA(CL_ERR_IO,strerror(errno)); - }else{ - // stat it - struct stat sb; - if (::fstat (fhandle, &sb)){ - _CLTHROWA(CL_ERR_IO,strerror(errno)); - }else{ - // get length from stat - _length = sb.st_size; - - // mmap the file - void* address = ::mmap(0, _length, PROT_READ, MAP_SHARED, fhandle, 0); - if (address == MAP_FAILED){ - _CLTHROWA(CL_ERR_IO,strerror(errno)); - }else{ - data = (uint8_t*)address; - } - } - } -#endif - } - - FSDirectory::MMapIndexInput::MMapIndexInput(const MMapIndexInput& clone): IndexInput(clone){ - //Func - Constructor - // Uses clone for its initialization - //Pre - clone is a valide instance of FSIndexInput - //Post - The instance has been created and initialized by clone - -#ifdef _CLCOMPILER_MSVC - mmaphandle = NULL; - fhandle = NULL; -#endif - - data = clone.data; - pos = clone.pos; - - //clone the file length - _length = clone._length; - //Keep in mind that this instance is a clone - isClone = true; - } - - uint8_t FSDirectory::MMapIndexInput::readByte(){ - return *(data+(pos++)); - } - - void FSDirectory::MMapIndexInput::readBytes(uint8_t* b, const int32_t len){ - memcpy(b, data+pos, len); - pos+=len; - } - int32_t FSDirectory::MMapIndexInput::readVInt(){ - uint8_t b = *(data+(pos++)); - int32_t i = b & 0x7F; - for (int shift = 7; (b & 0x80) != 0; shift += 7) { - b = *(data+(pos++)); - i |= (b & 0x7F) << shift; - } - return i; - } - int64_t FSDirectory::MMapIndexInput::getFilePointer() const{ - return pos; - } - void FSDirectory::MMapIndexInput::seek(const int64_t pos){ - this->pos=pos; - } - - FSDirectory::MMapIndexInput::~MMapIndexInput(){ - //Func - Destructor - //Pre - True - //Post - The file for which this instance is responsible has been closed. - // The instance has been destroyed - - close(); - } - - IndexInput* FSDirectory::MMapIndexInput::clone() const - { - return _CLNEW FSDirectory::MMapIndexInput(*this); - } - void FSDirectory::MMapIndexInput::close() { - //IndexInput::close(); - - if ( !isClone ){ -#ifdef _CLCOMPILER_MSVC - if ( data != NULL ){ - if ( ! UnmapViewOfFile(data) ){ - CND_PRECONDITION( false, "UnmapViewOfFile(data) failed"); //todo: change to rich error - } - } - - if ( mmaphandle != NULL ){ - if ( ! CloseHandle(mmaphandle) ){ - CND_PRECONDITION( false, "CloseHandle(mmaphandle) failed"); - } - } - if ( fhandle != NULL ){ - if ( !CloseHandle(fhandle) ){ - CND_PRECONDITION( false, "CloseHandle(fhandle) failed"); - } - } - mmaphandle = NULL; - fhandle = NULL; -#else - if ( data != NULL ) - ::munmap(data, _length); - if ( fhandle > 0 ) - ::close(fhandle); - fhandle = 0; -#endif - } - data = NULL; - pos = 0; - } - - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/store/OutputStream.h b/3rdparty/clucene/src/CLucene/store/OutputStream.h deleted file mode 100644 index a82d6718a..000000000 --- a/3rdparty/clucene/src/CLucene/store/OutputStream.h +++ /dev/null @@ -1,23 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_store_IndexOutput_ -#define _lucene_store_IndexOutput_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -CL_NS_DEF(store) - - -deprecated... please use IndexOutput.h header -and change OutputStream to OutdexInput - - - -CL_NS_END - -#endif // _lucene_store_IndexOutput_ diff --git a/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp b/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp deleted file mode 100644 index b0a7c4d64..000000000 --- a/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#include "CLucene/StdHeader.h" -#include "RAMDirectory.h" - -#include "Lock.h" -#include "Directory.h" -#include "FSDirectory.h" -#include "CLucene/index/IndexReader.h" -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Misc.h" -#include "CLucene/debug/condition.h" - -CL_NS_USE(util) -CL_NS_DEF(store) - -RAMFile::RAMFile() -{ - length = 0; - lastModified = Misc::currentTimeMillis(); -} - -RAMFile::~RAMFile() -{ -} - - -RAMDirectory::RAMLock::RAMLock(const QString& name, RAMDirectory* dir) - : directory(dir) -{ - fname = name; -} - -RAMDirectory::RAMLock::~RAMLock() -{ - directory = NULL; -} - -QString RAMDirectory::RAMLock::toString() const -{ - return QLatin1String("LockFile@RAM"); -} - -bool RAMDirectory::RAMLock::isLocked() -{ - return directory->fileExists(fname); -} - -bool RAMDirectory::RAMLock::obtain() -{ - SCOPED_LOCK_MUTEX(directory->files_mutex); - if (!directory->fileExists(fname)) { - IndexOutput* tmp = directory->createOutput(fname); - tmp->close(); - _CLDELETE(tmp); - - return true; - } - return false; -} - -void RAMDirectory::RAMLock::release() -{ - directory->deleteFile(fname); -} - -RAMIndexOutput::~RAMIndexOutput() -{ - if (deleteFile) - _CLDELETE(file); - file = NULL; -} - -RAMIndexOutput::RAMIndexOutput(RAMFile* f) - : file(f) -{ - pointer = 0; - deleteFile = false; -} - -RAMIndexOutput::RAMIndexOutput() - : file(_CLNEW RAMFile) -{ - pointer = 0; - deleteFile = true; -} - -void RAMIndexOutput::writeTo(IndexOutput* out) -{ - flush(); - int64_t end = file->length; - int64_t pos = 0; - int32_t p = 0; - while (pos < end) { - int32_t length = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; - int64_t nextPos = pos + length; - if (nextPos > end) { // at the last buffer - length = (int32_t)(end - pos); - } - out->writeBytes((uint8_t*)file->buffers[p++], length); - pos = nextPos; - } -} - -void RAMIndexOutput::reset() -{ - seek(_ILONGLONG(0)); - file->length = _ILONGLONG(0); -} - -void RAMIndexOutput::flushBuffer(const uint8_t* src, const int32_t len) -{ - uint8_t* b = NULL; - int32_t bufferPos = 0; - while (bufferPos != len) { - uint32_t bufferNumber = pointer/CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; - int32_t bufferOffset = pointer%CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; - int32_t bytesInBuffer = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE - bufferOffset; - int32_t remainInSrcBuffer = len - bufferPos; - int32_t bytesToCopy = bytesInBuffer >= remainInSrcBuffer ? remainInSrcBuffer : bytesInBuffer; - - if (bufferNumber == file->buffers.size()){ - b = _CL_NEWARRAY(uint8_t, CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); - file->buffers.push_back( b ); - }else{ - b = file->buffers[bufferNumber]; - } - memcpy(b+bufferOffset, src+bufferPos, bytesToCopy * sizeof(uint8_t)); - bufferPos += bytesToCopy; - pointer += bytesToCopy; - } - if (pointer > file->length) - file->length = pointer; - - file->lastModified = Misc::currentTimeMillis(); -} - -void RAMIndexOutput::close() -{ - BufferedIndexOutput::close(); -} - -/** Random-at methods */ -void RAMIndexOutput::seek(const int64_t pos) -{ - BufferedIndexOutput::seek(pos); - pointer = (int32_t)pos; -} - -int64_t RAMIndexOutput::length() -{ - return file->length; -} - - -RAMIndexInput::RAMIndexInput(RAMFile* f) - : file(f) -{ - pointer = 0; - _length = f->length; -} - -RAMIndexInput::RAMIndexInput(const RAMIndexInput& other) - : BufferedIndexInput(other) -{ - file = other.file; - pointer = other.pointer; - _length = other._length; -} - -RAMIndexInput::~RAMIndexInput() -{ - RAMIndexInput::close(); -} - -IndexInput* RAMIndexInput::clone() const -{ - return _CLNEW RAMIndexInput(*this); -} - -int64_t RAMIndexInput::length() -{ - return _length; -} - -QString RAMIndexInput::getDirectoryType() const -{ - return RAMDirectory::DirectoryType(); -} - -void RAMIndexInput::readInternal(uint8_t* dest, const int32_t len) -{ - const int64_t bytesAvailable = file->length - pointer; - int64_t remainder = len <= bytesAvailable ? len : bytesAvailable; - int32_t start = pointer; - int32_t destOffset = 0; - while (remainder != 0) { - int32_t bufferNumber = start / CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; - int32_t bufferOffset = start % CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; - int32_t bytesInBuffer = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE - bufferOffset; - - /* The buffer's entire length (bufferLength) is defined by IndexInput.h - ** as int32_t, so obviously the number of bytes in a given segment of the - ** buffer won't exceed the the capacity of int32_t. Therefore, the - ** int64_t->int32_t cast on the next line is safe. */ - int32_t bytesToCopy = bytesInBuffer >= remainder ? static_cast(remainder) : bytesInBuffer; - uint8_t* b = file->buffers[bufferNumber]; - memcpy(dest + destOffset, b + bufferOffset, bytesToCopy * sizeof(uint8_t)); - - destOffset += bytesToCopy; - start += bytesToCopy; - remainder -= bytesToCopy; - pointer += bytesToCopy; - } -} - -void RAMIndexInput::close() -{ - BufferedIndexInput::close(); -} - -void RAMIndexInput::seekInternal(const int64_t pos) -{ - CND_PRECONDITION(pos >= 0 && pos < this->_length, "Seeking out of range") - pointer = (int32_t)pos; -} - -// #pragma mark -- RAMDirectory - -QStringList RAMDirectory::list() const -{ - SCOPED_LOCK_MUTEX(files_mutex); - - QStringList names; - - FileMap::const_iterator itr; - for (itr = files.begin(); itr != files.end(); ++itr) - names.push_back(itr->first); - - return names; -} - -RAMDirectory::RAMDirectory() - : Directory() - , files(false, true) -{ -} - -RAMDirectory::~RAMDirectory() -{ - //todo: should call close directory? -} - -void RAMDirectory::_copyFromDir(Directory* dir, bool closeDir) -{ - QStringList names = dir->list(); - uint8_t buf[CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE]; - - foreach (const QString& name, names) { - if (!CL_NS(index)::IndexReader::isLuceneFile(name)) - continue; - - // make place on ram disk - IndexOutput* os = createOutput(name); - // read current file - IndexInput* is = dir->openInput(name); - - // and copy to ram disk - //todo: this could be a problem when copying from big indexes... - int64_t readCount = 0; - int64_t len = is->length(); - while (readCount < len) { - int32_t toRead = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; - if ((readCount + toRead) > len) - toRead = int32_t(len - readCount); - is->readBytes(buf, toRead); - os->writeBytes(buf, toRead); - readCount += toRead; - } - - // graceful cleanup - is->close(); - _CLDELETE(is); - os->close(); - _CLDELETE(os); - } - if (closeDir) - dir->close(); -} - -RAMDirectory::RAMDirectory(Directory* dir) - : Directory() - , files(false, true) -{ - _copyFromDir(dir, false); -} - -RAMDirectory::RAMDirectory(const QString& dir) - : Directory() - , files(false, true) -{ - Directory* fsdir = FSDirectory::getDirectory(dir, false); - try { - _copyFromDir(fsdir, false); - } _CLFINALLY ( - fsdir->close(); - _CLDECDELETE(fsdir); - ); -} - -bool RAMDirectory::fileExists(const QString& name) const -{ - SCOPED_LOCK_MUTEX(files_mutex); - return files.exists(name); -} - -int64_t RAMDirectory::fileModified(const QString& name) const -{ - SCOPED_LOCK_MUTEX(files_mutex); - const RAMFile* f = files.get(name); - return f->lastModified; -} - -int64_t RAMDirectory::fileLength(const QString& name) const -{ - SCOPED_LOCK_MUTEX(files_mutex); - RAMFile* f = files.get(name); - return f->length; -} - - -IndexInput* RAMDirectory::openInput(const QString& name) -{ - SCOPED_LOCK_MUTEX(files_mutex); - RAMFile* file = files.get(name); - if (file == NULL) { - _CLTHROWA(CL_ERR_IO, // DSR:PROPOSED: Better error checking. - "[RAMDirectory::open] The requested file does not exist."); - } - return _CLNEW RAMIndexInput(file); -} - -void RAMDirectory::close() -{ - SCOPED_LOCK_MUTEX(files_mutex); - files.clear(); -} - -bool RAMDirectory::doDeleteFile(const QString& name) -{ - SCOPED_LOCK_MUTEX(files_mutex); - files.remove(name); - return true; -} - -void RAMDirectory::renameFile(const QString& from, const QString& to) -{ - SCOPED_LOCK_MUTEX(files_mutex); - FileMap::iterator itr = files.find(from); - - /* DSR:CL_BUG_LEAK: - ** If a file named $to already existed, its old value was leaked. - ** My inclination would be to prevent this implicit deletion with an - ** exception, but it happens routinely in CLucene's internals (e.g., during - ** IndexWriter.addIndexes with the file named 'segments'). */ - if (files.exists(to)) - files.remove(to); - - if (itr == files.end()) { - char tmp[1024]; - _snprintf(tmp, 1024, "cannot rename %s, file does not exist", - from.toLocal8Bit().constData()); - _CLTHROWT(CL_ERR_IO, tmp); - } - - CND_PRECONDITION(itr != files.end(), "itr == files.end()") - - RAMFile* file = itr->second; - files.removeitr(itr, true, true); - files.put(to, file); -} - - -void RAMDirectory::touchFile(const QString& name) -{ - RAMFile* file = NULL; - { - SCOPED_LOCK_MUTEX(files_mutex); - file = files.get(name); - } - uint64_t ts1 = file->lastModified; - uint64_t ts2 = Misc::currentTimeMillis(); - - //make sure that the time has actually changed - while (ts1 == ts2) { - _LUCENE_SLEEP(1); - ts2 = Misc::currentTimeMillis(); - }; - - file->lastModified = ts2; -} - -IndexOutput* RAMDirectory::createOutput(const QString& name) -{ - /* Check the $files VoidMap to see if there was a previous file named - ** $name. If so, delete the old RAMFile object, but reuse the existing - ** char buffer ($n) that holds the filename. If not, duplicate the - ** supplied filename buffer ($name) and pass ownership of that memory ($n) - ** to $files. */ - - SCOPED_LOCK_MUTEX(files_mutex); - - QString n = files.getKey(name); - if (!n.isEmpty()) { - RAMFile* rf = files.get(name); - _CLDELETE(rf); - } else { - n = name; - } - - RAMFile* file = _CLNEW RAMFile(); -#ifdef _DEBUG - file->filename = n; -#endif - files[n] = file; - - return _CLNEW RAMIndexOutput(file); -} - -LuceneLock* RAMDirectory::makeLock(const QString& name) -{ - return _CLNEW RAMLock(name, this); -} - -QString RAMDirectory::toString() const -{ - return QLatin1String("RAMDirectory"); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/store/RAMDirectory.h b/3rdparty/clucene/src/CLucene/store/RAMDirectory.h deleted file mode 100644 index af92e30b2..000000000 --- a/3rdparty/clucene/src/CLucene/store/RAMDirectory.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -*/ -#ifndef _lucene_store_RAMDirectory_ -#define _lucene_store_RAMDirectory_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include -#include - -#include "Lock.h" -#include "Directory.h" -#include "CLucene/util/VoidMap.h" -#include "CLucene/util/Arrays.h" - -CL_NS_DEF(store) - -class RAMFile : LUCENE_BASE -{ -public: - CL_NS(util)::CLVector > buffers; - int64_t length; - uint64_t lastModified; - -#ifdef _DEBUG - QString filename; -#endif - - RAMFile(); - ~RAMFile(); -}; - -class RAMIndexOutput : public BufferedIndexOutput -{ -protected: - RAMFile* file; - int32_t pointer; - bool deleteFile; - - // output methods: - void flushBuffer(const uint8_t* src, const int32_t len); - -public: - RAMIndexOutput(RAMFile* f); - RAMIndexOutput(); - /** Construct an empty output buffer. */ - virtual ~RAMIndexOutput(); - - virtual void close(); - - // Random-at methods - virtual void seek(const int64_t pos); - int64_t length(); - /** Resets this to an empty buffer. */ - void reset(); - /** Copy the current contents of this buffer to the named output. */ - void writeTo(IndexOutput* output); -}; - -class RAMIndexInput : public BufferedIndexInput -{ -private: - RAMFile* file; - int32_t pointer; - int64_t _length; - -protected: - /** IndexInput methods */ - RAMIndexInput(const RAMIndexInput& clone); - void readInternal(uint8_t *dest, const int32_t len); - - /** Random-at methods */ - void seekInternal(const int64_t pos); - -public: - RAMIndexInput(RAMFile* f); - ~RAMIndexInput(); - IndexInput* clone() const; - - void close(); - int64_t length(); - QString getDirectoryType() const; -}; - - -/** -* A memory-resident {@link Directory} implementation. -*/ -class RAMDirectory : public Directory -{ - class RAMLock : public LuceneLock - { - private: - RAMDirectory* directory; - QString fname; - public: - RAMLock(const QString& name, RAMDirectory* dir); - virtual ~RAMLock(); - bool obtain(); - void release(); - bool isLocked(); - virtual QString toString() const; - }; - - typedef CL_NS(util)::CLHashMap > FileMap; - -protected: - /// Removes an existing file in the directory. - virtual bool doDeleteFile(const QString& name); - - /** - * Creates a new RAMDirectory instance from a different - * Directory implementation. This can be used to load - * a disk-based index into memory. - *

- * This should be used only with indices that can fit into memory. - * - * @param dir a Directory value - * @exception IOException if an error occurs - */ - void _copyFromDir(Directory* dir, bool closeDir); - FileMap files; // unlike the java Hashtable, FileMap is not synchronized, and all access must be protected by a lock - -public: -#ifndef _CL_DISABLE_MULTITHREADING //do this so that the mutable keyword still works without mt enabled - mutable DEFINE_MUTEX(files_mutex) // mutable: const methods must also be able to synchronize properly -#endif - - // Returns a null terminated array of strings, one for each file in the directory. - QStringList list() const; - - /** Constructs an empty {@link Directory}. */ - RAMDirectory(); - - // Destructor - only call this if you are sure the directory - // is not being used anymore. Otherwise use the ref-counting - // facilities of dir->close - virtual ~RAMDirectory(); - RAMDirectory(Directory* dir); - - /** - * Creates a new RAMDirectory instance from the {@link FSDirectory}. - * - * @param dir a String specifying the full index directory path - */ - RAMDirectory(const QString& dir); - - /// Returns true iff the named file exists in this directory. - bool fileExists(const QString& name) const; - - /// Returns the time the named file was last modified. - int64_t fileModified(const QString& name) const; - - /// Returns the length in bytes of a file in the directory. - int64_t fileLength(const QString& name) const; - - /// Removes an existing file in the directory. - virtual void renameFile(const QString& from, const QString& to); - - /** Set the modified time of an existing file to now. */ - void touchFile(const QString& name); - - /// Creates a new, empty file in the directory with the given name. - /// Returns a stream writing this file. - virtual IndexOutput* createOutput(const QString& name); - - /// Construct a {@link Lock}. - /// @param name the name of the lock file - LuceneLock* makeLock(const QString& name); - - /// Returns a stream reading an existing file. - IndexInput* openInput(const QString& name); - - virtual void close(); - - QString toString() const; - - static QString DirectoryType() { return QLatin1String("RAM"); } - QString getDirectoryType() const { return DirectoryType(); } -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp b/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp deleted file mode 100644 index 056fa9bc3..000000000 --- a/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "TransactionalRAMDirectory.h" - -CL_NS_DEF(store) -CL_NS_USE(util) - -TransactionalRAMDirectory::TransactionalRAMDirectory() - : RAMDirectory() - , filesToRestoreOnAbort(false, true) -{ - transOpen = false; -} - -TransactionalRAMDirectory::~TransactionalRAMDirectory() -{ -} - -bool TransactionalRAMDirectory::archiveOrigFileIfNecessary(const QString& name) -{ - // If a file named $name was present when the transaction started and the - // original RAMFile object has not been archived for restoration upon - // transaction abort, then do so, and return true. - // In any other case, return false. - if (fileExists(name) && filesToRemoveOnAbort.find(name) == filesToRemoveOnAbort.end()) { - // The file exists, but isn't recorded as having been created after the - // start of the transaction, so it must've been present at the start of - // the transaction. - - // Transfer memory ownership of both the key and the value from files to - // filesToRestoreOnAbort. - QString origName = files.getKey(name); - RAMFile* origFile = files.get(name); - files.remove(name, true, true); - filesToRestoreOnAbort.put(origName, origFile); - - CND_CONDITION(!fileExists(name), - "File should not exist immediately after archival."); - return true; - } - - return false; -} - -void TransactionalRAMDirectory::unarchiveOrigFile(const QString& name) -{ - QString origName = filesToRestoreOnAbort.getKey(name); - if (origName.isEmpty()) { - _CLTHROWA(CL_ERR_RAMTransaction, - "File submitted for unarchival was not archived."); - } - RAMFile* origFile = filesToRestoreOnAbort.get(name); - // Transfer memory ownership back to files from filesToRestoreOnAbort. - filesToRestoreOnAbort.remove(name, true, true); - files.put(origName, origFile); -} - -bool TransactionalRAMDirectory::transIsOpen() const -{ - return transOpen; -} - -void TransactionalRAMDirectory::transStart() -{ - if (transOpen) { - _CLTHROWA(CL_ERR_RAMTransaction, - "Must resolve previous transaction before starting another."); - } - - CND_CONDITION(filesToRemoveOnAbort.size() == 0, - "filesToRemoveOnAbort should have been cleared by either its" - " constructor or transResolved."); - - CND_CONDITION(filesToRestoreOnAbort.size() == 0, - "filesToRestoreOnAbort should have been cleared by either its" - " constructor or transResolved."); - - transOpen = true; -} - -void TransactionalRAMDirectory::transResolved() -{ - // This method implements actions common to both forms of transaction - // resolution. - filesToRemoveOnAbort.clear(); - filesToRestoreOnAbort.clear(); - transOpen = false; -} - -void TransactionalRAMDirectory::transCommit() -{ - if (!transOpen) - _CLTHROWA(CL_ERR_RAMTransaction, "There is no open transaction."); - - // All storage is in memory, so commit is ultra-simple. - transResolved(); -} - -void TransactionalRAMDirectory::transAbort() -{ - if (!transOpen) - _CLTHROWA(CL_ERR_RAMTransaction, "There is no open transaction."); - - // Delete each file in filesToRemoveOnAbort. - FilenameSet::const_iterator itrDel = filesToRemoveOnAbort.begin(); - for ( ; itrDel != filesToRemoveOnAbort.end(); ++itrDel) { - size_t nameLength = itrDel->first.length(); - - // Special exception: Refrain from deleting a lock's flag file, as that - // would interfere with the operation of the lock. - if (!(nameLength >= 5 - && itrDel->first.rightRef(5) == QLatin1String(".lock"))) { - RAMDirectory::deleteFile(itrDel->first); - } - } - // Ownership of the memory of both the key and the value never left files, - // so there's no need for a special directive to filesToRemoveOnAbort. - filesToRemoveOnAbort.clear(); - - // Now that any new-since-trans-start files with the same names as - // already-present-at-trans-start files are out of the way, restore each - // file in filesToRestoreOnAbort. - TransFileMap::const_iterator itr = filesToRestoreOnAbort.begin(); - for ( ; itr != filesToRestoreOnAbort.end(); ++itr) { - files.put(itr->first, itr->second); - filesToRestoreOnAbort.remove(itr->first); - } - - CND_CONDITION(filesToRestoreOnAbort.size() == 0, - "filesToRestoreOnAbort should be empty."); - - transResolved(); -} - -bool TransactionalRAMDirectory::doDeleteFile(const QString& name) -{ - if (!transOpen) - return RAMDirectory::doDeleteFile(name); - - bool wasOriginalAndWasArchived = archiveOrigFileIfNecessary(name); - if (!wasOriginalAndWasArchived) { - // The file to be deleted wasn't present at transaction start, so instead - // of archiving it, we delete it the conventional way, making sure to - // erase its record in filesToRemoveOnAbort if it was listed there. - filesToRemoveOnAbort.remove(name); - return RAMDirectory::doDeleteFile(name); - } - return true; -} - -void TransactionalRAMDirectory::renameFile(const QString& from, const QString& to) -{ - // During the review on 2005.03.18, decided not to implement transactional - // renameFile for two reasons: - // a) It's not needed in the limited scenario for which - // TransactionalRAMDirectory was designed (IndexWriter::addDocument and - // subcode). - // b) Supporting renaming during a transaction would add considerable - // bookkeeping overhead, reducing the performance of the overwhelmingly - // typical case (commit) in order to support the rare case (abort). - // - // This was not a thinly disguised punt due to the complication of - // implementing renameFile transactionally; rather, several implementations - // were considered, but it seemed wrongheaded to degrade the performance of - // the typical case based on the mere potential need to support renameFile - // at some future point for the benefit of the atypical case. - if (transOpen) { - _CLTHROWA(CL_ERR_RAMTransaction, - "TransactionalRAMDirectory disallows renameFile during a transaction."); - } - RAMDirectory::renameFile(from, to); -} - -IndexOutput* TransactionalRAMDirectory::createOutput(const QString& name) -{ - if (!transOpen) - return RAMDirectory::createOutput(name); - - bool wasOriginalAndWasArchived = archiveOrigFileIfNecessary(name); - try { - IndexOutput* ret = RAMDirectory::createOutput(name); - // Importantly, we store a pointer to the filename memory managed by - // files, rather than that passed in by the client (name). We don't make - // an additional copy of the filename's memory because the transactional - // metadata container filesToRemoveOnAbort is not at risk of outliving - // files. - filesToRemoveOnAbort.put(files.getKey(name), NULL); - return ret; - } catch (...) { - if (wasOriginalAndWasArchived) { - unarchiveOrigFile(name); - } - throw; - } -} - -void TransactionalRAMDirectory::close() -{ - if (transOpen) - transAbort(); - - RAMDirectory::close(); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h b/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h deleted file mode 100644 index 44c5e8e99..000000000 --- a/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_store_TransactionalRAMDirectory_ -#define _lucene_store_TransactionalRAMDirectory_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "RAMDirectory.h" -#include "CLucene/util/VoidList.h" - -CL_NS_DEF(store) - -/*** -This transactional in-memory Directory was created to address a specific -situation, and was deliberately pared down to the simplest viable -implementation. For the sake of simplicity, this implementation imposes -restrictions on what operations can be performed in the directory while a -transaction is in progress (documented in TransactionalRAMDirectory.cpp). - -Because the Lucene Directory interface itself is rather simplistic, it -would not be difficult to expand TransactionalRAMDirectory so that it -provided fully general transactionality. However, the developer of this -original implementation was of the opinion that the last thing CLucene -needs is gratuitous features that exceed their required complexity and -haven't been rigorously tested. -*/ -class TransactionalRAMDirectory : public RAMDirectory -{ -private: - typedef CL_NS(util)::CLSet FilenameSet; - FilenameSet filesToRemoveOnAbort; - - typedef CL_NS(util)::CLSet > TransFileMap; - TransFileMap filesToRestoreOnAbort; - - bool transOpen; - - void transResolved(); - bool archiveOrigFileIfNecessary(const QString& name); - void unarchiveOrigFile(const QString& name); - -protected: - bool doDeleteFile(const QString& name); - -public: - TransactionalRAMDirectory(); - virtual ~TransactionalRAMDirectory(); - - bool transIsOpen() const; - void transStart(); - void transCommit(); - void transAbort(); - - // Constrained operations: - void renameFile(const QString& from, const QString& to); - IndexOutput* createOutput(const QString& name); - - void close(); -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/Arrays.h b/3rdparty/clucene/src/CLucene/util/Arrays.h deleted file mode 100644 index ba60c5638..000000000 --- a/3rdparty/clucene/src/CLucene/util/Arrays.h +++ /dev/null @@ -1,164 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_Arrays_ -#define _lucene_util_Arrays_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "VoidList.h" - -CL_NS_DEF(util) - class Arrays{ - public: - template - class _Arrays { - protected: - //used by binarySearch to check for equality - virtual bool equals(_type a,_type b) const = 0; - virtual int32_t compare(_type a,_type b) const = 0; - public: - virtual ~_Arrays(){ - } - - void sort(_type* a, int32_t alen, int32_t fromIndex, int32_t toIndex) const{ - CND_PRECONDITION(fromIndex < toIndex,"fromIndex >= toIndex"); - CND_PRECONDITION(fromIndex >= 0,"fromIndex < 0"); - - // First presort the array in chunks of length 6 with insertion - // sort. A mergesort would give too much overhead for this length. - for (int32_t chunk = fromIndex; chunk < toIndex; chunk += 6) - { - int32_t end = min(chunk + 6, toIndex); - for (int32_t i = chunk + 1; i < end; i++) - { - if (compare(a[i - 1], a[i]) > 0) - { - // not already sorted - int32_t j = i; - _type elem = a[j]; - do - { - a[j] = a[j - 1]; - j--; - } - while (j > chunk && compare(a[j - 1], elem) > 0); - a[j] = elem; - } - } - } - - int32_t len = toIndex - fromIndex; - // If length is smaller or equal 6 we are done. - if (len <= 6) - return; - - _type* src = a; - _type* dest = _CL_NEWARRAY(_type,alen); - _type* t = NULL; // t is used for swapping src and dest - - // The difference of the fromIndex of the src and dest array. - int32_t srcDestDiff = -fromIndex; - - // The merges are done in this loop - for (int32_t size = 6; size < len; size <<= 1) - { - for (int32_t start = fromIndex; start < toIndex; start += size << 1) - { - // mid is the start of the second sublist; - // end the start of the next sublist (or end of array). - int32_t mid = start + size; - int32_t end = min(toIndex, mid + size); - - // The second list is empty or the elements are already in - // order - no need to merge - if (mid >= end || compare(src[mid - 1], src[mid]) <= 0) - { - memcpy(dest + start + srcDestDiff, src+start, (end-start)*sizeof(_type)); - }// The two halves just need swapping - no need to merge - else if (compare(src[start], src[end - 1]) > 0) - { - memcpy(dest+end-size+srcDestDiff, src+start, size * sizeof(_type)); - memcpy(dest+start+srcDestDiff, src+mid, (end-mid) * sizeof(_type)); - - }else{ - // Declare a lot of variables to save repeating - // calculations. Hopefully a decent JIT will put these - // in registers and make this fast - int32_t p1 = start; - int32_t p2 = mid; - int32_t i = start + srcDestDiff; - - // The main merge loop; terminates as soon as either - // half is ended - while (p1 < mid && p2 < end) - { - dest[i++] = src[(compare(src[p1], src[p2]) <= 0 - ? p1++ : p2++)]; - } - - // Finish up by copying the remainder of whichever half - // wasn't finished. - if (p1 < mid) - memcpy(dest+i,src+p1, (mid-p1) * sizeof(_type)); - else - memcpy(dest+i,src+p2, (end-p2) * sizeof(_type)); - } - } - // swap src and dest ready for the next merge - t = src; - src = dest; - dest = t; - fromIndex += srcDestDiff; - toIndex += srcDestDiff; - srcDestDiff = -srcDestDiff; - } - - // make sure the result ends up back in the right place. Note - // that src and dest may have been swapped above, so src - // contains the sorted array. - if (src != a) - { - // Note that fromIndex == 0. - memcpy(a+srcDestDiff,src,toIndex * sizeof(_type)); - } - } - }; - }; - - template - class CLListEquals: - public CL_NS_STD(binary_function) - { - typedef typename class1::const_iterator _itr1; - typedef typename class2::const_iterator _itr2; - public: - CLListEquals(){ - } - bool equals( class1* val1, class2* val2 ) const{ - static _comparator comp; - if ( val1 == val2 ) - return true; - size_t size = val1->size(); - if ( size != val2->size() ) - return false; - - _itr1 itr1 = val1->begin(); - _itr2 itr2 = val2->begin(); - while ( --size >= 0 ){ - if ( !comp(*itr1,*itr2) ) - return false; - itr1++; - itr2++; - } - return true; - } - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/BitSet.cpp b/3rdparty/clucene/src/CLucene/util/BitSet.cpp deleted file mode 100644 index 3679bd120..000000000 --- a/3rdparty/clucene/src/CLucene/util/BitSet.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "BitSet.h" -#include "CLucene/store/Directory.h" - -CL_NS_USE(store) -CL_NS_DEF(util) - -BitSet::BitSet(const BitSet& copy) - : _size(copy._size) - , _count(-1) -{ - int32_t len = (_size >> 3) + 1; - bits = _CL_NEWARRAY(uint8_t, len); - memcpy(bits, copy.bits, len); -} - -BitSet::BitSet(int32_t size) - : _size(size) - , _count(-1) -{ - int32_t len = (_size >> 3) + 1; - bits = _CL_NEWARRAY(uint8_t, len); - memset(bits, 0, len); -} - -BitSet::BitSet(CL_NS(store)::Directory* d, const QString& name) -{ - _count = -1; - CL_NS(store)::IndexInput* input = d->openInput(name); - try { - _size = input->readInt(); // read size - _count = input->readInt(); // read count - - bits = _CL_NEWARRAY(uint8_t,(_size >> 3) + 1); // allocate bits - input->readBytes(bits, (_size >> 3) + 1); // read bits - } _CLFINALLY ( - input->close(); - _CLDELETE(input ); - ); -} - -void BitSet::write(CL_NS(store)::Directory* d, const QString& name) -{ - CL_NS(store)::IndexOutput* output = d->createOutput(name); - try { - output->writeInt(size()); // write size - output->writeInt(count()); // write count - output->writeBytes(bits, (_size >> 3) + 1); // write bits - } _CLFINALLY ( - output->close(); - _CLDELETE(output); - ); -} - -BitSet::~BitSet() -{ - _CLDELETE_ARRAY(bits); -} - -void BitSet::set(int32_t bit, bool val) -{ - if (val) - bits[bit >> 3] |= 1 << (bit & 7); - else - bits[bit >> 3] &= ~(1 << (bit & 7)); - - _count = -1; -} - -int32_t BitSet::size() const -{ - return _size; -} - -int32_t BitSet::count() -{ - // if the BitSet has been modified - if (_count == -1) { - static const uint8_t BYTE_COUNTS[] = { - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8}; - - int32_t c = 0; - int32_t end = (_size >> 3) + 1; - for (int32_t i = 0; i < end; i++) - c += BYTE_COUNTS[bits[i]]; // sum bits per uint8_t - _count = c; - } - return _count; -} - -BitSet* BitSet::clone() const -{ - return _CLNEW BitSet(*this); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/BitSet.h b/3rdparty/clucene/src/CLucene/util/BitSet.h deleted file mode 100644 index e93847e98..000000000 --- a/3rdparty/clucene/src/CLucene/util/BitSet.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_util_BitSet_ -#define _lucene_util_BitSet_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -#include "CLucene/store/Directory.h" - -CL_NS_DEF(util) - -class BitSet : LUCENE_BASE -{ -public: - // Create a bitset with the specified size - BitSet (int32_t size); - BitSet(CL_NS(store)::Directory* d, const QString& name); - void write(CL_NS(store)::Directory* d, const QString& name); - - // Destructor for the bit set - ~BitSet(); - - // get the value of the specified bit - inline bool get(const int32_t bit) const - { - return (bits[bit >> 3] & (1 << (bit & 7))) != 0; - } - - // set the value of the specified bit - void set(int32_t bit, bool val = true); - - ///returns the size of the bitset - int32_t size() const; - - // Returns the total number of one bits in this BitSet. This is - // efficiently computed and cached, so that, if the BitSet is not changed, - // no recomputation is done for repeated calls. - int32_t count(); - BitSet *clone() const; - -protected: - BitSet(const BitSet& copy); - -private: - int32_t _size; - int32_t _count; - uint8_t *bits; -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/Equators.cpp b/3rdparty/clucene/src/CLucene/util/Equators.cpp deleted file mode 100644 index e112bd234..000000000 --- a/3rdparty/clucene/src/CLucene/util/Equators.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "Equators.h" - -CL_NS_DEF(util) - -bool Equals::Int32::operator()(const int32_t val1, const int32_t val2) const -{ - return (val1)==(val2); -} - -bool Equals::Char::operator()(const char* val1, const char* val2) const -{ - if ( val1 == val2 ) - return true; - return (strcmp(val1, val2) == 0); -} - -#ifdef _UCS2 -bool Equals::WChar::operator()(const wchar_t* val1, const wchar_t* val2) const -{ - if (val1 == val2) - return true; - return (_tcscmp(val1, val2) == 0); -} -#endif - -bool Equals::Qstring::operator()(const QString& val1, const QString& val2) const -{ - return (val1 == val2); -} - -/////////////////////////////////////////////////////////////////////////////// -// Comparors -/////////////////////////////////////////////////////////////////////////////// - -int32_t Compare::Int32::getValue() const -{ - return value; -} - -Compare::Int32::Int32(int32_t val) -{ - value = val; -} - -Compare::Int32::Int32() -{ - value = 0; -} - -int32_t Compare::Int32::compareTo(void* o) -{ - try { - Int32* other = (Int32*)o; - if (value == other->value) - return 0; - // Returns just -1 or 1 on inequality; doing math might overflow. - return value > other->value ? 1 : -1; - } catch(...) { - _CLTHROWA(CL_ERR_Runtime, "Couldnt compare types"); - } -} - -bool Compare::Int32::operator()(int32_t t1, int32_t t2) const -{ - return t1 > t2 ? true : false; -} - -size_t Compare::Int32::operator()(int32_t t) const -{ - return t; -} - -qreal Compare::Float::getValue() const -{ - return value; -} - -Compare::Float::Float(qreal val) -{ - value = val; -} - -int32_t Compare::Float::compareTo(void* o) -{ - try { - Float* other = (Float*)o; - if (value == other->value) - return 0; - // Returns just -1 or 1 on inequality; doing math might overflow. - return value > other->value ? 1 : -1; - } catch(...) { - _CLTHROWA(CL_ERR_Runtime,"Couldnt compare types"); - } -} - -bool Compare::Char::operator()(const char* val1, const char* val2) const -{ - if ( val1 == val2) - return false; - return (strcmp(val1, val2) < 0); -} - -size_t Compare::Char::operator()(const char* val1) const -{ - return CL_NS(util)::Misc::ahashCode(val1); -} - -#ifdef _UCS2 -bool Compare::WChar::operator()(const wchar_t* val1, const wchar_t* val2) const -{ - if ( val1==val2) - return false; - return (_tcscmp(val1, val2) < 0); -} - -size_t Compare::WChar::operator()(const wchar_t* val1) const -{ - return CL_NS(util)::Misc::whashCode(val1); -} -#endif - -const TCHAR* Compare::TChar::getValue() const -{ - return s; -} - -Compare::TChar::TChar() -{ - s = NULL; -} - -Compare::TChar::TChar(const TCHAR* str) -{ - this->s = str; -} - -int32_t Compare::TChar::compareTo(void* o) -{ - try { - TChar* os = (TChar*)o; - return _tcscmp(s, os->s); - } catch(...) { - _CLTHROWA(CL_ERR_Runtime,"Couldnt compare types"); - } - -} - -bool Compare::TChar::operator()(const TCHAR* val1, const TCHAR* val2) const -{ - if (val1 == val2) - return false; - - return (_tcscmp(val1, val2) < 0); -} - -size_t Compare::TChar::operator()(const TCHAR* val1) const -{ - return CL_NS(util)::Misc::thashCode(val1); -} - -bool Compare::Qstring::operator()(const QString& val1, const QString& val2) const -{ - return (val1 < val2); -} - -size_t Compare::Qstring::operator ()(const QString& val1) const -{ - return CL_NS(util)::Misc::qhashCode(val1); -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/Equators.h b/3rdparty/clucene/src/CLucene/util/Equators.h deleted file mode 100644 index 11fcb0eaf..000000000 --- a/3rdparty/clucene/src/CLucene/util/Equators.h +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_util_Equators_ -#define _lucene_util_Equators_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -//#ifdef QT_LINUXBASE -// we are going to use qreal now, we basically maintain our own clucene anyway -//// LSB doesn't define float_t - see http://bugs.linuxbase.org/show_bug.cgi?id=2374 -//typedef float float_t; -//#endif - -CL_NS_DEF(util) - -/////////////////////////////////////////////////////////////////////////////// -// Equators -/////////////////////////////////////////////////////////////////////////////// - -class Equals{ -public: - class Int32:public CL_NS_STD(binary_function) - { - public: - bool operator()( const int32_t val1, const int32_t val2 ) const; - }; - - class Char:public CL_NS_STD(binary_function) - { - public: - bool operator()( const char* val1, const char* val2 ) const; - }; -#ifdef _UCS2 - class WChar: public CL_NS_STD(binary_function) - { - public: - bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; - }; - class TChar: public WChar{ - }; -#else - class TChar: public Char{ - }; -#endif - - template - class Void:public CL_NS_STD(binary_function) - { - public: - bool operator()( _cl* val1, _cl* val2 ) const{ - return val1==val2; - } - }; - - class Qstring : public CL_NS_STD(binary_function) - { - public: - bool operator() (const QString& val1, const QString& val2) const; - }; -}; - - -/////////////////////////////////////////////////////////////////////////////// -// Comparors -/////////////////////////////////////////////////////////////////////////////// - -class Comparable : LUCENE_BASE -{ -public: - virtual ~Comparable(){ - } - - virtual int32_t compareTo(void* o) = 0; -}; - -/** @internal */ -class Compare{ -public: - class _base - { // traits class for hash containers - public: - enum - { // parameters for hash table - bucket_size = 4, // 0 < bucket_size - min_buckets = 8 - }; // min_buckets = 2 ^^ N, 0 < N - - _base() - { - } - }; - - class Int32:public _base, public Comparable{ - int32_t value; - public: - int32_t getValue() const; - Int32(int32_t val); - Int32(); - int32_t compareTo(void* o); - bool operator()( int32_t t1, int32_t t2 ) const; - size_t operator()( int32_t t ) const; - }; - - - class Float:public Comparable{ - qreal value; - public: - qreal getValue() const; - Float(qreal val); - int32_t compareTo(void* o); - }; - - - class Char: public _base // - { - public: - bool operator()( const char* val1, const char* val2 ) const; - size_t operator()( const char* val1) const; - }; - -#ifdef _UCS2 - class WChar: public _base // - { - public: - bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; - size_t operator()( const wchar_t* val1) const; - }; -#endif - - class TChar: public _base, public Comparable{ - const TCHAR* s; - public: - const TCHAR* getValue() const; - - TChar(); - TChar(const TCHAR* str); - int32_t compareTo(void* o); - bool operator()( const TCHAR* val1, const TCHAR* val2 ) const; - size_t operator()( const TCHAR* val1) const; - }; - - - template - class Void:public _base // - { - public: - int32_t compareTo(_cl* o){ - if ( this == o ) - return o; - else - return this > o ? 1 : -1; - } - bool operator()( _cl* t1, _cl* t2 ) const{ - return t1 > t2 ? true : false; - } - size_t operator()( _cl* t ) const{ - return (size_t)t; - } - }; - - class Qstring : public _base - { - public: - bool operator() (const QString& val1, const QString& val2) const; - size_t operator() (const QString& val1) const; - }; -}; - -/////////////////////////////////////////////////////////////////////////////// -// allocators -/////////////////////////////////////////////////////////////////////////////// - -class Deletor -{ -public: - - template - class Array{ - public: - static void doDelete(_kt* arr){ - _CLDELETE_LARRAY(arr); - } - }; - class tcArray{ - public: - static void doDelete(const TCHAR* arr){ - _CLDELETE_CARRAY(arr); - } - }; - class acArray{ - public: - static void doDelete(const char* arr){ - _CLDELETE_CaARRAY(arr); - } - }; - - class Unintern{ - public: - static void doDelete(TCHAR* arr); - }; - template - class Object{ - public: - static void doDelete(_kt* obj){ - _CLLDELETE(obj); - } - }; - template - class Void{ - public: - static void doDelete(_kt* obj){ - _CLVDELETE(obj); - } - }; - class Dummy{ - public: - static void doDelete(const void* nothing) - { - // TODO: remove all occurances where it hits this point - // CND_WARNING(false, "Deletor::Dummy::doDelete run, set deleteKey - // or deleteValue to false"); - } - }; - class DummyInt32{ - public: - static void doDelete(const int32_t nothing){ - } - }; - class DummyFloat{ - public: - static void doDelete(const qreal nothing){ - } - }; - template - class ConstNullVal{ - public: - static void doDelete(const _type nothing) - { - // TODO: remove all occurances where it hits this point - // CND_WARNING(false, "Deletor::Dummy::doDelete run, set deleteKey - // or deleteValue to false"); - } - }; - - template - class NullVal{ - public: - static void doDelete(_type nothing) - { - // TODO: remove all occurances where it hits this point - // CND_WARNING(false, "Deletor::Dummy::doDelete run, set deleteKey - // or deleteValue to false"); - } - }; - class DummyQString { - public: - static void doDelete(const QString& nothing) { - } - }; -}; -//////////////////////////////////////////////////////////////////////////////// - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp b/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp deleted file mode 100644 index f9fbe9b10..000000000 --- a/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "FastCharStream.h" - -#include "CLucene/util/Reader.h" - -CL_NS_DEF(util) - -const int32_t FastCharStream::maxRewindSize = LUCENE_MAX_WORD_LEN*2; - - FastCharStream::FastCharStream(Reader* reader): - pos(0), - rewindPos(0), - resetPos(0), - col(1), - line(1), - input(reader) - { - input->mark(maxRewindSize); - } - FastCharStream::~FastCharStream(){ - } - void FastCharStream::readChar(TCHAR &c) { - try{ - int32_t r = input->read(); - if ( r == -1 ) - input = NULL; - c = r; - }catch(CLuceneError& err){ - if ( err.number() == CL_ERR_IO ) - input = 0; - throw err; - } - } - int FastCharStream::GetNext() - { - // printf("getnext\n"); - if (input == 0 ) // end of file - { - _CLTHROWA(CL_ERR_IO,"warning : FileReader.GetNext : Read TCHAR over EOS."); - } - // this is rather inefficient - // implementing the functions from the java version of - // charstream will be much more efficient. - ++pos; - if ( pos > resetPos + maxRewindSize && rewindPos == 0) { - // move the marker one position (~expensive) - resetPos = pos-(maxRewindSize/2); - if ( resetPos != input->reset(resetPos) ) - _CLTHROWA(CL_ERR_IO,"Unexpected reset() result"); - input->mark(maxRewindSize); - input->skip((maxRewindSize/2) - 1); - } - TCHAR ch; - readChar(ch); - - if (input == NULL) { // eof - return -1; - } - if (rewindPos == 0) { - col += 1; - if(ch == '\n') { - line++; - col = 1; - } - } else { - rewindPos--; - } - return ch; - } - - void FastCharStream::UnGet(){ -// printf("UnGet \n"); - if (input == 0) - return; - if ( pos == 0 ) { - _CLTHROWA(CL_ERR_IO,"error : No character can be UnGet"); - } - rewindPos++; - - input->reset(pos-1); - pos--; - } - - int FastCharStream::Peek() { - int c = GetNext(); - UnGet(); - return c; - } - - bool FastCharStream::Eos() const { - return input==NULL; - } - - int32_t FastCharStream::Column() const { - return col; - } - - int32_t FastCharStream::Line() const { - return line; - } -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/FastCharStream.h b/3rdparty/clucene/src/CLucene/util/FastCharStream.h deleted file mode 100644 index 24e5b5612..000000000 --- a/3rdparty/clucene/src/CLucene/util/FastCharStream.h +++ /dev/null @@ -1,55 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_FastCharStream_ -#define _lucene_util_FastCharStream_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/Reader.h" - -CL_NS_DEF(util) - - /** Ported implementation of the FastCharStream class. */ - class FastCharStream:LUCENE_BASE - { - static const int32_t maxRewindSize; - int32_t pos; - int32_t rewindPos; - int64_t resetPos; - int32_t col; - int32_t line; - // read character from stream return false on error - void readChar(TCHAR &); - public: - Reader* input; - - /// Initializes a new instance of the FastCharStream class LUCENE_EXPORT. - FastCharStream(Reader* reader); - ~FastCharStream(); - - /// Returns the next TCHAR from the stream. - int GetNext(); - - void UnGet(); - - /// Returns the current top TCHAR from the input stream without removing it. - int Peek(); - - - /// Returns True if the end of stream was reached. - bool Eos() const; - - /// Gets the current column. - int32_t Column() const; - - /// Gets the current line. - int32_t Line() const; - }; -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/Misc.cpp b/3rdparty/clucene/src/CLucene/util/Misc.cpp deleted file mode 100644 index 42e3fd0a8..000000000 --- a/3rdparty/clucene/src/CLucene/util/Misc.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#include "CLucene/StdHeader.h" -#include "Misc.h" - -#ifdef _CL_TIME_WITH_SYS_TIME -# include -# include -#else -# if defined(_CL_HAVE_SYS_TIME_H) -# include -# else -# include -# endif -#endif - -#ifdef _CL_HAVE_SYS_TIMEB_H -# include -#endif - -#ifdef UNDER_CE -#include -#endif - -CL_NS_DEF(util) - -uint64_t Misc::currentTimeMillis() -{ -#ifndef UNDER_CE -#if defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) || defined(__BORLANDC__) - struct _timeb tstruct; - _ftime(&tstruct); - - return (((uint64_t) tstruct.time) * 1000) + tstruct.millitm; -#else - struct timeval tstruct; - if (gettimeofday(&tstruct, NULL) < 0) { - _CLTHROWA(CL_ERR_Runtime,"Error in gettimeofday call."); - } - - return (((uint64_t) tstruct.tv_sec) * 1000) + tstruct.tv_usec / 1000; -#endif -#else //UNDER_CE - QT_USE_NAMESPACE - QTime t = QTime::currentTime(); - return t.second() * 1000 + t.msec(); -#endif //UNDER_CE -} - -// #pragma mark -- char related utils - -size_t Misc::ahashCode(const char* str) -{ - // Compute the hash code using a local variable to be reentrant. - size_t hashCode = 0; - while (*str != 0) - hashCode = hashCode * 31 + *str++; - return hashCode; -} - -size_t Misc::ahashCode(const char* str, size_t len) -{ - // Compute the hash code using a local variable to be reentrant. - size_t count = len; - size_t hashCode = 0; - for (size_t i = 0; i < count; i++) - hashCode = hashCode * 31 + *str++; - return hashCode; -} - -char* Misc::ajoin(const char* a, const char* b, const char* c, const char* d, - const char* e, const char* f) -{ -#define aLEN(x) (x == NULL ? 0 : strlen(x)) - const size_t totalLen = aLEN(a) + aLEN(b) + aLEN(c) + aLEN(d) + aLEN(e) - + aLEN(f) + sizeof(char); /* Space for terminator. */ - - char* buf = _CL_NEWARRAY(char, totalLen); - buf[0] = 0; - if (a != NULL) - strcat(buf, a); - - if (b != NULL) - strcat(buf, b); - - if (c != NULL) - strcat(buf, c); - - if (d != NULL) - strcat(buf, d); - - if (e != NULL) - strcat(buf, e); - - if (f != NULL) - strcat(buf, f); - - return buf; -} - -char* Misc::segmentname(const char* segment, const char* ext, int32_t x) -{ - CND_PRECONDITION(ext != NULL, "ext is NULL"); - - char* buf = _CL_NEWARRAY(char, CL_MAX_PATH); - if (x == -1) - _snprintf(buf, CL_MAX_PATH, "%s%s", segment, ext); - else - _snprintf(buf, CL_MAX_PATH, "%s%s%d", segment, ext, x); - return buf; -} - -void Misc::segmentname(char* buffer, int32_t bufferLen, const char* segment, - const char* ext, int32_t x) -{ - CND_PRECONDITION(buffer != NULL, "buffer is NULL"); - CND_PRECONDITION(segment != NULL, "segment is NULL"); - CND_PRECONDITION(ext != NULL, "extention is NULL"); - - if (x == -1) - _snprintf(buffer, bufferLen, "%s%s", segment, ext); - else - _snprintf(buffer, bufferLen, "%s%s%d", segment, ext, x); -} - -// #pragma mark -- qt related utils - -size_t Misc::qhashCode(const QString& str) -{ - size_t hashCode = 0; - for (int i = 0; i < str.count(); ++i) - hashCode = hashCode * 31 + str.at(i).unicode(); - return hashCode; -} - -size_t Misc::qhashCode(const QString& str, size_t len) -{ - size_t count = len; - size_t hashCode = 0; - for (size_t i = 0; i < count; ++i) - hashCode = hashCode * 31 + str.at(i).unicode(); - return hashCode; -} - -QString Misc::qjoin(const QString &a, const QString &b, const QString &c, - const QString &d, const QString &e, const QString &f) -{ - QString buffer; - - if (!a.isNull() && !a.isEmpty()) - buffer.append(a); - - if (!b.isNull() && !b.isEmpty()) - buffer.append(b); - - if (!c.isNull() && !c.isEmpty()) - buffer.append(c); - - if (!d.isNull() && !d.isEmpty()) - buffer.append(d); - - if (!e.isNull() && !e.isEmpty()) - buffer.append(e); - - if (!f.isNull() && !f.isEmpty()) - buffer.append(f); - - return buffer; -} - -QString Misc::segmentname(const QString& segment, const QString& ext, int32_t x) -{ - CND_PRECONDITION(!ext.isEmpty(), "ext is NULL"); - - if (x == -1) - return QString(segment + ext); - - QString buf(QLatin1String("%1%2%3")); - return buf.arg(segment).arg(ext).arg(x); -} - -void Misc::segmentname(QString& buffer, int32_t bufferLen, - const QString& segment, const QString& ext, int32_t x) -{ - CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); - CND_PRECONDITION(!ext.isEmpty(), "extention is NULL"); - - buffer = segment + ext; - if (x != -1) - buffer += QString::number(x); -} - -// #pragma mark -- TCHAR related utils - -int32_t Misc::stringDifference(const TCHAR* s1, int32_t len1, const TCHAR* s2, - int32_t len2) -{ - int32_t len = len1 < len2 ? len1 : len2; - for (int32_t i = 0; i < len; i++) - if (s1[i] != s2[i]) - return i; - return len; -} - -/* DSR:CL_BUG: (See comment for join method in Misc.h): */ -TCHAR* Misc::join (const TCHAR* a, const TCHAR* b, const TCHAR* c, - const TCHAR* d, const TCHAR* e, const TCHAR* f) -{ -#define LEN(x) (x == NULL ? 0 : _tcslen(x)) - const size_t totalLen = LEN(a) + LEN(b) + LEN(c) + LEN(d) + LEN(e) + LEN(f) - + sizeof(TCHAR); /* Space for terminator. */ - - TCHAR* buf = _CL_NEWARRAY(TCHAR, totalLen); - buf[0] = 0; - if (a != NULL) - _tcscat(buf, a); - - if (b != NULL) - _tcscat(buf, b); - - if (c != NULL) - _tcscat(buf, c); - - if (d != NULL) - _tcscat(buf, d); - - if (e != NULL) - _tcscat(buf, e); - - if (f != NULL) - _tcscat(buf, f); - - return buf; -} - -#ifdef _UCS2 - -size_t Misc::whashCode(const wchar_t* str) -{ - // Compute the hash code using a local variable to be reentrant. - size_t hashCode = 0; - while (*str != 0) - hashCode = hashCode * 31 + *str++; - return hashCode; -} - -size_t Misc::whashCode(const wchar_t* str, size_t len) -{ - // Compute the hash code using a local variable to be reentrant. - size_t count = len; - size_t hashCode = 0; - for (size_t i = 0; i < count; i++) - hashCode = hashCode * 31 + *str++; - return hashCode; -} - -char* Misc::_wideToChar(const wchar_t* s CL_FILELINEPARAM) -{ - size_t len = _tcslen(s); - char* msg = _CL_NEWARRAY(char, len + 1); - _cpywideToChar(s, msg, len + 1); - return msg; -} - -void Misc::_cpywideToChar(const wchar_t* s, char* d, size_t len) -{ - size_t sLen = wcslen(s); - for (uint32_t i = 0; i < len && i < sLen + 1; i++) - d[i] = LUCENE_OOR_CHAR(s[i]); -} - -wchar_t* Misc::_charToWide(const char* s CL_FILELINEPARAM) -{ - size_t len = strlen(s); - wchar_t* msg = _CL_NEWARRAY(wchar_t, len + 1); - _cpycharToWide(s, msg, len + 1); - return msg; -} - -void Misc::_cpycharToWide(const char* s, wchar_t* d, size_t len) -{ - size_t sLen = strlen(s); - for (uint32_t i = 0; i < len && i < sLen + 1; i++) - d[i] = s[i]; -} - -#endif - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/Misc.h b/3rdparty/clucene/src/CLucene/util/Misc.h deleted file mode 100644 index 561c6e4d9..000000000 --- a/3rdparty/clucene/src/CLucene/util/Misc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team - * - * Distributable under the terms of either the Apache License (Version 2.0) or - * the GNU Lesser General Public License, as specified in the COPYING file. - * - * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. -*/ -#ifndef _lucene_util_Misc_H -#define _lucene_util_Misc_H - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include - -CL_NS_DEF(util) - -class Misc -{ -public: - static uint64_t currentTimeMillis(); - - static size_t ahashCode(const char* str); - static size_t ahashCode(const char* str, size_t len); - static char* ajoin(const char* a, const char* b, const char* c = NULL, - const char* d = NULL, const char* e = NULL, const char* f = NULL); - static char* segmentname(const char* segment, const char* ext, int32_t x = -1); - static void segmentname(char* buffer, int32_t bufferLen, const char* segment, - const char* ext, int32_t x = -1); - - static size_t qhashCode(const QString& str); - static size_t qhashCode(const QString& str, size_t len); - static QString qjoin(const QString& a, const QString& b, - const QString& c = QString(), const QString& d = QString(), - const QString& e = QString(), const QString& f = QString()); - static QString segmentname(const QString& segment, const QString& ext, - int32_t x = -1 ); - static void segmentname(QString& buffer, int32_t bufferLen, - const QString& Segment, const QString& ext, int32_t x = -1); - - // Compares two strings, character by character, and returns the - // first position where the two strings differ from one another. - // - // @param s1 The first string to compare - // @param s1Len The length of the first string to compare - // @param s2 The second string to compare - // @param s2Len The length of the second string to compare - // @return The first position where the two strings differ. - static int32_t stringDifference(const TCHAR* s1, int32_t s1Len, - const TCHAR* s2, int32_t s2Len); - static TCHAR* join (const TCHAR* a, const TCHAR* b, const TCHAR* c = NULL, - const TCHAR* d = NULL, const TCHAR* e = NULL, const TCHAR* f = NULL ); - -#ifdef _UCS2 - static size_t whashCode(const wchar_t* str); - static size_t whashCode(const wchar_t* str, size_t len); - -# define thashCode whashCode - - static char* _wideToChar(const wchar_t* s CL_FILELINEPARAM); - static void _cpywideToChar(const wchar_t* s, char* d, size_t len); - - static wchar_t* _charToWide(const char* s CL_FILELINEPARAM); - static void _cpycharToWide(const char* s, wchar_t* d, size_t len); - -#else -# define thashCode ahashCode -#endif -}; - -CL_NS_END - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/PriorityQueue.h b/3rdparty/clucene/src/CLucene/util/PriorityQueue.h deleted file mode 100644 index 45649ee7f..000000000 --- a/3rdparty/clucene/src/CLucene/util/PriorityQueue.h +++ /dev/null @@ -1,177 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_PriorityQueue_ -#define _lucene_util_PriorityQueue_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif -CL_NS_DEF(util) - -// A PriorityQueue maintains a partial ordering of its elements such that the -// least element can always be found in constant time. Put()'s and pop()'s -// require log(size) time. -template class PriorityQueue:LUCENE_BASE { - private: - _type* heap; //(was object[]) - size_t _size; - bool dk; - size_t maxSize; - - void upHeap(){ - size_t i = _size; - _type node = heap[i]; // save bottom node (WAS object) - int32_t j = ((uint32_t)i) >> 1; - while (j > 0 && lessThan(node,heap[j])) { - heap[i] = heap[j]; // shift parents down - i = j; - j = ((uint32_t)j) >> 1; - } - heap[i] = node; // install saved node - } - void downHeap(){ - size_t i = 1; - _type node = heap[i]; // save top node - size_t j = i << 1; // find smaller child - size_t k = j + 1; - if (k <= _size && lessThan(heap[k], heap[j])) { - j = k; - } - while (j <= _size && lessThan(heap[j],node)) { - heap[i] = heap[j]; // shift up child - i = j; - j = i << 1; - k = j + 1; - if (k <= _size && lessThan(heap[k], heap[j])) { - j = k; - } - } - heap[i] = node; // install saved node - } - - protected: - PriorityQueue(){ - this->_size = 0; - this->dk = false; - this->heap = NULL; - this->maxSize = 0; - } - - // Determines the ordering of objects in this priority queue. Subclasses - // must define this one method. - virtual bool lessThan(_type a, _type b)=0; - - // Subclass constructors must call this. - void initialize(const int32_t maxSize, bool deleteOnClear){ - _size = 0; - dk = deleteOnClear; - int32_t heapSize = maxSize + 1; - heap = _CL_NEWARRAY(_type,heapSize); - this->maxSize = maxSize; - } - - public: - virtual ~PriorityQueue(){ - clear(); - _CLDELETE_ARRAY(heap); - } - - /** - * Adds an Object to a PriorityQueue in log(size) time. - * If one tries to add more objects than maxSize from initialize - * a RuntimeException (ArrayIndexOutOfBound) is thrown. - */ - void put(_type element){ - if ( _size>=maxSize ) - _CLTHROWA(CL_ERR_IndexOutOfBounds,"add is out of bounds"); - - ++_size; - heap[_size] = element; - upHeap(); - } - - /** - * Adds element to the PriorityQueue in log(size) time if either - * the PriorityQueue is not full, or not lessThan(element, top()). - * @param element - * @return true if element is added, false otherwise. - */ - bool insert(_type element){ - if(_size < maxSize){ - put(element); - return true; - }else if(_size > 0 && !lessThan(element, top())){ - if ( dk ){ - _valueDeletor::doDelete(heap[1]); - } - heap[1] = element; - adjustTop(); - return true; - }else - return false; - } - - /** - * Returns the least element of the PriorityQueue in constant time. - */ - _type top(){ - if (_size > 0) - return heap[1]; - else - return NULL; - } - - /** Removes and returns the least element of the PriorityQueue in log(size) - * time. - */ - _type pop(){ - if (_size > 0) { - _type result = heap[1]; // save first value - heap[1] = heap[_size]; // move last to first - - heap[_size] = (_type)0; // permit GC of objects - --_size; - downHeap(); // adjust heap - return result; - } else - return (_type)NULL; - } - - /**Should be called when the object at top changes values. Still log(n) - worst case, but it's at least twice as fast to

-		    { pq.top().change(); pq.adjustTop(); }
-		   
instead of
-		    { o = pq.pop(); o.change(); pq.push(o); }
-		   
- */ - void adjustTop(){ - downHeap(); - } - - - /** - * Returns the number of elements currently stored in the PriorityQueue. - */ - size_t size(){ - return _size; - } - - /** - * Removes all entries from the PriorityQueue. - */ - void clear(){ - for (size_t i = 1; i <= _size; ++i){ - if ( dk ){ - _valueDeletor::doDelete(heap[i]); - } - } - _size = 0; - } - }; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/Reader.cpp b/3rdparty/clucene/src/CLucene/util/Reader.cpp deleted file mode 100644 index 1ce97106d..000000000 --- a/3rdparty/clucene/src/CLucene/util/Reader.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "Reader.h" - -CL_NS_DEF(util) - -StringReader::StringReader ( const TCHAR* value ): - Reader(NULL,true){ - reader = new jstreams::StringReader(value); -} -StringReader::StringReader ( const TCHAR* value, const int32_t length ): - Reader(NULL,true){ - reader = new jstreams::StringReader(value,length); -} -StringReader::StringReader ( const TCHAR* value, const int32_t length, bool copyData ): - Reader(NULL,true){ - reader = new jstreams::StringReader(value,length, copyData); -} -StringReader::~StringReader(){ -} - - -FileReader::FileReader ( const char* path, const char* enc, - const int32_t cachelen, const int32_t /*cachebuff*/ ): - Reader(NULL, true) -{ - this->input = new jstreams::FileInputStream(path, cachelen); - this->reader = new SimpleInputStreamReader(this->input,enc); //(this is a jstream object) -} - -FileReader::~FileReader (){ - if (input) - delete input; -} -int32_t FileReader::read(const TCHAR*& start, int32_t _min, int32_t _max) { - return reader->read(start, _min, _max); -} -int64_t FileReader::mark(int32_t readlimit) { - return reader->mark(readlimit); -} -int64_t FileReader::reset(int64_t newpos) { - return reader->reset(newpos); -} - - - -SimpleInputStreamReader::SimpleInputStreamReader(jstreams::StreamBase *i, const char* enc) -{ - finishedDecoding = false; - input = i; - charbuf.setSize(262); - - if ( strcmp(enc,"ASCII")==0 ) - encoding = ASCII; -#ifdef _UCS2 - else if ( strcmp(enc,"UTF-8")==0 ) - encoding = UTF8; - else if ( strcmp(enc,"UCS-2LE")==0 ) - encoding = UCS2_LE; -#endif - else - _CLTHROWA(CL_ERR_IllegalArgument,"Unsupported encoding, use jstreams iconv based instead"); - - mark(262); - charsLeft = 0; -} -SimpleInputStreamReader::~SimpleInputStreamReader(){ - input = NULL; -} -int32_t SimpleInputStreamReader::decode(TCHAR* start, int32_t space){ - // decode from charbuf - const char *inbuf = charbuf.readPos; - const char *inbufend = charbuf.readPos + charbuf.avail; - TCHAR *outbuf = start; - const TCHAR *outbufend = outbuf + space; - - if ( encoding == ASCII ){ - while ( outbuf inbufend ){ - break; //character incomplete - }else{ - size_t rd = lucene_utf8towc(outbuf,inbuf,inbufend-inbuf); - if ( rd == 0 ){ - error = "Invalid multibyte sequence."; - status = jstreams::Error; - return -1; - }else{ - inbuf+=rd; - outbuf++; - } - } - } -#endif //_UCS2 - }else - _CLTHROWA(CL_ERR_Runtime,"Unexpected encoding"); - - if ( outbuf < outbufend ) { - //we had enough room to convert the entire input - if ( inbuf < inbufend ) { - // last character is incomplete - // move from inbuf to the end to the start of - // the buffer - memmove(charbuf.start, inbuf, inbufend-inbuf); - charbuf.readPos = charbuf.start; - charbuf.avail = inbufend-inbuf; - } else if ( outbuf < outbufend ) { //input sequence was completely converted - charbuf.readPos = charbuf.start; - charbuf.avail = 0; - if (input == NULL) { - finishedDecoding = true; - } - } - } else { - charbuf.readPos += charbuf.avail - (inbufend-inbuf); - charbuf.avail = inbufend-inbuf; - } - return outbuf-start; -} - -int32_t SimpleInputStreamReader::fillBuffer(TCHAR* start, int32_t space) { - // fill up charbuf - if (input && charbuf.readPos == charbuf.start) { - const char *begin; - int32_t numRead; - numRead = input->read(begin, 1, charbuf.size - charbuf.avail); - //printf("filled up charbuf\n"); - if (numRead < -1) { - error = input->getError(); - status = jstreams::Error; - input = 0; - return numRead; - } - if (numRead < 1) { - // signal end of input buffer - input = 0; - if (charbuf.avail) { - error = "stream ends on incomplete character"; - status = jstreams::Error; - } - return -1; - } - // copy data into other buffer - memmove( charbuf.start + charbuf.avail, begin, numRead * sizeof(char)); - charbuf.avail = numRead + charbuf.avail; - } - // decode - int32_t n = decode(start, space); - //printf("decoded %i\n", n); - return n; -} - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/Reader.h b/3rdparty/clucene/src/CLucene/util/Reader.h deleted file mode 100644 index 6b018b3aa..000000000 --- a/3rdparty/clucene/src/CLucene/util/Reader.h +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_Reader_ -#define _lucene_util_Reader_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "streambase.h" -#include "stringreader.h" -#include "fileinputstream.h" -#include "bufferedstream.h" - -CL_NS_DEF(util) -/** -* An inline wrapper that reads from Jos van den Oever's jstreams -*/ -class Reader:LUCENE_BASE { -typedef jstreams::StreamBase jsReader; -public: - bool deleteReader; - jsReader* reader; - - Reader(jsReader* reader, bool deleteReader){ - this->reader = reader; - this->deleteReader = deleteReader; - } - virtual ~Reader(){ - if ( deleteReader ) - delete reader; - reader = NULL; - } - inline int read(){ - const TCHAR*b; - int32_t nread = reader->read(b, 1,1); - if ( nread < -1 ) //if not eof - _CLTHROWA(CL_ERR_IO,reader->getError() ); - else if ( nread == -1 ) - return -1; - else - return b[0]; - } - /** - * Read at least 1 character, and as much as is conveniently available - */ - inline int32_t read(const TCHAR*& start){ - int32_t nread = reader->read(start,1,0); - if ( nread < -1 ) //if not eof - _CLTHROWA(CL_ERR_IO,reader->getError()); - else - return nread; - } - inline int32_t read(const TCHAR*& start, int32_t len){ - int32_t nread = reader->read(start, len, len); - if ( nread < -1 ) //if not eof - _CLTHROWA(CL_ERR_IO,reader->getError()); - else - return nread; - } - inline int64_t skip(int64_t ntoskip){ - int64_t skipped = reader->skip(ntoskip); - if ( skipped < 0 ) - _CLTHROWA(CL_ERR_IO,reader->getError()); - else - return skipped; - } - inline int64_t mark(int32_t readAheadlimit){ - int64_t pos = reader->mark(readAheadlimit); - if ( pos < 0 ) - _CLTHROWA(CL_ERR_IO,reader->getError()); - else - return pos; - } - int64_t reset(int64_t pos){ - int64_t r = reader->reset(pos); - if ( r < 0 ) - _CLTHROWA(CL_ERR_IO,reader->getError()); - else - return r; - } -}; - -///A helper class which constructs a the jstreams StringReader. -class StringReader: public Reader{ -public: - StringReader ( const TCHAR* value ); - StringReader ( const TCHAR* value, const int32_t length ); - StringReader ( const TCHAR* value, const int32_t length, bool copyData ); - ~StringReader(); -}; - -/** A very simple inputstreamreader implementation. For a -* more complete InputStreamReader, use the jstreams version -* located in the contrib package -*/ -class SimpleInputStreamReader: public jstreams::BufferedInputStream{ - int32_t decode(TCHAR* start, int32_t space); - int encoding; - enum{ - ASCII=1, - UTF8=2, - UCS2_LE=3 - }; - bool finishedDecoding; - jstreams::StreamBase* input; - int32_t charsLeft; - - jstreams::InputStreamBuffer charbuf; - int32_t fillBuffer(TCHAR* start, int32_t space); -public: - SimpleInputStreamReader(jstreams::StreamBase *i, const char* encoding); - ~SimpleInputStreamReader(); -}; - -/** -* A helper class which constructs a FileReader with a specified -* simple encodings, or a given inputstreamreader -*/ -class FileReader: public Reader{ - jstreams::FileInputStream* input; -public: - FileReader ( const char* path, const char* enc, - const int32_t cachelen = 13, - const int32_t cachebuff = 14 ); //todo: optimise these cache values - ~FileReader (); - - int32_t read(const TCHAR*& start, int32_t _min, int32_t _max); - int64_t mark(int32_t readlimit); - int64_t reset(int64_t); -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp b/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp deleted file mode 100644 index b5f1ca238..000000000 --- a/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "StringBuffer.h" -#include "Misc.h" - -CL_NS_DEF(util) - - StringBuffer::StringBuffer(TCHAR* buf,int32_t maxlen, const bool consumeBuffer){ - buffer = buf; - bufferLength = maxlen; - bufferOwner = !consumeBuffer; - len = 0; - } - StringBuffer::StringBuffer(){ - //Func - Constructor. Allocates a buffer with the default length. - //Pre - true - //Post - buffer of length bufferLength has been allocated - - //Initialize - bufferLength = LUCENE_DEFAULT_TOKEN_BUFFER_SIZE; - len = 0; - //Allocate a buffer of length bufferLength - buffer = _CL_NEWARRAY(TCHAR,bufferLength); - bufferOwner = true; - } - - StringBuffer::StringBuffer(const int32_t initSize){ - //Func - Constructor. Allocates a buffer of length initSize + 1 - //Pre - initSize > 0 - //Post - A buffer has been allocated of length initSize + 1 - - //Initialize the bufferLength to initSize + 1 The +1 is for the terminator '\0' - bufferLength = initSize + 1; - len = 0; - //Allocate a buffer of length bufferLength - buffer = _CL_NEWARRAY(TCHAR,bufferLength); - bufferOwner = true; - } - - StringBuffer::StringBuffer(const TCHAR* value){ - //Func - Constructor. - // Creates an instance of Stringbuffer containing a copy of the string value - //Pre - value != NULL - //Post - An instance of StringBuffer has been created containing the copy of the string value - - //Initialize the length of the string to be stored in buffer - len = (int32_t) _tcslen(value); - - //Calculate the space occupied in buffer by a copy of value - const int32_t occupiedLength = len + 1; - - // Minimum allocated buffer length is LUCENE_DEFAULT_TOKEN_BUFFER_SIZE. - bufferLength = (occupiedLength >= LUCENE_DEFAULT_TOKEN_BUFFER_SIZE - ? occupiedLength : LUCENE_DEFAULT_TOKEN_BUFFER_SIZE); - - //Allocate a buffer of length bufferLength - buffer = _CL_NEWARRAY(TCHAR,bufferLength); - bufferOwner = true; - //Copy the string value into buffer - _tcsncpy(buffer, value, occupiedLength); - //Assert that the buffer has been terminated at the end of the string - CND_PRECONDITION (buffer[len] == '\0', "Buffer was not correctly terminated"); - } - - StringBuffer::~StringBuffer() { - // Func - Destructor - // Pre - true - // Post - Instanc has been destroyed - - if( bufferOwner ){ - _CLDELETE_CARRAY(buffer); - }else - buffer = NULL; - } - void StringBuffer::clear(){ - //Func - Clears the Stringbuffer and resets it to it default empty state - //Pre - true - //Post - pre(buffer) has been destroyed and a new one has been allocated - - //Destroy the current buffer if present - _CLDELETE_CARRAY(buffer); - - //Initialize - len = 0; - bufferLength = LUCENE_DEFAULT_TOKEN_BUFFER_SIZE; - //Allocate a buffer of length bufferLength - buffer = _CL_NEWARRAY(TCHAR,bufferLength); - } - - void StringBuffer::appendChar(const TCHAR character) { - //Func - Appends a single character - //Pre - true - //Post - The character has been appended to the string in the buffer - - //Check if the current buffer length is sufficient to have the string value appended - if (len + 1 > bufferLength){ - //Have the size of the current string buffer increased because it is too small - growBuffer(len + 1); - } - //Put character at position len which is the end of the string in the buffer - //Note that this action might overwrite the terminator of the string '\0', which - //is kind of tricky - buffer[len] = character; - //Increase the len by to represent the correct length of the string in the buffer - len++; - } - - void StringBuffer::append(const TCHAR* value) { - //Func - Appends a copy of the string value - //Pre - value != NULL - //Post - value has been copied and appended to the string in buffer - - append(value, _tcslen(value)); - } - void StringBuffer::append(const TCHAR* value, size_t appendedLength) { - //Func - Appends a copy of the string value - //Pre - value != NULL - // appendedLength contains the length of the string value which is to be appended - //Post - value has been copied and appended to the string in buffer - - //Check if the current buffer length is sufficient to have the string value appended - if (len + appendedLength + 1 > bufferLength){ - //Have the size of the current string buffer increased because it is too small - growBuffer(len + appendedLength + 1); - } - - //Copy the string value into the buffer at postion len - _tcsncpy(buffer + len, value, appendedLength); - - //Add the length of the copied string to len to reflect the new length of the string in - //the buffer (Note: len is not the bufferlength!) - len += appendedLength; - } - - void StringBuffer::appendInt(const int32_t value) { - //Func - Appends an integer (after conversion to a character string) - //Pre - true - //Post - The converted integer value has been appended to the string in buffer - - //instantiate a buffer of 30 charactes for the conversion of the integer - TCHAR buf[30]; - //Convert the integer value to a string buf using the radix 10 (duh) - _i64tot(value, buf, 10); - //Have the converted integer now stored in buf appended to the string in buffer - append(buf); - } - - void StringBuffer::appendFloat(const qreal value, const int32_t digits){ - //Func - Appends a qreal (after conversion to a character string) - //Pre - digits > 0. Indicates the minimum number of characters printed - //Post - The converted qreal value has been appended to the string in buffer - - //using sprintf("%f" was not reliable on other plaforms... we use a custom float convertor - //bvk: also, using sprintf and %f seems excessivelly slow - if(digits>8) - _CLTHROWA(CL_ERR_IllegalArgument,"Too many digits..."); - - //the maximum number of characters that int64 will hold is 23. so we need 23*2+2 - TCHAR buf[48]; //the buffer to hold - int64_t v = (int64_t)value; //the integer value of the float - _i64tot(v,buf,10); //add the whole number - - size_t len = 99-_tcslen(buf); //how many digits we have to work with? - size_t dig = len< (size_t)digits ? len : digits; - if ( dig > 0 ){ - _tcscat(buf,_T(".")); //add a decimal point - - int64_t remi=(int64_t)((value-v)*pow((qreal)10,(qreal)(dig+1))); //take the remainder and make a whole number - if ( remi<0 ) remi*=-1; - int64_t remadj=remi/10; - if ( remi-(remadj*10) >=5 ) - remadj++; //adjust remainder - - // add as many zeros as necessary between the decimal point and the - // significant part of the number. Fixes a bug when trying to print - // numbers that have zeros right after the decimal point - if (remadj) { - int32_t numZeros = dig - (int32_t)log10((qreal)remadj) - 1; - while(numZeros-- > 0) - _tcscat(buf,_T("0")); //add a zero before the decimal point - } - - _i64tot(remadj,buf+_tcslen(buf),10); //add the remainder - } - - append(buf); - } - - void StringBuffer::prepend(const TCHAR* value){ - //Func - Puts a copy of the string value infront of the current string in the StringBuffer - //Pre - value != NULL - //Post - The string in pre(buffer) has been shifted n positions where n equals the length of value. - // The string value was then copied to the beginning of stringbuffer - - prepend(value, _tcslen(value)); - } - - void StringBuffer::prepend(const TCHAR* value, const size_t prependedLength) { - //Func - Puts a copy of the string value in front of the string in the StringBuffer - //Pre - value != NULL - // prependedLength contains the length of the string value which is to be prepended - //Post - A copy of the string value is has been in front of the string in buffer - //todo: something is wrong with this code, i'm sure... it only grows (and therefore moves if the buffer is to small) - //Check if the current buffer length is sufficient to have the string value prepended - if (prependedLength + len + 1 > bufferLength){ - //Have the size of the current string buffer increased because it is too small - //Because prependedLength is passed as the second argument to growBuffer, - //growBuffer will have left the first prependedLength characters empty - //when it recopied buffer during reallocation. - growBuffer(prependedLength + len + 1, prependedLength); - } - - //Copy the string value into the buffer at postion 0 - _tcsncpy(buffer, value, prependedLength); - //Add the length of the copied string to len to reflect the new length of the string in - //the buffer (Note: len is not the bufferlength!) - len += prependedLength; - } - - int32_t StringBuffer::length() const{ - //Func - Returns the length of the string in the StringBuffer - //Pre - true - //Post - The length len of the string in the buffer has been returned - - return len; - } - TCHAR* StringBuffer::toString(){ - //Func - Returns a copy of the current string in the StringBuffer sized equal to the length of the string - // in the StringBuffer. - //Pre - true - //Post - The copied string has been returned - - //Instantiate a buffer equal to the length len + 1 - TCHAR* ret = _CL_NEWARRAY(TCHAR,len + 1); - if (ret){ - //Copy the string in buffer - _tcsncpy(ret, buffer, len); - //terminate the string - ret[len] = '\0'; - } - //return the the copy - return ret; - } - TCHAR* StringBuffer::getBuffer() { - //Func - '\0' terminates the buffer and returns its pointer - //Pre - true - //Post - buffer has been '\0' terminated and returned - - // Check if the current buffer is '\0' terminated - if (len == bufferLength){ - //Make space for terminator, if necessary. - growBuffer(len + 1); - } - //'\0' buffer so it can be returned properly - buffer[len] = '\0'; - - return buffer; - } - - void StringBuffer::reserve(const int32_t size){ - if ( bufferLength >= size ) - return; - bufferLength = size; - - //Allocate a new buffer of length bufferLength - TCHAR* tmp = _CL_NEWARRAY(TCHAR,bufferLength); - _tcsncpy(tmp, buffer, len); - tmp[len] = '\0'; - - //destroy the old buffer - if (buffer){ - _CLDELETE_CARRAY(buffer); - } - //Assign the new buffer tmp to buffer - buffer = tmp; - } - - void StringBuffer::growBuffer(const int32_t minLength) { - //Func - Has the buffer grown to a minimum length of minLength or bigger - //Pre - minLength >= len + 1 - //Post - The buffer has been grown to a minimum length of minLength or bigger - - growBuffer(minLength, 0); - } - void StringBuffer::growBuffer(const int32_t minLength, const int32_t skippingNInitialChars) { - //Func - Has the buffer grown to a minimum length of minLength or bigger and shifts the - // current string in buffer by skippingNInitialChars forward - //Pre - After growth, must have at least enough room for contents + terminator so - // minLength >= skippingNInitialChars + len + 1 - // skippingNInitialChars >= 0 - //Post - The buffer has been grown to a minimum length of minLength or bigger and - // if skippingNInitialChars > 0, the contents of the buffer has beeen shifted - // forward by skippingNInitialChars positions as the buffer is reallocated, - // leaving the first skippingNInitialChars uninitialized (presumably to be - // filled immediately thereafter by the caller). - - CND_PRECONDITION (skippingNInitialChars >= 0, "skippingNInitialChars is less than zero"); - CND_PRECONDITION (minLength >= skippingNInitialChars + len + 1,"skippingNInitialChars is not large enough"); - - //More aggressive growth strategy to offset smaller default buffer size: - if ( !bufferOwner ){ - if ( bufferLength 0 ){ - printf("ERROR: stringaPool still contains intern'd strings (refcounts):\n"); - __strintrntype::iterator itr = stringaPool.begin(); - while ( itr != stringaPool.end() ){ - printf(" %s (%d)\n",(itr->first), (itr->second)); - ++itr; - } - } - - if ( stringPool.size() > 0 ){ - printf("ERROR: stringPool still contains intern'd strings (refcounts):\n"); - __wcsintrntype::iterator itr = stringPool.begin(); - while ( itr != stringPool.end() ){ - _tprintf(_T(" %s (%d)\n"),(itr->first), (itr->second)); - ++itr; - } - } - #endif - } - - const TCHAR* CLStringIntern::intern(const TCHAR* str CL_FILELINEPARAM){ - if ( str == NULL ) - return NULL; - if ( str[0] == 0 ) - return LUCENE_BLANK_STRING; - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - __wcsintrntype::iterator itr = stringPool.find(str); - if ( itr==stringPool.end() ){ -#ifdef _UCS2 - TCHAR* ret = lucenewcsdup(str CL_FILELINEREF); -#else - TCHAR* ret = lucenestrdup(str CL_FILELINEREF); -#endif - stringPool[ret]= 1; - return ret; - }else{ - (itr->second)++; - return itr->first; - } - } - - bool CLStringIntern::unintern(const TCHAR* str){ - if ( str == NULL ) - return false; - if ( str[0] == 0 ) - return false; - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - __wcsintrntype::iterator itr = stringPool.find(str); - if ( itr != stringPool.end() ){ - if ( (itr->second) == 1 ){ - stringPool.removeitr(itr); - return true; - }else - (itr->second)--; - } - return false; - } - - const char* CLStringIntern::internA(const char* str CL_FILELINEPARAM){ - if ( str == NULL ) - return NULL; - if ( str[0] == 0 ) - return _LUCENE_BLANK_ASTRING; - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - __strintrntype::iterator itr = stringaPool.find(str); - if ( itr==stringaPool.end() ){ - char* ret = lucenestrdup(str CL_FILELINE); - stringaPool[ret] = 1; - return ret; - }else{ - (itr->second)++; - return itr->first; - } - } - - bool CLStringIntern::uninternA(const char* str){ - if ( str == NULL ) - return false; - if ( str[0] == 0 ) - return false; - - SCOPED_LOCK_MUTEX(THIS_LOCK) - - __strintrntype::iterator itr = stringaPool.find(str); - if ( itr!=stringaPool.end() ){ - if ( (itr->second) == 1 ){ - stringaPool.removeitr(itr); - return true; - }else - (itr->second)--; - } - return false; - } - - /* removed because of multi-threading problems... - __wcsintrntype::iterator CLStringIntern::internitr(const TCHAR* str CL_FILELINEPARAM){ - if ( str[0] == 0 ){ - if ( !blanksinitd ){ - CLStringIntern::stringPool.put(LUCENE_BLANK_STRING,1); - wblank=stringPool.find(str); - blanksinitd=true; - } - return wblank; - } - __wcsintrntype::iterator itr = stringPool.find(str); - if (itr==stringPool.end()){ -#ifdef _UCS2 - TCHAR* ret = lucenewcsdup(str CL_FILELINEREF); -#else - TCHAR* ret = lucenestrdup(str CL_FILELINEREF); -#endif - stringPool.put(ret,1); - return stringPool.find(str); - }else{ - (itr->second)++; - return itr; - } - } - bool CLStringIntern::uninternitr(__wcsintrntype::iterator itr){ - if ( itr!=stringPool.end() ){ - if ( itr==wblank ) - return false; - if ( (itr->second) == 1 ){ - stringPool.removeitr(itr); - return true; - }else - (itr->second)--; - } - return false; - } -*/ - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/StringIntern.h b/3rdparty/clucene/src/CLucene/util/StringIntern.h deleted file mode 100644 index ded060c64..000000000 --- a/3rdparty/clucene/src/CLucene/util/StringIntern.h +++ /dev/null @@ -1,61 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_StringIntern_H -#define _lucene_util_StringIntern_H - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "VoidMap.h" -CL_NS_DEF(util) -typedef CL_NS(util)::CLHashMap __wcsintrntype; -typedef CL_NS(util)::CLHashMap __strintrntype; - - /** Functions for intern'ing strings. This - * is a process of pooling strings thus using less memory, - * and furthermore allows intern'd strings to be directly - * compared: - * string1==string2, rather than _tcscmp(string1,string2) - */ - class CLStringIntern{ - static __wcsintrntype stringPool; - static __strintrntype stringaPool; - STATIC_DEFINE_MUTEX(THIS_LOCK) - public: - /** - * Internalise the specified string. - * \return Returns a pointer to the internalised string - */ - static const char* internA(const char* str CL_FILELINEPARAM); - /** - * Uninternalise the specified string. Decreases - * the reference count and frees the string if - * reference count is zero - * \returns true if string was destroyed, otherwise false - */ - static bool uninternA(const char* str); - - /** - * Internalise the specified string. - * \return Returns a pointer to the internalised string - */ - static const TCHAR* intern(const TCHAR* str CL_FILELINEPARAM); - - /** - * Uninternalise the specified string. Decreases - * the reference count and frees the string if - * reference count is zero - * \returns true if string was destroyed, otherwise false - */ - static bool unintern(const TCHAR* str); - - static void shutdown(); - }; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp b/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp deleted file mode 100644 index a54c86916..000000000 --- a/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "CLucene/LuceneThreads.h" -#include "ThreadLocal.h" - -CL_NS_DEF(util) - -DEFINE_MUTEX(ThreadLocalBase::ThreadLocalBase_THIS_LOCK) - -ThreadLocalBase::ShutdownHooksType ThreadLocalBase::shutdownHooks(false); -ThreadLocalBase::ThreadLocalsType ThreadLocalBase::threadLocals(false,false); - -ThreadLocalBase::ThreadLocalBase(){ -} -ThreadLocalBase::~ThreadLocalBase(){ -} - -void ThreadLocalBase::UnregisterCurrentThread(){ - _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; - SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) - - ThreadLocalsType::iterator itr = threadLocals.lower_bound(id); - ThreadLocalsType::iterator end = threadLocals.upper_bound(id); - while ( itr != end ){ - itr->second->setNull(); - ++itr; - } -} -void ThreadLocalBase::shutdown(){ - SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) - - ThreadLocalsType::iterator itr = threadLocals.begin(); - while ( itr != threadLocals.end() ){ - itr->second->setNull(); - ++itr; - } - - ShutdownHooksType::iterator itr2 = shutdownHooks.begin(); - while ( itr2 != shutdownHooks.end() ){ - ShutdownHook* hook = *itr2; - hook(false); - } -} -void ThreadLocalBase::registerShutdownHook(ShutdownHook* hook){ - SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) - shutdownHooks.insert(hook); -} - - -CL_NS_END diff --git a/3rdparty/clucene/src/CLucene/util/ThreadLocal.h b/3rdparty/clucene/src/CLucene/util/ThreadLocal.h deleted file mode 100644 index f67c76ca9..000000000 --- a/3rdparty/clucene/src/CLucene/util/ThreadLocal.h +++ /dev/null @@ -1,143 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_ThreadLocal_H -#define _lucene_util_ThreadLocal_H - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "CLucene/util/VoidMap.h" - -CL_NS_DEF(util) - -class ThreadLocalBase: LUCENE_BASE{ -public: - /** - * A hook called when CLucene is starting or shutting down, - * this can be used for setting up and tearing down static - * variables - */ - typedef void ShutdownHook(bool startup); - -protected: - STATIC_DEFINE_MUTEX(ThreadLocalBase_THIS_LOCK) - typedef CL_NS(util)::CLMultiMap<_LUCENE_THREADID_TYPE, ThreadLocalBase*, - CL_NS(util)::CLuceneThreadIdCompare, - CL_NS(util)::Deletor::ConstNullVal<_LUCENE_THREADID_TYPE>, - CL_NS(util)::Deletor::ConstNullVal > ThreadLocalsType; - static ThreadLocalsType threadLocals; - //todo: using http://en.wikipedia.org/wiki/Thread-local_storage#Pthreads_implementation - //would work better... but lots of testing would be needed first... - typedef CL_NS(util)::CLSetList, - CL_NS(util)::Deletor::ConstNullVal > ShutdownHooksType; - static ShutdownHooksType shutdownHooks; - - ThreadLocalBase(); -public: - virtual ~ThreadLocalBase(); - - /** - * Call this function to clear the local thread data for this - * ThreadLocal. Calling set(NULL) does the same thing, except - * this function is virtual and can be called without knowing - * the template. - */ - virtual void setNull() = 0; - - /** - * If you want to clean up thread specific memory, then you should - * make sure this thread is called when the thread is not going to be used - * again. This will clean up threadlocal data which can contain quite a lot - * of data, so if you are creating lots of new threads, then it is a good idea - * to use this function, otherwise there will be many memory leaks. - */ - static void UnregisterCurrentThread(); - - /** - * Call this function to shutdown CLucene - */ - static void shutdown(); - - /** - * Add this function to the shutdown hook list. This function will be called - * when CLucene is shutdown. - */ - static void registerShutdownHook(ShutdownHook* hook); -}; - -template -class ThreadLocal: public ThreadLocalBase{ - typedef CL_NS(util)::CLSet<_LUCENE_THREADID_TYPE, T, - CL_NS(util)::CLuceneThreadIdCompare, - CL_NS(util)::Deletor::ConstNullVal<_LUCENE_THREADID_TYPE>, - _deletor > LocalsType; - LocalsType locals; - DEFINE_MUTEX(locals_LOCK) -public: - ThreadLocal(); - ~ThreadLocal(); - T get(); - void setNull(); - void set(T t); -}; - -template -ThreadLocal::ThreadLocal(): - locals(false,true) -{ - //add this object to the base's list of threadlocals to be - //notified in case of UnregisterThread() - _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; - SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) - threadLocals.insert( CL_NS_STD(pair)(id, this) ); -} - -template -ThreadLocal::~ThreadLocal(){ - //remove this object to the base's list of threadlocals - _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; - SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) - - //remove all the thread local data for this object - locals.clear(); - - //remove this object from the ThreadLocalBase threadLocal list - ThreadLocalsType::iterator itr = threadLocals.lower_bound(id); - ThreadLocalsType::iterator end = threadLocals.upper_bound(id); - while ( itr != end ){ - if ( itr->second == this){ - threadLocals.erase(itr); - break; - } - ++itr; - } -} - -template -T ThreadLocal::get(){ - return locals.get(_LUCENE_CURRTHREADID); -} - -template -void ThreadLocal::setNull(){ - set(NULL); -} - -template -void ThreadLocal::set(T t){ - _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; - locals.remove(id); - if ( t != NULL ) - locals.insert( CL_NS_STD(pair)(id, t) ); -} - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/VoidList.h b/3rdparty/clucene/src/CLucene/util/VoidList.h deleted file mode 100644 index cd6908876..000000000 --- a/3rdparty/clucene/src/CLucene/util/VoidList.h +++ /dev/null @@ -1,175 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_VoidList_ -#define _lucene_util_VoidList_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#include "Equators.h" - -CL_NS_DEF(util) - -/** -* A template to encapsulate various list type classes -* @internal -*/ -template -class __CLList:public _base,LUCENE_BASE { -private: - bool dv; - typedef _base base; -public: - DEFINE_MUTEX(THIS_LOCK) - - typedef typename _base::const_iterator const_iterator; - typedef typename _base::iterator iterator; - - virtual ~__CLList(){ - clear(); - } - - __CLList ( const bool deleteValue ): - dv(deleteValue) - { - } - - void setDoDelete(bool val){ dv=val; } - - //sets array to the contents of this array. - //array must be size+1, otherwise memory may be overwritten - void toArray(_kt* into) const{ - int i=0; - for ( const_iterator itr=base::begin();itr!=base::end();itr++ ){ - into[i] = *itr; - i++; - } - into[i] = NULL; - } - - void set(int32_t i, _kt val) { - if ( dv ) - _valueDeletor::doDelete((*this)[i]); - (*this)[i] = val; - } - - //todo: check this - void delete_back(){ - if ( base::size() > 0 ){ - iterator itr = base::end(); - if ( itr != base::begin()) - itr --; - _kt key = *itr; - base::erase(itr); - if ( dv ) - _valueDeletor::doDelete(key); - } - } - - void delete_front(){ - if ( base::size() > 0 ){ - iterator itr = base::begin(); - _kt key = *itr; - base::erase(itr); - if ( dv ) - _valueDeletor::doDelete(key); - } - } - - void clear(){ - if ( dv ){ - iterator itr = base::begin(); - while ( itr != base::end() ){ - _valueDeletor::doDelete(*itr); - ++itr; - } - } - base::clear(); - } - - void remove(int32_t i, bool dontDelete=false){ - iterator itr=base::begin(); - itr+=i; - _kt key = *itr; - base::erase( itr ); - if ( dv && !dontDelete ) - _valueDeletor::doDelete(key); - } - void remove(iterator itr, bool dontDelete=false){ - _kt key = *itr; - base::erase( itr ); - if ( dv && !dontDelete ) - _valueDeletor::doDelete(key); - } - -}; - -//growable arrays of Objects (like a collection or list) -//a list, so can contain duplicates -//it grows in chunks... todo: check jlucene for initial size of array, and growfactors -template -class CLVector:public __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor> -{ -public: - CLVector ( const bool deleteValue=true ): - __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor>(deleteValue) - { - } -}; - -//An array-backed implementation of the List interface -//a list, so can contain duplicates -//*** a very simple list - use -//(This class is roughly equivalent to Vector, except that it is unsynchronized.) -#define CLArrayList CLVector -#define CLHashSet CLHashList - -//implementation of the List interface, provides access to the first and last list elements in O(1) -//no comparator is required... and so can contain duplicates -//a simple list with no comparator -//*** a very simple list - use -#ifdef LUCENE_DISABLE_HASHING - #define CLHashList CLSetList -#else - -template -class CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> -{ -public: - CLHashList ( const bool deleteValue=true ): - __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor>(deleteValue) - { - } -}; -#endif - -template -class CLLinkedList:public __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor> -{ -public: - CLLinkedList ( const bool deleteValue=true ): - __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor>(deleteValue) - { - } -}; -template -class CLSetList:public __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor> -{ -public: - CLSetList ( const bool deleteValue=true ): - __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor>(deleteValue) - { - } -}; - -CL_NS_END -#endif diff --git a/3rdparty/clucene/src/CLucene/util/VoidMap.h b/3rdparty/clucene/src/CLucene/util/VoidMap.h deleted file mode 100644 index b22b507e9..000000000 --- a/3rdparty/clucene/src/CLucene/util/VoidMap.h +++ /dev/null @@ -1,270 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_util_VoidMap_ -#define _lucene_util_VoidMap_ - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - - -CL_NS_DEF(util) - -/** -* A template to encapsulate various map type classes -* @internal -*/ -template -class __CLMap:public _base,LUCENE_BASE { -private: - bool dk; - bool dv; - typedef _base base; -public: - DEFINE_MUTEX(THIS_LOCK) - - typedef typename _base::iterator iterator; - typedef typename _base::const_iterator const_iterator; - typedef CL_NS_STD(pair)<_kt, _vt> _pair; - - ///Default constructor for the __CLMap - __CLMap (): - dk(true), - dv(true) - { - } - - ///Deconstructor for the __CLMap - ~__CLMap (){ - clear(); - } - - void setDeleteKey(bool val){ dk = val; } - void setDeleteValue(bool val){ dv = val; } - - ///Construct the VoidMap and set the deleteTypes to the specified values - ///\param deleteKey if true then the key variable is deleted when an object is deleted - ///\param keyDelType delete the key variable using the specified type - ///\param deleteValue if true then the value variable is deleted when an object is deleted - ///\param valueDelType delete the value variable using the specified type - /*__CLMap ( const bool deleteKey, const bool deleteValue ): - dk(deleteKey), - dv(deleteValue) - { - }*/ - - ///checks to see if the specified key exists - ///\param k the key to check for - ///\returns true if the key exists - bool exists(_kt k)const{ - const_iterator itr = base::find(k); - bool ret = itr!=base::end(); - return ret; - } - - ///put the specified pair into the map. remove any old items first - ///\param k the key - ///\param v the value - void put(_kt k,_vt v){ - //todo: check if this is always right! - //must should look through code, for - //cases where map is not unique!!! - if ( dk || dv ) - remove(k); - - //todo: replacing the old item might be quicker... - - base::insert(_pair(k,v)); - } - - - ///using a non-const key, get a non-const value - _vt get( _kt k) const { - const_iterator itr = base::find(k); - if ( itr==base::end() ) - return _vt(); - else - return itr->second; - } - ///using a non-const key, get the actual key - _kt getKey( _kt k) const { - const_iterator itr = base::find(k); - if ( itr==base::end() ) - return _kt(); - else - return itr->first; - } - - void removeitr (iterator itr, const bool dontDeleteKey = false, const bool dontDeleteValue = false){ - //delete key&val first. This prevents potential loops (deleting object removes itself) - _kt key = itr->first; - _vt val = itr->second; - base::erase(itr); - - //keys & vals need to be deleted after erase, because the hashvalue is still needed - if ( dk && !dontDeleteKey ) - _KeyDeletor::doDelete(key); - if ( dv && !dontDeleteValue ) - _ValueDeletor::doDelete(val); - } - ///delete and optionally delete the specified key and associated value - void remove(_kt key, const bool dontDeleteKey = false, const bool dontDeleteValue = false){ - iterator itr = base::find(key); - if ( itr!=base::end() ) - removeitr(itr,dontDeleteKey,dontDeleteValue); - } - - ///clear all keys and values in the map - void clear(){ - if ( dk || dv ){ - iterator itr = base::begin(); - while ( itr!=base::end() ){ - #ifdef _CL_HAVE_EXT_HASH_MAP - removeitr(itr); - itr = base::begin(); - - #else - if ( dk ) - _KeyDeletor::doDelete(itr->first); - if ( dv ) - _ValueDeletor::doDelete(itr->second); - ++itr; - - #endif - } - } - base::clear(); - } -}; - -// makes no guarantees as to the order of the map -// cannot contain duplicate keys; each key can map to at most one value -#define CLHashtable CLHashMap - -#if defined(_CL_HAVE_GOOGLE_DENSE_HASH_MAP) -//do nothing -#elif defined(LUCENE_DISABLE_HASHING) - - //a CLSet with CLHashMap traits -template -class CLHashMap:public __CLMap<_kt,_vt, - CL_NS_STD(map)<_kt,_vt, _Compare>, - _KeyDeletor,_ValueDeletor> -{ - typedef typename CL_NS_STD(map)<_kt,_vt,_Compare> _base; - typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, _Compare>, - _KeyDeletor,_ValueDeletor> _this; -public: - CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) - { - _this::setDeleteKey(deleteKey); - _this::setDeleteValue(deleteValue); - } -}; -#elif defined(_CL_HAVE_EXT_HASH_MAP) - //ext/hash_map syntax -//HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized -template -class CLHashMap:public __CLMap<_kt,_vt, - CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, - _KeyDeletor,_ValueDeletor> -{ - typedef __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, - _KeyDeletor,_ValueDeletor> _this; -public: - CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) - { - _this::setDeleteKey(deleteKey); - _this::setDeleteValue(deleteValue); - } -}; - -#else -//HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized -template -class CLHashMap:public __CLMap<_kt,_vt, - CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, - _KeyDeletor,_ValueDeletor> -{ - typedef __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, - _KeyDeletor,_ValueDeletor> _this; -public: - CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) - { - _this::setDeleteKey(deleteKey); - _this::setDeleteValue(deleteValue); - } -}; -#endif - -//A collection that contains no duplicates -//does not guarantee that the order will remain constant over time -template -class CLSet:public __CLMap<_kt,_vt, - CL_NS_STD(map)<_kt,_vt, _Compare>, - _KeyDeletor,_ValueDeletor> -{ - typedef typename CL_NS_STD(map)<_kt,_vt,_Compare> _base; - typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, _Compare>, - _KeyDeletor,_ValueDeletor> _this; -public: - CLSet ( const bool deleteKey=false, const bool deleteValue=false ) - { - _this::setDeleteKey(deleteKey); - _this::setDeleteValue(deleteValue); - } -}; - - -//A collection that can contains duplicates -template -class CLMultiMap:public __CLMap<_kt,_vt, - CL_NS_STD(multimap)<_kt,_vt>, - _KeyDeletor,_ValueDeletor> -{ - typedef typename CL_NS_STD(multimap)<_kt,_vt> _base; - typedef __CLMap<_kt, _vt, CL_NS_STD(multimap)<_kt,_vt>, - _KeyDeletor,_ValueDeletor> _this; -public: - CLMultiMap ( const bool deleteKey=false, const bool deleteValue=false ) - { - _this::setDeleteKey(deleteKey); - _this::setDeleteValue(deleteValue); - } -}; - - -//*** need to create a class that allows duplicates - use -//#define CLSet __CLMap -CL_NS_END - -#ifdef _CL_HAVE_GOOGLE_DENSE_HASH_MAP -#include "GoogleSparseMap.h" -#endif - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/bufferedstream.h b/3rdparty/clucene/src/CLucene/util/bufferedstream.h deleted file mode 100644 index d905955b1..000000000 --- a/3rdparty/clucene/src/CLucene/util/bufferedstream.h +++ /dev/null @@ -1,157 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Jos van den Oever -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -/* This file is part of Strigi Desktop Search - * - * Copyright (C) 2006 Jos van den Oever - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifndef BUFFEREDSTREAM_H -#define BUFFEREDSTREAM_H - -#include "streambase.h" -#include "inputstreambuffer.h" - -#include -#include - -namespace jstreams { - -template -class BufferedInputStream : public StreamBase { -private: - bool finishedWritingToBuffer; - InputStreamBuffer buffer; - - void writeToBuffer(int32_t minsize); - int32_t read_(const T*& start, int32_t min, int32_t max); -protected: - /** - * This function must be implemented by the subclasses. - * It should write a maximum of @p space characters at the buffer - * position pointed to by @p start. If no more data is available due to - * end of file, -1 should be returned. If an error occurs, the status - * should be set to Error, an error message should be set and the function - * must return -1. - **/ - virtual int32_t fillBuffer(T* start, int32_t space) = 0; - // this function might be useful if you want to reuse a bufferedstream - void resetBuffer() {printf("implement 'resetBuffer'\n");} - BufferedInputStream(); -public: - int32_t read(const T*& start, int32_t min, int32_t max); - int64_t reset(int64_t); - virtual int64_t skip(int64_t ntoskip); -}; - -template -BufferedInputStream::BufferedInputStream() { - finishedWritingToBuffer = false; -} - -template -void -BufferedInputStream::writeToBuffer(int32_t ntoread) { - int32_t missing = ntoread - buffer.avail; - int32_t nwritten = 0; - while (missing > 0 && nwritten >= 0) { - int32_t space; - space = buffer.makeSpace(missing); - T* start = buffer.readPos + buffer.avail; - nwritten = fillBuffer(start, space); - assert(StreamBase::status != Eof); - if (nwritten > 0) { - buffer.avail += nwritten; - missing = ntoread - buffer.avail; - } - } - if (nwritten < 0) { - finishedWritingToBuffer = true; - } -} -template -int32_t -BufferedInputStream::read(const T*& start, int32_t min, int32_t max) { - if (StreamBase::status == Error) return -2; - if (StreamBase::status == Eof) return -1; - - // do we need to read data into the buffer? - if (!finishedWritingToBuffer && min > buffer.avail) { - // do we have enough space in the buffer? - writeToBuffer(min); - if (StreamBase::status == Error) return -2; - } - - int32_t nread = buffer.read(start, max); - - BufferedInputStream::position += nread; - if (BufferedInputStream::position > BufferedInputStream::size - && BufferedInputStream::size > 0) { - // error: we read more than was specified in size - // this is an error because all dependent code might have been labouring - // under a misapprehension - BufferedInputStream::status = Error; - BufferedInputStream::error = "Stream is longer than specified."; - nread = -2; - } else if (BufferedInputStream::status == Ok && buffer.avail == 0 - && finishedWritingToBuffer) { - BufferedInputStream::status = Eof; - if (BufferedInputStream::size == -1) { - BufferedInputStream::size = BufferedInputStream::position; - } - // save one call to read() by already returning -1 if no data is there - if (nread == 0) nread = -1; - } - return nread; -} -template -int64_t -BufferedInputStream::reset(int64_t newpos) { - if (StreamBase::status == Error) return -2; - // check to see if we have this position - int64_t d = BufferedInputStream::position - newpos; - if (buffer.readPos - d >= buffer.start && -d < buffer.avail) { - BufferedInputStream::position -= d; - buffer.avail += (int32_t)d; - buffer.readPos -= d; - StreamBase::status = Ok; - } - return StreamBase::position; -} -template -int64_t -BufferedInputStream::skip(int64_t ntoskip) { - const T *begin; - int32_t nread; - int64_t skipped = 0; - while (ntoskip) { - int32_t step = (int32_t)((ntoskip > buffer.size) ?buffer.size :ntoskip); - nread = read(begin, 1, step); - if (nread <= 0) { - return skipped; - } - ntoskip -= nread; - skipped += nread; - } - return skipped; -} -} - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/dirent.cpp b/3rdparty/clucene/src/CLucene/util/dirent.cpp deleted file mode 100644 index 3c5c54200..000000000 --- a/3rdparty/clucene/src/CLucene/util/dirent.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Matt J. Weinstein -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" - -#if !defined(_CL_HAVE_DIRENT_H) && !defined(_CL_HAVE_SYS_NDIR_H) && !defined(_CL_HAVE_SYS_DIR_H) && !defined(_CL_HAVE_NDIR_H) -#include "dirent.h" - -DIR * -opendir (const char *szPath) -{ - DIR *nd; - char szFullPath[CL_MAX_PATH]; - - errno = 0; - - if (!szPath) - { - errno = EFAULT; - return NULL; - } - - if (szPath[0] == '\0') - { - errno = ENOTDIR; - return NULL; - } - - /* Attempt to determine if the given path really is a directory. */ - struct _stat rcs; - if ( _stat(szPath,&rcs) == -1) - { - /* call GetLastError for more error info */ - errno = ENOENT; - return NULL; - } - if (!(rcs.st_mode & _S_IFDIR)) - { - /* Error, entry exists but not a directory. */ - errno = ENOTDIR; - return NULL; - } - - /* Make an absolute pathname. */ - _realpath(szPath,szFullPath); - - /* Allocate enough space to store DIR structure and the complete - * directory path given. */ - //nd = (DIR *) malloc (sizeof (DIR) + _tcslen (szFullPath) + _tcslen (DIRENT_SLASH) + - // _tcslen (DIRENT_SEARCH_SUFFIX)+1); - nd = new DIR; - - if (!nd) - { - /* Error, out of memory. */ - errno = ENOMEM; - return NULL; - } - - /* Create the search expression. */ - strcpy (nd->dd_name, szFullPath); - - /* Add on a slash if the path does not end with one. */ - if (nd->dd_name[0] != '\0' && - nd->dd_name[strlen (nd->dd_name) - 1] != '/' && - nd->dd_name[strlen (nd->dd_name) - 1] != '\\') - { - strcat (nd->dd_name, DIRENT_SLASH); - } - - /* Add on the search pattern */ - strcat (nd->dd_name, DIRENT_SEARCH_SUFFIX); - - /* Initialize handle to -1 so that a premature closedir doesn't try - * to call _findclose on it. */ - nd->dd_handle = -1; - - /* Initialize the status. */ - nd->dd_stat = 0; - - /* Initialize the dirent structure. ino and reclen are invalid under - * Win32, and name simply points at the appropriate part of the - * findfirst_t structure. */ - //nd->dd_dir.d_ino = 0; - //nd->dd_dir.d_reclen = 0; - nd->dd_dir.d_namlen = 0; - nd->dd_dir.d_name = nd->dd_dta.name; - - return nd; -} - - -struct dirent * readdir (DIR * dirp) -{ - errno = 0; - - /* Check for valid DIR struct. */ - if (!dirp) - { - errno = EFAULT; - return NULL; - } - - if (dirp->dd_dir.d_name != dirp->dd_dta.name) - { - /* The structure does not seem to be set up correctly. */ - errno = EINVAL; - return NULL; - } - - bool bCallFindNext = true; - - if (dirp->dd_stat < 0) - { - /* We have already returned all files in the directory - * (or the structure has an invalid dd_stat). */ - return NULL; - } - else if (dirp->dd_stat == 0) - { - /* We haven't started the search yet. */ - /* Start the search */ - dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta)); - - if (dirp->dd_handle == -1) - { - /* Whoops! Seems there are no files in that - * directory. */ - dirp->dd_stat = -1; - } - else - { - dirp->dd_stat = 1; - } - - /* Dont call _findnext first time. */ - bCallFindNext = false; - } - - while (dirp->dd_stat > 0) - { - if (bCallFindNext) - { - /* Get the next search entry. */ - if (_findnext (dirp->dd_handle, &(dirp->dd_dta))) - { - /* We are off the end or otherwise error. */ - _findclose (dirp->dd_handle); - dirp->dd_handle = -1; - dirp->dd_stat = -1; - return NULL; - } - else - { - /* Update the status to indicate the correct - * number. */ - dirp->dd_stat++; - } - } - - /* Successfully got an entry. Everything about the file is - * already appropriately filled in except the length of the - * file name. */ - dirp->dd_dir.d_namlen = strlen (dirp->dd_dir.d_name); - - bool bThisFolderOrUpFolder = dirp->dd_dir.d_name[0] == '.' && - (dirp->dd_dir.d_name[1] == 0 || (dirp->dd_dir.d_name[1] == '.' && dirp->dd_dir.d_name[2] == 0)); - - if (!bThisFolderOrUpFolder) - { - struct _stat buf; - char buffer[CL_MAX_DIR]; - size_t bl = strlen(dirp->dd_name)-strlen(DIRENT_SEARCH_SUFFIX); - strncpy(buffer,dirp->dd_name,bl); - buffer[bl]=0; - strcat(buffer, dirp->dd_dir.d_name); - if ( _stat(buffer,&buf) == 0 ) - { - /* Finally we have a valid entry. */ - return &dirp->dd_dir; - } - } - - /* Allow to find next file. */ - bCallFindNext = true; - } - - return NULL; -} - - - -int32_t -closedir (DIR * dirp) -{ - int32_t rc; - - errno = 0; - rc = 0; - - if (!dirp) - { - errno = EFAULT; - return -1; - } - - if (dirp->dd_handle != -1) - { - rc = _findclose (dirp->dd_handle); - } - - /* Delete the dir structure. */ - _CLVDELETE(dirp); - - return rc; -} -#endif //HAVE_DIRENT_H - diff --git a/3rdparty/clucene/src/CLucene/util/dirent.h b/3rdparty/clucene/src/CLucene/util/dirent.h deleted file mode 100644 index 71cd34c0a..000000000 --- a/3rdparty/clucene/src/CLucene/util/dirent.h +++ /dev/null @@ -1,105 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Matt J. Weinstein -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef lucene_util_dirent_H -#define lucene_util_dirent_H - -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - -#if !defined(_CL_HAVE_DIRENT_H) && !defined(_CL_HAVE_SYS_NDIR_H) && !defined(_CL_HAVE_SYS_DIR_H) && !defined(_CL_HAVE_NDIR_H) - -/** -\unit - * dirent.c - * - * Derived from DIRLIB.C by Matt J. Weinstein - * This note appears in the DIRLIB.H - * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 - * - * Updated by Jeremy Bettis - * Significantly revised and rewinddir, seekdir and telldir added by Colin - * Cut down again & changed by Ben van Klinken - * Peters - * - */ - -/** dirent structure - used by the dirent.h directory iteration functions */ -struct dirent -{ - unsigned short d_namlen; /* Length of name in d_name. */ - char *d_name; /* File name. */ -}; - -/** DIR structure - used by the dirent.h directory iteration functions*/ -struct DIR -{ - /** disk transfer area for this dir */ - struct _finddata_t dd_dta; - - /* dirent struct to return from dir (NOTE: this makes this thread - * safe as long as only one thread uses a particular DIR struct at - * a time) */ - struct dirent dd_dir; - - /** _findnext handle */ - intptr_t dd_handle; - - /** - * Status of search: - * 0 = not started yet (next entry to read is first entry) - * -1 = off the end - * positive = 0 based index of next entry - */ - int32_t dd_stat; - - /** given path for dir with search pattern (struct is extended) */ - char dd_name[CL_MAX_DIR]; - -}; - -#define DIRENT_SEARCH_SUFFIX "*" -#define DIRENT_SLASH PATH_DELIMITERA - - -/** -* Returns a pointer to a DIR structure appropriately filled in to begin -* searching a directory. -*/ -DIR* opendir (const char* filespec); - -/** -* Return a pointer to a dirent structure filled with the information on the -* next entry in the directory. -*/ -struct dirent* readdir (DIR* dir); - -/** -* Frees up resources allocated by opendir. -*/ -int32_t closedir (DIR* dir); - - -#elif defined (_CL_HAVE_DIRENT_H) -# include -# define NAMLEN(dirent) strlen((dirent)->d_name) - -#else -# define dirent direct -# define NAMLEN(dirent) (dirent)->d_namlen -# if defined(_CL_HAVE_SYS_NDIR_H) -# include -# endif -# if defined(_CL_HHAVE_SYS_DIR_H) -# include -# endif -# if defined(_CL_HHAVE_NDIR_H) -# include -# endif - -#endif //HAVE_DIRENT_H -#endif diff --git a/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp b/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp deleted file mode 100644 index 9125d8478..000000000 --- a/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Jos van den Oever -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -/* This file is part of Strigi Desktop Search - * - * Copyright (C) 2006 Jos van den Oever - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#include "jstreamsconfig.h" -#include "fileinputstream.h" - -#ifndef UNDER_CE -#include -#endif -#include -namespace jstreams { - -const int32_t FileInputStream::defaultBufferSize = 1048576; -FileInputStream::FileInputStream(const char *filepath, int32_t buffersize) { - // try to open the file for reading - file = fopen(filepath, "rb"); - this->filepath = filepath; - if (file == 0) { - // handle error - error = "Could not read file '"; - error += filepath; - error += "': "; -#ifndef UNDER_CE - error += strerror(errno); -#endif - status = Error; - return; - } - // determine file size. if the stream is not seekable, the size will be -1 - fseek(file, 0, SEEK_END); - size = ftell(file); - fseek(file, 0, SEEK_SET); - - // if the file has size 0, make sure that it's really empty - // this is useful for filesystems like /proc that report files as size 0 - // for files that do contain content - if (size == 0) { - char dummy[1]; - size_t n = fread(dummy, 1, 1, file); - if (n == 1) { - size = -1; - fseek(file, 0, SEEK_SET); - } else { - fclose(file); - file = 0; - return; - } - } - - // allocate memory in the buffer - int32_t bufsize = (size <= buffersize) ?size+1 :buffersize; - mark(bufsize); -} -FileInputStream::~FileInputStream() { - if (file) { - if (fclose(file)) { - // handle error - error = "Could not close file '" + filepath + "'."; - } - } -} -int32_t -FileInputStream::fillBuffer(char* start, int32_t space) { - if (file == 0) return -1; - // read into the buffer - int32_t nwritten = fread(start, 1, space, file); - // check the file stream status - if (ferror(file)) { - error = "Could not read from file '" + filepath + "'."; - fclose(file); - file = 0; - status = Error; - return -1; - } - if (feof(file)) { - fclose(file); - file = 0; - } - return nwritten; -} -} diff --git a/3rdparty/clucene/src/CLucene/util/fileinputstream.h b/3rdparty/clucene/src/CLucene/util/fileinputstream.h deleted file mode 100644 index 144423da8..000000000 --- a/3rdparty/clucene/src/CLucene/util/fileinputstream.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2003-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef FILEINPUTSTREAM_H -#define FILEINPUTSTREAM_H - -#include "bufferedstream.h" - -namespace jstreams { - -class FileInputStream : public BufferedInputStream { -private: - FILE *file; - std::string filepath; - -public: - static const int32_t defaultBufferSize; - FileInputStream(const char *filepath, int32_t buffersize=defaultBufferSize); - ~FileInputStream(); - int32_t fillBuffer(char* start, int32_t space); -}; - -} // end namespace jstreams - -#endif - diff --git a/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h b/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h deleted file mode 100644 index 873e811cd..000000000 --- a/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h +++ /dev/null @@ -1,126 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Jos van den Oever -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -/* This file is part of Strigi Desktop Search - * - * Copyright (C) 2006 Jos van den Oever - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifndef INPUTSTREAMBUFFER_H -#define INPUTSTREAMBUFFER_H - -#include - -namespace jstreams { - -template -class InputStreamBuffer { -private: -public: - T* start; - int32_t size; - T* readPos; - int32_t avail; - - InputStreamBuffer(); - ~InputStreamBuffer(); - void setSize(int32_t size); - int32_t read(const T*& start, int32_t max=0); - - /** - * This function prepares the buffer for a new write. - * returns the number of available places. - **/ - int32_t makeSpace(int32_t needed); -}; - -template -InputStreamBuffer::InputStreamBuffer() { - readPos = start = 0; - size = avail = 0; -} -template -InputStreamBuffer::~InputStreamBuffer() { - free(start); -} -template -void -InputStreamBuffer::setSize(int32_t size) { - // store pointer information - int32_t offset = (int32_t)(readPos - start); - - // allocate memory in the buffer - if ( start == 0 ) - start = (T*)malloc(size*sizeof(T)); - else - start = (T*)realloc(start, size*sizeof(T)); - this->size = size; - - // restore pointer information - readPos = start + offset; -} -template -int32_t -InputStreamBuffer::makeSpace(int32_t needed) { - // determine how much space is available for writing - int32_t space = size - ((int32_t)(readPos - start)) - avail; - if (space >= needed) { - // there's enough space - return space; - } - - if (avail) { - if (readPos != start) { -// printf("moving\n"); - // move data to the start of the buffer - memmove(start, readPos, avail*sizeof(T)); - space += (int32_t)(readPos - start); - readPos = start; - } - } else { - // we may start writing at the start of the buffer - readPos = start; - space = size; - } - if (space >= needed) { - // there's enough space now - return space; - } - - // still not enough space, we have to allocate more -// printf("resize %i %i %i %i %i\n", avail, needed, space, size + needed - space, size); - setSize(size + needed - space); - return needed; -} -template -int32_t -InputStreamBuffer::read(const T*& start, int32_t max) { - start = readPos; - if (max <= 0 || max > avail) { - max = avail; - } - readPos += max; - avail -= max; - return max; -} - -} // end namespace jstreams - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h b/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h deleted file mode 100644 index 2a6ce9f8d..000000000 --- a/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h +++ /dev/null @@ -1,9 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ - -//this is just a compatibility header for jstreams -#include "CLucene/StdHeader.h" diff --git a/3rdparty/clucene/src/CLucene/util/streambase.h b/3rdparty/clucene/src/CLucene/util/streambase.h deleted file mode 100644 index b0d9dc167..000000000 --- a/3rdparty/clucene/src/CLucene/util/streambase.h +++ /dev/null @@ -1,148 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Jos van den Oever -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -* -* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -------------------------------------------------------------------------------*/ -/* This file is part of Strigi Desktop Search - * - * Copyright (C) 2006 Jos van den Oever - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifndef STREAMBASE_H -#define STREAMBASE_H - -#include - -#if defined(_BUILD_FOR_QT_) - #include "StdHeader.h" -#endif - -#define INT32MAX 0x7FFFFFFFL - -namespace jstreams { - -enum StreamStatus { Ok, Eof, Error }; - -/** - * @short Base class for stream read access to many different file types. - * - * This class is based on the interface java.io.InputStream. It allows - * for uniform access to streamed resources. - * The main difference with the java equivalent is a performance improvement. - * When reading data, data is not copied into a buffer provided by the caller, - * but a pointer to the read data is provided. This makes this interface - * especially useful for deriving from it and implementing filterers or - * transformers. - */ -// java mapping: long=int64, int=int32, byte=uint8_t -template -class StreamBase { -protected: - int64_t size; - int64_t position; - std::string error; - StreamStatus status; -public: - StreamBase() :size(-1), position(0), status(Ok){ } - virtual ~StreamBase(){} - /** - * @brief Return a string representation of the last error. - * If no error has occurred, an empty string is returned. - **/ - const char* getError() const { return error.c_str(); } - StreamStatus getStatus() const { return status; } - /** - * @brief Get the current position in the stream. - * The value obtained from this function can be used to reset the stream. - **/ - int64_t getPosition() const { return position; } - /** - * @brief Return the size of the stream. - * If the size of the stream is unknown, -1 - * is returned. If the end of the stream has been reached the size is - * always known. - **/ - int64_t getSize() const { return size; } - /** - * @brief Reads characters from the stream and sets \a start to - * the first character that was read. - * - * If @p ntoread is @c 0, then at least one character will be read. - * - * @param start Pointer passed by reference that will be set to point to - * the retrieved array of characters. If the end of the stream - * is encountered or an error occurs, the value of @p start - * is undefined. - * @param min The number of characters to read from the stream. - * @param max The maximum number of characters to read from the stream. - * @return the number of characters that were read. If -1 is returned, the - * end of the stream has been reached. If -2 is returned, an error - * has occurred. - **/ - virtual int32_t read(const T*& start, int32_t min, int32_t max) = 0; - /** - * Skip @param ntoskip bytes. Unless an error occurs or the end of file is - * encountered, this amount of bytes is skipped. - * This function returns new position in the stream. - **/ - virtual int64_t skip(int64_t ntoskip); - /** - * @brief Repositions this stream to given requested position. - * Reset is guaranteed to work after a successful call to read(), - * when the new position is in the range of the data returned by read(). - * This means that @p pos must lie between than the position - * corresponding to the start parameter (x) of the read function - * and the position corresponding to the last position in the returned - * buffer (x + nread). - **/ - virtual int64_t reset(int64_t pos) = 0; - int64_t mark(int32_t readlimit) { - int64_t p = getPosition(); - const T* ptr; - read(ptr, readlimit, -1); - return reset(p); - } -}; -#define SKIPSTEP 1024 -template -int64_t -StreamBase::skip(int64_t ntoskip) { - const T *begin; - int32_t nread; - int64_t skipped = 0; - while (ntoskip) { - int32_t step = (int32_t)((ntoskip > SKIPSTEP) ?SKIPSTEP :ntoskip); - nread = read(begin, 1, step); - if (nread < -1 ) { - // an error occurred - return nread; - } else if (nread < 1) { - ntoskip = 0; - } else { - skipped += nread; - ntoskip -= nread; - } - } - return skipped; -} - -} // end namespace jstreams - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/stringreader.h b/3rdparty/clucene/src/CLucene/util/stringreader.h deleted file mode 100644 index 698d07e37..000000000 --- a/3rdparty/clucene/src/CLucene/util/stringreader.h +++ /dev/null @@ -1,124 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Jos van den Oever -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -/* This file is part of Strigi Desktop Search - * - * Copyright (C) 2006 Jos van den Oever - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifndef STRINGREADER_H -#define STRINGREADER_H - -/** - * Author: Jos van den Oever - * Ben van Klinken - **/ - - -#include "streambase.h" - -namespace jstreams { - -template -class StringReader : public StreamBase { -private: - int64_t markpt; - T* data; - bool dataowner; - StringReader(const StringReader&); - void operator=(const StringReader&); -public: - StringReader(const T* value, int32_t length = -1, bool copy = true); - ~StringReader(); - int32_t read(const T*& start, int32_t min, int32_t max); - int64_t skip(int64_t ntoskip); - int64_t reset(int64_t pos); -}; - -typedef StringReader StringInputStream; - -template -StringReader::StringReader(const T* value, int32_t length, bool copy) - : markpt(0), dataowner(copy) { - if (length < 0) { - length = 0; - while (value[length] != '\0') { - length++; - } - } - StreamBase::size = length; - if (copy) { - data = new T[length+1]; - size_t s = (size_t)(length*sizeof(T)); - memcpy(data, value, s); - data[length] = 0; - } else { - // casting away const is ok, because we don't write anyway - data = (T*)value; - } -} -template -StringReader::~StringReader() { - if (dataowner) { - delete [] data; - } -} -template -int32_t -StringReader::read(const T*& start, int32_t min, int32_t max) { - int64_t left = StreamBase::size - StreamBase::position; - if (left == 0) { - StreamBase::status = Eof; - return -1; - } - if (min < 0) min = 0; - int32_t nread = (int32_t)((max > left || max < 1) ?left :max); - start = data + StreamBase::position; - StreamBase::position += nread; - if (StreamBase::position == StreamBase::size) { - StreamBase::status = Eof; - } - return nread; -} -template -int64_t -StringReader::skip(int64_t ntoskip) { - const T* start; - return read(start, ntoskip, ntoskip); -} -template -int64_t -StringReader::reset(int64_t newpos) { - if (newpos < 0) { - StreamBase::status = Ok; - StreamBase::position = 0; - } else if (newpos < StreamBase::size) { - StreamBase::status = Ok; - StreamBase::position = newpos; - } else { - StreamBase::position = StreamBase::size; - StreamBase::status = Eof; - } - return StreamBase::position; -} - -} // end namespace jstreams - -#endif diff --git a/3rdparty/clucene/src/CLucene/util/subinputstream.h b/3rdparty/clucene/src/CLucene/util/subinputstream.h deleted file mode 100644 index 8ae3e33c7..000000000 --- a/3rdparty/clucene/src/CLucene/util/subinputstream.h +++ /dev/null @@ -1,141 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Jos van den Oever -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -/* This file is part of Strigi Desktop Search - * - * Copyright (C) 2006 Jos van den Oever - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#ifndef SUBINPUTSTREAM_H -#define SUBINPUTSTREAM_H - -#include "streambase.h" - -namespace jstreams { - -template -class SubInputStream : public StreamBase { -private: - const int64_t offset; - StreamBase *input; -public: - SubInputStream(StreamBase *input, int64_t size=-1); - int32_t read(const T*& start, int32_t min, int32_t max); - int64_t reset(int64_t newpos); - int64_t skip(int64_t ntoskip); -}; -template -SubInputStream::SubInputStream(StreamBase *i, int64_t length) - : offset(i->getPosition()), input(i) { - assert(length >= -1); -// printf("substream offset: %lli\n", offset); - StreamBase::size = length; -} - -template -int32_t SubInputStream::read(const T*& start, int32_t min, int32_t max) { - if (StreamBase::size != -1) { - const int64_t left = StreamBase::size - StreamBase::position; - if (left == 0) { - return -1; - } - // restrict the amount of data that can be read - if (max <= 0 || max > left) { - max = (int32_t)left; - } - if (min > max) min = max; - if (left < min) min = (int32_t)left; - } - int32_t nread = input->read(start, min, max); - if (nread < -1) { - fprintf(stderr, "substream too short.\n"); - StreamBase::status = Error; - StreamBase::error = input->getError(); - } else if (nread < min) { - if (StreamBase::size == -1) { - StreamBase::status = Eof; - if (nread > 0) { - StreamBase::position += nread; - StreamBase::size = StreamBase::position; - } - } else { -// fprintf(stderr, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! nread %i min %i max %i size %lli\n", nread, min, max, size); -// fprintf(stderr, "pos %lli parentpos %lli\n", position, input->getPosition()); -// fprintf(stderr, "status: %i error: %s\n", input->getStatus(), input->getError()); - // we expected data but didn't get enough so that's an error - StreamBase::status = Error; - StreamBase::error = "Premature end of stream\n"; - nread = -2; - } - } else { - StreamBase::position += nread; - if (StreamBase::position == StreamBase::size) { - StreamBase::status = Eof; - } - } - return nread; -} - -template -int64_t SubInputStream::reset(int64_t newpos) { -// fprintf(stderr, "subreset pos: %lli newpos: %lli offset: %lli\n", position, -// newpos, offset); - StreamBase::position = input->reset(newpos + offset); - if (StreamBase::position < offset) { - printf("###########\n"); - StreamBase::status = Error; - StreamBase::error = input->getError(); - } else { - StreamBase::position -= offset; - StreamBase::status = input->getStatus(); - } - return StreamBase::position; -} - -template -int64_t SubInputStream::skip(int64_t ntoskip) { -// printf("subskip pos: %lli ntoskip: %lli offset: %lli\n", position, ntoskip, offset); - if (StreamBase::size == StreamBase::position) { - StreamBase::status = Eof; - return -1; - } - if (StreamBase::size != -1) { - const int64_t left = StreamBase::size - StreamBase::position; - // restrict the amount of data that can be skipped - if (ntoskip > left) { - ntoskip = left; - } - } - int64_t skipped = input->skip(ntoskip); - if (input->getStatus() == Error) { - StreamBase::status = Error; - StreamBase::error = input->getError(); - } else { - StreamBase::position += skipped; - if (StreamBase::position == StreamBase::size) { - StreamBase::status = Eof; - } - } - return skipped; -} - -} //end namespace jstreams - -#endif diff --git a/modules/qt_clucene.pri b/modules/qt_clucene.pri index 49e79f5b6..e8d56b5f7 100644 --- a/modules/qt_clucene.pri +++ b/modules/qt_clucene.pri @@ -7,8 +7,11 @@ QT.clucene.name = QtCLucene QT.clucene.bins = $$QT_MODULE_BIN_BASE QT.clucene.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtCLucene QT.clucene.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCLucene/$$QT.clucene.VERSION -QT.clucene.sources = $$QT_MODULE_BASE/src/assistant/lib/fulltextsearch +QT.clucene.sources = $$QT_MODULE_BASE/src/assistant/clucene QT.clucene.libs = $$QT_MODULE_LIB_BASE QT.clucene.plugins = $$QT_MODULE_PLUGIN_BASE QT.clucene.imports = $$QT_MODULE_IMPORT_BASE QT.clucene.depends = core +QT.clucene.defines = QT_CLUCLENE_LIB + +QT_CONFIG += clucene diff --git a/modules/qt_help.pri b/modules/qt_help.pri index f4e088780..a61086ccc 100644 --- a/modules/qt_help.pri +++ b/modules/qt_help.pri @@ -7,9 +7,11 @@ QT.help.name = QtHelp QT.help.bins = $$QT_MODULE_BIN_BASE QT.help.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtHelp QT.help.private_includes = $$QT_MODULE_INCLUDE_BASE/QtHelp/$$QT.help.VERSION -QT.help.sources = $$QT_MODULE_BASE/src/assistant/lib +QT.help.sources = $$QT_MODULE_BASE/src/assistant/help QT.help.libs = $$QT_MODULE_LIB_BASE QT.help.plugins = $$QT_MODULE_PLUGIN_BASE QT.help.imports = $$QT_MODULE_IMPORT_BASE -QT.help.depends = network xml sql +QT.help.depends = network sql QT.help.DEFINES = QT_HELP_LIB + +QT_CONFIG += help diff --git a/src/assistant/3rdparty/clucene/APACHE.license b/src/assistant/3rdparty/clucene/APACHE.license new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/APACHE.license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/assistant/3rdparty/clucene/AUTHORS b/src/assistant/3rdparty/clucene/AUTHORS new file mode 100644 index 000000000..4a7904b6d --- /dev/null +++ b/src/assistant/3rdparty/clucene/AUTHORS @@ -0,0 +1,22 @@ +As with most development projects, contributions come from many people and in +many forms. The CLucene project would like to thank it's many contributors. +Omissions are merely accidental, please e-mail ustramooner@users.sourceforge.net +if you have been left out or a contribution is not mentioned. + +CLucene was originally ported to C++ by Ben van Klinken (ustramooner@users.sourceforge.net) +from Doug Cutting's popular java search engine, Lucene (see http://lucene.apache.org). + +Here is a list of contributors. Please send me an email at ustramooner@users.sourceforge.net +if I have left you out. + +Doug Cutting cutting@users.sourceforge.net +John Wheeler j_wheeler@users.sourceforge.net +Robert G. Ristroph rgristroph@users.sourceforge.net +David Rushby woodsplitter@users.sourceforge.net +Jimmy Pritts jpritts@sdf.lonestar.org +Peter Edwards peter@dragonstaff.co.uk +Jorge Sabater Redondo jsabater@elderecho.com +Daniel Glassey danglassey@ntlworld.com +Peter Gladkikh batyi@mail.ru +Pedja amigo@max3d.com +Peter Hodges hodges.peter@gmail.com diff --git a/src/assistant/3rdparty/clucene/COPYING b/src/assistant/3rdparty/clucene/COPYING new file mode 100644 index 000000000..0e32bb4f3 --- /dev/null +++ b/src/assistant/3rdparty/clucene/COPYING @@ -0,0 +1,30 @@ +License + +The CLucene Core Library uses a dual license strategy for the source code. +These licenses are the GNU Lesser General Public License (LGPL) and the Apache +License (Version 2.0). Users can choose the license they wish to distribute +their software under. This means that you do not need to abide by *both* +licenses, but rather than you can choose the license which most suits your +needs. + +To rephrase this and to make it perfectly clear: +CLucene is distributed under the GNU Lesser General Public License (LGPL) + *or* +the Apache License, Version 2.0 + +However, we are an open source project, and we encourage users to use the LGPL +license and participate fully in the free software community. Dual licensing +of the CLucene source code provides open and free access to the technology both +for the GPL community and for other developers or companies that cannot use the +GPL. + +You can freely modify, extend, and improve the CLucene source code. The only +question is whether or not you must provide the source code and contribute +modifications to the community. The GNU and Apache licenses allow different +ranges of flexibility in this regard, but in the end, regardless of the license +used, we highly recommend that you submit any bugs, incompatibilities or +added features. + +Note that this same license does *not* apply to the CLucene Contributions +package. You should read the COPYING file in that directory or package for +more information. \ No newline at end of file diff --git a/src/assistant/3rdparty/clucene/ChangeLog b/src/assistant/3rdparty/clucene/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/src/assistant/3rdparty/clucene/LGPL.license b/src/assistant/3rdparty/clucene/LGPL.license new file mode 100644 index 000000000..422c76072 --- /dev/null +++ b/src/assistant/3rdparty/clucene/LGPL.license @@ -0,0 +1,475 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + +------------------------------------------------------------------------------- + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + +------------------------------------------------------------------------------- + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + +------------------------------------------------------------------------------- + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + +------------------------------------------------------------------------------- + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + +------------------------------------------------------------------------------- + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + +------------------------------------------------------------------------------- + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + +------------------------------------------------------------------------------- + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + +------------------------------------------------------------------------------- + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/src/assistant/3rdparty/clucene/README b/src/assistant/3rdparty/clucene/README new file mode 100644 index 000000000..ee4f49369 --- /dev/null +++ b/src/assistant/3rdparty/clucene/README @@ -0,0 +1,92 @@ +CLucene README +============== + +------------------------------------------------------ +CLucene is a C++ port of Lucene. +It is a high-performance, full-featured text search +engine written in C++. CLucene is faster than lucene +as it is written in C++. +------------------------------------------------------ + +CLucene has contributions from many, see AUTHORS + +CLucene is distributed under the GNU Lesser General Public License (LGPL) + *or* +the Apache License, Version 2.0 +See the LGPL.license and APACHE.license for the respective license information. +Read COPYING for more about the license. + +Installation +------------ +* For Linux, MacOSX, cygwin and MinGW build information, read INSTALL. +* Boost.Jam files are provided in the root directory and subdirectories. +* Microsoft Visual Studio (6&7) are provided in the win32 folder. + +Mailing List +------------ +Questions and discussion should be directed to the CLucene mailing list + at clucene-developers@lists.sourceforge.net +Find subscription instructions at + http://lists.sourceforge.net/lists/listinfo/clucene-developers +Suggestions and bug reports can be made on our bug tracking database + (http://sourceforge.net/tracker/?group_id=80013&atid=558446) + +The latest version +------------------ +Details of the latest version can be found on the CLucene sourceforge project +web site: http://www.sourceforge.net/projects/clucene + +Documentation +------------- +Documentation is provided at http://clucene.sourceforge.net/doc/doxygen/html/ +You can also build your own documentation by running doxygen from the root directory +of clucene. +CLucene is a very close port of Java Lucene, so you can also try looking at the +Java Docs on http://lucene.apache.org/java/ + + +Performance +----------- +Very little benchmarking has been done on clucene. Andi Vajda posted some +limited statistics on the clucene list a while ago with the following results. + +There are 250 HTML files under $JAVA_HOME/docs/api/java/util for about +6108kb of HTML text. +org.apache.lucene.demo.IndexFiles with java and gcj: +on mac os x 10.3.1 (panther) powerbook g4 1ghz 1gb: + . running with java 1.4.1_01-99 : 20379 ms + . running with gcj 3.3.2 -O2 : 17842 ms + . running clucene 0.8.9's demo : 9930 ms + +I recently did some more tests and came up with these rough tests: +663mb (797 files) of Guttenberg texts +on a Pentium 4 running Windows XP with 1 GB of RAM. Indexing max 100,000 fields +• Jlucene: 646453ms. peak mem usage ~72mb, avg ~14mb ram +• Clucene: 232141. peak mem usage ~60, avg ~4mb ram + +Searching indexing using 10,000 single word queries +• Jlucene: ~60078ms and used ~13mb ram +• Clucene: ~48359ms and used ~4.2mb ram + +Platform notes +-------------- + +'Too many open files' +Some platforms don't provide enough file handles to run CLucene properly. +To solve this, increase the open file limit: + +On Solaris: +ulimit -n 1024 +set rlim_fd_cur=1024 + +Acknowledgments +---------------- + +The Apache Lucene project is the basis for this software, so the biggest +acknoledgment goes to that project. + +We wish to acknowledge the following copyrighted works that +make up portions of the CLucene software: + +CLucene relies heavily on the use of autoconf and libtool to provide +a build environment. diff --git a/src/assistant/3rdparty/clucene/src/CLucene.h b/src/assistant/3rdparty/clucene/src/CLucene.h new file mode 100644 index 000000000..1eac800fd --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene.h @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +//Includes some standard headers for searching and indexing. +#ifndef _lucene_CLucene_ +#define _lucene_CLucene_ + +#include "CLucene/StdHeader.h" +#include "CLucene/debug/condition.h" +#include "CLucene/debug/mem.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/IndexWriter.h" +#include "CLucene/index/MultiReader.h" +#include "CLucene/index/Term.h" +#include "CLucene/search/IndexSearcher.h" +#include "CLucene/search/MultiSearcher.h" +#include "CLucene/search/DateFilter.h" +#include "CLucene/search/WildcardQuery.h" +#include "CLucene/search/FuzzyQuery.h" +#include "CLucene/search/PhraseQuery.h" +#include "CLucene/search/PrefixQuery.h" +#include "CLucene/search/RangeQuery.h" +#include "CLucene/search/BooleanQuery.h" +#include "CLucene/document/Document.h" +#include "CLucene/document/Field.h" +#include "CLucene/document/DateField.h" +#include "CLucene/store/Directory.h" +#include "CLucene/store/FSDirectory.h" +#include "CLucene/queryParser/QueryParser.h" +#include "CLucene/queryParser/MultiFieldQueryParser.h" +#include "CLucene/analysis/standard/StandardAnalyzer.h" +#include "CLucene/analysis/Analyzers.h" +#include "CLucene/util/Reader.h" + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/CLBackwards.h b/src/assistant/3rdparty/clucene/src/CLucene/CLBackwards.h new file mode 100644 index 000000000..ffaf42824 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/CLBackwards.h @@ -0,0 +1,87 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _clucene_backwards_h +#define _clucene_backwards_h + +//In light of the recent major changes to clucene, +//this file should help to maintain some backwards compatibility +//include it after including StdHeader.h +// +//Note: I haven't tested this much, so please send me your changes + +//dirent is one of the most major changes that won't easily port. +//you can use the TCHAR copying macros, STRCPY_TtoA and STRCPY_AtoT +//to copy between different character types. + +//If you use stringPrintF, you will need to add the target string +//size parameter, because it is using _sntprintf... Change this if you +//want, but _sntprintf is much safer + +#define char_t TCHAR +#define uchar_t TCHAR +#define l_byte_t byte_t + +//#define stringSpn _tcsspn //not used in clucene anymore +#define stringCSpn _tcscspn +#define stringLength _tcslen +//#define stringToInteger _ttoi //not used in clucene anymore, use integer w/ base +#define stringFind _tcsstr +#define stringFindChar _tcschr +#define stringCompare _tcscmp +#define stringNCopy _tcsncpy +#define stringCopy _tcscpy +#define stringCat _tcscat +//#define stringToken _tcstok //not used in clucene anymore +#define stringPrintF _sntprintf //you will have errors, because now we used printf w/ bufferlen count +#define printFormatted _tprintf + +//conversion functions +#define integerToString _i64tot +#define stringToIntegerBase _tcstoi64 +#define stringToFloat _tcstod + +//file find structures +#define Cmd_Stat fileStat +#define Struct_Stat fileStat +#define stringICompare _tcsicmp +#define stringNCompare _tcsncmp +#define stringDifference _tcscmp + +//character conversion functions +#define isSpace _istspace +#define isDigit _istwdigit +#define isAlNum _istwalnum +#define toLower _totlower +#define stringUpper _tcsupr +//#define stringLower _tcslwr //not used in clucene anymore + +#define _THROWX(y) _THROWT(y) +#define _THROWC(y) _THROWA(y) + +//file naming stuff - remember we have changed all names to file naming lower case +#define fileRename _rename +#define fileFullName(abs,rel) _realpath(rel,abs) +#define makeDirectory _tmkdir +#define unlinkFile _unlink + +//no longer supported definitions +#ifdef _UNICODE + #define TO_CHAR_T STRDUP_AtoT + #define _cout wcout + #define _cin wcin + #define _cerr wcerr +#else + #define TO_CHAR_T STRDUP_WtoT + #define _cout cout + #define _cin cin + #define _cerr cerr +#endif + +//some headers that used to be automatically included: +#include "CLucene/util/dirent.h" //if we have dirent, then the native one will be used + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/CLConfig.h b/src/assistant/3rdparty/clucene/src/CLucene/CLConfig.h new file mode 100644 index 000000000..c63c083ff --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/CLConfig.h @@ -0,0 +1,304 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_Config_ +#define _lucene_Config_ + + +//////////////////////////////////////////////////////////////////// +// this settings should be set up in the compiler, +// but are put here for reference as to what could be defined +//////////////////////////////////////////////////////////////////// +// +//define this if you want debugging code to be enabled +//#define _DEBUG +// +//define this if you want condition debugging to be enabled +#if defined(_DEBUG) && !defined(_CL__CND_DEBUG) + #define _CL__CND_DEBUG +#endif +// +//define this to print out lots of information about merges, etc +//requires __CL__CND_DEBUG to be defined +//#define _CL_DEBUG_INFO stdout +// +//to disable namespaces define this +//#define DISABLE_NAMESPACE +// +//This is mostly for windows. If you have put the google sparse +//map code in your include path somewhere, then define this +//to use it. +//However, for msvc, there are no significant gains since there +//is already a compatible hashmap available. +//#define _CL_HAVE_GOOGLE_DENSE_HASH_MAP +// +//////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////// +// These options can be set depending on the particular needs of +// Your application +//////////////////////////////////////////////////////////////////// +// +//define this to force the build into ascii mode +//#define _ASCII +// +//define this to force the build into ucs2 mode +//#define _UCS2 +// +//if a wide character is being converted to a ascii character and it +//cannot fit, this character is used instead. Required. +#define LUCENE_OOR_CHAR(c) ((char)(((unsigned short)c)&0xFF)) +// +//define if you would like to force clucene to use the internal +//character functions. +//Tests may display unpredictable behaviour if this is not defined. +#define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS +// +//define this to enable mmap support in the fsdirectory IndexInput +//todo: only available for windows so far...need to add MMapInput.cpp to project +//EXPERIMENTAL +//#define LUCENE_FS_MMAP +// +//LOCK_DIR implementation: +//define this to set an exact directory for the lock dir (not recommended) +//all other methods of getting the temporary directory will be ignored +//#define LUCENE_LOCK_DIR "/tmp" +// +//define this to try and load the lock dir from this specified environment variable +#define LUCENE_LOCK_DIR_ENV_1 "TEMP" +//define this if you want to have look up this environment variable if the first one fails +#define LUCENE_LOCK_DIR_ENV_2 "TMP" +//define this if you want to have a fallback directory, if not defined then +//the lockdirectory will be the index directory +#define LUCENE_LOCK_DIR_ENV_FALLBACK "/tmp" +// +//////////////////////////////////////////////////////////////////// + + + +//////////////////////////////////////////////////////////////////// +// The following are search query options +// THe NO_* options can make CLucene faster and/or smaller +// special queries sometime require longer search times or may +// not be required +//////////////////////////////////////////////////////////////////// +// +//Define this to remove fuzzy query and sloppy scoring +//#define NO_FUZZY_QUERY +// +//Define to remove wildcard t*m or te?m to match term +//#define NO_WILDCARD_QUERY +// +//Define to remove prefix term query - ter* to match term or terms +//#define NO_PREFIX_QUERY +// +//Define to remove range (exlusive and inclusive) +//#define NO_RANGE_QUERY +// +//This must always be defined. They can be adjusted if required. But +//general Wildcard string would be '*' and Wildcard Char would be '?' +//Both are Required. +#define LUCENE_WILDCARDTERMENUM_WILDCARD_STRING '*' +#define LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR '?' +// +//////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////// +// memory handling configurations +//////////////////////////////////////////////////////////////////// +// +//If this is defined, lucene's configurations are changed +//to use less memory, but may run slower. +//todo: i dont think this actualy changes speed much, just memory +#define LUCENE_OPTIMIZE_FOR_MEMORY +// +//define this if you want the pointer tracking to be enabled +//this is a useful tool for memory leak tracking +//The LuceneBase can slow down the code a *lot* +#if defined(_DEBUG) + #if !defined(LUCENE_DISABLE_MEMTRACKING) && !defined(LUCENE_ENABLE_MEMLEAKTRACKING) + #define LUCENE_ENABLE_MEMLEAKTRACKING + #endif +#endif +// +//enable use of rich file/line tracking. use CL_FILELINE to pass +//to functions like stringDuplicate (or use CL_STRDUP* functions instead) and +//CLStringIntern::x. +#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) + #define LUCENE_ENABLE_FILELINEINFO +#endif +// +//enable creation of clucene.log file. Logs every +//call to new operator. Must have LUCENE_ENABLE_MEMLEAKTRACKING enabled. +//writes log in this format. +//action,file name,file line,allocation size +//logging can be disabled by setting _lucene_disable_debuglogging to true +#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) && defined(_DEBUG) +//#define LUCENE_ENABLE_CONSTRUCTOR_LOG +#endif +// +// +//enable this if you want to enable reference counting. This is +//not necessary or useful in most cases except when implementing wrappers +//which have reference counting. If the wrapper wraps a StringReader, +//for example, it should expect that the wrapped StringReader should not +//be deleted. However, when the stringreader is added into a Field, +//the Field usually takes over the stringReader and deletes it on completion. +//If reference counting is enabled, the wrapper can add a reference to any class +//and when _CLDECDELETE is called, the reference is decremented and only deleted +//if the refcount is zero. +#define LUCENE_ENABLE_REFCOUNT + + +//////////////////////////////////////////////////////////////////// +// These options allow you to remove certain implementations +// out of clucene so that they can be implemented in the client +// application +//////////////////////////////////////////////////////////////////// +// +//define this to your own setting if you would like to implement your own +//threading locking code. it should have the same sort of functions as +//mutex_default. If not defined, clucene will try and use posix,win32 critical +//sections, or a timer based mutex hack. +//#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_default +// +//define this if you want to implement the _Cnd_OutDebug routine yourself +//you can then easily customise in your own application how to handle debug messages +//#define _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG +// +//define this if you want to implement your own namespace macros +//#define _LUCENE_DONTIMPLEMENT_NS_MACROS +// +//define this if you do not want clucene to include any standard libraries. +//this could be useful if you want to use alternate libraries +//#define LUCENE_DISABLE_INCLUDES +// +//////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////// +// These options will be changed depending on your compiler/platform +// but can also be changed here if required +//////////////////////////////////////////////////////////////////// +// +//define this if multi-threading support is not required +//if not defined, multi-thread locking will +//occur (and its related processing overhead) +//note: it is recommended to disable multithreading if you do not need it +//there is a lot of overhead that can be avoided. +//#define _CL_DISABLE_MULTITHREADING +// +//if you want to define your own default file encoding. specify it +//here - normally defined in the platform specific headers +//#define PLATFORM_DEFAULT_READER_ENCODING CL_NS(util)::FileReader::ENCODING_ASCII +// +//disable hash implementations (if available) +//#define LUCENE_DISABLE_HASHING +//////////////////////////////////////////////////////////////////// + + + +//////////////////////////////////////////////////////////////////// +// These options should not be changed. But you can experiment with +// them to optimize performance +//////////////////////////////////////////////////////////////////// +// +//some defaults, wouldn't usually need to be changed +//Buffer size for input/output streams. Required. +#define LUCENE_STREAM_BUFFER_SIZE 1024 +// +// DSR:2004.08.19: +// Formerly, StringBuffer used 1024 as the default size of its internal buffer. +// However, StringBuffer is used primarily for token- and term-oriented +// processing, e.g. in StandardTokenizer. I've calculated that the average +// token (as produced by StandardTokenizer) in all .txt files distributed in +// the Project Gutenberg CD Image (August 2003 release) has only 6 characters. +// Although most languages are likely to have a longer average word length than +// English due to the popularity of "non-atomized" conjugation and declension +// mechanisms, 1024 is still vastly excessive. +// I made two changes intended to deliver better overall performance: +// a) Switched to a default StringBuffer character capacity of 32. Though 32 +// is longer than the average token, the high cost of realloc makes a +// slightly liberal default size optimal. I chose the default size of 32 +// after fairly extensive experimentation on the Gutenberg e-texts. The +// results are summarized in the following table: +// ------------------------------------------------------------------------ +// LUCENE_DEFAULT_TOKEN_BUFFER_SIZE value | % faster than default size 1024 +// ------------------------------------------------------------------------ +// 8 : 4% +// 16 : 7% +// 32 : 6% +// 64 : 3% +// A default size of 32 is actually slightly slower than 16, but I was +// experimenting on English text; I expect that 32 will maintain decent +// performance in languages such as German, and in technical documents +// with long tokens. +// +// b) To offset the switch to a smaller default buffer size, I implemented a +// more aggressive growth strategy. A StringBuffer now [at least] doubles +// the size of its internal buffer every time it needs to grow, rather +// than [at least] increasing by LUCENE_DEFAULT_TOKEN_BUFFER_SIZE no +// matter how many times it has already grown. +//Required. +#define LUCENE_DEFAULT_TOKEN_BUFFER_SIZE 32 +//todo: should implement a similar strategy in analysis/token +// +//Expert: The fraction of {@link TermDocs} entries stored in skip tables, +//used to accellerate {@link TermDocs#skipTo(int)}. Larger values result in +//smaller indices, greater acceleration, but fewer accelerable cases, while +//smaller values result in bigger indices, less acceleration and more +//accelerable cases. More detailed experiments would be useful here. */ +#define LUCENE_DEFAULT_TERMDOCS_SKIP_INTERVAL 16 +// +//Size of TermScore cache. Required. +#define LUCENE_SCORE_CACHE_SIZE 32 +// +//analysis options +//maximum length that the CharTokenizer uses. Required. +//By adjusting this value, you can greatly improve the performance of searching +//and especially indexing. Default is 255, but smaller numbers will decrease +//the amount of memory used as well as increasing the speed. +#define LUCENE_MAX_WORD_LEN 255 +//Maximum length of a token word. +//Should be the same or more than LUCENE_MAX_WORD_LEN +//if not defined, then no token limit, but may be slower +//if defined will be faster (up to 15% in some cases), but will use more memory +#ifndef LUCENE_OPTIMIZE_FOR_MEMORY + #define LUCENE_TOKEN_WORD_LENGTH LUCENE_MAX_WORD_LEN +#endif +// +//maximum field length. some optimisation can be done if a maximum field +//length is given... The smaller the better +#define LUCENE_MAX_FIELD_LEN 100 +// +//The initial value set to BooleanQuery::maxClauseCount. Default is 1024 +#define LUCENE_BOOLEANQUERY_MAXCLAUSECOUNT 1024 +// +//bvk: 12.3.2005 +//============================================================================== +//Previously the way the tokenizer has worked has been changed to optionally +//use a a fixed word length. I have implemented this in the Term class as well. +//It seems that by predefining the text length instead of using new TCHAR[x] +//in the constructor greatly improves the performance by 20-30% for certain +//operations. +//Maximum length of a term text. +//Should be the same or more than LUCENE_MAX_WORD_LEN +//if not defined, then no term text limit, but may be slower +//if defined will be faster (up to 30% in some cases), but will use more memory +#ifndef LUCENE_OPTIMIZE_FOR_MEMORY + #define LUCENE_TERM_TEXT_LENGTH LUCENE_MAX_WORD_LEN +#endif +// +//Size of the CharTokenizer buffersize. Required. +#define LUCENE_IO_BUFFER_SIZE 1024 +// +//the minimum amount the segment term enum should grow by. Must be at least 1 +#define LUCENE_SEGMENTTERMENUM_GROWSIZE 8 +// +//////////////////////////////////////////////////////////////////// + +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/CLMonolithic.cpp b/src/assistant/3rdparty/clucene/src/CLucene/CLMonolithic.cpp new file mode 100644 index 000000000..e3c279876 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/CLMonolithic.cpp @@ -0,0 +1,115 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +/* +* this is a monolithic file that can be used to compile clucene using one source file. +* it simplifies some build processes by avoiding static & dynamic compalation pitfalls. +* +* note: when creating a project add either this file, or all the other .cpp files, not both! +*/ +#include "CLucene/StdHeader.cpp" +#include "CLucene/analysis/Analyzers.cpp" +#include "CLucene/analysis/AnalysisHeader.cpp" +#include "CLucene/analysis/standard/StandardAnalyzer.cpp" +#include "CLucene/analysis/standard/StandardFilter.cpp" +#include "CLucene/analysis/standard/StandardTokenizer.cpp" +#include "CLucene/config/gunichartables.cpp" +#include "CLucene/config/repl_tcscasecmp.cpp" +#include "CLucene/config/repl_tcslwr.cpp" +#include "CLucene/config/repl_tcstod.cpp" +#include "CLucene/config/repl_lltot.cpp" +#include "CLucene/config/repl_tcstoll.cpp" +#include "CLucene/config/repl_tprintf.cpp" +#include "CLucene/config/threads.cpp" +#include "CLucene/config/utf8.cpp" +#include "CLucene/debug/condition.cpp" +#include "CLucene/debug/error.cpp" +#include "CLucene/debug/memtracking.cpp" +#include "CLucene/document/DateField.cpp" +#include "CLucene/document/Document.cpp" +#include "CLucene/document/Field.cpp" +#include "CLucene/index/CompoundFile.cpp" +#include "CLucene/index/DocumentWriter.cpp" +#include "CLucene/index/FieldInfos.cpp" +#include "CLucene/index/FieldsReader.cpp" +#include "CLucene/index/FieldsWriter.cpp" +#include "CLucene/index/IndexWriter.cpp" +#include "CLucene/index/IndexReader.cpp" +#include "CLucene/index/MultiReader.cpp" +#include "CLucene/index/SegmentInfos.cpp" +#include "CLucene/index/SegmentMergeInfo.cpp" +#include "CLucene/index/SegmentMergeQueue.cpp" +#include "CLucene/index/SegmentMerger.cpp" +#include "CLucene/index/SegmentReader.cpp" +#include "CLucene/index/SegmentTermDocs.cpp" +#include "CLucene/index/SegmentTermEnum.cpp" +#include "CLucene/index/SegmentTermPositions.cpp" +#include "CLucene/index/SegmentTermVector.cpp" +#include "CLucene/index/Term.cpp" +#include "CLucene/index/TermInfo.cpp" +#include "CLucene/index/TermInfosReader.cpp" +#include "CLucene/index/TermInfosWriter.cpp" +#include "CLucene/index/TermVectorReader.cpp" +#include "CLucene/index/TermVectorWriter.cpp" +#include "CLucene/queryParser/Lexer.cpp" +#include "CLucene/queryParser/MultiFieldQueryParser.cpp" +#include "CLucene/queryParser/QueryParser.cpp" +#include "CLucene/queryParser/QueryParserBase.cpp" +#include "CLucene/queryParser/QueryToken.cpp" +#include "CLucene/queryParser/TokenList.cpp" +#include "CLucene/search/BooleanQuery.cpp" +#include "CLucene/search/BooleanScorer.cpp" +#include "CLucene/search/CachingWrapperFilter.cpp" +#include "CLucene/search/ChainedFilter.cpp" +#include "CLucene/search/DateFilter.cpp" +#include "CLucene/search/ConjunctionScorer.cpp" +#include "CLucene/search/ExactPhraseScorer.cpp" +#include "CLucene/search/Explanation.cpp" +#include "CLucene/search/FieldCache.cpp" +#include "CLucene/search/FieldCacheImpl.cpp" +#include "CLucene/search/FieldDocSortedHitQueue.cpp" +#include "CLucene/search/FieldSortedHitQueue.cpp" +#include "CLucene/search/FilteredTermEnum.cpp" +#include "CLucene/search/FuzzyQuery.cpp" +#include "CLucene/search/Hits.cpp" +#include "CLucene/search/HitQueue.cpp" +#include "CLucene/search/IndexSearcher.cpp" +#include "CLucene/search/MultiSearcher.cpp" +#include "CLucene/search/MultiTermQuery.cpp" +#include "CLucene/search/PhrasePositions.cpp" +#include "CLucene/search/PhraseQuery.cpp" +#include "CLucene/search/PhraseScorer.cpp" +#include "CLucene/search/PrefixQuery.cpp" +#include "CLucene/search/QueryFilter.cpp" +#include "CLucene/search/RangeQuery.cpp" +#include "CLucene/search/RangeFilter.cpp" +#include "CLucene/search/SearchHeader.cpp" +#include "CLucene/search/Similarity.cpp" +#include "CLucene/search/SloppyPhraseScorer.cpp" +#include "CLucene/search/Sort.cpp" +#include "CLucene/search/TermQuery.cpp" +#include "CLucene/search/TermScorer.cpp" +#include "CLucene/search/WildcardQuery.cpp" +#include "CLucene/search/WildcardTermEnum.cpp" +#include "CLucene/store/FSDirectory.cpp" +#include "CLucene/store/IndexInput.cpp" +#include "CLucene/store/Lock.cpp" +#include "CLucene/store/MMapInput.cpp" +#include "CLucene/store/IndexOutput.cpp" +#include "CLucene/store/RAMDirectory.cpp" +#include "CLucene/store/TransactionalRAMDirectory.cpp" +#include "CLucene/util/BitSet.cpp" +#include "CLucene/util/Equators.cpp" +#include "CLucene/util/FastCharStream.cpp" +#include "CLucene/util/fileinputstream.cpp" +#include "CLucene/util/Misc.cpp" +#include "CLucene/util/Reader.cpp" +#include "CLucene/util/StringBuffer.cpp" +#include "CLucene/util/StringIntern.cpp" +#include "CLucene/util/dirent.cpp" +#include "CLucene/util/ThreadLocal.cpp" diff --git a/src/assistant/3rdparty/clucene/src/CLucene/LuceneThreads.h b/src/assistant/3rdparty/clucene/src/CLucene/LuceneThreads.h new file mode 100644 index 000000000..cad07869f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/LuceneThreads.h @@ -0,0 +1,72 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _LuceneThreads_h +#define _LuceneThreads_h +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#if defined(_CL_DISABLE_MULTITHREADING) + #define SCOPED_LOCK_MUTEX(theMutex) + #define DEFINE_MUTEX(x) + #define STATIC_DEFINE_MUTEX(x) + #define _LUCENE_SLEEP(x) + #define _LUCENE_CURRTHREADID 1 + #define _LUCENE_THREADID_TYPE char + + CL_NS_DEF(util) + class CLuceneThreadIdCompare + { + public: + enum + { // parameters for hash table + bucket_size = 4, // 0 < bucket_size + min_buckets = 8 + }; // min_buckets = 2 ^^ N, 0 < N + + bool operator()( char t1, char t2 ) const{ + return t1 < t2; + } + }; + CL_NS_END +#else + + #if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX) + //do nothing + #elif defined(_CL_HAVE_PTHREAD) + #include "CLucene/config/threadPthread.h" + #elif defined(_CL_HAVE_WIN32_THREADS) || defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) //note that mingw32 could have pthreads, so put this after. + #if !defined(_CL_HAVE_WIN32_THREADS) + #define _CL_HAVE_WIN32_THREADS + #endif + #include "CLucene/config/threadCSection.h" + #else + #error A valid thread library was not found + #endif //mutex types + + CL_NS_DEF(util) + /** @internal */ + class mutexGuard + { + private: + _LUCENE_THREADMUTEX* mrMutex; + mutexGuard(const mutexGuard& clone); + public: + mutexGuard( _LUCENE_THREADMUTEX& rMutex ); + ~mutexGuard(); + }; + CL_NS_END + + #define SCOPED_LOCK_MUTEX(theMutex) CL_NS(util)::mutexGuard theMutexGuard(theMutex); + #define DEFINE_MUTEX(theMutex) _LUCENE_THREADMUTEX theMutex; + #define STATIC_DEFINE_MUTEX(theMutex) static _LUCENE_THREADMUTEX theMutex; + +#endif //_CL_DISABLE_MULTITHREADING + + + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.cpp new file mode 100644 index 000000000..d64c51f77 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.cpp @@ -0,0 +1,134 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CLucene/util/Misc.h" + +#include "CLucene/search/Sort.h" +#include "CLucene/search/Similarity.h" +#include "CLucene/search/FieldCache.h" +#include "CLucene/search/FieldSortedHitQueue.h" + +#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG) +# define CRTDBG_MAP_ALLOC +# include +#ifndef UNDER_CE +# include +#endif +#endif + +CL_NS_USE(util) + +TCHAR* _LUCENE_BLANK_STRING = _T(""); +char* _LUCENE_BLANK_ASTRING = ""; + +#ifndef Q_CC_MIPS +#if defined(_LUCENE_THREADMUTEX_USINGDEFAULT) +# if defined(_LUCENE_PRAGMA_WARNINGS) +# pragma message ("==================Using clunky thread mutex!!!==================") +# else +# if !defined(Q_OS_SOLARIS) +# warning "==================Using clunky thread mutex!!!==================" +# endif +# endif +#endif + +#if defined(_ASCII) +# if defined(_LUCENE_PRAGMA_WARNINGS) +# pragma message ("==================Using ascii mode!!!==================") +# else +# if !defined(Q_OS_SOLARIS) +# warning "==================Using ascii mode!!!==================" +# endif +# endif +#endif + +//This causes confusion, because CLucene doesn't really need hashed maps/sets. My experience with the +//hash maps on linux are that there are no significant improvements in using them (infact it adversely +//affected performance... therefore we'll just silently ignore +/*#if defined(LUCENE_DISABLE_HASHING) +# if defined(_LUCENE_PRAGMA_WARNINGS) +# pragma message ("==================Hashing not available or is disabled! CLucene may run slower than optimal ==================") +# else +# if !defined(Q_OS_SOLARIS) +# warning "==================Hashing not available or is disabled! CLucene may run slower than optimal ==================" +# endif +# endif +#endif*/ +#endif + +//clears all static memory. do not attempt to do anything else +//in clucene after calling this function +void _lucene_shutdown(){ + CL_NS(search)::FieldSortedHitQueue::Comparators.clear(); + _CLDELETE(CL_NS(search)::Sort::RELEVANCE); + _CLDELETE(CL_NS(search)::Sort::INDEXORDER); + _CLDELETE(CL_NS(search)::ScoreDocComparator::INDEXORDER); + _CLDELETE(CL_NS(search)::ScoreDocComparator::RELEVANCE); + _CLDELETE(CL_NS(search)::SortField::FIELD_SCORE); + _CLDELETE(CL_NS(search)::SortField::FIELD_DOC); + _CLDELETE(CL_NS(search)::FieldCache::DEFAULT); + + _CLLDELETE(CL_NS(search)::Similarity::getDefault()); + + CL_NS(util)::CLStringIntern::shutdown(); +} + +void CLDebugBreak(){ + //can be used for debug breaking... +#if defined(_CLCOMPILER_MSVC) && defined(_DEBUG) + _CrtDbgBreak(); +#else + int i=0; //a line to put breakpoint on +#endif +} + +//these are functions that lucene uses which +//are not replacement functions +char* lucenestrdup(const char* v CL_FILELINEPARAM){ + size_t len = strlen(v); + char* ret = new char[len+1]; + strncpy(ret,v,len+1); +#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) +# if defined(LUCENE_ENABLE_FILELINEINFO) + CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,file,line,len); +# else + CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,__FILE__,__LINE__,len); +# endif +#endif + return ret; +} + +#ifdef _UCS2 +wchar_t* lucenewcsdup(const wchar_t* v CL_FILELINEPARAM){ + size_t len = _tcslen(v); + wchar_t* ret = new wchar_t[len+1]; + _tcsncpy(ret,v,len+1); +#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) +# if defined(LUCENE_ENABLE_FILELINEINFO) + CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,file,line,len); +# else + CL_NS(debug)::LuceneBase::__cl_voidpadd((void*)ret,__FILE__,__LINE__,len); +# endif +#endif + return ret; +} +#endif //ucs2 + + +//ok, these are the exceptions, but these never +//exist on non-msvc platform, so lets put it here +#ifndef _CL_HAVE_FILELENGTH +int64_t lucene_filelength(int filehandle) +{ + struct fileStat info; + if (fileHandleStat(filehandle, &info) == -1) + _CLTHROWA( CL_ERR_IO,"fileStat error" ); + return info.st_size; +} +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h new file mode 100644 index 000000000..fbb3fd949 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h @@ -0,0 +1,501 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#ifndef lucene_stdheader_h +#define lucene_stdheader_h + +#if defined(OVERRIDE_DEFAULT_CLCONFIG) + #include "AltCLConfig.h" +#else + #include "CLucene/CLConfig.h" +#endif + +//first inclusion of compiler.h (it will be called again later) +#include "CLucene/config/compiler.h" + +extern void _lucene_shutdown(); +extern int _lucene_counter_break; //can set a watch on this +#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) + extern bool _lucene_disable_debuglogging; //if LUCENE_ENABLE_CONSTRUCTOR_LOG is on, dont do log if this is true +#endif + +//////////////////////////////////////////////////////// +// default includes +//////////////////////////////////////////////////////// +#ifndef LUCENE_DISABLE_INCLUDES + +#include + +#if defined(_CL_STDC_HEADERS) + #include + #include +#else + #if defined(_CL_HAVE_STDLIB_H) + #include + #endif +#endif + +#if defined(_CL_HAVE_STRING_H) + #if !defined(_CL_STDC_HEADERS) && defined(_CL_HAVE_MEMORY_H) + #include + #endif + #include +#elif defined(_CL_HAVE_STRINGS_H) + //note: as a side note, strtok is not thread-safe.. so be careful where you use it! + #error "strtok replacement for BSD has not been implemented" + #include + #if !defined(_CL_HAVE_STRCHR) + #define strchr index + #define strrchr rindex + #endif +#endif + +#if defined(_CL_HAVE_UNISTD_H) + #include +#elif defined(_CL_HAVE_IO_H) && defined(_CL_HAVE_DIRECT_H) +#ifndef UNDER_CE + #include + #include +#endif +#else + #error "Neither unistd.h or (io.h & direct.h) were available" +#endif + +#ifndef _CL_DISABLE_NATIVE_EXCEPTIONS + #ifdef _CL_HAVE_STDEXCEPT + #include + #else + #error "CLucene can't compile with exception handling on because header is not available" + #endif +#endif + +#if defined(_CL_STAT_MACROS_BROKEN) + #error "Haven't implemented STAT_MACROS_BROKEN fix yet" +#elif defined(_CL_HAVE_SYS_STAT_H) +#ifdef UNDER_CE + #include +#else + #include +#endif +#else + #error "Haven't implemented platforms with no sys/stat.h" +#endif + +#if defined(_CL_HAVE_STDARG_H) + #include +#else + #error "CLucene can compile, but some extras may not work" +#endif + +#if defined(_CL_HAVE_MATH_H) + #include +#else + #error "CLucene can't compile without " +#endif + +#if defined(_CL_HAVE_MAP) + #include +#else + #error "CLucene can't compile without the map header" +#endif + +#if defined(_CL_HAVE_LIST) + #include +#else + #error "CLucene can't compile without the list header" +#endif + +#if defined(_CL_HAVE_SET) + #include +#else + #error "CLucene can't compile without the set header" +#endif + +#if defined(_CL_HAVE_VECTOR) + #include +#else + #error "CLucene can't compile without the vector header" +#endif + +#if !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) + //hashing is all or nothing! + #include + #include +#elif !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_EXT_HASH_MAP) && defined(_CL_HAVE_EXT_HASH_SET) + #include + #include +#elif !defined(LUCENE_DISABLE_HASHING) + #define LUCENE_DISABLE_HASHING +#endif +#if !defined(LUCENE_DISABLE_HASHING) && !defined(CL_NS_HASHING) + #define CL_NS_HASHING(func) std::func +#endif + +#if defined(_CL_HAVE_ALGORITHM) +# include +#else +# error "Can't compile clucene without " +#endif + +#if defined(_CL_HAVE_FUNCTIONAL) +# include +#else +# error "Can't compile clucene without " +#endif + +#if !defined(_CL_HAVE_PRINTF) + #error "CLucene can't compile without printf, replacements have not been implemented" +#endif + +#if !defined(_CL_HAVE_SNPRINTF) && !defined(_CL_HAVE__SNPRINTF) + #error "CLucene can't compile without snprintf, replacements have not been implemented" +#elif !defined(_CL_HAVE__SNPRINTF)&& defined(_CL_HAVE_SVNPRINTF) + #define _snprintf snprintf +#endif + +#if defined(_UCS2) + #if defined(_CL_HAVE_WCHAR_H) + #include + #else + //actually the repl_wchar.h replacements header will + //always be included. It replaces some functions + //that are missing in some wchar.h headers. + #endif +#endif + +#if defined(_UCS2) && defined(_CL_HAVE_WCTYPE_H) + #include +#elif defined(_ASCII) && defined(_CL_HAVE_CTYPE_H) + #include + #undef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS +#elif defined(_UCS2) + //must be in _UCS2 to use internal char functions + #undef LUCENE_USE_INTERNAL_CHAR_FUNCTIONS + #define LUCENE_USE_INTERNAL_CHAR_FUNCTIONS +#else + #error "Cannot compile in _ASCII without ctype.h" +#endif + +//always include replacement, some missing tchar defines +#include "CLucene/config/repl_tchar.h" + +#if defined(_CL_HAVE_ERRNO_H) +#ifndef UNDER_CE + #include +#endif +#else + #error "Haven't implemented platforms with no errno.h" +#endif + +#if defined(_CL_HAVE_FCNTL_H) +#ifndef UNDER_CE + #include +#endif +#else + #error "Haven't implemented platforms with no fcntl.h" +#endif + +#if defined(_CL_HAVE_WINDOWS_H) + #include +#endif + +#endif //LUCENE_DISABLE_INCLUDES +// +//////////////////////////////////////////////////////// + +//second inclusion of compiler.h +//this gives CompilerXXX.h a chance to include other headers +#include "CLucene/config/compiler.h" +// +//////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////// +// Character functions. +// Here we decide whose character functions to use +//////////////////////////////////////////////////////// +#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) + #define stringCaseFold cl_tcscasefold + #define stringCaseFoldCmp cl_tcscasefoldcmp + + #undef _istspace + #undef _istdigit + #undef _istalnum + #undef _istalpha + #undef _totlower + #undef _totupper + #define _istalnum cl_isalnum + #define _istalpha cl_isletter + #define _istspace cl_isspace + #define _istdigit cl_isdigit + #define _totlower cl_tolower + #define _totupper cl_toupper + + //here are some functions to help deal with utf8/ucs2 conversions + //lets let the user decide what mb functions to use... we provide pure utf8 ones no matter what. + /*#undef _mbtowc + #undef _mbstowcs + #undef _wctomb + #undef _wcstombs + #define _mbtowc lucene_mbstowc + #define _mbsstowcs lucene_mbstowcs + #define _wctomb lucene_wcto_mb + #define _wcstombs lucene_wcstombs*/ +#else + //we are using native functions + //here are some functions to help deal with utf8/ucs2 conversions + /*#define _mbtowc mbtowc + #define _wctomb wctomb + #define _mbstowcs mbstowcs + #define _wcstombs wcstombs*/ + + //we are using native character functions + #if defined(_ASCII) + #undef _istspace + #undef _istdigit + #undef _istalnum + #undef _istalpha + #undef _totlower + #undef _totupper + #define _istspace(x) isspace((unsigned char)x) + #define _istdigit(x) isdigit((unsigned char)x) + #define _istalnum(x) isalnum((unsigned char)x) + #define _istalpha(x) isalpha((unsigned char)x) + #define _totlower(x) tolower((unsigned char)x) + #define _totupper(x) toupper((unsigned char)x) + #endif +#endif + +//the methods contained in gunichartables.h +typedef unsigned long clunichar; +bool cl_isletter(clunichar c); +bool cl_isalnum(clunichar c); +bool cl_isdigit(clunichar c); +bool cl_isspace (clunichar c); +TCHAR cl_tolower (TCHAR c); +TCHAR cl_toupper (TCHAR c); + +int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src); +TCHAR* cl_tcscasefold( TCHAR * str, int len=-1 ); + +//we provide utf8 conversion functions +size_t lucene_utf8towc (wchar_t *ret, const char *s, size_t n); +size_t lucene_utf8towcs(wchar_t *, const char *, size_t maxslen); +size_t lucene_wctoutf8 (char * ret, const wchar_t str); +size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); +size_t lucene_utf8charlen(const char *p); + +///a blank string... +extern TCHAR* _LUCENE_BLANK_STRING; +#define LUCENE_BLANK_STRING _LUCENE_BLANK_STRING +extern char* _LUCENE_BLANK_ASTRING; +#define LUCENE_BLANK_ASTRING _LUCENE_BLANK_ASTRING + +/* Converts a string into a form that is independent of case. The + * result will not correspond to any particular case, but can be + * compared for equality or ordered with the results of calling + * stringCaseFold() on other strings. + * + * If we did not define this elsewhere, then just convert to lower case + */ +#ifndef stringCaseFold + #define stringCaseFold _tcslwr +#endif +/* Compares 2 strings using case folding (if available) + * If we did not define this elsewhere, then just compare + * using normal method + */ +#ifndef stringCaseFoldCmp + #define stringCaseFoldCmp _tcsicmp +#endif + +//now that all the character routines are completed, include the +//wchar.h replacements. +#include "CLucene/config/repl_wchar.h" //always include replacements + +//a replacement for _tcsdup. This uses new TCHAR[] instead of malloc, so that we can use delete[] to free +#if defined(LUCENE_ENABLE_FILELINEINFO) + #define CL_FILELINE ,__FILE__,__LINE__ + #define CL_FILELINEREF ,file,line /// StringArray; +typedef CL_NS(util)::CLVector StringArrayWithDeletor; +typedef CL_NS(util)::CLVector StringArrayConst; +typedef CL_NS(util)::CLVector StringArrayConstWithDeletor; + +typedef CL_NS(util)::CLVector AStringArray; +typedef CL_NS(util)::CLVector AStringArrayWithDeletor; +typedef CL_NS(util)::CLVector AStringArrayConst; +typedef CL_NS(util)::CLVector AStringArrayConstWithDeletor; +CL_NS_END + +// +//////////////////////////////////////////////////////// + +#endif // STDHEADER_H diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp new file mode 100644 index 000000000..03f61a038 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.cpp @@ -0,0 +1,200 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "AnalysisHeader.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(analysis) + +const TCHAR* Token::defaultType=_T("word"); + +Token::Token(): + _startOffset (0), + _endOffset (0), + _type ( defaultType ), + positionIncrement (1) +{ + _termTextLen = 0; +#ifndef LUCENE_TOKEN_WORD_LENGTH + _termText = NULL; + bufferTextLen = 0; +#else + _termText[0] = 0; //make sure null terminated + bufferTextLen = LUCENE_TOKEN_WORD_LENGTH+1; +#endif +} + +Token::~Token(){ +#ifndef LUCENE_TOKEN_WORD_LENGTH + free(_termText); +#endif +} + +Token::Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ): + _startOffset (start), + _endOffset (end), + _type ( typ ), + positionIncrement (1) +{ + _termTextLen = 0; +#ifndef LUCENE_TOKEN_WORD_LENGTH + _termText = NULL; + bufferTextLen = 0; +#else + _termText[0] = 0; //make sure null terminated + bufferTextLen = LUCENE_TOKEN_WORD_LENGTH+1; +#endif + setText(text); +} + +void Token::set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ){ + _startOffset = start; + _endOffset = end; + _type = typ; + positionIncrement = 1; + setText(text); +} + +void Token::setText(const TCHAR* text){ + _termTextLen = _tcslen(text); + +#ifndef LUCENE_TOKEN_WORD_LENGTH + growBuffer(_termTextLen+1); + _tcsncpy(_termText,text,_termTextLen+1); +#else + if ( _termTextLen > LUCENE_TOKEN_WORD_LENGTH ){ + //in the case where this occurs, we will leave the endOffset as it is + //since the actual word still occupies that space. + _termTextLen=LUCENE_TOKEN_WORD_LENGTH; + } + _tcsncpy(_termText,text,_termTextLen+1); +#endif + _termText[_termTextLen] = 0; //make sure null terminated +} + +void Token::growBuffer(size_t size){ + if(bufferTextLen>=size) + return; +#ifndef LUCENE_TOKEN_WORD_LENGTH + if ( _termText == NULL ) + _termText = (TCHAR*)malloc( size * sizeof(TCHAR) ); + else + _termText = (TCHAR*)realloc( _termText, size * sizeof(TCHAR) ); + bufferTextLen = size; +#else + _CLTHROWA(CL_ERR_TokenMgr,"Couldn't grow Token buffer"); +#endif +} + +void Token::setPositionIncrement(int32_t posIncr) { + if (posIncr < 0) { + _CLTHROWA(CL_ERR_IllegalArgument,"positionIncrement must be >= 0"); + } + positionIncrement = posIncr; +} + +int32_t Token::getPositionIncrement() const { return positionIncrement; } + +// Returns the Token's term text. +const TCHAR* Token::termText() const{ + return (const TCHAR*) _termText; +} +size_t Token::termTextLength() { + if ( _termTextLen == -1 ) //it was invalidated by growBuffer + _termTextLen = _tcslen(_termText); + return _termTextLen; +} +void Token::resetTermTextLen(){ + _termTextLen=-1; +} +bool Token::OrderCompare::operator()( Token* t1, Token* t2 ) const{ + if(t1->startOffset()>t2->startOffset()) + return false; + if(t1->startOffset()startOffset()) + return true; + return true; +} +TCHAR* Token::toString() const{ + StringBuffer sb; + sb.append(_T("(")); + sb.append( _termText ); + sb.append(_T(",")); + sb.appendInt( _startOffset ); + sb.append(_T(",")); + sb.appendInt( _endOffset ); + + if (!_tcscmp( _type, _T("word")) == 0 ){ + sb.append(_T(",type=")); + sb.append(_type); + } + if (positionIncrement != 1){ + sb.append(_T(",posIncr=")); + sb.appendInt(positionIncrement); + } + sb.append(_T(")")); + + return sb.toString(); +} + + +Token* TokenStream::next(){ + Token* t = _CLNEW Token; //deprecated + if ( !next(t) ) + _CLDELETE(t); + return t; +} + + +TokenFilter::TokenFilter(TokenStream* in, bool deleteTS): + input(in), + deleteTokenStream(deleteTS) +{ +} +TokenFilter::~TokenFilter(){ + close(); +} + +// Close the input TokenStream. +void TokenFilter::close() { + if ( input != NULL ){ + input->close(); + if ( deleteTokenStream ) + _CLDELETE( input ); + } + input = NULL; +} + + + +Tokenizer::Tokenizer() { + input = NULL; +} + +Tokenizer::Tokenizer(CL_NS(util)::Reader* _input): + input(_input) +{ +} + +void Tokenizer::close(){ + if (input != NULL) { + // ? delete input; + input = NULL; + } +} + +Tokenizer::~Tokenizer(){ + close(); +} + + +int32_t Analyzer::getPositionIncrementGap(const TCHAR* fieldName) +{ + return 0; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h b/src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h new file mode 100644 index 000000000..0cfd9c684 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/AnalysisHeader.h @@ -0,0 +1,234 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_analysis_AnalysisHeader_ +#define _lucene_analysis_AnalysisHeader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/Reader.h" + +CL_NS_DEF(analysis) + + +/** A Token is an occurence of a term from the text of a field. It consists of +* a term's text, the start and end offset of the term in the text of the field, +* and a type string. +* +* The start and end offsets permit applications to re-associate a token with +* its source text, e.g., to display highlighted query terms in a document +* browser, or to show matching text fragments in a KWIC (KeyWord In Context) +* display, etc. +* +* The type is an interned string, assigned by a lexical analyzer +* (a.k.a. tokenizer), naming the lexical or syntactic class that the token +* belongs to. For example an end of sentence marker token might be implemented +* with type "eos". The default token type is "word". +*/ +class Token:LUCENE_BASE{ +private: + int32_t _startOffset; // start in source text + int32_t _endOffset; // end in source text + const TCHAR* _type; // lexical type + int32_t positionIncrement; + size_t bufferTextLen; + +public: + #ifndef LUCENE_TOKEN_WORD_LENGTH + TCHAR* _termText; // the text of the term + #else + TCHAR _termText[LUCENE_TOKEN_WORD_LENGTH+1]; // the text of the term + #endif + int32_t _termTextLen; + static const TCHAR* defaultType; + + Token(); + ~Token(); + // Constructs a Token with the given text, start and end offsets, & type. + Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=defaultType); + void set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=defaultType); + + size_t bufferLength(){ return bufferTextLen; } + void growBuffer(size_t size); + + /* Set the position increment. This determines the position of this + * token relative to the previous Token in a TokenStream, used in + * phrase searching. + * + * The default value is 1. + * + * Some common uses for this are: + * + * - Set it to zero to put multiple terms in the same position. This is + * useful if, e.g., a word has multiple stems. Searches for phrases + * including either stem will match. In this case, all but the first stem's + * increment should be set to zero: the increment of the first instance + * should be one. Repeating a token with an increment of zero can also be + * used to boost the scores of matches on that token. + * + * - Set it to values greater than one to inhibit exact phrase matches. + * If, for example, one does not want phrases to match across removed stop + * words, then one could build a stop word filter that removes stop words and + * also sets the increment to the number of stop words removed before each + * non-stop word. Then exact phrase queries will only match when the terms + * occur with no intervening stop words. + */ + void setPositionIncrement(int32_t posIncr); + int32_t getPositionIncrement() const; + const TCHAR* termText() const; + size_t termTextLength(); + void resetTermTextLen(); + void setText(const TCHAR* txt); + + /** + * Returns this Token's starting offset, the position of the first character + * corresponding to this token in the source text. + * + * Note that the difference between endOffset() and startOffset() may not be + * equal to termText.length(), as the term text may have been altered by a + * stemmer or some other filter. + */ + int32_t startOffset() const { return _startOffset; } + void setStartOffset(int32_t val){ _startOffset =val; } + + /** + * Returns this Token's ending offset, one greater than the position of the + * last character corresponding to this token in the source text. + */ + int32_t endOffset() const { return _endOffset; } + void setEndOffset(int32_t val){ _endOffset =val; } + + // Returns this Token's lexical type. Defaults to "word". + const TCHAR* type() const { return _type; } /// + { + public: + bool operator()( Token* t1, Token* t2 ) const; + }; +}; + +/** +* A TokenStream enumerates the sequence of tokens, either from +* fields of a document or from query text. +*

+* This is an abstract class. Concrete subclasses are: +*

    +*
  • {@link Tokenizer}, a TokenStream +* whose input is a Reader; and +*
  • {@link TokenFilter}, a TokenStream +* whose input is another TokenStream. +*
+*/ +class TokenStream:LUCENE_BASE { +public: + /** Sets token to the next token in the stream, returns false at the EOS. */ + virtual bool next(Token* token) = 0; + + /** Releases resources associated with this stream. */ + virtual void close() = 0; + + virtual ~TokenStream(){ + } + + /* This is for backwards compatibility only. You should pass the token you want to fill + * to next(), this will save a lot of object construction and destructions. + * @deprecated. use next(token). Kept only to avoid breaking existing code. + */ + _CL_DEPRECATED(next(Token)) Token* next(); +}; + + +/** An Analyzer builds TokenStreams, which analyze text. It thus represents a + * policy for extracting index terms from text. + *

+ * Typical implementations first build a Tokenizer, which breaks the stream of + * characters from the Reader into raw Tokens. One or more TokenFilters may + * then be applied to the output of the Tokenizer. + *

+ * WARNING: You must override one of the methods defined by this class in your + * subclass or the Analyzer will enter an infinite loop. + */ +class Analyzer:LUCENE_BASE{ +public: + /** Creates a TokenStream which tokenizes all the text in the provided + Reader. Default implementation forwards to tokenStream(Reader) for + compatibility with older version. Override to allow Analyzer to choose + strategy based on document and/or field. Must be able to handle null + field name for backward compatibility. */ + virtual TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader)=0; + + virtual ~Analyzer(){ + } + + /** + * Invoked before indexing a Field instance if + * terms have already been added to that field. This allows custom + * analyzers to place an automatic position increment gap between + * Field instances using the same field name. The default value + * position increment gap is 0. With a 0 position increment gap and + * the typical default token position increment of 1, all terms in a field, + * including across Field instances, are in successive positions, allowing + * exact PhraseQuery matches, for instance, across Field instance boundaries. + * + * @param fieldName Field name being indexed. + * @return position increment gap, added to the next token emitted from {@link #tokenStream(TCHAR*, Reader*)} + */ + virtual int32_t getPositionIncrementGap(const TCHAR* fieldName); +}; + + +/** A Tokenizer is a TokenStream whose input is a Reader. +

+This is an abstract class. +*/ +class Tokenizer:public TokenStream { +protected: + /** The text source for this Tokenizer. */ + CL_NS(util)::Reader* input; + +public: + /** Construct a tokenizer with null input. */ + Tokenizer(); + /** Construct a token stream processing the given input. */ + Tokenizer(CL_NS(util)::Reader* _input); + + // ** By default, closes the input Reader. */ + virtual void close(); + virtual ~Tokenizer(); +}; + +/** A TokenFilter is a TokenStream whose input is another token stream. +

+This is an abstract class. +*/ +class TokenFilter:public TokenStream { +protected: + /** The source of tokens for this filter. */ + TokenStream* input; + /** If true then input will be deleted in the destructor */ + bool deleteTokenStream; + + /** Construct a token stream filtering the given input. + * + * @param in The TokenStream to filter from + * @param deleteTS If true, input will be deleted in the destructor + */ + TokenFilter(TokenStream* in, bool deleteTS=false); + virtual ~TokenFilter(); +public: + /** Close the input TokenStream. */ + void close(); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp b/src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp new file mode 100644 index 000000000..142bbfb63 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.cpp @@ -0,0 +1,389 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Analyzers.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(analysis) + +CharTokenizer::CharTokenizer(Reader* in) : + Tokenizer(in), + offset(0), + bufferIndex(0), + dataLen(0), + ioBuffer(NULL) +{ + buffer[0]=0; +} + +TCHAR CharTokenizer::normalize(const TCHAR c) const +{ + return c; +} +bool CharTokenizer::next(Token* token){ + int32_t length = 0; + int32_t start = offset; + while (true) { + TCHAR c; + offset++; + if (bufferIndex >= dataLen) { + dataLen = input->read(ioBuffer, LUCENE_IO_BUFFER_SIZE); + if (dataLen == -1) + dataLen = 0; + bufferIndex = 0; + } + if (dataLen <= 0 ) { + if (length > 0) + break; + else + return false; + }else + c = ioBuffer[bufferIndex++]; + if (isTokenChar(c)) { // if it's a token TCHAR + + if (length == 0) // start of token + start = offset-1; + + buffer[length++] = normalize(c); // buffer it, normalized + + if (length == LUCENE_MAX_WORD_LEN) // buffer overflow! + break; + + } else if (length > 0) // at non-Letter w/ chars + break; // return 'em + + } + buffer[length]=0; + token->set( buffer, start, start+length); + return true; +} + +bool LetterTokenizer::isTokenChar(const TCHAR c) const { + return _istalpha(c)!=0; +} + + +TCHAR LowerCaseTokenizer::normalize(const TCHAR chr) const { + return _totlower(chr); +} + +bool WhitespaceTokenizer::isTokenChar(const TCHAR c) const{ + return _istspace(c)==0; //(return true if NOT a space) +} + +TokenStream* WhitespaceAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { + return _CLNEW WhitespaceTokenizer(reader); +} + +TokenStream* SimpleAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { + return _CLNEW LowerCaseTokenizer(reader); +} + +bool LowerCaseFilter::next(Token* t){ + if (!input->next(t)) + return false; + stringCaseFold( t->_termText ); + return true; +} + +StopFilter::StopFilter(TokenStream* in, bool deleteTokenStream, const TCHAR** stopWords): + TokenFilter(in, deleteTokenStream), + table(_CLNEW CLSetList(false)) +{ + fillStopTable( table,stopWords ); +} + +void StopFilter::fillStopTable(CLSetList* stopTable, + const TCHAR** stopWords) { + for (int32_t i = 0; stopWords[i]!=NULL; i++) + stopTable->insert(stopWords[i]); +} + +bool StopFilter::next(Token* token) { + // return the first non-stop word found + while (input->next(token)){ + if (table->find(token->_termText)==table->end()){ + return true; + } + } + + // reached EOS -- return nothing + return false; +} + +StopAnalyzer::StopAnalyzer():stopTable(false) +{ + StopFilter::fillStopTable(&stopTable,ENGLISH_STOP_WORDS); +} +StopAnalyzer::~StopAnalyzer() +{ +} +StopAnalyzer::StopAnalyzer( const TCHAR** stopWords) { + StopFilter::fillStopTable(&stopTable,stopWords); +} +TokenStream* StopAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { + return _CLNEW StopFilter(_CLNEW LowerCaseTokenizer(reader),true, &stopTable); +} + +const TCHAR* StopAnalyzer::ENGLISH_STOP_WORDS[] = +{ + _T("a"), _T("an"), _T("and"), _T("are"), _T("as"), _T("at"), _T("be"), _T("but"), _T("by"), + _T("for"), _T("if"), _T("in"), _T("into"), _T("is"), _T("it"), + _T("no"), _T("not"), _T("of"), _T("on"), _T("or"), _T("s"), _T("such"), + _T("t"), _T("that"), _T("the"), _T("their"), _T("then"), _T("there"), _T("these"), + _T("they"), _T("this"), _T("to"), _T("was"), _T("will"), _T("with"), NULL +}; + +PerFieldAnalyzerWrapper::PerFieldAnalyzerWrapper(Analyzer* defaultAnalyzer): + analyzerMap(true,true) +{ + this->defaultAnalyzer = defaultAnalyzer; +} +PerFieldAnalyzerWrapper::~PerFieldAnalyzerWrapper(){ + analyzerMap.clear(); + _CLDELETE(defaultAnalyzer); +} + +void PerFieldAnalyzerWrapper::addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer) { + analyzerMap.put(STRDUP_TtoT(fieldName), analyzer); +} + +TokenStream* PerFieldAnalyzerWrapper::tokenStream(const TCHAR* fieldName, Reader* reader) { + Analyzer* analyzer = (fieldName==NULL?defaultAnalyzer:analyzerMap.get(fieldName)); + if (analyzer == NULL) { + analyzer = defaultAnalyzer; + } + + return analyzer->tokenStream(fieldName, reader); +} + + + +bool ISOLatin1AccentFilter::next(Token* token){ + if ( input->next(token) ){ + int32_t l = token->termTextLength(); + const TCHAR* chars = token->termText(); + bool doProcess = false; + for (int32_t i = 0; i < l; ++i) { +#ifdef _UCS2 + if ( chars[i] >= 0xC0 && chars[i] <= 0x178 ) { +#else + if ( (chars[i] >= 0xC0 && chars[i] <= 0xFF) || chars[i] < 0 ) { +#endif + doProcess = true; + break; + } + } + if ( !doProcess ) { + return true; + } + + StringBuffer output(l*2); + for (int32_t j = 0; j < l; j++) { + #ifdef _UCS2 + TCHAR c = chars[j]; + #else + unsigned char c = chars[j]; + #endif + switch (c) { + case 0xC0 : + case 0xC1 : + case 0xC2 : + case 0xC3 : + case 0xC4 : + case 0xC5 : + output.appendChar('A'); + break; + case 0xC6 : + output.append(_T("AE")); + break; + case 0xC7 : + output.appendChar('C'); + break; + case 0xC8 : + case 0xC9 : + case 0xCA : + case 0xCB : + output.appendChar('E'); + break; + case 0xCC : + case 0xCD : + case 0xCE : + case 0xCF : + output.appendChar('I'); + break; + case 0xD0 : + output.appendChar('D'); + break; + case 0xD1 : + output.appendChar('N'); + break; + case 0xD2 : + case 0xD3 : + case 0xD4 : + case 0xD5 : + case 0xD6 : + case 0xD8 : + output.appendChar('O'); + break; + case 0xDE : + output.append(_T("TH")); + break; + case 0xD9 : + case 0xDA : + case 0xDB : + case 0xDC : + output.appendChar('U'); + break; + case 0xDD : + output.appendChar('Y'); + break; + case 0xE0 : + case 0xE1 : + case 0xE2 : + case 0xE3 : + case 0xE4 : + case 0xE5 : + output.appendChar('a'); + break; + case 0xE6 : + output.append(_T("ae")); + break; + case 0xE7 : + output.appendChar('c'); + break; + case 0xE8 : + case 0xE9 : + case 0xEA : + case 0xEB : + output.appendChar('e'); + break; + case 0xEC : + case 0xED : + case 0xEE : + case 0xEF : + output.appendChar('i'); + break; + case 0xF0 : + output.appendChar('d'); + break; + case 0xF1 : + output.appendChar('n'); + break; + case 0xF2 : + case 0xF3 : + case 0xF4 : + case 0xF5 : + case 0xF6 : + case 0xF8 : + output.appendChar('o'); + break; + case 0xDF : + output.append(_T("ss")); + break; + case 0xFE : + output.append(_T("th")); + break; + case 0xF9 : + case 0xFA : + case 0xFB : + case 0xFC : + output.appendChar('u'); + break; + case 0xFD : + case 0xFF : + output.appendChar('y'); + break; + + #ifdef _UCS2 + case 0x152 : + output.append(_T("OE")); + break; + case 0x153 : + output.append(_T("oe")); + break; + case 0x178 : + output.appendChar('Y'); + break; + #endif + default : + output.appendChar(c); + break; + } + } + token->setText(output.getBuffer()); + return true; + } + return false; +} + + +TokenStream* KeywordAnalyzer::tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader){ + return _CLNEW KeywordTokenizer(reader); +} + +KeywordTokenizer::KeywordTokenizer(CL_NS(util)::Reader* input, int bufferSize): + Tokenizer(input) +{ + this->done = false; + if ( bufferSize < 0 ) + this->bufferSize = DEFAULT_BUFFER_SIZE; +} +KeywordTokenizer::~KeywordTokenizer(){ +} + +bool KeywordTokenizer::next(Token* token){ + if (!done) { + done = true; + int32_t rd; + const TCHAR* buffer=0; + while (true) { + rd = input->read(buffer, bufferSize); + if (rd == -1) + break; + token->growBuffer(token->_termTextLen +rd+1); + + int32_t cp = rd; + if ( token->_termTextLen + cp > token->bufferLength() ) + cp = token->bufferLength() - token->_termTextLen; + _tcsncpy(token->_termText+token->_termTextLen,buffer,cp); + token->_termTextLen+=rd; + } + token->_termText[token->_termTextLen]=0; + token->set(token->_termText,0,token->_termTextLen); + return true; + } + return false; +} + + +LengthFilter::LengthFilter(TokenStream* in, int _min, int _max): + TokenFilter(in) +{ + this->_min = _min; + this->_max = _max; +} + +bool LengthFilter::next(Token* token) +{ + // return the first non-stop word found + while ( input->next(token) ) + { + size_t len = token->termTextLength(); + if (len >= _min && len <= _max) + return true; + // note: else we ignore it but should we index each part of it? + } + // reached EOS -- return null + return false; +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.h b/src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.h new file mode 100644 index 000000000..a12bd653f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/Analyzers.h @@ -0,0 +1,309 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_analysis_Analyzers_ +#define _lucene_analysis_Analyzers_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/Reader.h" +#include "AnalysisHeader.h" +#include "CLucene/util/Misc.h" + +CL_NS_DEF(analysis) + +/** An abstract base class for simple, character-oriented tokenizers.*/ +class CharTokenizer:public Tokenizer { +private: + int32_t offset, bufferIndex, dataLen; + TCHAR buffer[LUCENE_MAX_WORD_LEN+1]; + const TCHAR* ioBuffer; +protected: + + /** Returns true iff a character should be included in a token. This + * tokenizer generates as tokens adjacent sequences of characters which + * satisfy this predicate. Characters for which this is false are used to + * define token boundaries and are not included in tokens. */ + virtual bool isTokenChar(const TCHAR c) const = 0; + + /** Called on each token character to normalize it before it is added to the + * token. The default implementation does nothing. Subclasses may use this + * to, e.g., lowercase tokens. */ + virtual TCHAR normalize(const TCHAR c) const; + +public: + CharTokenizer(CL_NS(util)::Reader* in); + virtual ~CharTokenizer(){ + } + bool next(Token* token); +}; + + +/** A LetterTokenizer is a tokenizer that divides text at non-letters. That's +to say, it defines tokens as maximal strings of adjacent letters, as defined +by java.lang.Character.isLetter() predicate. + +Note: this does a decent job for most European languages, but does a terrible +job for some Asian languages, where words are not separated by spaces. */ +class LetterTokenizer:public CharTokenizer { +public: + // Construct a new LetterTokenizer. + LetterTokenizer(CL_NS(util)::Reader* in): + CharTokenizer(in) {} + + ~LetterTokenizer(){} +protected: + /** Collects only characters which satisfy _istalpha.*/ + bool isTokenChar(const TCHAR c) const; +}; + + + +/** +* LowerCaseTokenizer performs the function of LetterTokenizer +* and LowerCaseFilter together. It divides text at non-letters and converts +* them to lower case. While it is functionally equivalent to the combination +* of LetterTokenizer and LowerCaseFilter, there is a performance advantage +* to doing the two tasks at once, hence this (redundant) implementation. +*

+* Note: this does a decent job for most European languages, but does a terrible +* job for some Asian languages, where words are not separated by spaces. +*/ +class LowerCaseTokenizer:public LetterTokenizer { +public: + /** Construct a new LowerCaseTokenizer. */ + LowerCaseTokenizer(CL_NS(util)::Reader* in): + LetterTokenizer(in) {} + + ~LowerCaseTokenizer(){} +protected: + /** Collects only characters which satisfy _totlower. */ + TCHAR normalize(const TCHAR chr) const; +}; + + +/** A WhitespaceTokenizer is a tokenizer that divides text at whitespace. + * Adjacent sequences of non-Whitespace characters form tokens. */ +class WhitespaceTokenizer: public CharTokenizer { +public: + /** Construct a new WhitespaceTokenizer. */ + WhitespaceTokenizer(CL_NS(util)::Reader* in):CharTokenizer(in) {} + ~WhitespaceTokenizer(){} +protected: + /** Collects only characters which do not satisfy _istspace. + */ + bool isTokenChar(const TCHAR c) const; +}; + + +/** An Analyzer that uses WhitespaceTokenizer. */ +class WhitespaceAnalyzer: public Analyzer { + public: + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); + ~WhitespaceAnalyzer(){} +}; + +/** An Analyzer that filters LetterTokenizer with LowerCaseFilter. */ +class SimpleAnalyzer: public Analyzer { +public: + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); + ~SimpleAnalyzer(){} +}; + + + +/** +* Normalizes token text to lower case. +*/ +class LowerCaseFilter: public TokenFilter { +public: + LowerCaseFilter(TokenStream* in, bool deleteTokenStream):TokenFilter(in,deleteTokenStream) {} + ~LowerCaseFilter(){} + bool next(Token* token); +}; + + +/** + * Removes stop words from a token stream. + */ +class StopFilter: public TokenFilter { +private: + //bvk: i found this to work faster with a non-hash table. the number of items + //in the stop table is not like to make it worth having hashing. + CL_NS(util)::CLSetList* table; +public: + // Constructs a filter which removes words from the input + // TokenStream that are named in the array of words. + StopFilter(TokenStream* in, bool deleteTokenStream, const TCHAR** stopWords); + + ~StopFilter(){} + + /** Constructs a filter which removes words from the input + * TokenStream that are named in the CLSetList. + */ + StopFilter(TokenStream* in, bool deleteTokenStream, CL_NS(util)::CLSetList* stopTable): + TokenFilter(in, deleteTokenStream), + table(stopTable) + {} + + + /** + * Builds a Hashtable from an array of stop words, appropriate for passing + * into the StopFilter constructor. This permits this table construction to + * be cached once when an Analyzer is constructed. + * Note: the stopWords list must be a static list because the strings are not copied + */ + static void fillStopTable(CL_NS(util)::CLSetList* stopTable, + const TCHAR** stopWords); + + /** + * Returns the next input Token whose termText() is not a stop word. + */ + bool next(Token* token); +}; + + + + +/** Filters LetterTokenizer with LowerCaseFilter and StopFilter. */ +class StopAnalyzer: public Analyzer { + CL_NS(util)::CLSetList stopTable; + +public: + /** Builds an analyzer which removes words in ENGLISH_STOP_WORDS. */ + StopAnalyzer(); + ~StopAnalyzer(); + + /** Builds an analyzer which removes words in the provided array. */ + StopAnalyzer( const TCHAR** stopWords ); + /** Filters LowerCaseTokenizer with StopFilter. */ + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); + + /** An array containing some common English words that are not usually useful + for searching. */ + static const TCHAR* ENGLISH_STOP_WORDS[]; +}; + + + +/** + * This analyzer is used to facilitate scenarios where different + * fields require different analysis techniques. Use {@link #addAnalyzer} + * to add a non-default analyzer on a field name basis. + * + *

Example usage: + * + *

+ *   PerFieldAnalyzerWrapper aWrapper =
+ *      new PerFieldAnalyzerWrapper(new StandardAnalyzer());
+ *   aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
+ *   aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
+ * 
+ * + *

In this example, StandardAnalyzer will be used for all fields except "firstname" + * and "lastname", for which KeywordAnalyzer will be used. + * + *

A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing + * and query parsing. + */ +class PerFieldAnalyzerWrapper : public Analyzer { +private: + Analyzer* defaultAnalyzer; + CL_NS(util)::CLHashMap > analyzerMap; +public: + /** + * Constructs with default analyzer. + * + * @param defaultAnalyzer Any fields not specifically + * defined to use a different analyzer will use the one provided here. + */ + PerFieldAnalyzerWrapper(Analyzer* defaultAnalyzer); + ~PerFieldAnalyzerWrapper(); + + /** + * Defines an analyzer to use for the specified field. + * + * @param fieldName field name requiring a non-default analyzer + * @param analyzer non-default analyzer to use for field + */ + void addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer); + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); +}; + + +/** + * A filter that replaces accented characters in the ISO Latin 1 character set + * (ISO-8859-1) by their unaccented equivalent. The case will not be altered. + *

+ * For instance, 'à' will be replaced by 'a'. + *

+ */ +class ISOLatin1AccentFilter: public TokenFilter { +public: + ISOLatin1AccentFilter(TokenStream* input, bool deleteTs): + TokenFilter(input,deleteTs) + { + } + + /** + * To replace accented characters in a String by unaccented equivalents. + */ + bool next(Token* token); +}; + + +/** + * Emits the entire input as a single token. + */ +class KeywordTokenizer: public Tokenizer { +private: + LUCENE_STATIC_CONSTANT(int, DEFAULT_BUFFER_SIZE = 256); + bool done; + int bufferSize; +public: + KeywordTokenizer(CL_NS(util)::Reader* input, int bufferSize=-1); + virtual ~KeywordTokenizer(); + bool next(Token* token); +}; + +/** + * "Tokenizes" the entire stream as a single token. This is useful + * for data like zip codes, ids, and some product names. + */ +class KeywordAnalyzer: public Analyzer { +public: + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); + virtual ~KeywordAnalyzer(){} +}; + + +/** + * Removes words that are too long and too short from the stream. + * + */ +class LengthFilter: public TokenFilter { +private: + int _min; + int _max; +public: + /** + * Build a filter that removes words that are too long or too + * short from the text. + */ + LengthFilter(TokenStream* in, int _min, int _max); + + /** + * Returns the next input Token whose termText() is the right len + */ + bool next(Token* token); +}; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp new file mode 100644 index 000000000..e0994c41a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.cpp @@ -0,0 +1,46 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "StandardAnalyzer.h" + +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Reader.h" +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/analysis/Analyzers.h" +#include "StandardFilter.h" +#include "StandardTokenizer.h" + +CL_NS_USE(util) +CL_NS_USE(analysis) + +CL_NS_DEF2(analysis,standard) + + StandardAnalyzer::StandardAnalyzer(): + stopSet(false) + { + StopFilter::fillStopTable( &stopSet,CL_NS(analysis)::StopAnalyzer::ENGLISH_STOP_WORDS); + } + + StandardAnalyzer::StandardAnalyzer( const TCHAR** stopWords): + stopSet(false) + { + StopFilter::fillStopTable( &stopSet,stopWords ); + } + + StandardAnalyzer::~StandardAnalyzer(){ + } + + + TokenStream* StandardAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) + { + TokenStream* ret = _CLNEW StandardTokenizer(reader); + ret = _CLNEW StandardFilter(ret,true); + ret = _CLNEW LowerCaseFilter(ret,true); + ret = _CLNEW StopFilter(ret,true, &stopSet); + return ret; + } +CL_NS_END2 diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h new file mode 100644 index 000000000..9cce041df --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardAnalyzer.h @@ -0,0 +1,47 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_analysis_standard_StandardAnalyzer +#define _lucene_analysis_standard_StandardAnalyzer + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Reader.h" +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/analysis/Analyzers.h" +#include "StandardFilter.h" +#include "StandardTokenizer.h" + + +CL_NS_DEF2(analysis,standard) + + /** Represents a standard analyzer. */ + class StandardAnalyzer : public Analyzer + { + private: + CL_NS(util)::CLSetList stopSet; + public: + /** Builds an analyzer.*/ + StandardAnalyzer(); + + /** Builds an analyzer with the given stop words. */ + StandardAnalyzer( const TCHAR** stopWords); + + ~StandardAnalyzer(); + + + /** + * Constructs a StandardTokenizer filtered by a + * StandardFilter, a LowerCaseFilter and a StopFilter. + */ + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader) + ; + }; +CL_NS_END2 +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp new file mode 100644 index 000000000..9869d2592 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardFilter.cpp @@ -0,0 +1,58 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "StandardFilter.h" + +#include "../AnalysisHeader.h" +#include "../Analyzers.h" +#include "StandardTokenizerConstants.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(analysis) +CL_NS_USE(util) +CL_NS_DEF2(analysis,standard) + + StandardFilter::StandardFilter(TokenStream* in, bool deleteTokenStream): + TokenFilter(in, deleteTokenStream) + { + } + + StandardFilter::~StandardFilter(){ + } + + bool StandardFilter::next(Token* t) { + if (!input->next(t)) + return false; + + TCHAR* text = t->_termText; + const int32_t textLength = t->termTextLength(); + const TCHAR* type = t->type(); + + if ( type == tokenImage[APOSTROPHE] && //we can compare the type directy since the type should always come from the tokenImage + ( textLength >= 2 && _tcsicmp(text+textLength-2, _T("'s"))==0 ) ) + { + // remove 's + text[textLength-2]=0; + t->resetTermTextLen(); + + return true; + + } else if ( type == tokenImage[ACRONYM] ) { // remove dots + int32_t j = 0; + for ( int32_t i=0;iin. + StandardFilter(TokenStream* in, bool deleteTokenStream); + + ~StandardFilter(); + + + /** Returns the next token in the stream, or NULL at EOS. + *

Removes 's from the end of words. + *

Removes dots from acronyms. + */ + bool next(Token* token); + }; +CL_NS_END2 +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp new file mode 100644 index 000000000..60f9a449c --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.cpp @@ -0,0 +1,446 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "StandardTokenizer.h" + +CL_NS_USE(analysis) +CL_NS_USE(util) +CL_NS_DEF2(analysis,standard) + + const static TCHAR* tokenImageArray[] = { + _T(""), + _T(""), + _T(""), + _T(""), + _T(""), + _T(""), + _T(""), + _T(""), + _T(""), + _T("") + }; + const TCHAR** tokenImage = tokenImageArray; + + /* A bunch of shortcut macros, many of which make assumptions about variable + ** names. These macros enhance readability, not just convenience! */ + #define EOS (ch==-1 || rd->Eos()) + #define SPACE (_istspace((TCHAR)ch) != 0) + #define ALPHA (_istalpha((TCHAR)ch) != 0) + #define ALNUM (_istalnum(ch) != 0) + #define DIGIT (_istdigit(ch) != 0) + #define UNDERSCORE (ch == '_') + + #define _CJK ( (ch>=0x3040 && ch<=0x318f) || \ + (ch>=0x3300 && ch<=0x337f) || \ + (ch>=0x3400 && ch<=0x3d2d) || \ + (ch>=0x4e00 && ch<=0x9fff) || \ + (ch>=0xf900 && ch<=0xfaff) || \ + (ch>=0xac00 && ch<=0xd7af) ) //korean + + + #define DASH (ch == '-') + #define NEGATIVE_SIGN_ DASH + //#define POSITIVE_SIGN_ (ch == '+') + //#define SIGN (NEGATIVE_SIGN_ || POSITIVE_SIGN_) + + #define DOT (ch == '.') + #define DECIMAL DOT + + + //freebsd seems to have a problem with defines over multiple lines, so this has to be one long line + #define _CONSUME_AS_LONG_AS(conditionFails) while (true) { ch = readChar(); if (ch==-1 || (!(conditionFails) || str.len >= LUCENE_MAX_WORD_LEN)) { break; } str.appendChar(ch);} + + #define CONSUME_ALPHAS _CONSUME_AS_LONG_AS(ALPHA) + + #define CONSUME_DIGITS _CONSUME_AS_LONG_AS(DIGIT) + + /* otherMatches is a condition (possibly compound) under which a character + ** that's not an ALNUM or UNDERSCORE can be considered not to break the + ** span. Callers should pass false if only ALNUM/UNDERSCORE are acceptable. */ + #define CONSUME_WORD _CONSUME_AS_LONG_AS(ALNUM || UNDERSCORE) + + /* + ** Consume CJK characters + */ + #define CONSUME_CJK _CONSUME_AS_LONG_AS(_CJK) + + + /* It is considered that "nothing of value" has been read if: + ** a) The "read head" hasn't moved since specialCharPos was established. + ** or + ** b) The "read head" has moved by one character, but that character was + ** either whitespace or not among the characters found in the body of + ** a token (deliberately doesn't include the likes of '@'/'&'). */ + #define CONSUMED_NOTHING_OF_VALUE (rdPos == specialCharPos || (rdPos == specialCharPos+1 && ( SPACE || !(ALNUM || DOT || DASH || UNDERSCORE) ))) + + #define RIGHTMOST(sb) (sb.getBuffer()[sb.len-1]) + #define RIGHTMOST_IS(sb, c) (RIGHTMOST(sb) == c) + /* To discard the last character in a StringBuffer, we decrement the buffer's + ** length indicator and move the terminator back by one character. */ + #define SHAVE_RIGHTMOST(sb) (sb.getBuffer()[--sb.len] = '\0') + + //#define REMOVE_TRAILING_CHARS(sb, charMatchesCondition) { TCHAR* sbBuf = sb.getBuffer(); for (int32_t i = sb.len-1; i >= 0; i--) { TCHAR c = sbBuf[i]; if (charMatchesCondition) { sbBuf[--sb.len] = '\0'; } else {break;}}} + + /* Does StringBuffer sb contain any of the characters in string ofThese? */ + #define CONTAINS_ANY(sb, ofThese) (_tcscspn(sb.getBuffer(), _T(ofThese)) != static_cast(sb.len)) + + + StandardTokenizer::StandardTokenizer(Reader* reader): + rd(_CLNEW FastCharStream(reader)), + /* rdPos is zero-based. It starts at -1, and will advance to the first + ** position when readChar() is first called. */ + rdPos(-1), + tokenStart(-1) + { + } + + StandardTokenizer::~StandardTokenizer() { + _CLDELETE(rd); + } + + int StandardTokenizer::readChar() { + /* Increment by 1 because we're speaking in terms of characters, not + ** necessarily bytes: */ + rdPos++; + return rd->GetNext(); + } + + void StandardTokenizer::unReadChar() { + rd->UnGet(); + rdPos--; + } + + inline bool StandardTokenizer::setToken(Token* t, StringBuffer* sb, TokenTypes tokenCode) { + t->setStartOffset(tokenStart); + t->setEndOffset(tokenStart+sb->length()); + t->setType(tokenImage[tokenCode]); + sb->getBuffer(); //null terminates the buffer + t->resetTermTextLen(); + return true; + } + + bool StandardTokenizer::next(Token* t) { + int ch=0; + while (!EOS) { + ch = readChar(); + + if ( ch == 0 || ch == -1 ){ + continue; + } else if (SPACE) { + continue; + } else if (ALPHA || UNDERSCORE) { + tokenStart = rdPos; + return ReadAlphaNum(ch,t); + } else if (DIGIT || NEGATIVE_SIGN_ || DECIMAL) { + tokenStart = rdPos; + /* ReadNumber returns NULL if it fails to extract a valid number; in + ** that case, we just continue. */ + if (ReadNumber(NULL, ch,t)) + return true; + } else if ( _CJK ){ + if ( ReadCJK(ch,t) ) + return true; + } + } + return false; + } + + bool StandardTokenizer::ReadNumber(const TCHAR* previousNumber, const TCHAR prev,Token* t) { + /* previousNumber is only non-NULL if this function already read a complete + ** number in a previous recursion, yet has been asked to read additional + ** numeric segments. For example, in the HOST "192.168.1.3", "192.168" is + ** a complete number, but this function will recurse to read the "1.3", + ** generating a single HOST token "192.168.1.3". */ + t->growBuffer(LUCENE_MAX_WORD_LEN+1);//make sure token can hold the next word + StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText + TokenTypes tokenType; + bool decExhausted; + if (previousNumber != NULL) { + str.prepend(previousNumber); + tokenType = CL_NS2(analysis,standard)::HOST; + decExhausted = false; + } else { + tokenType = CL_NS2(analysis,standard)::NUM; + decExhausted = (prev == '.'); + } + if ( str.len >= LUCENE_MAX_WORD_LEN ){ + //if a number is too long, i would say there is no point + //storing it, because its going to be the wrong number anyway? + //what do people think? + return false; + } + str.appendChar(prev); + + const bool signExhausted = (prev == '-'); + int ch = prev; + + CONSUME_DIGITS; + + if (str.len < 2 /* CONSUME_DIGITS didn't find any digits. */ + && ( + (signExhausted && !DECIMAL) + || (decExhausted /* && !DIGIT is implied, since CONSUME_DIGITS stopped on a non-digit. */) + ) + ) + { + /* We have either: + ** a) a negative sign that's not followed by either digit(s) or a decimal + ** b) a decimal that's not followed by digit(s) + ** so this is not a valid number. */ + if (!EOS) { + /* Unread the character that stopped CONSUME_DIGITS: */ + unReadChar(); + } + return false; + } + + /* We just read a group of digits. Is it followed by a decimal symbol, + ** implying that there might be another group of digits available? */ + if (!EOS) { + if (DECIMAL) { + if ( str.len >= LUCENE_MAX_WORD_LEN ) + return false; //read above for rationale + str.appendChar(ch); + } else { + unReadChar(); + goto SUCCESSFULLY_EXTRACTED_NUMBER; + } + + CONSUME_DIGITS; + if (!DIGIT && !DECIMAL) { + unReadChar(); + } else if (!EOS && DECIMAL && _istdigit(rd->Peek())) { + /* We just read the fractional digit group, but it's also followed by + ** a decimal symbol and at least one more digit, so this must be a + ** HOST rather than a real number. */ + return ReadNumber(str.getBuffer(), '.',t); + } + } + + SUCCESSFULLY_EXTRACTED_NUMBER: + TCHAR rightmost = RIGHTMOST(str); + /* Don't including a trailing decimal point. */ + if (rightmost == '.') { + SHAVE_RIGHTMOST(str); + unReadChar(); + rightmost = RIGHTMOST(str); + } + /* If all we have left is a negative sign, it's not a valid number. */ + if (rightmost == '-') { + CND_PRECONDITION (str.len == 1, "Number is invalid"); + return false; + } + + return setToken(t,&str,tokenType); + } + + bool StandardTokenizer::ReadAlphaNum(const TCHAR prev, Token* t) { + t->growBuffer(LUCENE_MAX_WORD_LEN+1);//make sure token can hold the next word + StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText + if ( str.len < LUCENE_MAX_WORD_LEN ){ + str.appendChar(prev); + int ch = prev; + + CONSUME_WORD; + if (!EOS && str.len < LUCENE_MAX_WORD_LEN-1 ) { //still have space for 1 more character? + switch(ch) { /* What follows the first alphanum segment? */ + case '.': + str.appendChar('.'); + return ReadDotted(&str, CL_NS2(analysis,standard)::UNKNOWN,t); + case '\'': + str.appendChar('\''); + return ReadApostrophe(&str,t); + case '@': + str.appendChar('@'); + return ReadAt(&str,t); + case '&': + str.appendChar('&'); + return ReadCompany(&str,t); + /* default: fall through to end of this function. */ + } + } + } + return setToken(t,&str,CL_NS2(analysis,standard)::ALPHANUM); + } + + bool StandardTokenizer::ReadCJK(const TCHAR prev, Token* t) { + t->growBuffer(LUCENE_MAX_WORD_LEN+1);//make sure token can hold the next word + StringBuffer str(t->_termText,t->bufferLength(),true); //use stringbuffer to read data onto the termText + if ( str.len < LUCENE_MAX_WORD_LEN ){ + str.appendChar(prev); + int ch = prev; + + CONSUME_CJK; + } + return setToken(t,&str,CL_NS2(analysis,standard)::CJK); + } + + + bool StandardTokenizer::ReadDotted(StringBuffer* _str, TokenTypes forcedType, Token* t) { + const int32_t specialCharPos = rdPos; + StringBuffer& str=*_str; + + /* A segment of a "dotted" is not allowed to begin with another dot or a dash. + ** Even though hosts, e-mail addresses, etc., could have a dotted-segment + ** that begins with a dot or a dash, it's far more common in source text + ** for a pattern like "abc.--def" to be intended as two tokens. */ + int ch = rd->Peek(); + if (!(DOT || DASH)) { + bool prevWasDot; + bool prevWasDash; + if (str.len == 0) { + prevWasDot = false; + prevWasDash = false; + } else { + prevWasDot = RIGHTMOST(str) == '.'; + prevWasDash = RIGHTMOST(str) == '-'; + } + while (!EOS && str.len < LUCENE_MAX_WORD_LEN-1 ) { + ch = readChar(); + const bool dot = ch == '.'; + const bool dash = ch == '-'; + + if (!(ALNUM || UNDERSCORE || dot || dash)) { + break; + } + /* Multiple dots or dashes in succession end the token. + ** Consider the following inputs: + ** "Visit windowsupdate.microsoft.com--update today!" + ** "In the U.S.A.--yes, even there!" */ + if ((dot || dash) && (prevWasDot || prevWasDash)) { + /* We're not going to append the character we just read, in any case. + ** As to the character before it (which is currently RIGHTMOST(str)): + ** Unless RIGHTMOST(str) is a dot, in which we need to save it so the + ** acronym-versus-host detection can work, we want to get rid of it. */ + if (!prevWasDot) { + SHAVE_RIGHTMOST(str); + } + break; + } + + str.appendChar(ch); + + prevWasDot = dot; + prevWasDash = dash; + } + } + + /* There's a potential StringBuffer.append call in the code above, which + ** could cause str to reallocate its internal buffer. We must wait to + ** obtain the optimization-oriented strBuf pointer until after the initial + ** potentially realloc-triggering operations on str. + ** Because there can be other such ops much later in this function, strBuf + ** is guarded within a block to prevent its use during or after the calls + ** that would potentially invalidate it. */ + { /* Begin block-guard of strBuf */ + TCHAR* strBuf = str.getBuffer(); + + bool rightmostIsDot = RIGHTMOST_IS(str, '.'); + if (CONSUMED_NOTHING_OF_VALUE) { + /* No more alphanums available for this token; shave trailing dot, if any. */ + if (rightmostIsDot) { + SHAVE_RIGHTMOST(str); + } + /* If there are no dots remaining, this is a generic ALPHANUM. */ + if (_tcschr(strBuf, '.') == NULL) { + forcedType = CL_NS2(analysis,standard)::ALPHANUM; + } + + /* Check the token to see if it's an acronym. An acronym must have a + ** letter in every even slot and a dot in every odd slot, including the + ** last slot (for example, "U.S.A."). */ + } else if (rightmostIsDot) { + bool isAcronym = true; + const int32_t upperCheckLimit = str.len - 1; /* -1 b/c we already checked the last slot. */ + + for (int32_t i = 0; i < upperCheckLimit; i++) { + const bool even = (i % 2 == 0); + ch = strBuf[i]; + if ( (even && !ALPHA) || (!even && !DOT) ) { + isAcronym = false; + break; + } + } + if (isAcronym) { + forcedType = CL_NS2(analysis,standard)::ACRONYM; + } else { + /* If it's not an acronym, we don't want the trailing dot. */ + SHAVE_RIGHTMOST(str); + /* If there are no dots remaining, this is a generic ALPHANUM. */ + if (_tcschr(strBuf, '.') == NULL) { + forcedType = CL_NS2(analysis,standard)::ALPHANUM; + } + } + } + } /* End block-guard of strBuf */ + + if (!EOS) { + if (ch == '@' && str.len < LUCENE_MAX_WORD_LEN-1) { + str.appendChar('@'); + return ReadAt(&str,t); + } else { + unReadChar(); + } + } + + return setToken(t,&str,CL_NS2(analysis,standard)::UNKNOWN + ? forcedType : CL_NS2(analysis,standard)::HOST); + } + + bool StandardTokenizer::ReadApostrophe(StringBuffer* _str, Token* t) { + StringBuffer& str=*_str; + + TokenTypes tokenType = CL_NS2(analysis,standard)::APOSTROPHE; + const int32_t specialCharPos = rdPos; + int ch=0; + + CONSUME_ALPHAS; + if (RIGHTMOST_IS(str, '\'') || CONSUMED_NOTHING_OF_VALUE) { + /* After the apostrophe, no more alphanums were available within this + ** token; shave trailing apostrophe and revert to generic ALPHANUM. */ + SHAVE_RIGHTMOST(str); + tokenType = CL_NS2(analysis,standard)::ALPHANUM; + } + if (!EOS) { + unReadChar(); + } + + return setToken(t,&str,tokenType); + } + + bool StandardTokenizer::ReadAt(StringBuffer* str, Token* t) { + ReadDotted(str, CL_NS2(analysis,standard)::EMAIL,t); + /* JLucene grammar indicates dots/digits not allowed in company name: */ + if (!CONTAINS_ANY((*str), ".0123456789")) { + setToken(t,str,CL_NS2(analysis,standard)::COMPANY); + } + return true; + } + + bool StandardTokenizer::ReadCompany(StringBuffer* _str, Token* t) { + StringBuffer& str = *_str; + const int32_t specialCharPos = rdPos; + int ch=0; + + CONSUME_WORD; + if (CONSUMED_NOTHING_OF_VALUE) { + /* After the ampersand, no more alphanums were available within this + ** token; shave trailing ampersand and revert to ALPHANUM. */ + CND_PRECONDITION(RIGHTMOST_IS(str, '&'),"ReadCompany failed"); + SHAVE_RIGHTMOST(str); + + + return setToken(t,&str,CL_NS2(analysis,standard)::ALPHANUM); + } + if (!EOS) { + unReadChar(); + } + + return setToken(t,&str,CL_NS2(analysis,standard)::COMPANY); + } + +CL_NS_END2 diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h new file mode 100644 index 000000000..d4195be81 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizer.h @@ -0,0 +1,88 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_analysis_standard_StandardTokenizer +#define _lucene_analysis_standard_StandardTokenizer + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "../AnalysisHeader.h" +#include "../Analyzers.h" +#include "StandardTokenizerConstants.h" +#include "CLucene/util/StringBuffer.h" +#include "CLucene/util/FastCharStream.h" +#include "CLucene/util/Reader.h" + + +CL_NS_DEF2(analysis,standard) + +/** A grammar-based tokenizer constructed with JavaCC. + * + *

This should be a good tokenizer for most European-language documents: + * + *

    + *
  • Splits words at punctuation characters, removing punctuation. However, a + * dot that's not followed by whitespace is considered part of a token. + *
  • Splits words at hyphens, unless there's a number in the token, in which case + * the whole token is interpreted as a product number and is not split. + *
  • Recognizes email addresses and internet hostnames as one token. + *
+ * + *

Many applications have specific tokenizer needs. If this tokenizer does + * not suit your application, please consider copying this source code + * directory to your project and maintaining your own grammar-based tokenizer. + */ + class StandardTokenizer: public Tokenizer { + private: + int32_t rdPos; + int32_t tokenStart; + + // Advance by one character, incrementing rdPos and returning the character. + int readChar(); + // Retreat by one character, decrementing rdPos. + void unReadChar(); + + // createToken centralizes token creation for auditing purposes. + //Token* createToken(CL_NS(util)::StringBuffer* sb, TokenTypes tokenCode); + inline bool setToken(Token* t, CL_NS(util)::StringBuffer* sb, TokenTypes tokenCode); + + bool ReadDotted(CL_NS(util)::StringBuffer* str, TokenTypes forcedType,Token* t); + + public: + CL_NS(util)::FastCharStream* rd; + + // Constructs a tokenizer for this Reader. + StandardTokenizer(CL_NS(util)::Reader* reader); + + ~StandardTokenizer(); + + /** Returns the next token in the stream, or false at end-of-stream. + * The returned token's type is set to an element of + * StandardTokenizerConstants::tokenImage. */ + bool next(Token* token); + + // Reads for number like "1"/"1234.567", or IP address like "192.168.1.2". + bool ReadNumber(const TCHAR* previousNumber, const TCHAR prev, Token* t); + + bool ReadAlphaNum(const TCHAR prev, Token* t); + + // Reads for apostrophe-containing word. + bool ReadApostrophe(CL_NS(util)::StringBuffer* str, Token* t); + + // Reads for something@... it may be a COMPANY name or a EMAIL address + bool ReadAt(CL_NS(util)::StringBuffer* str, Token* t); + + // Reads for COMPANY name like AT&T. + bool ReadCompany(CL_NS(util)::StringBuffer* str, Token* t); + + // Reads CJK characters + bool ReadCJK(const TCHAR prev, Token* t); + }; + +CL_NS_END2 +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h new file mode 100644 index 000000000..3c95af45a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/analysis/standard/StandardTokenizerConstants.h @@ -0,0 +1,30 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_analysis_standard_StandardTokenizerConstants +#define _lucene_analysis_standard_StandardTokenizerConstants + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF2(analysis,standard) + enum TokenTypes { + _EOF, + UNKNOWN, + ALPHANUM, + APOSTROPHE, + ACRONYM, + COMPANY, + EMAIL, + HOST, + NUM, + CJK + }; + extern const TCHAR** tokenImage; + + CL_NS_END2 +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerAcc.h b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerAcc.h new file mode 100644 index 000000000..6ecd142be --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerAcc.h @@ -0,0 +1,166 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#if !defined(_lucene_COMPILER_ACC) +#define _lucene_COMPILER_ACC + +// It is internal CLucene header - DO NOT include it directly +#if !defined(_SUPPRESS_MAKE_BASED_CONFIG) +#if defined(_BUILD_FOR_QT_) +#include "fulltextsearch/qclucene-config_p.h" +#else +#include "CLucene/clucene-config.h" //make clucene-config.h file +#endif +#endif + +#if defined(_ASCII) +#undef _UCS2 +#elif defined(_UCS2) +// +#else +#define CL_CHARSET_GUESS +#endif + +//dont allow FS_MMAP if mmap is not available +#if defined(LUCENE_FS_MMAP) && !defined(_CL_HAVE_MMAP) +#error "LUCENE_FS_MMAP is defined and MMap doesn't appear to be available" +#endif + +#ifdef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS +#undef _LUCENE_DISABLE_EXCEPTIONS +#define _LUCENE_DISABLE_EXCEPTIONS + +#error "this is bad if you made it here... your compiler seems not to have try/catch blocks." +#error "maybe you could implement an alternative solution for us? :)" +#endif + +#ifndef _CL_HAVE_NAMESPACES +#define DISABLE_NAMESPACE +#endif + +#define LUCENE_DISABLE_HASHING //we could enable this, but so far test show that the hashing is slower :( + +//define the file functions +#define fileSeek lseek +#define fileSize _filelength +#define fileStat stat +#define fileHandleStat fstat +#ifdef _CL_HAVE_TELL +#define fileTell tell +#else +//ftell (and probably soon ftell64) are POSIX standard functions, but tell and +//tell64 are not, so we define fileTell in terms of fileSeek. +#define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR) +#endif + +//this is needed early on so that CL_MAX_PATH can be correctly determined +//in the StdHeader.h. This was earlier causing problems with macosx. +//:: crash was due to realpath() that expects an output arguments that +//has at least the size of PATH_MAX (even if the result has a lower size) +#include + +#ifndef _CL_HAVE_WCHAR_T + typedef unsigned short wchar_t; +#endif + +#if defined(__CYGWIN__) +//cygwin seems to incorrectly define that it has wprintf??? +#undef _CL_HAVE_WPRINTF +#elif defined(__MINGW32__) +# ifndef _CL_HAVE_WINDOWS_H +# define _CL_HAVE_WINDOWS_H +# endif +#endif + + +/////////////////////////////////////////////////////////////////////////////// +//end _lucene_COMPILER_ACC +#elif !defined(_lucene_COMPILER_ACC2) +#define _lucene_COMPILER_ACC2 +//second inclusion + + //types + #if defined(_CL_HAVE_SYS_TYPES_H) + #include + #endif + #if defined(_CL_HAVE_INTTYPES_H) + #include + #elif defined(_CL_HAVE_STDINT_H) + #include + #else + #if _CL_SIZEOF_UNSIGNED_LONG_LONG==8 + typedef unsigned long long uint64_t; + typedef long long int64_t; + #elif _CL_SIZEOF_UNSIGNED_LONG==8 + typedef unsigned long uint64_t; + typedef long int64_t; + #else + #error I do not know what to use for a uint64_t. + #endif + + /* Give us an unsigned 32-bit data type. */ + #if _CL_SIZEOF_UNSIGNED_LONG==4 + typedef unsigned long uint32_t; + typedef long int32_t; + #elif _CL_SIZEOF_UNSIGNED_INT==4 + typedef unsigned int uint32_t; + typedef int int32_t; + #else + #error I do not know what to use for a uint32_t. + #endif + + /* An unsigned 8-bit data type */ + #if _CL_SIZEOF_UNSIGNED_CHAR==1 + typedef unsigned char uint8_t; + #else + #error I do not know what to use for a uint8_t. + #endif + #endif + + //second chance to fix default settings + //this must be defined later, otherwise it messes up + //the standard libraries + #if !defined(__MINGW32__) + #define _close ::close + #define _read ::read + #endif + + //now that int64_t is defined, we can define this... + #ifndef _CL_HAVE_FILELENGTH + #undef fileSize + #define fileSize lucene_filelength + int64_t lucene_filelength(int handle); + #endif + +#elif !defined(_lucene_COMPILER_ACC3) +#define _lucene_COMPILER_ACC3 + //third inclusion + + #if !defined(__MINGW32__) + //define replacements + #define O_RANDOM 0 + #undef O_BINARY + #define O_BINARY 0 + #define _S_IREAD 0444 + #define _S_IWRITE 0333 // write and execute permissions + + //some functions that are needed - not charset dependent and not tchar type functions + #define _open open + #define _write write + #define _snprintf snprintf + + //clucene uses ascii for filename interactions + #define _realpath(rel,abs) realpath(rel,abs) + #define _mkdir(x) mkdir(x,0777) + #define _unlink unlink + #else + #define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) + #endif + //also required by mingw + #define _rename rename +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerBcb.h b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerBcb.h new file mode 100644 index 000000000..f1b423b50 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerBcb.h @@ -0,0 +1,68 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#if !defined(_lucene_COMPILER_BCB) +#define _lucene_COMPILER_BCB + +// It is internal CLucene header - DO NOT include it directly + +#include "CLucene/config/define_std.h" +#undef _CL_HAVE_STRTOLL +#undef _CL_HAVE_WCSTOLL + +#define _LUCENE_PRAGMA_ONCE +#define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning +#define LUCENE_DISABLE_HASHING +#define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment } + +#undef LUCENE_ENABLE_MEMLEAKTRACKING //it has been reported that this causes problems + +#define fileSize filelength +#define fileSeek lseek +#define fileTell tell +#define fileStat stat +#define fileHandleStat fstat + +#define O_RANDOM 0 + +//java long type +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +//java int type +typedef int int32_t; +typedef unsigned int uint32_t; + +//java byte type +typedef unsigned char uint8_t; + +//floating point type +//we are going to use qreal now +//typedef double float_t; + +//required type +typedef int intptr_t; + +#define _CL_ILONG(x) x ## L +#define _ILONGLONG(x) x ## i64 + + +#elif !defined(_lucene_COMPILER_BCB2) +#define _lucene_COMPILER_BCB2 + //second inclusion + + #define _open open + #define _timeb timeb + #define _ftime ::ftime + #define _rename rename + + #define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) + +#elif !defined(_lucene_COMPILER_BCB3) +#define _lucene_COMPILER_BCB3 + //third inclusion + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h new file mode 100644 index 000000000..41310cefe --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h @@ -0,0 +1,175 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#if !defined(_lucene_COMPILER_GCC) +#define _lucene_COMPILER_GCC + +// It is internal CLucene header - DO NOT include it directly +#if !defined(_SUPPRESS_MAKE_BASED_CONFIG) + #if defined(_BUILD_FOR_QT_) + #include "qclucene-config_p.h" + #else + #include "CLucene/clucene-config.h" //make clucene-config.h file + #endif +#endif + +#if defined(_ASCII) + #undef _UCS2 +#elif defined(_UCS2) +// +#else + #define CL_CHARSET_GUESS +#endif + +//dont allow FS_MMAP if mmap is not available +#if defined(LUCENE_FS_MMAP) && !defined(_CL_HAVE_MMAP) + #error "LUCENE_FS_MMAP is defined and MMap doesn't appear to be available" +#endif + +#ifdef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS + #undef _LUCENE_DISABLE_EXCEPTIONS + #define _LUCENE_DISABLE_EXCEPTIONS + + #error "this is bad if you made it here... your compiler seems not to have try/catch blocks." + #error "maybe you could implement an alternative solution for us? :)" +#endif + +#ifndef _CL_HAVE_NAMESPACES + #define DISABLE_NAMESPACE +#endif + +#define CL_NS_HASHING(func) __gnu_cxx::func +#define LUCENE_DISABLE_HASHING //we could enable this, but so far test show that the hashing is slower :( + +//define the file functions +#define fileSeek lseek +#define fileSize _filelength +#define fileStat stat +#define fileHandleStat fstat +#ifdef _CL_HAVE_TELL + #define fileTell tell +#else + //ftell (and probably soon ftell64) are POSIX standard functions, but tell and + //tell64 are not, so we define fileTell in terms of fileSeek. + #define fileTell(fhandle) fileSeek(fhandle, 0, SEEK_CUR) +#endif + +//this is needed early on so that CL_MAX_PATH can be correctly determined +//in the StdHeader.h. This was earlier causing problems with macosx. +//:: crash was due to realpath() that expects an output arguments that +//has at least the size of PATH_MAX (even if the result has a lower size) +#include + +#ifndef _CL_HAVE_WCHAR_T + typedef unsigned short wchar_t; +#endif + +#if defined(__CYGWIN__) + //cygwin seems to incorrectly define that it has wprintf??? + #undef _CL_HAVE_WPRINTF +#elif defined(__MINGW32__) + #ifndef _CL_HAVE_WINDOWS_H + #define _CL_HAVE_WINDOWS_H + #endif +#endif + + +/////////////////////////////////////////////////////////////////////////////// +//end _lucene_COMPILER_GCC1 +#elif !defined(_lucene_COMPILER_GCC2) +#define _lucene_COMPILER_GCC2 + //second inclusion + + //types + #if defined(_CL_HAVE_SYS_TYPES_H) + #include + #endif + #if defined(_CL_HAVE_INTTYPES_H) + #include + #elif defined(_CL_HAVE_STDINT_H) + #include + #else + #if _CL_SIZEOF_UNSIGNED_LONG_LONG==8 + typedef unsigned long long uint64_t; + typedef long long int64_t; + #elif _CL_SIZEOF_UNSIGNED_LONG==8 + typedef unsigned long uint64_t; + typedef long int64_t; + #else + #error I do not know what to use for a uint64_t. + #endif + + /* Give us an unsigned 32-bit data type. */ + #if _CL_SIZEOF_UNSIGNED_LONG==4 + typedef unsigned long uint32_t; + typedef long int32_t; + #elif _CL_SIZEOF_UNSIGNED_INT==4 + typedef unsigned int uint32_t; + typedef int int32_t; + #else + #error I do not know what to use for a uint32_t. + #endif + + /* An unsigned 8-bit data type */ + #if _CL_SIZEOF_UNSIGNED_CHAR==1 + typedef unsigned char uint8_t; + #else + #error I do not know what to use for a uint8_t. + #endif + #endif + + //second chance to fix default settings + //this must be defined later, otherwise it messes up + //the standard libraries + #if !defined(__MINGW32__) + #define _close ::close + #define _read ::read + #endif + + //now that int64_t is defined, we can define this... + #ifndef _CL_HAVE_FILELENGTH + #undef fileSize + #define fileSize lucene_filelength + int64_t lucene_filelength(int handle); + #endif + +#elif !defined(_lucene_COMPILER_GCC3) +#define _lucene_COMPILER_GCC3 + //third inclusion + + #if !defined(__MINGW32__) + //define replacements + #define O_RANDOM 0 + #undef O_BINARY + #define O_BINARY 0 + #define _S_IREAD 0444 + #define _S_IWRITE 0333 // write and execute permissions + + //some functions that are needed - not charset dependent and not tchar type functions + #define _open open + #define _write write + #define _snprintf snprintf + + //clucene uses ascii for filename interactions + #define _realpath(rel,abs) realpath(rel,abs) + #define _mkdir(x) mkdir(x,0777) + #define _unlink unlink + #else + #define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) + #endif + //also required by mingw + #define _rename rename +#endif + +#if defined(__GNUC__) && (defined(__sgi) || (defined(Q_OS_SOLARIS) && Q_SOLARIS_VERSION < 10)) + #undef _CL_HAVE_FLOAT_T +#endif + +#if defined(__GNUC__) && defined(Q_OS_SOLARIS) && Q_SOLARIS_VERSION < 10 + #undef _CL_HAVE_WCSTOLL +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h new file mode 100644 index 000000000..0021ea368 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h @@ -0,0 +1,136 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#if !defined(_lucene_COMPILER_MSVC) +#define _lucene_COMPILER_MSVC + +// It is internal CLucene header - DO NOT include it directly + +#include "CLucene/config/define_std.h" + +#if (_MSC_VER >= 1300) +//>= 7.0 + #if defined(_BUILD_FOR_QT_) + # pragma warning(disable: 4100) // disable unreferenced formal parameter + # pragma warning(disable: 4189) // disable local variable is initialized but not referenced + #endif + # pragma warning(disable: 4512) // This would be very annoying + # pragma warning(disable: 4290) // Ignore exception specification warning + # pragma warning(disable: 4250) // Ignore 'class1' : inherits 'class2::member' via dominance (e.g. in MultiReader) + // Check for STLport presence + #include + #if (_MSC_VER < 1310) || defined(_STLPORT_VERSION) + #define CL_NS_HASHING(func) std::func //the namespace is different on VC 7.0 + #else + #define CL_NS_HASHING(func) stdext::func + #endif + #define LUCENE_STATIC_CONSTANT_SYNTAX 1 + + #if _MSC_FULL_VER >= 140050320 + #define _CL_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) + #else + #define _CL_DEPRECATE_TEXT(_Text) __declspec(deprecated) + #endif + +#elif (_MSC_VER >= 1200) +//6.0 +#ifdef LUCENE_ENABLE_MEMLEAKTRACKING + #define _CLDELETE_CARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(TCHAR*,x); x=NULL;} + #define _CLDELETE_CaARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(char*,x); x=NULL;} + #define _CLDELETE_LCARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(TCHAR*,x);} + #define _CLDELETE_LCaARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((void*)x,__FILE__,__LINE__);delete[] __CONST_CAST(char*,x);} +#else + #define _CLDELETE_CARRAY(x) if (x!=NULL){delete[] __CONST_CAST(TCHAR*,x); x=NULL;} + #define _CLDELETE_CaARRAY(x) if (x!=NULL){delete[] __CONST_CAST(char*,x); x=NULL;} + #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete[] __CONST_CAST(TCHAR*,x);} + #define _CLDELETE_LCaARRAY(x) if (x!=NULL){delete[] __CONST_CAST(char*,x);} + +#endif + #define LUCENE_STATIC_CONSTANT_SYNTAX 2 + + # pragma warning(disable: 4786) // This would be very annoying + namespace std{ + # undef min // just in case + # undef max // just in case + + #define min(a,b) (a>b?b:a) + #define max(a,b) (a>b?a:b) + } + + //only 7.0+ has these function + #undef _CL_HAVE_LLTOA + #undef _CL_HAVE_LLTOAW + #undef _CL_HAVE_INTPTR_T + #undef _CL_HAVE_WCSTOLL + #undef _CL_HAVE_STRTOLL + #undef _CL_HAVE_HASH_MAP + #undef _CL_HAVE_HASH_SET + +#else +# error "This version of MSVC has not been tested. Please uncomment this line to try anyway. Please send a report to the Clucene's administration if successful" +#endif + +#if _MSC_VER >= 1020 + #define _LUCENE_PRAGMA_ONCE +#endif +#define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning + +//if we are compiling using single-threaded libraries, we can disable multi-threading stuff +#if !defined(_MT) && !defined(_CL_DISABLE_MULTITHREADING) + #define _CL_DISABLE_MULTITHREADING +#endif + +//msvc supports large files +#ifdef _LARGE_FILES +# define fileSize _filelengthi64 +# define fileSeek _lseeki64 +# define fileTell _telli64 +# define fileStat _stati64 +# define fileHandleStat _fstati64 +#else +# define fileSize _filelength +# define fileSeek _lseek +# define fileTell _tell +# define fileStat _stat +# define fileHandleStat _fstat +#endif + +//_rename is not defined??? +#define _rename rename + +#define CL_MAX_PATH 260 //give the windef.h value for this... +#define _realpath(rel,abs) _fullpath(abs,rel,CL_MAX_PATH) + +//java long type +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +//java int type +typedef int int32_t; +typedef unsigned int uint32_t; + +//java byte type +typedef unsigned char uint8_t; + +//floating point type +//we are going to use qreal now +//typedef double float_t; + +#define _CL_ILONG(x) x ## L +#define _ILONGLONG(x) x ## i64 + + +#elif !defined(_lucene_COMPILER_MSVC2) +#define _lucene_COMPILER_MSVC2 + //second inclusion + + +#elif !defined(_lucene_COMPILER_MSVC3) +#define _lucene_COMPILER_MSVC3 + //third inclusion +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformMac.h b/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformMac.h new file mode 100644 index 000000000..9f6d6f421 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformMac.h @@ -0,0 +1,19 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +// It is internal CLucene header - DO NOT include it directly + +# define PATH_DELIMITER _T("/") +# define PATH_DELIMITERA "/" +# define PATH_DELIMITERC '/' + +# if (__GNUC__ < 3) && !defined( __APPLE_CC__) +// GCC strange "ignore std" mode works better if you pretend everything +// is in the std namespace, for the most part. +# define LUCENE_NO_STDC_NAMESPACE +# endif + +#undef _T //apple has something else strange here... diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformUnix.h b/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformUnix.h new file mode 100644 index 000000000..202a894bd --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformUnix.h @@ -0,0 +1,12 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +// It is internal CLucene header - DO NOT include it directly + +# define PATH_DELIMITER _T("/") +# define PATH_DELIMITERA "/" +# define PATH_DELIMITERC '/' + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformWin32.h b/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformWin32.h new file mode 100644 index 000000000..8b8a1132e --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/PlatformWin32.h @@ -0,0 +1,11 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +// It is internal CLucene header - DO NOT include it directly + +# define PATH_DELIMITER _T("\\") +# define PATH_DELIMITERA "\\" +# define PATH_DELIMITERC '\\' diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/compiler.h b/src/assistant/3rdparty/clucene/src/CLucene/config/compiler.h new file mode 100644 index 000000000..68f93b6e4 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/compiler.h @@ -0,0 +1,259 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#if !defined(lucene_compiler_h) +#define lucene_compiler_h + +#if defined(_MBCS) || defined(_ASCII) +#undef _ASCII +#undef _UCS2 +#define _ASCII +#elif defined(_UNICODE) +#define _UCS2 +#elif !defined(_UCS2) +#define _UCS2 +#endif + +//msvc needs unicode define so that it uses unicode library +#ifdef _UCS2 +#undef _UNICODE +#define _UNICODE +#undef _ASCII +#else +#undef _UNICODE +#undef _UCS2 +#endif + + +//////////////////////////////////////////////////////////////////// +// Figure out what compiler we are using +//////////////////////////////////////////////////////////////////// + +#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__COMO__) +#define _CLCOMPILER_MSVC _MSC_VER +#endif + +#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__) +#include "CLucene/config/CompilerGcc.h" + +#elif defined(_CLCOMPILER_MSVC) +/* Microsoft Visual C++ */ +#include "CLucene/config/CompilerMsvc.h" + +#elif defined (__BORLANDC__) +#include "CLucene/config/CompilerBcb.h" + +#elif defined (__HP_aCC) +#include "CLucene/config/CompilerAcc.h" + +#else + //Unable to identify the compiler, issue error diagnostic. + //Edit to set STLport up for your compiler. + //Uncomment this next line +#error "Unable to identify the compiler, issue error diagnostic. Edit to set Lucene up for your compiler." +#include "CLucene/config/LuceneMycomp.h" +#endif /* end of compiler choice */ +//////////////////////////////////////////////////////////////////// + + + +//////////////////////////////////////////////////////////////////// +// Now include platform specific definitions +//////////////////////////////////////////////////////////////////// + +/* Operating system recognition (basic) */ +#if defined (__unix) || defined (__linux__) || defined (__QNX__) || defined (_AIX) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__Lynx__) || defined(hpux) || defined(__hpux) +#undef _UNIX +#define _UNIX 1 +#include "CLucene/config/PlatformUnix.h" + +#elif defined(macintosh) || defined (_MAC) || defined(__APPLE__) +#undef _MAC +#define _MAC 1 +#include "CLucene/config/PlatformMac.h" + +#elif defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__) +#undef _WIN32 +#define _WIN32 +#include "CLucene/config/PlatformWin32.h" + +#elif defined (__WIN16) || defined (WIN16) || defined (_WIN16) +#undef _WIN16 +#define _WIN16 +#error "CLucene has not been tested on this platform. Please send a report to the lucene administrators if you are able to successfully compile" +#else +#error "CLucene could not identify the platform." +#endif /* platforms */ + + + +//////////////////////////////////////////////////////////////////// +// Now we take all that we have learnt, and define some things +//////////////////////////////////////////////////////////////////// + +//lets just say that we can always do unicode! :) +#ifdef CL_CHARSET_GUESS +#define _UCS2 +#endif + +#if defined(_ASCII) +#undef _UCS2 +#elif defined(_UCS2) +#undef _ASCII +#endif + +#ifndef _LUCENE_NO_NEW_STYLE_CASTS +#define __CONST_CAST(typ,var) const_cast(var) +#define __REINTERPRET_CAST(typ,var) reinterpret_cast(var) +#else +#define __CONST_CAST(typ,var) ((typ)(var)) +#define __REINTERPRET_CAST,var) ((typ)(var)) +#endif + +#ifndef _CL_DEPRECATE_TEXT +#define _CL_DEPRECATE_TEXT(_Text) +#endif +#define _CL_DEPRECATED(_NewItem) _CL_DEPRECATE_TEXT("This function or variable has been superceded by newer library or operating system functionality. Consider using" #_NewItem "instead. See online help for details.") + + +//cnd-debug exit command +#ifndef debugFatalExit +#define debugFatalExit(ret) exit(ret) +#endif + +#ifndef _CL_ILONG +#define _CL_ILONG(x) x ## L +#endif +#ifndef _ILONGLONG +#define _ILONGLONG(x) x ## LL +#endif + +//define whats the values of item intergers *should* be. we can check this in a test +#define LUCENE_INT64_MAX_SHOULDBE _ILONGLONG(0x7FFFFFFFFFFFFFFF) +#define LUCENE_INT32_MAX_SHOULDBE 0x7FFFFFFFL +#define LUCENE_UINT8_MAX_SHOULDBE 0xff + +//maximum path length. only used for buffers that use fullpath. +//anything else should use a dynamic length. +#if defined(CL_MAX_PATH) +//do nothing... +#elif defined(PATH_MAX) +#define CL_MAX_PATH PATH_MAX +#elif defined(MAX_PATH) +#define CL_MAX_PATH MAX_PATH +#elif defined(_MAX_PATH) +#define CL_MAX_PATH _MAX_PATH +#else + #error "CL_MAX_PATH could not be determined" +#endif + +//this is the max filename... for now its just the same, +//but this could change, so we use a different name +#define CL_MAX_NAME CL_MAX_PATH +//this used to be CL_MAX_NAME * 32, but as Alex Hudson points out, this could come to be 128kb. +//the above logic for CL_MAX_NAME should be correct enough to handle all file names +#define CL_MAX_DIR CL_MAX_PATH + +#ifdef _LARGE_FILES +#define LUCENE_MAX_FILELENGTH LUCENE_INT64_MAX_SHOULDBE +#else +#define LUCENE_MAX_FILELENGTH LUCENE_INT32_MAX_SHOULDBE +#endif + +//use the LUCENE_STATIC_CONSTANT_SYNTAX to determine LUCENE_STATIC_CONSTANT +#ifndef LUCENE_STATIC_CONSTANT + //autoconf is not properly detecting the correct method for this, and since there's no real big + //harm in always using an enum, we'll probably just make this the default. + /*#if LUCENE_STATIC_CONSTANT_SYNTAX == 1 + #define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment + #elif LUCENE_STATIC_CONSTANT_SYNTAX == 2*/ + #define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment } + /*#else + #error "LUCENE_STATIC_CONSTANT not defined, and/or LUCENE_STATIC_CONSTANT_SYNTAX is not defined to a valid value" + #endif*/ +#endif + +//end of lucene_compiler_h +#elif !defined(lucene_compiler_h2) +#define lucene_compiler_h2 +//here we include the compiler header again, this gives the header a +//second chance at including stuff, after the main inclusions are complete + +#if defined (__GNUC__) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__) +#include "CLucene/config/CompilerGcc.h" + +#elif defined(_CLCOMPILER_MSVC) +/* Microsoft Visual C++ */ +#include "CLucene/config/CompilerMsvc.h" + +#elif defined __BORLANDC__ +#include "CLucene/config/CompilerBcb.h" + +#elif defined (__HP_aCC) +#include "CLucene/config/CompilerAcc.h" + +#else +//Unable to identify the compiler, issue error diagnostic. +//Edit to set STLport up for your compiler. +//Uncomment this next line +#error "Unable to identify the compiler, issue error diagnostic. Edit to set Lucene up for your compiler." +#include "CLucene/config/LuceneMycomp.h" +#endif /* end of compiler choice */ + +#ifndef _CL_HAVE_FLOAT_T +//#ifdef _CL_HAVE_LONG_DOUBLE +// long double's are not working (reported by Mark Ashworth on Solaris 64) +// typedef long double float_t; /* `float' expressions are evaluated as `long double'. */ +//#else +// we are going to use qreal now +// typedef double float_t; +//#endif +#endif + +/*todo: but need to define SIZEOF_VOID_P #if (SIZEOF_VOID_P > 4 && SIZEOF_VOID_P <= 8) +#ifndef _CL_HAVE_INTPTR_T + typedef int64_t intptr_t; +#endif +#elif (SIZEOF_VOID_P > 2 && SIZEOF_VOID_P <= 4) +# ifndef _CL_HAVE_INTPTR_T + typedef int32_t intptr_t; +# endif +#else +#error "void * is either >8 bytes or <= 2. In either case, I am confused." +#endif*/ + +#ifndef _CL_HAVE_INTPTR_T + typedef int intptr_t; +#endif + +//end of lucene_compiler_h2 +#elif !defined(lucene_compiler_h3) +#define lucene_compiler_h3 +//here we include the compiler header again, this gives the header a +//third chance at including stuff, after the main inclusions are complete + +#if defined (__GNUC__ ) || defined(__SUNPRO_CC) || defined(__xlC__) || defined(__sgi) && defined(__EDG__) +#include "CLucene/config/CompilerGcc.h" + +#elif defined(_CLCOMPILER_MSVC) +/* Microsoft Visual C++ */ +#include "CLucene/config/CompilerMsvc.h" + +#elif defined __BORLANDC__ +#include "CLucene/config/CompilerBcb.h" + +#elif defined (__HP_aCC) +#include "CLucene/config/CompilerAcc.h" + +#else +//Unable to identify the compiler, issue error diagnostic. +//Edit to set STLport up for your compiler. +//Uncomment this next line +#error "Unable to identify the compiler, issue error diagnostic. Edit to set Lucene up for your compiler." +#include "CLucene/config/LuceneMycomp.h" +#endif /* end of compiler choice */ + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/define_std.h b/src/assistant/3rdparty/clucene/src/CLucene/config/define_std.h new file mode 100644 index 000000000..22a079053 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/define_std.h @@ -0,0 +1,113 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef lucene_define_std +#define lucene_define_std +//define a standard list of defines. +//These defines represents a fairly complete compiler. +//Of course it is preferable to use the autoconf generated +//list, but then not all systems can do this :) + +//we support long files - 64 bit file functions +#define _LARGE_FILES + +//support namespaces +#define _CL_HAVE_NAMESPACES + +//support try/catch blocks +#define _CL_HAVE_FUNCTION_TRY_BLOCKS + +//the normal headers +#define _CL_STDC_HEADERS +#define _CL_HAVE_STDARG_H +#define _CL_HAVE_ALGORITHM +#define _CL_HAVE_FUNCTIONAL +#define _CL_HAVE_MATH_H +#define _CL_HAVE_STL +#define _CL_HAVE_HASH_MAP +#define _CL_HAVE_HASH_SET +#define _CL_HAVE_MAP +#define _CL_HAVE_SET +#define _CL_HAVE_LIST +#define _CL_HAVE_VECTOR +#define _CL_HAVE_STDEXCEPT +#define _CL_HAVE_ERRNO_H +#define _CL_HAVE_SYS_STAT_H +#define _CL_HAVE_FCNTL_H + +//character & std tchar support +#define _CL_HAVE_TCHAR_H +#ifdef _UCS2 + #define _CL_HAVE_WCTYPE_H + + #define _CL_HAVE_WCSCPY + #define _CL_HAVE_WCSNCPY + #define _CL_HAVE_WCSCAT + #define _CL_HAVE_WCSCHR + #define _CL_HAVE_WCSSTR + #define _CL_HAVE_WCSLEN + #define _CL_HAVE_WCSCMP + #define _CL_HAVE_WCSNCMP + #define _CL_HAVE_WCSCSPN +#else + #define _CL_HAVE_CTYPE_H +#endif + +//already have the normal structures +#define _CL_HAVE_FLOAT_T +#define _CL_HAVE_INTPTR_T + +//system dependant: +#define _CL_HAVE_STRING_H //could be HAVE_STRINGS_H && HAVE_STRCHR +#define _CL_HAVE_SYS_TIMEB_H +#define _CL_HAVE_TIME_H + +#if defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__) + #define _CL_HAVE_IO_H + #define _CL_HAVE_DIRECT_H + #define _CL_HAVE_WINDOWS_H +#else + #define _CL_HAVE_UNISTD_H +#endif +#ifdef UNDER_CE +#undef _CL_HAVE_SYS_TIMEB_H +#endif + +//////////////////////////////////////////////// +//now for individual functions. some compilers +//miss these, so must individually define what +//we have +//////////////////////////////////////////////// + +//string functions +#define _CL_HAVE_STRLWR +#define _CL_HAVE_WCSLWR +#define _CL_HAVE_WCSCASECMP +#define _CL_HAVE_STRCASECMP + +//formatting functions +#define _CL_HAVE_SNWPRINTF +#define _CL_HAVE_VSNWPRINTF +#define _CL_HAVE_WPRINTF +#define _CL_HAVE_SNPRINTF +#define _CL_HAVE_PRINTF + + +//conversion functions +#define _CL_HAVE_STRTOLL +#define _CL_HAVE_WCSTOLL +#define _CL_HAVE_WCSTOD +#define _CL_HAVE_LLTOA +#define _CL_HAVE_LLTOW +#define _CL_HAVE_INTPTR_T + +//these ones are not standard (msvc) +//so you will probably need to undefine +//if you are not using msvc +#define _CL_HAVE_FILELENGTH + + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.cpp new file mode 100644 index 000000000..5463936f6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.cpp @@ -0,0 +1,386 @@ +/* + * Copyright (C) 1999 Tom Tromey + * Copyright (C) 2000 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + ************************************************ + * Also licensed with permission from Tom Tromey + * and Owen Taylor under the Apache license. + * Original location: + * http://cvs.gnome.org/viewcvs/glib/glib/guniprop.c?view=log + ************************************************ + * + * Copyright 2003-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ + +#include "CLucene/StdHeader.h" + +typedef unsigned long gunichar; +typedef unsigned short guint16; +typedef short gint16; +typedef char gchar; +typedef unsigned char guchar; + +/* These are the possible character classifications. + * See http://www.unicode.org/Public/UNIDATA/UnicodeData.txt + or http://www.unicode.org/Public/UNIDATA/UCD.html. + + todo: i think there is a new version of the unicode, which we should use. + data is licensed like this: http://www.unicode.org/copyright.html... not sure but looks apache compatible + */ +typedef enum +{ + G_UNICODE_CONTROL, + G_UNICODE_FORMAT, + G_UNICODE_UNASSIGNED, + G_UNICODE_PRIVATE_USE, + G_UNICODE_SURROGATE, + G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_LETTER, + G_UNICODE_TITLECASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_COMBINING_MARK, + G_UNICODE_ENCLOSING_MARK, + G_UNICODE_NON_SPACING_MARK, + G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_LETTER_NUMBER, + G_UNICODE_OTHER_NUMBER, + G_UNICODE_CONNECT_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_FINAL_PUNCTUATION, + G_UNICODE_INITIAL_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_SYMBOL, + G_UNICODE_LINE_SEPARATOR, + G_UNICODE_PARAGRAPH_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR +} GUnicodeType; + + +#include "gunichartables.h" + +#define ATTR_TABLE(Page) (((Page) <= G_UNICODE_LAST_PAGE_PART1) \ + ? attr_table_part1[Page] \ + : attr_table_part2[(Page) - 0xe00]) + +#define ATTTABLE(Page, Char) \ + ((ATTR_TABLE(Page) == G_UNICODE_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char])) + + +#define TTYPE_PART1(Page, Char) \ + ((type_table_part1[Page] >= G_UNICODE_MAX_TABLE_INDEX) \ + ? (type_table_part1[Page] - G_UNICODE_MAX_TABLE_INDEX) \ + : (type_data[type_table_part1[Page]][Char])) + +#define TTYPE_PART2(Page, Char) \ + ((type_table_part2[Page] >= G_UNICODE_MAX_TABLE_INDEX) \ + ? (type_table_part2[Page] - G_UNICODE_MAX_TABLE_INDEX) \ + : (type_data[type_table_part2[Page]][Char])) + +#define TYPE(Char) \ + (((Char) <= G_UNICODE_LAST_CHAR_PART1) \ + ? TTYPE_PART1 ((Char) >> 8, (Char) & 0xff) \ + : (((Char) >= 0xe0000 && (Char) <= G_UNICODE_LAST_CHAR) \ + ? TTYPE_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \ + : G_UNICODE_UNASSIGNED)) + +/* Count the number of elements in an array. The array must be defined + * as such; using this with a dynamically allocated array will give + * incorrect results. + */ +#define G_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0])) + + + + +#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) +#ifdef _LUCENE_PRAGMA_WARNINGS + #pragma message ("===== Using internal character function =====") +#else +#if !(defined(Q_OS_SOLARIS) || defined(Q_CC_MIPS)) +#warning "===== Using internal character function =====" +#endif +#endif + +bool cl_isletter(gunichar c) +{ + int t = TYPE (c); + switch(t) + { + case G_UNICODE_LOWERCASE_LETTER: return true; + case G_UNICODE_TITLECASE_LETTER: return true; + case G_UNICODE_UPPERCASE_LETTER: return true; + case G_UNICODE_MODIFIER_LETTER: return true; + case G_UNICODE_OTHER_LETTER: return true; + default: return false; + } +} + +bool cl_isalnum(gunichar c) +{ + int t = TYPE (c); + switch(t) + { + case G_UNICODE_LOWERCASE_LETTER: return true; + case G_UNICODE_TITLECASE_LETTER: return true; + case G_UNICODE_UPPERCASE_LETTER: return true; + case G_UNICODE_MODIFIER_LETTER: return true; + case G_UNICODE_OTHER_LETTER: return true; + case G_UNICODE_DECIMAL_NUMBER: return true; + case G_UNICODE_LETTER_NUMBER: return true; + case G_UNICODE_OTHER_NUMBER: return true; + default: return false; + } +} + +bool cl_isdigit(gunichar c) +{ + int t = TYPE (c); + switch(t) + { + case G_UNICODE_DECIMAL_NUMBER: return true; + case G_UNICODE_LETTER_NUMBER: return true; + case G_UNICODE_OTHER_NUMBER: return true; + default: return false; + } +} + +/** + * cl_isspace: + * @c: a Unicode character + * + * Determines whether a character is a space, tab, or line separator + * (newline, carriage return, etc.). Given some UTF-8 text, obtain a + * character value with lucene_utf8towc(). + * + * (Note: don't use this to do word breaking; you have to use + * Pango or equivalent to get word breaking right, the algorithm + * is fairly complex.) + * + * Return value: %TRUE if @c is a punctuation character + **/ +bool cl_isspace (gunichar c) +{ + switch (c) + { + /* special-case these since Unicode thinks they are not spaces */ + case '\t': + case '\n': + case '\r': + case '\f': + return true; + + default: + { + int t = TYPE ((gunichar)c); + return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR + || t == G_UNICODE_PARAGRAPH_SEPARATOR); + } + } +} + + + +/** + * cl_tolower: + * @c: a Unicode character. + * + * Converts a character to lower case. + * + * Return value: the result of converting @c to lower case. + * If @c is not an upperlower or titlecase character, + * or has no lowercase equivalent @c is returned unchanged. + **/ +TCHAR cl_tolower (TCHAR ch) +{ + gunichar c=ch; + int t = TYPE ((gunichar)c); + if (t == G_UNICODE_UPPERCASE_LETTER) + { + gunichar val = ATTTABLE (c >> 8, c & 0xff); + if (val >= 0x1000000) + { + const gchar *p = special_case_table + val - 0x1000000; + int len=0; + wchar_t ret=0; + lucene_utf8towc(&ret,p,6); +#ifdef _UCS2 + return ret; +#else + return LUCENE_OOR_CHAR(ret); +#endif + //return cl_utf8_get_char (p, &len); + }else + return val ? val : c; + }else if (t == G_UNICODE_TITLECASE_LETTER){ + unsigned int i; + for (i = 0; i < G_N_ELEMENTS (title_table); ++i) + { + if (title_table[i][0] == c) + return title_table[i][2]; + } + } + return c; +} + +/** + * cl_toupper: + * @c: a Unicode character + * + * Converts a character to uppercase. + * + * Return value: the result of converting @c to uppercase. + * If @c is not an lowercase or titlecase character, + * or has no upper case equivalent @c is returned unchanged. + **/ +TCHAR cl_toupper (TCHAR ch) +{ + gunichar c=ch; + int t = TYPE (c); + if (t == G_UNICODE_LOWERCASE_LETTER) + { + gunichar val = ATTTABLE (c >> 8, c & 0xff); + if (val >= 0x1000000) + { + const gchar *p = special_case_table + val - 0x1000000; + + wchar_t ret=0; + lucene_utf8towc(&ret,p,6); +#ifdef _UCS2 + return ret; +#else + return LUCENE_OOR_CHAR(ret); +#endif + //return lucene_utf8towc (p); + } + else + return val ? val : c; + } + else if (t == G_UNICODE_TITLECASE_LETTER) + { + unsigned int i; + for (i = 0; i < G_N_ELEMENTS (title_table); ++i) + { + if (title_table[i][0] == c) + return title_table[i][1]; + } + } + return c; +} + + + +/** + * cl_tcasefold: + * @str: a unicode string + * + * Converts a string into a form that is independent of case. The + * result will not correspond to any particular case, but can be + * compared for equality or ordered with the results of calling + * cl_tcasefold() on other strings. + * + * Note that calling cl_tcasefold() followed by g_utf8_collate() is + * only an approximation to the correct linguistic case insensitive + * ordering, though it is a fairly good one. Getting this exactly + * right would require a more sophisticated collation function that + * takes case sensitivity into account. GLib does not currently + * provide such a function. + * + * Return value: a newly allocated string, that is a + * case independent form of @str. + **/ +TCHAR cl_tcasefold(const TCHAR ch){ + int start = 0; + int end = G_N_ELEMENTS (casefold_table); + + if (ch >= casefold_table[start].ch && + ch <= casefold_table[end - 1].ch) + { + while (1) + { + int half = (start + end) / 2; + if (ch == casefold_table[half].ch) + { + wchar_t ret=0; + lucene_utf8towc(&ret,casefold_table[half].data,6); + + #ifdef _UCS2 + return ret; + #else + LUCENE_OOR_CHAR(ret) + #endif + }else if (half == start){ + break; + }else if (ch > casefold_table[half].ch){ + start = half; + }else{ + end = half; + } + } + } + return cl_tolower(ch); + +} + + +//this function was not taken from gnome +TCHAR* cl_tcscasefold( TCHAR * str, int len ) //len default is -1 +{ + TCHAR *p = str; + while ((len < 0 || p < str + len) && *p) + { + *p = cl_tcasefold(*p); + p++; + } + return str; +} +//this function was not taken from gnome +int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src){ + TCHAR f,l; + + do{ + f = cl_tcasefold( (*(dst++)) ); + l = cl_tcasefold( (*(src++)) ); + } while ( (f) && (f == l) ); + + return (int)(f - l); +} + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.h b/src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.h new file mode 100644 index 000000000..182a87054 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/gunichartables.h @@ -0,0 +1,11264 @@ +/* This file is automatically generated. DO NOT EDIT! + Instead, edit gen-unicode-tables.pl and re-run. */ + +#ifndef CHARTABLES_H +#define CHARTABLES_H + +#define G_UNICODE_DATA_VERSION "4.0" + +#define G_UNICODE_LAST_CHAR 0x10ffff + +#define G_UNICODE_MAX_TABLE_INDEX 10000 + +#define G_UNICODE_LAST_CHAR_PART1 0x2FAFF + +#define G_UNICODE_LAST_PAGE_PART1 762 + +static const char type_data[][256] = { + { /* page 0, index 0 */ + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_CONTROL, + G_UNICODE_CONTROL, G_UNICODE_CONTROL, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_MATH_SYMBOL, G_UNICODE_FORMAT, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_OTHER_NUMBER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_FINAL_PUNCTUATION, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER + }, + { /* page 1, index 1 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER + }, + { /* page 2, index 2 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL + }, + { /* page 3, index 3 */ + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 4, index 4 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 5, index 5 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 6, index 6 */ + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_FORMAT, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_LETTER + }, + { /* page 7, index 7 */ + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 9, index 8 */ + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_LETTER, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 10, index 9 */ + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 11, index 10 */ + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 12, index 11 */ + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 13, index 12 */ + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 14, index 13 */ + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_MODIFIER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 15, index 14 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 16, index 15 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 17, index 16 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 18, index 17 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER + }, + { /* page 19, index 18 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 20, index 19 */ + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER + }, + { /* page 22, index 20 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 23, index 21 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_OTHER_LETTER, G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 24, index 22 */ + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_UNASSIGNED, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 25, index 23 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL + }, + { /* page 29, index 24 */ + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 30, index 25 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 31, index 26 */ + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_TITLECASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_TITLECASE_LETTER, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_UNASSIGNED + }, + { /* page 32, index 27 */ + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_INITIAL_PUNCTUATION, + G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_INITIAL_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_LINE_SEPARATOR, G_UNICODE_PARAGRAPH_SEPARATOR, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_INITIAL_PUNCTUATION, G_UNICODE_FINAL_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_SPACE_SEPARATOR, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_OTHER_NUMBER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_ENCLOSING_MARK, G_UNICODE_ENCLOSING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 33, index 28 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL + }, + { /* page 35, index 29 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 36, index 30 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER + }, + { /* page 37, index 31 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL + }, + { /* page 38, index 32 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 39, index 33 */ + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL + }, + { /* page 41, index 34 */ + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL + }, + { /* page 43, index 35 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 46, index 36 */ + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 47, index 37 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 48, index 38 */ + G_UNICODE_SPACE_SEPARATOR, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_LETTER_NUMBER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_LETTER_NUMBER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_LETTER + }, + { /* page 49, index 39 */ + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER + }, + { /* page 50, index 40 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED + }, + { /* page 77, index 41 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL + }, + { /* page 159, index 42 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 164, index 43 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 215, index 44 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 250, index 45 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 251, index 46 */ + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER + }, + { /* page 253, index 47 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 254, index 48 */ + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_CONNECT_PUNCTUATION, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_DASH_PUNCTUATION, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT + }, + { /* page 255, index 49 */ + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_DASH_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_MODIFIER_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OPEN_PUNCTUATION, G_UNICODE_CLOSE_PUNCTUATION, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OPEN_PUNCTUATION, + G_UNICODE_CLOSE_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_CONNECT_PUNCTUATION, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_MODIFIER_LETTER, G_UNICODE_MODIFIER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MODIFIER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_CURRENCY_SYMBOL, G_UNICODE_CURRENCY_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, G_UNICODE_MATH_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 256, index 50 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 257, index 51 */ + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_OTHER_PUNCTUATION, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 259, index 52 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_NUMBER, + G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, G_UNICODE_OTHER_NUMBER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_LETTER_NUMBER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_PUNCTUATION, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 260, index 53 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 264, index 54 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 464, index 55 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 465, index 56 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, + G_UNICODE_COMBINING_MARK, G_UNICODE_COMBINING_MARK, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 467, index 57 */ + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, G_UNICODE_OTHER_SYMBOL, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 468, index 58 */ + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER + }, + { /* page 469, index 59 */ + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER + }, + { /* page 470, index 60 */ + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_MATH_SYMBOL, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER + }, + { /* page 471, index 61 */ + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_UPPERCASE_LETTER, + G_UNICODE_UPPERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_MATH_SYMBOL, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_LOWERCASE_LETTER, G_UNICODE_LOWERCASE_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER, + G_UNICODE_DECIMAL_NUMBER, G_UNICODE_DECIMAL_NUMBER + }, + { /* page 678, index 62 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 762, index 63 */ + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, G_UNICODE_OTHER_LETTER, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 3584, index 64 */ + G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_FORMAT, G_UNICODE_FORMAT, G_UNICODE_FORMAT, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED + }, + { /* page 3585, index 65 */ + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_NON_SPACING_MARK, G_UNICODE_NON_SPACING_MARK, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 4095, index 66 */ + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + }, + { /* page 4351, index 67 */ + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, + G_UNICODE_PRIVATE_USE, G_UNICODE_PRIVATE_USE, G_UNICODE_UNASSIGNED, + G_UNICODE_UNASSIGNED + } +}; + +/* U+0000 through U+2FAFF */ +static const gint16 type_table_part1[763] = { + 0 /* page 0 */, + 1 /* page 1 */, + 2 /* page 2 */, + 3 /* page 3 */, + 4 /* page 4 */, + 5 /* page 5 */, + 6 /* page 6 */, + 7 /* page 7 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 8 /* page 9 */, + 9 /* page 10 */, + 10 /* page 11 */, + 11 /* page 12 */, + 12 /* page 13 */, + 13 /* page 14 */, + 14 /* page 15 */, + 15 /* page 16 */, + 16 /* page 17 */, + 17 /* page 18 */, + 18 /* page 19 */, + 19 /* page 20 */, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 20 /* page 22 */, + 21 /* page 23 */, + 22 /* page 24 */, + 23 /* page 25 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 24 /* page 29 */, + 25 /* page 30 */, + 26 /* page 31 */, + 27 /* page 32 */, + 28 /* page 33 */, + G_UNICODE_MATH_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, + 29 /* page 35 */, + 30 /* page 36 */, + 31 /* page 37 */, + 32 /* page 38 */, + 33 /* page 39 */, + G_UNICODE_OTHER_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, + 34 /* page 41 */, + G_UNICODE_MATH_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, + 35 /* page 43 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 36 /* page 46 */, + 37 /* page 47 */, + 38 /* page 48 */, + 39 /* page 49 */, + 40 /* page 50 */, + G_UNICODE_OTHER_SYMBOL + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 41 /* page 77 */, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 42 /* page 159 */, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 43 /* page 164 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 44 /* page 215 */, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_SURROGATE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 45 /* page 250 */, + 46 /* page 251 */, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 47 /* page 253 */, + 48 /* page 254 */, + 49 /* page 255 */, + 50 /* page 256 */, + 51 /* page 257 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 52 /* page 259 */, + 53 /* page 260 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 54 /* page 264 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 55 /* page 464 */, + 56 /* page 465 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + 57 /* page 467 */, + 58 /* page 468 */, + 59 /* page 469 */, + 60 /* page 470 */, + 61 /* page 471 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 62 /* page 678 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_OTHER_LETTER + G_UNICODE_MAX_TABLE_INDEX, + 63 /* page 762 */ +}; + +/* U+E0000 through U+10FFFF */ +static const gint16 type_table_part2[768] = { + 64 /* page 3584 */, + 65 /* page 3585 */, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_UNASSIGNED + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + 66 /* page 4095 */, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + G_UNICODE_PRIVATE_USE + G_UNICODE_MAX_TABLE_INDEX, + 67 /* page 4351 */ +}; + +static const gunichar attr_data[][256] = { + { /* page 0, index 0 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, + 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, + 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, + 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x039c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, + 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, + 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0000, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x1000000, + 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8, + 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 0x00d0, 0x00d1, + 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0000, 0x00d8, 0x00d9, 0x00da, + 0x00db, 0x00dc, 0x00dd, 0x00de, 0x0178 + }, + { /* page 1, index 1 */ + 0x0101, 0x0100, 0x0103, 0x0102, 0x0105, 0x0104, 0x0107, 0x0106, 0x0109, + 0x0108, 0x010b, 0x010a, 0x010d, 0x010c, 0x010f, 0x010e, 0x0111, 0x0110, + 0x0113, 0x0112, 0x0115, 0x0114, 0x0117, 0x0116, 0x0119, 0x0118, 0x011b, + 0x011a, 0x011d, 0x011c, 0x011f, 0x011e, 0x0121, 0x0120, 0x0123, 0x0122, + 0x0125, 0x0124, 0x0127, 0x0126, 0x0129, 0x0128, 0x012b, 0x012a, 0x012d, + 0x012c, 0x012f, 0x012e, 0x1000007, 0x0049, 0x0133, 0x0132, 0x0135, + 0x0134, 0x0137, 0x0136, 0x0000, 0x013a, 0x0139, 0x013c, 0x013b, 0x013e, + 0x013d, 0x0140, 0x013f, 0x0142, 0x0141, 0x0144, 0x0143, 0x0146, 0x0145, + 0x0148, 0x0147, 0x1000086, 0x014b, 0x014a, 0x014d, 0x014c, 0x014f, + 0x014e, 0x0151, 0x0150, 0x0153, 0x0152, 0x0155, 0x0154, 0x0157, 0x0156, + 0x0159, 0x0158, 0x015b, 0x015a, 0x015d, 0x015c, 0x015f, 0x015e, 0x0161, + 0x0160, 0x0163, 0x0162, 0x0165, 0x0164, 0x0167, 0x0166, 0x0169, 0x0168, + 0x016b, 0x016a, 0x016d, 0x016c, 0x016f, 0x016e, 0x0171, 0x0170, 0x0173, + 0x0172, 0x0175, 0x0174, 0x0177, 0x0176, 0x00ff, 0x017a, 0x0179, 0x017c, + 0x017b, 0x017e, 0x017d, 0x0053, 0x0000, 0x0253, 0x0183, 0x0182, 0x0185, + 0x0184, 0x0254, 0x0188, 0x0187, 0x0256, 0x0257, 0x018c, 0x018b, 0x0000, + 0x01dd, 0x0259, 0x025b, 0x0192, 0x0191, 0x0260, 0x0263, 0x01f6, 0x0269, + 0x0268, 0x0199, 0x0198, 0x0000, 0x0000, 0x026f, 0x0272, 0x0220, 0x0275, + 0x01a1, 0x01a0, 0x01a3, 0x01a2, 0x01a5, 0x01a4, 0x0280, 0x01a8, 0x01a7, + 0x0283, 0x0000, 0x0000, 0x01ad, 0x01ac, 0x0288, 0x01b0, 0x01af, 0x028a, + 0x028b, 0x01b4, 0x01b3, 0x01b6, 0x01b5, 0x0292, 0x01b9, 0x01b8, 0x0000, + 0x0000, 0x01bd, 0x01bc, 0x0000, 0x01f7, 0x0000, 0x0000, 0x0000, 0x0000, + 0x01c6, 0x0000, 0x01c4, 0x01c9, 0x0000, 0x01c7, 0x01cc, 0x0000, 0x01ca, + 0x01ce, 0x01cd, 0x01d0, 0x01cf, 0x01d2, 0x01d1, 0x01d4, 0x01d3, 0x01d6, + 0x01d5, 0x01d8, 0x01d7, 0x01da, 0x01d9, 0x01dc, 0x01db, 0x018e, 0x01df, + 0x01de, 0x01e1, 0x01e0, 0x01e3, 0x01e2, 0x01e5, 0x01e4, 0x01e7, 0x01e6, + 0x01e9, 0x01e8, 0x01eb, 0x01ea, 0x01ed, 0x01ec, 0x01ef, 0x01ee, + 0x10000ad, 0x01f3, 0x0000, 0x01f1, 0x01f5, 0x01f4, 0x0195, 0x01bf, + 0x01f9, 0x01f8, 0x01fb, 0x01fa, 0x01fd, 0x01fc, 0x01ff, 0x01fe + }, + { /* page 2, index 2 */ + 0x0201, 0x0200, 0x0203, 0x0202, 0x0205, 0x0204, 0x0207, 0x0206, 0x0209, + 0x0208, 0x020b, 0x020a, 0x020d, 0x020c, 0x020f, 0x020e, 0x0211, 0x0210, + 0x0213, 0x0212, 0x0215, 0x0214, 0x0217, 0x0216, 0x0219, 0x0218, 0x021b, + 0x021a, 0x021d, 0x021c, 0x021f, 0x021e, 0x019e, 0x0000, 0x0223, 0x0222, + 0x0225, 0x0224, 0x0227, 0x0226, 0x0229, 0x0228, 0x022b, 0x022a, 0x022d, + 0x022c, 0x022f, 0x022e, 0x0231, 0x0230, 0x0233, 0x0232, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0181, 0x0186, 0x0000, 0x0189, 0x018a, 0x0000, 0x018f, + 0x0000, 0x0190, 0x0000, 0x0000, 0x0000, 0x0000, 0x0193, 0x0000, 0x0000, + 0x0194, 0x0000, 0x0000, 0x0000, 0x0000, 0x0197, 0x0196, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x019c, 0x0000, 0x0000, 0x019d, 0x0000, 0x0000, + 0x019f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x01a6, 0x0000, 0x0000, 0x01a9, 0x0000, 0x0000, 0x0000, + 0x0000, 0x01ae, 0x0000, 0x01b1, 0x01b2, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x01b7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 3, index 3 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03ac, + 0x0000, 0x03ad, 0x03ae, 0x03af, 0x0000, 0x03cc, 0x0000, 0x03cd, 0x03ce, + 0x100008f, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, + 0x03c1, 0x0000, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, + 0x03ca, 0x03cb, 0x0386, 0x0388, 0x0389, 0x038a, 0x100009e, 0x0391, + 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, + 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a3, + 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x038c, + 0x038e, 0x038f, 0x0000, 0x0392, 0x0398, 0x0000, 0x0000, 0x0000, 0x03a6, + 0x03a0, 0x0000, 0x03d9, 0x03d8, 0x03db, 0x03da, 0x03dd, 0x03dc, 0x03df, + 0x03de, 0x03e1, 0x03e0, 0x03e3, 0x03e2, 0x03e5, 0x03e4, 0x03e7, 0x03e6, + 0x03e9, 0x03e8, 0x03eb, 0x03ea, 0x03ed, 0x03ec, 0x03ef, 0x03ee, 0x039a, + 0x03a1, 0x03f9, 0x0000, 0x03b8, 0x0395, 0x0000, 0x03f8, 0x03f7, 0x03f2, + 0x03fb, 0x03fa, 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 4, index 4 */ + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, + 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f, 0x0430, 0x0431, + 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, + 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, + 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, + 0x044d, 0x044e, 0x044f, 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, + 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, + 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, + 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0x0400, + 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, + 0x040a, 0x040b, 0x040c, 0x040d, 0x040e, 0x040f, 0x0461, 0x0460, 0x0463, + 0x0462, 0x0465, 0x0464, 0x0467, 0x0466, 0x0469, 0x0468, 0x046b, 0x046a, + 0x046d, 0x046c, 0x046f, 0x046e, 0x0471, 0x0470, 0x0473, 0x0472, 0x0475, + 0x0474, 0x0477, 0x0476, 0x0479, 0x0478, 0x047b, 0x047a, 0x047d, 0x047c, + 0x047f, 0x047e, 0x0481, 0x0480, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x048b, 0x048a, 0x048d, 0x048c, 0x048f, 0x048e, + 0x0491, 0x0490, 0x0493, 0x0492, 0x0495, 0x0494, 0x0497, 0x0496, 0x0499, + 0x0498, 0x049b, 0x049a, 0x049d, 0x049c, 0x049f, 0x049e, 0x04a1, 0x04a0, + 0x04a3, 0x04a2, 0x04a5, 0x04a4, 0x04a7, 0x04a6, 0x04a9, 0x04a8, 0x04ab, + 0x04aa, 0x04ad, 0x04ac, 0x04af, 0x04ae, 0x04b1, 0x04b0, 0x04b3, 0x04b2, + 0x04b5, 0x04b4, 0x04b7, 0x04b6, 0x04b9, 0x04b8, 0x04bb, 0x04ba, 0x04bd, + 0x04bc, 0x04bf, 0x04be, 0x0000, 0x04c2, 0x04c1, 0x04c4, 0x04c3, 0x04c6, + 0x04c5, 0x04c8, 0x04c7, 0x04ca, 0x04c9, 0x04cc, 0x04cb, 0x04ce, 0x04cd, + 0x0000, 0x04d1, 0x04d0, 0x04d3, 0x04d2, 0x04d5, 0x04d4, 0x04d7, 0x04d6, + 0x04d9, 0x04d8, 0x04db, 0x04da, 0x04dd, 0x04dc, 0x04df, 0x04de, 0x04e1, + 0x04e0, 0x04e3, 0x04e2, 0x04e5, 0x04e4, 0x04e7, 0x04e6, 0x04e9, 0x04e8, + 0x04eb, 0x04ea, 0x04ed, 0x04ec, 0x04ef, 0x04ee, 0x04f1, 0x04f0, 0x04f3, + 0x04f2, 0x04f5, 0x04f4, 0x0000, 0x0000, 0x04f9, 0x04f8, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 5, index 5 */ + 0x0501, 0x0500, 0x0503, 0x0502, 0x0505, 0x0504, 0x0507, 0x0506, 0x0509, + 0x0508, 0x050b, 0x050a, 0x050d, 0x050c, 0x050f, 0x050e, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, + 0x0566, 0x0567, 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, + 0x056f, 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f, 0x0580, + 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0531, 0x0532, + 0x0533, 0x0534, 0x0535, 0x0536, 0x0537, 0x0538, 0x0539, 0x053a, 0x053b, + 0x053c, 0x053d, 0x053e, 0x053f, 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, + 0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054a, 0x054b, 0x054c, 0x054d, + 0x054e, 0x054f, 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0555, 0x0556, + 0x1000044, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 6, index 6 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 9, index 7 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, + 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 10, index 8 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, + 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 11, index 9 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, + 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 12, index 10 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, + 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 13, index 11 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 14, index 12 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 15, index 13 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, + 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 16, index 14 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 19, index 15 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0003, + 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 23, index 16 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 24, index 17 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 25, index 18 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 30, index 19 */ + 0x1e01, 0x1e00, 0x1e03, 0x1e02, 0x1e05, 0x1e04, 0x1e07, 0x1e06, 0x1e09, + 0x1e08, 0x1e0b, 0x1e0a, 0x1e0d, 0x1e0c, 0x1e0f, 0x1e0e, 0x1e11, 0x1e10, + 0x1e13, 0x1e12, 0x1e15, 0x1e14, 0x1e17, 0x1e16, 0x1e19, 0x1e18, 0x1e1b, + 0x1e1a, 0x1e1d, 0x1e1c, 0x1e1f, 0x1e1e, 0x1e21, 0x1e20, 0x1e23, 0x1e22, + 0x1e25, 0x1e24, 0x1e27, 0x1e26, 0x1e29, 0x1e28, 0x1e2b, 0x1e2a, 0x1e2d, + 0x1e2c, 0x1e2f, 0x1e2e, 0x1e31, 0x1e30, 0x1e33, 0x1e32, 0x1e35, 0x1e34, + 0x1e37, 0x1e36, 0x1e39, 0x1e38, 0x1e3b, 0x1e3a, 0x1e3d, 0x1e3c, 0x1e3f, + 0x1e3e, 0x1e41, 0x1e40, 0x1e43, 0x1e42, 0x1e45, 0x1e44, 0x1e47, 0x1e46, + 0x1e49, 0x1e48, 0x1e4b, 0x1e4a, 0x1e4d, 0x1e4c, 0x1e4f, 0x1e4e, 0x1e51, + 0x1e50, 0x1e53, 0x1e52, 0x1e55, 0x1e54, 0x1e57, 0x1e56, 0x1e59, 0x1e58, + 0x1e5b, 0x1e5a, 0x1e5d, 0x1e5c, 0x1e5f, 0x1e5e, 0x1e61, 0x1e60, 0x1e63, + 0x1e62, 0x1e65, 0x1e64, 0x1e67, 0x1e66, 0x1e69, 0x1e68, 0x1e6b, 0x1e6a, + 0x1e6d, 0x1e6c, 0x1e6f, 0x1e6e, 0x1e71, 0x1e70, 0x1e73, 0x1e72, 0x1e75, + 0x1e74, 0x1e77, 0x1e76, 0x1e79, 0x1e78, 0x1e7b, 0x1e7a, 0x1e7d, 0x1e7c, + 0x1e7f, 0x1e7e, 0x1e81, 0x1e80, 0x1e83, 0x1e82, 0x1e85, 0x1e84, 0x1e87, + 0x1e86, 0x1e89, 0x1e88, 0x1e8b, 0x1e8a, 0x1e8d, 0x1e8c, 0x1e8f, 0x1e8e, + 0x1e91, 0x1e90, 0x1e93, 0x1e92, 0x1e95, 0x1e94, 0x10000b6, 0x10000bf, + 0x10000c8, 0x10000d1, 0x10000da, 0x1e60, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1ea1, 0x1ea0, 0x1ea3, 0x1ea2, 0x1ea5, 0x1ea4, 0x1ea7, 0x1ea6, 0x1ea9, + 0x1ea8, 0x1eab, 0x1eaa, 0x1ead, 0x1eac, 0x1eaf, 0x1eae, 0x1eb1, 0x1eb0, + 0x1eb3, 0x1eb2, 0x1eb5, 0x1eb4, 0x1eb7, 0x1eb6, 0x1eb9, 0x1eb8, 0x1ebb, + 0x1eba, 0x1ebd, 0x1ebc, 0x1ebf, 0x1ebe, 0x1ec1, 0x1ec0, 0x1ec3, 0x1ec2, + 0x1ec5, 0x1ec4, 0x1ec7, 0x1ec6, 0x1ec9, 0x1ec8, 0x1ecb, 0x1eca, 0x1ecd, + 0x1ecc, 0x1ecf, 0x1ece, 0x1ed1, 0x1ed0, 0x1ed3, 0x1ed2, 0x1ed5, 0x1ed4, + 0x1ed7, 0x1ed6, 0x1ed9, 0x1ed8, 0x1edb, 0x1eda, 0x1edd, 0x1edc, 0x1edf, + 0x1ede, 0x1ee1, 0x1ee0, 0x1ee3, 0x1ee2, 0x1ee5, 0x1ee4, 0x1ee7, 0x1ee6, + 0x1ee9, 0x1ee8, 0x1eeb, 0x1eea, 0x1eed, 0x1eec, 0x1eef, 0x1eee, 0x1ef1, + 0x1ef0, 0x1ef3, 0x1ef2, 0x1ef5, 0x1ef4, 0x1ef7, 0x1ef6, 0x1ef9, 0x1ef8, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 31, index 20 */ + 0x1f08, 0x1f09, 0x1f0a, 0x1f0b, 0x1f0c, 0x1f0d, 0x1f0e, 0x1f0f, 0x1f00, + 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, 0x1f18, 0x1f19, + 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0x0000, 0x0000, 0x1f10, 0x1f11, 0x1f12, + 0x1f13, 0x1f14, 0x1f15, 0x0000, 0x0000, 0x1f28, 0x1f29, 0x1f2a, 0x1f2b, + 0x1f2c, 0x1f2d, 0x1f2e, 0x1f2f, 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, + 0x1f25, 0x1f26, 0x1f27, 0x1f38, 0x1f39, 0x1f3a, 0x1f3b, 0x1f3c, 0x1f3d, + 0x1f3e, 0x1f3f, 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, + 0x1f37, 0x1f48, 0x1f49, 0x1f4a, 0x1f4b, 0x1f4c, 0x1f4d, 0x0000, 0x0000, + 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x0000, 0x0000, + 0x10000e3, 0x1f59, 0x10000ee, 0x1f5b, 0x10000fd, 0x1f5d, 0x100010c, + 0x1f5f, 0x0000, 0x1f51, 0x0000, 0x1f53, 0x0000, 0x1f55, 0x0000, 0x1f57, + 0x1f68, 0x1f69, 0x1f6a, 0x1f6b, 0x1f6c, 0x1f6d, 0x1f6e, 0x1f6f, 0x1f60, + 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, 0x1fba, 0x1fbb, + 0x1fc8, 0x1fc9, 0x1fca, 0x1fcb, 0x1fda, 0x1fdb, 0x1ff8, 0x1ff9, 0x1fea, + 0x1feb, 0x1ffa, 0x1ffb, 0x0000, 0x0000, 0x10001b7, 0x10001c4, 0x10001d1, + 0x10001de, 0x10001eb, 0x10001f8, 0x1000205, 0x1000212, 0x100021f, + 0x1000229, 0x1000233, 0x100023d, 0x1000247, 0x1000251, 0x100025b, + 0x1000265, 0x100026f, 0x100027c, 0x1000289, 0x1000296, 0x10002a3, + 0x10002b0, 0x10002bd, 0x10002ca, 0x10002d7, 0x10002e1, 0x10002eb, + 0x10002f5, 0x10002ff, 0x1000309, 0x1000313, 0x100031d, 0x1000327, + 0x1000334, 0x1000341, 0x100034e, 0x100035b, 0x1000368, 0x1000375, + 0x1000382, 0x100038f, 0x1000399, 0x10003a3, 0x10003ad, 0x10003b7, + 0x10003c1, 0x10003cb, 0x10003d5, 0x1fb8, 0x1fb9, 0x100041e, 0x10003df, + 0x100042b, 0x0000, 0x100011b, 0x1000466, 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, + 0x10003eb, 0x0000, 0x0399, 0x0000, 0x0000, 0x0000, 0x1000436, 0x10003f4, + 0x1000443, 0x0000, 0x1000126, 0x1000475, 0x1f72, 0x1f73, 0x1f74, 0x1f75, + 0x1000400, 0x0000, 0x0000, 0x0000, 0x1fd8, 0x1fd9, 0x1000131, 0x1000140, + 0x0000, 0x0000, 0x100014f, 0x100015a, 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, + 0x0000, 0x0000, 0x0000, 0x0000, 0x1fe8, 0x1fe9, 0x1000169, 0x1000178, + 0x1000187, 0x1fec, 0x1000192, 0x100019d, 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, + 0x1fe5, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x100044e, 0x1000409, + 0x100045b, 0x0000, 0x10001ac, 0x1000484, 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, + 0x1000415, 0x0000, 0x0000, 0x0000 + }, + { /* page 33, index 21 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x03c9, 0x0000, 0x0000, 0x0000, 0x006b, 0x00e5, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 251, index 22 */ + 0x100000f, 0x1000016, 0x100001d, 0x1000024, 0x100002d, 0x1000036, + 0x100003d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x100004f, 0x100005a, 0x1000065, + 0x1000070, 0x100007b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000 + }, + { /* page 255, index 23 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff41, 0xff42, 0xff43, + 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, + 0xff4d, 0xff4e, 0xff4f, 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, + 0xff56, 0xff57, 0xff58, 0xff59, 0xff5a, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, + 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, + 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, + 0xff3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 260, index 24 */ + 0x10428, 0x10429, 0x1042a, 0x1042b, 0x1042c, 0x1042d, 0x1042e, 0x1042f, + 0x10430, 0x10431, 0x10432, 0x10433, 0x10434, 0x10435, 0x10436, 0x10437, + 0x10438, 0x10439, 0x1043a, 0x1043b, 0x1043c, 0x1043d, 0x1043e, 0x1043f, + 0x10440, 0x10441, 0x10442, 0x10443, 0x10444, 0x10445, 0x10446, 0x10447, + 0x10448, 0x10449, 0x1044a, 0x1044b, 0x1044c, 0x1044d, 0x1044e, 0x1044f, + 0x10400, 0x10401, 0x10402, 0x10403, 0x10404, 0x10405, 0x10406, 0x10407, + 0x10408, 0x10409, 0x1040a, 0x1040b, 0x1040c, 0x1040d, 0x1040e, 0x1040f, + 0x10410, 0x10411, 0x10412, 0x10413, 0x10414, 0x10415, 0x10416, 0x10417, + 0x10418, 0x10419, 0x1041a, 0x1041b, 0x1041c, 0x1041d, 0x1041e, 0x1041f, + 0x10420, 0x10421, 0x10422, 0x10423, 0x10424, 0x10425, 0x10426, 0x10427, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + }, + { /* page 471, index 25 */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, + 0x0009, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, + 0x0007, 0x0008, 0x0009, 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, + 0x0006, 0x0007, 0x0008, 0x0009 + } +}; + +/* U+0000 through U+2FAFF */ +static const gint16 attr_table_part1[763] = { + 0 /* page 0 */, + 1 /* page 1 */, + 2 /* page 2 */, + 3 /* page 3 */, + 4 /* page 4 */, + 5 /* page 5 */, + 6 /* page 6 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 7 /* page 9 */, + 8 /* page 10 */, + 9 /* page 11 */, + 10 /* page 12 */, + 11 /* page 13 */, + 12 /* page 14 */, + 13 /* page 15 */, + 14 /* page 16 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 15 /* page 19 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 16 /* page 23 */, + 17 /* page 24 */, + 18 /* page 25 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 19 /* page 30 */, + 20 /* page 31 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 21 /* page 33 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 22 /* page 251 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 23 /* page 255 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 24 /* page 260 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 25 /* page 471 */, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX +}; + +/* U+E0000 through U+10FFFF */ +static const gint16 attr_table_part2[768] = { + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX, + 0x0000 + G_UNICODE_MAX_TABLE_INDEX +}; + +static const gunichar title_table[][3] = { + { 0x01c5, 0x01c4, 0x01c6 }, + { 0x01c8, 0x01c7, 0x01c9 }, + { 0x01cb, 0x01ca, 0x01cc }, + { 0x01f2, 0x01f1, 0x01f3 }, + { 0x1f88, 0x0000, 0x1f80 }, + { 0x1f89, 0x0000, 0x1f81 }, + { 0x1f8a, 0x0000, 0x1f82 }, + { 0x1f8b, 0x0000, 0x1f83 }, + { 0x1f8c, 0x0000, 0x1f84 }, + { 0x1f8d, 0x0000, 0x1f85 }, + { 0x1f8e, 0x0000, 0x1f86 }, + { 0x1f8f, 0x0000, 0x1f87 }, + { 0x1f98, 0x0000, 0x1f90 }, + { 0x1f99, 0x0000, 0x1f91 }, + { 0x1f9a, 0x0000, 0x1f92 }, + { 0x1f9b, 0x0000, 0x1f93 }, + { 0x1f9c, 0x0000, 0x1f94 }, + { 0x1f9d, 0x0000, 0x1f95 }, + { 0x1f9e, 0x0000, 0x1f96 }, + { 0x1f9f, 0x0000, 0x1f97 }, + { 0x1fa8, 0x0000, 0x1fa0 }, + { 0x1fa9, 0x0000, 0x1fa1 }, + { 0x1faa, 0x0000, 0x1fa2 }, + { 0x1fab, 0x0000, 0x1fa3 }, + { 0x1fac, 0x0000, 0x1fa4 }, + { 0x1fad, 0x0000, 0x1fa5 }, + { 0x1fae, 0x0000, 0x1fa6 }, + { 0x1faf, 0x0000, 0x1fa7 }, + { 0x1fbc, 0x0000, 0x1fb3 }, + { 0x1fcc, 0x0000, 0x1fc3 }, + { 0x1ffc, 0x0000, 0x1ff3 } +}; + + +/* Table of special cases for case conversion; each record contains + * First, the best single character mapping to lowercase if Lu, + * and to uppercase if Ll, followed by the output mapping for the two cases + * other than the case of the codepoint, in the order [Ll],[Lu],[Lt], + * encoded in UTF-8, separated and terminated by a null character. + */ +static const gchar special_case_table[] = { + "\x00\x53\x53\x00\x53\x73\0" /* offset 0 */ + "\x69\x69\xcc\x87\x00\xc4\xb0\0" /* offset 7 */ + "\x00\x46\x46\x00\x46\x66\0" /* offset 15 */ + "\x00\x46\x49\x00\x46\x69\0" /* offset 22 */ + "\x00\x46\x4c\x00\x46\x6c\0" /* offset 29 */ + "\x00\x46\x46\x49\x00\x46\x66\x69\0" /* offset 36 */ + "\x00\x46\x46\x4c\x00\x46\x66\x6c\0" /* offset 45 */ + "\x00\x53\x54\x00\x53\x74\0" /* offset 54 */ + "\x00\x53\x54\x00\x53\x74\0" /* offset 61 */ + "\x00\xd4\xb5\xd5\x92\x00\xd4\xb5\xd6\x82\0" /* offset 68 */ + "\x00\xd5\x84\xd5\x86\x00\xd5\x84\xd5\xb6\0" /* offset 79 */ + "\x00\xd5\x84\xd4\xb5\x00\xd5\x84\xd5\xa5\0" /* offset 90 */ + "\x00\xd5\x84\xd4\xbb\x00\xd5\x84\xd5\xab\0" /* offset 101 */ + "\x00\xd5\x8e\xd5\x86\x00\xd5\x8e\xd5\xb6\0" /* offset 112 */ + "\x00\xd5\x84\xd4\xbd\x00\xd5\x84\xd5\xad\0" /* offset 123 */ + "\x00\xca\xbc\x4e\x00\xca\xbc\x4e\0" /* offset 134 */ + "\x00\xce\x99\xcc\x88\xcc\x81\x00\xce\x99\xcc\x88\xcc\x81\0" /* offset 143 */ + "\x00\xce\xa5\xcc\x88\xcc\x81\x00\xce\xa5\xcc\x88\xcc\x81\0" /* offset 158 */ + "\x00\x4a\xcc\x8c\x00\x4a\xcc\x8c\0" /* offset 173 */ + "\x00\x48\xcc\xb1\x00\x48\xcc\xb1\0" /* offset 182 */ + "\x00\x54\xcc\x88\x00\x54\xcc\x88\0" /* offset 191 */ + "\x00\x57\xcc\x8a\x00\x57\xcc\x8a\0" /* offset 200 */ + "\x00\x59\xcc\x8a\x00\x59\xcc\x8a\0" /* offset 209 */ + "\x00\x41\xca\xbe\x00\x41\xca\xbe\0" /* offset 218 */ + "\x00\xce\xa5\xcc\x93\x00\xce\xa5\xcc\x93\0" /* offset 227 */ + "\x00\xce\xa5\xcc\x93\xcc\x80\x00\xce\xa5\xcc\x93\xcc\x80\0" /* offset 238 */ + "\x00\xce\xa5\xcc\x93\xcc\x81\x00\xce\xa5\xcc\x93\xcc\x81\0" /* offset 253 */ + "\x00\xce\xa5\xcc\x93\xcd\x82\x00\xce\xa5\xcc\x93\xcd\x82\0" /* offset 268 */ + "\x00\xce\x91\xcd\x82\x00\xce\x91\xcd\x82\0" /* offset 283 */ + "\x00\xce\x97\xcd\x82\x00\xce\x97\xcd\x82\0" /* offset 294 */ + "\x00\xce\x99\xcc\x88\xcc\x80\x00\xce\x99\xcc\x88\xcc\x80\0" /* offset 305 */ + "\x00\xce\x99\xcc\x88\xcc\x81\x00\xce\x99\xcc\x88\xcc\x81\0" /* offset 320 */ + "\x00\xce\x99\xcd\x82\x00\xce\x99\xcd\x82\0" /* offset 335 */ + "\x00\xce\x99\xcc\x88\xcd\x82\x00\xce\x99\xcc\x88\xcd\x82\0" /* offset 346 */ + "\x00\xce\xa5\xcc\x88\xcc\x80\x00\xce\xa5\xcc\x88\xcc\x80\0" /* offset 361 */ + "\x00\xce\xa5\xcc\x88\xcc\x81\x00\xce\xa5\xcc\x88\xcc\x81\0" /* offset 376 */ + "\x00\xce\xa1\xcc\x93\x00\xce\xa1\xcc\x93\0" /* offset 391 */ + "\x00\xce\xa5\xcd\x82\x00\xce\xa5\xcd\x82\0" /* offset 402 */ + "\x00\xce\xa5\xcc\x88\xcd\x82\x00\xce\xa5\xcc\x88\xcd\x82\0" /* offset 413 */ + "\x00\xce\xa9\xcd\x82\x00\xce\xa9\xcd\x82\0" /* offset 428 */ + "\xe1\xbe\x88\xe1\xbc\x88\xce\x99\x00\xe1\xbe\x88\0" /* offset 439 */ + "\xe1\xbe\x89\xe1\xbc\x89\xce\x99\x00\xe1\xbe\x89\0" /* offset 452 */ + "\xe1\xbe\x8a\xe1\xbc\x8a\xce\x99\x00\xe1\xbe\x8a\0" /* offset 465 */ + "\xe1\xbe\x8b\xe1\xbc\x8b\xce\x99\x00\xe1\xbe\x8b\0" /* offset 478 */ + "\xe1\xbe\x8c\xe1\xbc\x8c\xce\x99\x00\xe1\xbe\x8c\0" /* offset 491 */ + "\xe1\xbe\x8d\xe1\xbc\x8d\xce\x99\x00\xe1\xbe\x8d\0" /* offset 504 */ + "\xe1\xbe\x8e\xe1\xbc\x8e\xce\x99\x00\xe1\xbe\x8e\0" /* offset 517 */ + "\xe1\xbe\x8f\xe1\xbc\x8f\xce\x99\x00\xe1\xbe\x8f\0" /* offset 530 */ + "\xe1\xbe\x80\x00\xe1\xbc\x88\xce\x99\0" /* offset 543 */ + "\xe1\xbe\x81\x00\xe1\xbc\x89\xce\x99\0" /* offset 553 */ + "\xe1\xbe\x82\x00\xe1\xbc\x8a\xce\x99\0" /* offset 563 */ + "\xe1\xbe\x83\x00\xe1\xbc\x8b\xce\x99\0" /* offset 573 */ + "\xe1\xbe\x84\x00\xe1\xbc\x8c\xce\x99\0" /* offset 583 */ + "\xe1\xbe\x85\x00\xe1\xbc\x8d\xce\x99\0" /* offset 593 */ + "\xe1\xbe\x86\x00\xe1\xbc\x8e\xce\x99\0" /* offset 603 */ + "\xe1\xbe\x87\x00\xe1\xbc\x8f\xce\x99\0" /* offset 613 */ + "\xe1\xbe\x98\xe1\xbc\xa8\xce\x99\x00\xe1\xbe\x98\0" /* offset 623 */ + "\xe1\xbe\x99\xe1\xbc\xa9\xce\x99\x00\xe1\xbe\x99\0" /* offset 636 */ + "\xe1\xbe\x9a\xe1\xbc\xaa\xce\x99\x00\xe1\xbe\x9a\0" /* offset 649 */ + "\xe1\xbe\x9b\xe1\xbc\xab\xce\x99\x00\xe1\xbe\x9b\0" /* offset 662 */ + "\xe1\xbe\x9c\xe1\xbc\xac\xce\x99\x00\xe1\xbe\x9c\0" /* offset 675 */ + "\xe1\xbe\x9d\xe1\xbc\xad\xce\x99\x00\xe1\xbe\x9d\0" /* offset 688 */ + "\xe1\xbe\x9e\xe1\xbc\xae\xce\x99\x00\xe1\xbe\x9e\0" /* offset 701 */ + "\xe1\xbe\x9f\xe1\xbc\xaf\xce\x99\x00\xe1\xbe\x9f\0" /* offset 714 */ + "\xe1\xbe\x90\x00\xe1\xbc\xa8\xce\x99\0" /* offset 727 */ + "\xe1\xbe\x91\x00\xe1\xbc\xa9\xce\x99\0" /* offset 737 */ + "\xe1\xbe\x92\x00\xe1\xbc\xaa\xce\x99\0" /* offset 747 */ + "\xe1\xbe\x93\x00\xe1\xbc\xab\xce\x99\0" /* offset 757 */ + "\xe1\xbe\x94\x00\xe1\xbc\xac\xce\x99\0" /* offset 767 */ + "\xe1\xbe\x95\x00\xe1\xbc\xad\xce\x99\0" /* offset 777 */ + "\xe1\xbe\x96\x00\xe1\xbc\xae\xce\x99\0" /* offset 787 */ + "\xe1\xbe\x97\x00\xe1\xbc\xaf\xce\x99\0" /* offset 797 */ + "\xe1\xbe\xa8\xe1\xbd\xa8\xce\x99\x00\xe1\xbe\xa8\0" /* offset 807 */ + "\xe1\xbe\xa9\xe1\xbd\xa9\xce\x99\x00\xe1\xbe\xa9\0" /* offset 820 */ + "\xe1\xbe\xaa\xe1\xbd\xaa\xce\x99\x00\xe1\xbe\xaa\0" /* offset 833 */ + "\xe1\xbe\xab\xe1\xbd\xab\xce\x99\x00\xe1\xbe\xab\0" /* offset 846 */ + "\xe1\xbe\xac\xe1\xbd\xac\xce\x99\x00\xe1\xbe\xac\0" /* offset 859 */ + "\xe1\xbe\xad\xe1\xbd\xad\xce\x99\x00\xe1\xbe\xad\0" /* offset 872 */ + "\xe1\xbe\xae\xe1\xbd\xae\xce\x99\x00\xe1\xbe\xae\0" /* offset 885 */ + "\xe1\xbe\xaf\xe1\xbd\xaf\xce\x99\x00\xe1\xbe\xaf\0" /* offset 898 */ + "\xe1\xbe\xa0\x00\xe1\xbd\xa8\xce\x99\0" /* offset 911 */ + "\xe1\xbe\xa1\x00\xe1\xbd\xa9\xce\x99\0" /* offset 921 */ + "\xe1\xbe\xa2\x00\xe1\xbd\xaa\xce\x99\0" /* offset 931 */ + "\xe1\xbe\xa3\x00\xe1\xbd\xab\xce\x99\0" /* offset 941 */ + "\xe1\xbe\xa4\x00\xe1\xbd\xac\xce\x99\0" /* offset 951 */ + "\xe1\xbe\xa5\x00\xe1\xbd\xad\xce\x99\0" /* offset 961 */ + "\xe1\xbe\xa6\x00\xe1\xbd\xae\xce\x99\0" /* offset 971 */ + "\xe1\xbe\xa7\x00\xe1\xbd\xaf\xce\x99\0" /* offset 981 */ + "\xe1\xbe\xbc\xce\x91\xce\x99\x00\xe1\xbe\xbc\0" /* offset 991 */ + "\xe1\xbe\xb3\x00\xce\x91\xce\x99\0" /* offset 1003 */ + "\xe1\xbf\x8c\xce\x97\xce\x99\x00\xe1\xbf\x8c\0" /* offset 1012 */ + "\xe1\xbf\x83\x00\xce\x97\xce\x99\0" /* offset 1024 */ + "\xe1\xbf\xbc\xce\xa9\xce\x99\x00\xe1\xbf\xbc\0" /* offset 1033 */ + "\xe1\xbf\xb3\x00\xce\xa9\xce\x99\0" /* offset 1045 */ + "\x00\xe1\xbe\xba\xce\x99\x00\xe1\xbe\xba\xcd\x85\0" /* offset 1054 */ + "\x00\xce\x86\xce\x99\x00\xce\x86\xcd\x85\0" /* offset 1067 */ + "\x00\xe1\xbf\x8a\xce\x99\x00\xe1\xbf\x8a\xcd\x85\0" /* offset 1078 */ + "\x00\xce\x89\xce\x99\x00\xce\x89\xcd\x85\0" /* offset 1091 */ + "\x00\xe1\xbf\xba\xce\x99\x00\xe1\xbf\xba\xcd\x85\0" /* offset 1102 */ + "\x00\xce\x8f\xce\x99\x00\xce\x8f\xcd\x85\0" /* offset 1115 */ + "\x00\xce\x91\xcd\x82\xce\x99\x00\xce\x91\xcd\x82\xcd\x85\0" /* offset 1126 */ + "\x00\xce\x97\xcd\x82\xce\x99\x00\xce\x97\xcd\x82\xcd\x85\0" /* offset 1141 */ + "\x00\xce\xa9\xcd\x82\xce\x99\x00\xce\xa9\xcd\x82\xcd\x85\0" /* offset 1156 */ +}; + + +/* Table of casefolding cases that can't be derived by lowercasing + */ +static const struct { + guint16 ch; + gchar data[7]; +} casefold_table[] = { + { 0x00b5, "\xce\xbc" }, + { 0x00df, "\x73\x73" }, + { 0x0130, "\x69\xcc\x87" }, + { 0x0149, "\xca\xbc\x6e" }, + { 0x017f, "\x73" }, + { 0x01f0, "\x6a\xcc\x8c" }, + { 0x0345, "\xce\xb9" }, + { 0x0390, "\xce\xb9\xcc\x88\xcc\x81" }, + { 0x03b0, "\xcf\x85\xcc\x88\xcc\x81" }, + { 0x03c2, "\xcf\x83" }, + { 0x03d0, "\xce\xb2" }, + { 0x03d1, "\xce\xb8" }, + { 0x03d5, "\xcf\x86" }, + { 0x03d6, "\xcf\x80" }, + { 0x03f0, "\xce\xba" }, + { 0x03f1, "\xcf\x81" }, + { 0x03f5, "\xce\xb5" }, + { 0x0587, "\xd5\xa5\xd6\x82" }, + { 0x1e96, "\x68\xcc\xb1" }, + { 0x1e97, "\x74\xcc\x88" }, + { 0x1e98, "\x77\xcc\x8a" }, + { 0x1e99, "\x79\xcc\x8a" }, + { 0x1e9a, "\x61\xca\xbe" }, + { 0x1e9b, "\xe1\xb9\xa1" }, + { 0x1f50, "\xcf\x85\xcc\x93" }, + { 0x1f52, "\xcf\x85\xcc\x93\xcc\x80" }, + { 0x1f54, "\xcf\x85\xcc\x93\xcc\x81" }, + { 0x1f56, "\xcf\x85\xcc\x93\xcd\x82" }, + { 0x1f80, "\xe1\xbc\x80\xce\xb9" }, + { 0x1f81, "\xe1\xbc\x81\xce\xb9" }, + { 0x1f82, "\xe1\xbc\x82\xce\xb9" }, + { 0x1f83, "\xe1\xbc\x83\xce\xb9" }, + { 0x1f84, "\xe1\xbc\x84\xce\xb9" }, + { 0x1f85, "\xe1\xbc\x85\xce\xb9" }, + { 0x1f86, "\xe1\xbc\x86\xce\xb9" }, + { 0x1f87, "\xe1\xbc\x87\xce\xb9" }, + { 0x1f88, "\xe1\xbc\x80\xce\xb9" }, + { 0x1f89, "\xe1\xbc\x81\xce\xb9" }, + { 0x1f8a, "\xe1\xbc\x82\xce\xb9" }, + { 0x1f8b, "\xe1\xbc\x83\xce\xb9" }, + { 0x1f8c, "\xe1\xbc\x84\xce\xb9" }, + { 0x1f8d, "\xe1\xbc\x85\xce\xb9" }, + { 0x1f8e, "\xe1\xbc\x86\xce\xb9" }, + { 0x1f8f, "\xe1\xbc\x87\xce\xb9" }, + { 0x1f90, "\xe1\xbc\xa0\xce\xb9" }, + { 0x1f91, "\xe1\xbc\xa1\xce\xb9" }, + { 0x1f92, "\xe1\xbc\xa2\xce\xb9" }, + { 0x1f93, "\xe1\xbc\xa3\xce\xb9" }, + { 0x1f94, "\xe1\xbc\xa4\xce\xb9" }, + { 0x1f95, "\xe1\xbc\xa5\xce\xb9" }, + { 0x1f96, "\xe1\xbc\xa6\xce\xb9" }, + { 0x1f97, "\xe1\xbc\xa7\xce\xb9" }, + { 0x1f98, "\xe1\xbc\xa0\xce\xb9" }, + { 0x1f99, "\xe1\xbc\xa1\xce\xb9" }, + { 0x1f9a, "\xe1\xbc\xa2\xce\xb9" }, + { 0x1f9b, "\xe1\xbc\xa3\xce\xb9" }, + { 0x1f9c, "\xe1\xbc\xa4\xce\xb9" }, + { 0x1f9d, "\xe1\xbc\xa5\xce\xb9" }, + { 0x1f9e, "\xe1\xbc\xa6\xce\xb9" }, + { 0x1f9f, "\xe1\xbc\xa7\xce\xb9" }, + { 0x1fa0, "\xe1\xbd\xa0\xce\xb9" }, + { 0x1fa1, "\xe1\xbd\xa1\xce\xb9" }, + { 0x1fa2, "\xe1\xbd\xa2\xce\xb9" }, + { 0x1fa3, "\xe1\xbd\xa3\xce\xb9" }, + { 0x1fa4, "\xe1\xbd\xa4\xce\xb9" }, + { 0x1fa5, "\xe1\xbd\xa5\xce\xb9" }, + { 0x1fa6, "\xe1\xbd\xa6\xce\xb9" }, + { 0x1fa7, "\xe1\xbd\xa7\xce\xb9" }, + { 0x1fa8, "\xe1\xbd\xa0\xce\xb9" }, + { 0x1fa9, "\xe1\xbd\xa1\xce\xb9" }, + { 0x1faa, "\xe1\xbd\xa2\xce\xb9" }, + { 0x1fab, "\xe1\xbd\xa3\xce\xb9" }, + { 0x1fac, "\xe1\xbd\xa4\xce\xb9" }, + { 0x1fad, "\xe1\xbd\xa5\xce\xb9" }, + { 0x1fae, "\xe1\xbd\xa6\xce\xb9" }, + { 0x1faf, "\xe1\xbd\xa7\xce\xb9" }, + { 0x1fb2, "\xe1\xbd\xb0\xce\xb9" }, + { 0x1fb3, "\xce\xb1\xce\xb9" }, + { 0x1fb4, "\xce\xac\xce\xb9" }, + { 0x1fb6, "\xce\xb1\xcd\x82" }, + { 0x1fb7, "\xce\xb1\xcd\x82\xce\xb9" }, + { 0x1fbc, "\xce\xb1\xce\xb9" }, + { 0x1fbe, "\xce\xb9" }, + { 0x1fc2, "\xe1\xbd\xb4\xce\xb9" }, + { 0x1fc3, "\xce\xb7\xce\xb9" }, + { 0x1fc4, "\xce\xae\xce\xb9" }, + { 0x1fc6, "\xce\xb7\xcd\x82" }, + { 0x1fc7, "\xce\xb7\xcd\x82\xce\xb9" }, + { 0x1fcc, "\xce\xb7\xce\xb9" }, + { 0x1fd2, "\xce\xb9\xcc\x88\xcc\x80" }, + { 0x1fd3, "\xce\xb9\xcc\x88\xcc\x81" }, + { 0x1fd6, "\xce\xb9\xcd\x82" }, + { 0x1fd7, "\xce\xb9\xcc\x88\xcd\x82" }, + { 0x1fe2, "\xcf\x85\xcc\x88\xcc\x80" }, + { 0x1fe3, "\xcf\x85\xcc\x88\xcc\x81" }, + { 0x1fe4, "\xcf\x81\xcc\x93" }, + { 0x1fe6, "\xcf\x85\xcd\x82" }, + { 0x1fe7, "\xcf\x85\xcc\x88\xcd\x82" }, + { 0x1ff2, "\xe1\xbd\xbc\xce\xb9" }, + { 0x1ff3, "\xcf\x89\xce\xb9" }, + { 0x1ff4, "\xcf\x8e\xce\xb9" }, + { 0x1ff6, "\xcf\x89\xcd\x82" }, + { 0x1ff7, "\xcf\x89\xcd\x82\xce\xb9" }, + { 0x1ffc, "\xcf\x89\xce\xb9" }, + { 0x2160, "\xe2\x85\xb0" }, + { 0x2161, "\xe2\x85\xb1" }, + { 0x2162, "\xe2\x85\xb2" }, + { 0x2163, "\xe2\x85\xb3" }, + { 0x2164, "\xe2\x85\xb4" }, + { 0x2165, "\xe2\x85\xb5" }, + { 0x2166, "\xe2\x85\xb6" }, + { 0x2167, "\xe2\x85\xb7" }, + { 0x2168, "\xe2\x85\xb8" }, + { 0x2169, "\xe2\x85\xb9" }, + { 0x216a, "\xe2\x85\xba" }, + { 0x216b, "\xe2\x85\xbb" }, + { 0x216c, "\xe2\x85\xbc" }, + { 0x216d, "\xe2\x85\xbd" }, + { 0x216e, "\xe2\x85\xbe" }, + { 0x216f, "\xe2\x85\xbf" }, + { 0x24b6, "\xe2\x93\x90" }, + { 0x24b7, "\xe2\x93\x91" }, + { 0x24b8, "\xe2\x93\x92" }, + { 0x24b9, "\xe2\x93\x93" }, + { 0x24ba, "\xe2\x93\x94" }, + { 0x24bb, "\xe2\x93\x95" }, + { 0x24bc, "\xe2\x93\x96" }, + { 0x24bd, "\xe2\x93\x97" }, + { 0x24be, "\xe2\x93\x98" }, + { 0x24bf, "\xe2\x93\x99" }, + { 0x24c0, "\xe2\x93\x9a" }, + { 0x24c1, "\xe2\x93\x9b" }, + { 0x24c2, "\xe2\x93\x9c" }, + { 0x24c3, "\xe2\x93\x9d" }, + { 0x24c4, "\xe2\x93\x9e" }, + { 0x24c5, "\xe2\x93\x9f" }, + { 0x24c6, "\xe2\x93\xa0" }, + { 0x24c7, "\xe2\x93\xa1" }, + { 0x24c8, "\xe2\x93\xa2" }, + { 0x24c9, "\xe2\x93\xa3" }, + { 0x24ca, "\xe2\x93\xa4" }, + { 0x24cb, "\xe2\x93\xa5" }, + { 0x24cc, "\xe2\x93\xa6" }, + { 0x24cd, "\xe2\x93\xa7" }, + { 0x24ce, "\xe2\x93\xa8" }, + { 0x24cf, "\xe2\x93\xa9" }, + { 0xfb00, "\x66\x66" }, + { 0xfb01, "\x66\x69" }, + { 0xfb02, "\x66\x6c" }, + { 0xfb03, "\x66\x66\x69" }, + { 0xfb04, "\x66\x66\x6c" }, + { 0xfb05, "\x73\x74" }, + { 0xfb06, "\x73\x74" }, + { 0xfb13, "\xd5\xb4\xd5\xb6" }, + { 0xfb14, "\xd5\xb4\xd5\xa5" }, + { 0xfb15, "\xd5\xb4\xd5\xab" }, + { 0xfb16, "\xd5\xbe\xd5\xb6" }, + { 0xfb17, "\xd5\xb4\xd5\xad" }, +}; + +static const struct { + gunichar ch; + gunichar mirrored_ch; +} bidi_mirroring_table[] = +{ + { 0x0028, 0x0029 }, + { 0x0029, 0x0028 }, + { 0x003c, 0x003e }, + { 0x003e, 0x003c }, + { 0x005b, 0x005d }, + { 0x005d, 0x005b }, + { 0x007b, 0x007d }, + { 0x007d, 0x007b }, + { 0x00ab, 0x00bb }, + { 0x00bb, 0x00ab }, + { 0x2039, 0x203a }, + { 0x203a, 0x2039 }, + { 0x2045, 0x2046 }, + { 0x2046, 0x2045 }, + { 0x207d, 0x207e }, + { 0x207e, 0x207d }, + { 0x208d, 0x208e }, + { 0x208e, 0x208d }, + { 0x2208, 0x220b }, + { 0x2209, 0x220c }, + { 0x220a, 0x220d }, + { 0x220b, 0x2208 }, + { 0x220c, 0x2209 }, + { 0x220d, 0x220a }, + { 0x2215, 0x29f5 }, + { 0x223c, 0x223d }, + { 0x223d, 0x223c }, + { 0x2243, 0x22cd }, + { 0x2252, 0x2253 }, + { 0x2253, 0x2252 }, + { 0x2254, 0x2255 }, + { 0x2255, 0x2254 }, + { 0x2264, 0x2265 }, + { 0x2265, 0x2264 }, + { 0x2266, 0x2267 }, + { 0x2267, 0x2266 }, + { 0x2268, 0x2269 }, + { 0x2269, 0x2268 }, + { 0x226a, 0x226b }, + { 0x226b, 0x226a }, + { 0x226e, 0x226f }, + { 0x226f, 0x226e }, + { 0x2270, 0x2271 }, + { 0x2271, 0x2270 }, + { 0x2272, 0x2273 }, + { 0x2273, 0x2272 }, + { 0x2274, 0x2275 }, + { 0x2275, 0x2274 }, + { 0x2276, 0x2277 }, + { 0x2277, 0x2276 }, + { 0x2278, 0x2279 }, + { 0x2279, 0x2278 }, + { 0x227a, 0x227b }, + { 0x227b, 0x227a }, + { 0x227c, 0x227d }, + { 0x227d, 0x227c }, + { 0x227e, 0x227f }, + { 0x227f, 0x227e }, + { 0x2280, 0x2281 }, + { 0x2281, 0x2280 }, + { 0x2282, 0x2283 }, + { 0x2283, 0x2282 }, + { 0x2284, 0x2285 }, + { 0x2285, 0x2284 }, + { 0x2286, 0x2287 }, + { 0x2287, 0x2286 }, + { 0x2288, 0x2289 }, + { 0x2289, 0x2288 }, + { 0x228a, 0x228b }, + { 0x228b, 0x228a }, + { 0x228f, 0x2290 }, + { 0x2290, 0x228f }, + { 0x2291, 0x2292 }, + { 0x2292, 0x2291 }, + { 0x2298, 0x29b8 }, + { 0x22a2, 0x22a3 }, + { 0x22a3, 0x22a2 }, + { 0x22a6, 0x2ade }, + { 0x22a8, 0x2ae4 }, + { 0x22a9, 0x2ae3 }, + { 0x22ab, 0x2ae5 }, + { 0x22b0, 0x22b1 }, + { 0x22b1, 0x22b0 }, + { 0x22b2, 0x22b3 }, + { 0x22b3, 0x22b2 }, + { 0x22b4, 0x22b5 }, + { 0x22b5, 0x22b4 }, + { 0x22b6, 0x22b7 }, + { 0x22b7, 0x22b6 }, + { 0x22c9, 0x22ca }, + { 0x22ca, 0x22c9 }, + { 0x22cb, 0x22cc }, + { 0x22cc, 0x22cb }, + { 0x22cd, 0x2243 }, + { 0x22d0, 0x22d1 }, + { 0x22d1, 0x22d0 }, + { 0x22d6, 0x22d7 }, + { 0x22d7, 0x22d6 }, + { 0x22d8, 0x22d9 }, + { 0x22d9, 0x22d8 }, + { 0x22da, 0x22db }, + { 0x22db, 0x22da }, + { 0x22dc, 0x22dd }, + { 0x22dd, 0x22dc }, + { 0x22de, 0x22df }, + { 0x22df, 0x22de }, + { 0x22e0, 0x22e1 }, + { 0x22e1, 0x22e0 }, + { 0x22e2, 0x22e3 }, + { 0x22e3, 0x22e2 }, + { 0x22e4, 0x22e5 }, + { 0x22e5, 0x22e4 }, + { 0x22e6, 0x22e7 }, + { 0x22e7, 0x22e6 }, + { 0x22e8, 0x22e9 }, + { 0x22e9, 0x22e8 }, + { 0x22ea, 0x22eb }, + { 0x22eb, 0x22ea }, + { 0x22ec, 0x22ed }, + { 0x22ed, 0x22ec }, + { 0x22f0, 0x22f1 }, + { 0x22f1, 0x22f0 }, + { 0x22f2, 0x22fa }, + { 0x22f3, 0x22fb }, + { 0x22f4, 0x22fc }, + { 0x22f6, 0x22fd }, + { 0x22f7, 0x22fe }, + { 0x22fa, 0x22f2 }, + { 0x22fb, 0x22f3 }, + { 0x22fc, 0x22f4 }, + { 0x22fd, 0x22f6 }, + { 0x22fe, 0x22f7 }, + { 0x2308, 0x2309 }, + { 0x2309, 0x2308 }, + { 0x230a, 0x230b }, + { 0x230b, 0x230a }, + { 0x2329, 0x232a }, + { 0x232a, 0x2329 }, + { 0x2768, 0x2769 }, + { 0x2769, 0x2768 }, + { 0x276a, 0x276b }, + { 0x276b, 0x276a }, + { 0x276c, 0x276d }, + { 0x276d, 0x276c }, + { 0x276e, 0x276f }, + { 0x276f, 0x276e }, + { 0x2770, 0x2771 }, + { 0x2771, 0x2770 }, + { 0x2772, 0x2773 }, + { 0x2773, 0x2772 }, + { 0x2774, 0x2775 }, + { 0x2775, 0x2774 }, + { 0x27d5, 0x27d6 }, + { 0x27d6, 0x27d5 }, + { 0x27dd, 0x27de }, + { 0x27de, 0x27dd }, + { 0x27e2, 0x27e3 }, + { 0x27e3, 0x27e2 }, + { 0x27e4, 0x27e5 }, + { 0x27e5, 0x27e4 }, + { 0x27e6, 0x27e7 }, + { 0x27e7, 0x27e6 }, + { 0x27e8, 0x27e9 }, + { 0x27e9, 0x27e8 }, + { 0x27ea, 0x27eb }, + { 0x27eb, 0x27ea }, + { 0x2983, 0x2984 }, + { 0x2984, 0x2983 }, + { 0x2985, 0x2986 }, + { 0x2986, 0x2985 }, + { 0x2987, 0x2988 }, + { 0x2988, 0x2987 }, + { 0x2989, 0x298a }, + { 0x298a, 0x2989 }, + { 0x298b, 0x298c }, + { 0x298c, 0x298b }, + { 0x298d, 0x2990 }, + { 0x298e, 0x298f }, + { 0x298f, 0x298e }, + { 0x2990, 0x298d }, + { 0x2991, 0x2992 }, + { 0x2992, 0x2991 }, + { 0x2993, 0x2994 }, + { 0x2994, 0x2993 }, + { 0x2995, 0x2996 }, + { 0x2996, 0x2995 }, + { 0x2997, 0x2998 }, + { 0x2998, 0x2997 }, + { 0x29b8, 0x2298 }, + { 0x29c0, 0x29c1 }, + { 0x29c1, 0x29c0 }, + { 0x29c4, 0x29c5 }, + { 0x29c5, 0x29c4 }, + { 0x29cf, 0x29d0 }, + { 0x29d0, 0x29cf }, + { 0x29d1, 0x29d2 }, + { 0x29d2, 0x29d1 }, + { 0x29d4, 0x29d5 }, + { 0x29d5, 0x29d4 }, + { 0x29d8, 0x29d9 }, + { 0x29d9, 0x29d8 }, + { 0x29da, 0x29db }, + { 0x29db, 0x29da }, + { 0x29f5, 0x2215 }, + { 0x29f8, 0x29f9 }, + { 0x29f9, 0x29f8 }, + { 0x29fc, 0x29fd }, + { 0x29fd, 0x29fc }, + { 0x2a2b, 0x2a2c }, + { 0x2a2c, 0x2a2b }, + { 0x2a2d, 0x2a2c }, + { 0x2a2e, 0x2a2d }, + { 0x2a34, 0x2a35 }, + { 0x2a35, 0x2a34 }, + { 0x2a3c, 0x2a3d }, + { 0x2a3d, 0x2a3c }, + { 0x2a64, 0x2a65 }, + { 0x2a65, 0x2a64 }, + { 0x2a79, 0x2a7a }, + { 0x2a7a, 0x2a79 }, + { 0x2a7d, 0x2a7e }, + { 0x2a7e, 0x2a7d }, + { 0x2a7f, 0x2a80 }, + { 0x2a80, 0x2a7f }, + { 0x2a81, 0x2a82 }, + { 0x2a82, 0x2a81 }, + { 0x2a83, 0x2a84 }, + { 0x2a84, 0x2a83 }, + { 0x2a8b, 0x2a8c }, + { 0x2a8c, 0x2a8b }, + { 0x2a91, 0x2a92 }, + { 0x2a92, 0x2a91 }, + { 0x2a93, 0x2a94 }, + { 0x2a94, 0x2a93 }, + { 0x2a95, 0x2a96 }, + { 0x2a96, 0x2a95 }, + { 0x2a97, 0x2a98 }, + { 0x2a98, 0x2a97 }, + { 0x2a99, 0x2a9a }, + { 0x2a9a, 0x2a99 }, + { 0x2a9b, 0x2a9c }, + { 0x2a9c, 0x2a9b }, + { 0x2aa1, 0x2aa2 }, + { 0x2aa2, 0x2aa1 }, + { 0x2aa6, 0x2aa7 }, + { 0x2aa7, 0x2aa6 }, + { 0x2aa8, 0x2aa9 }, + { 0x2aa9, 0x2aa8 }, + { 0x2aaa, 0x2aab }, + { 0x2aab, 0x2aaa }, + { 0x2aac, 0x2aad }, + { 0x2aad, 0x2aac }, + { 0x2aaf, 0x2ab0 }, + { 0x2ab0, 0x2aaf }, + { 0x2ab3, 0x2ab4 }, + { 0x2ab4, 0x2ab3 }, + { 0x2abb, 0x2abc }, + { 0x2abc, 0x2abb }, + { 0x2abd, 0x2abe }, + { 0x2abe, 0x2abd }, + { 0x2abf, 0x2ac0 }, + { 0x2ac0, 0x2abf }, + { 0x2ac1, 0x2ac2 }, + { 0x2ac2, 0x2ac1 }, + { 0x2ac3, 0x2ac4 }, + { 0x2ac4, 0x2ac3 }, + { 0x2ac5, 0x2ac6 }, + { 0x2ac6, 0x2ac5 }, + { 0x2acd, 0x2ace }, + { 0x2ace, 0x2acd }, + { 0x2acf, 0x2ad0 }, + { 0x2ad0, 0x2acf }, + { 0x2ad1, 0x2ad2 }, + { 0x2ad2, 0x2ad1 }, + { 0x2ad3, 0x2ad4 }, + { 0x2ad4, 0x2ad3 }, + { 0x2ad5, 0x2ad6 }, + { 0x2ad6, 0x2ad5 }, + { 0x2ade, 0x22a6 }, + { 0x2ae3, 0x22a9 }, + { 0x2ae4, 0x22a8 }, + { 0x2ae5, 0x22ab }, + { 0x2aec, 0x2aed }, + { 0x2aed, 0x2aec }, + { 0x2af7, 0x2af8 }, + { 0x2af8, 0x2af7 }, + { 0x2af9, 0x2afa }, + { 0x2afa, 0x2af9 }, + { 0x3008, 0x3009 }, + { 0x3009, 0x3008 }, + { 0x300a, 0x300b }, + { 0x300b, 0x300a }, + { 0x300c, 0x300d }, + { 0x300d, 0x300c }, + { 0x300e, 0x300f }, + { 0x300f, 0x300e }, + { 0x3010, 0x3011 }, + { 0x3011, 0x3010 }, + { 0x3014, 0x3015 }, + { 0x3015, 0x3014 }, + { 0x3016, 0x3017 }, + { 0x3017, 0x3016 }, + { 0x3018, 0x3019 }, + { 0x3019, 0x3018 }, + { 0x301a, 0x301b }, + { 0x301b, 0x301a }, + { 0xff08, 0xff09 }, + { 0xff09, 0xff08 }, + { 0xff1c, 0xff1e }, + { 0xff1e, 0xff1c }, + { 0xff3b, 0xff3d }, + { 0xff3d, 0xff3b }, + { 0xff5b, 0xff5d }, + { 0xff5d, 0xff5b }, + { 0xff5f, 0xff60 }, + { 0xff60, 0xff5f }, + { 0xff62, 0xff63 }, + { 0xff63, 0xff62 } +}; + +#endif /* CHARTABLES_H */ diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp new file mode 100644 index 000000000..05a63b887 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_lltot.cpp @@ -0,0 +1,47 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +TCHAR* lucene_i64tot( + int64_t value, /* [I] Value to be converted */ + TCHAR* str, /* [O] Destination for the converted value */ + int radix) /* [I] Number base for conversion */ +{ + uint64_t val; + int negative; + TCHAR buffer[65]; + TCHAR* pos; + int digit; + + if (value < 0 && radix == 10) { + negative = 1; + val = -value; + } else { + negative = 0; + val = value; + } /* if */ + + pos = &buffer[64]; + *pos = '\0'; + + do { + digit = val % radix; + val = val / radix; + if (digit < 10) { + *--pos = '0' + digit; + } else { + *--pos = 'a' + digit - 10; + } /* if */ + } while (val != 0L); + + if (negative) { + *--pos = '-'; + } /* if */ + + _tcsncpy(str,pos,&buffer[64] - pos + 1); //needed for unicode to work + return str; +} diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tchar.h b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tchar.h new file mode 100644 index 000000000..ba8aef5c6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tchar.h @@ -0,0 +1,126 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _CL_HAVE_TCHAR_H +#if defined(_UCS2) + #define TCHAR wchar_t + + //note: descriptions with * in front have replacement functions + + //formatting functions + #define _sntprintf swprintf //* make a formatted a string + #define _tprintf wprintf //* print a formatted string + + //this one has no replacement functions yet, but it is only used in the tests + #define _vsntprintf vsnwprintf //* print a formatted string using variable arguments + + //we are using the internal functions of the compiler here + //if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse + //will be replaced by internal functions + #define _istalnum iswalnum //* alpha/numeric char check + #define _istalpha iswalpha //* alpha char check + #define _istspace iswspace //* space char check + #define _istdigit iswdigit //* digit char check + #define _totlower towlower //* convert char to lower case + #define _totupper towupper //* convert char to lower case + #define _tcslwr wcslwr //* convert string to lower case + + //these are the string handling functions + //we may need to create wide-character/multi-byte replacements for these + #define _tcscpy wcscpy //copy a string to another string + #define _tcsncpy wcsncpy //copy a specified amount of one string to another string. + #define _tcscat wcscat //copy a string onto the end of the other string + #define _tcschr wcschr //find location of one character + #define _tcsstr wcsstr //find location of a string + #define _tcslen wcslen //get length of a string + #define _tcscmp wcscmp //case sensitive compare two strings + #define _tcsncmp wcsncmp //case sensitive compare two strings + #define _tcscspn wcscspn //location of any of a set of character in a string + + #ifdef _CL_HAVE_WCSICMP + #define _tcsicmp wcsicmp //* case insensitive compare two string + #else + #define _tcsicmp wcscasecmp //* case insensitive compare two string + #endif + + //conversion functions + #define _tcstod wcstod //convert a string to a double + #ifdef _PA_RISC + #define _tcstoi64 __wcstoll //* convers a string to an 64bit bit integer + #else + #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer + #endif + #define _i64tot lltow //* converts a 64 bit integer to a string (with base) + +#else //if defined(_ASCII) + #define TCHAR char + + //formatting functions + #define _sntprintf snprintf + #define _tprintf printf + #define _vsntprintf vsnprintf + + //we are using the internal functions of the compiler here + //if LUCENE_USE_INTERNAL_CHAR_FUNCTIONS is defined, thesse + //will be replaced by internal functions + #define _istalnum isalnum + #define _istalpha isalpha + #define _istspace isspace + #define _istdigit isdigit + #define _totlower tolower + #define _totupper toupper + #define _tcslwr strlwr + + //these are the string handling functions + #define _tcscpy strcpy + #define _tcsncpy strncpy + #define _tcscat strcat + #define _tcschr strchr + #define _tcsstr strstr + #define _tcslen strlen + #define _tcscmp strcmp + #define _tcsncmp strncmp + #define _tcsicmp strcasecmp + #define _tcscspn strcspn + + //converstion methods + #define _tcstod strtod + #define _tcstoi64 strtoll + #define _i64tot lltoa +#endif +#else //HAVE_TCHAR_H + #include + +#ifdef UNDER_CE +#include +#define _i64tot i64tot +inline TCHAR* i64tot(__int64 value, TCHAR* str, int radix) +{ + QT_USE_NAMESPACE + _tcscpy(str, (TCHAR *) QString::number(value, radix).utf16()); + return str; +} + +#define _tcstoi64 tcstoi64 +inline __int64 tcstoi64(const TCHAR *nptr, TCHAR **endptr, int base) +{ + QT_USE_NAMESPACE + bool ok; + return QString::fromUtf16((ushort*) nptr).toInt(&ok, base); +} + +#endif + + //some tchar headers miss these... + #ifndef _tcstoi64 + #if defined(_UCS2) + #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer + #else + #define _tcstoi64 strtoll + #endif + #endif + +#endif //HAVE_TCHAR_H diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp new file mode 100644 index 000000000..1bee7b7a6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcscasecmp.cpp @@ -0,0 +1,21 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +#include "CLucene/StdHeader.h" + +int lucene_tcscasecmp(const TCHAR * sa, const TCHAR * sb){ + TCHAR ca,cb; + if (sa == sb) + return 0; + + do{ + ca = _totlower( (*(sa++)) ); + cb = _totlower( (*(sb++)) ); + } while ( ca != L'\0' && (ca == cb) ); + + return (int)(ca - cb); +} diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp new file mode 100644 index 000000000..2ae6abca4 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcslwr.cpp @@ -0,0 +1,15 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +#include "CLucene/StdHeader.h" + +TCHAR* lucene_tcslwr( TCHAR* str ) +{ + TCHAR* ret = str; + for ( ; *str; str++) *str = _totlower(*str); + return ret; +} diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp new file mode 100644 index 000000000..1fd4ca770 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstod.cpp @@ -0,0 +1,23 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +#include "CLucene/StdHeader.h" + +#ifndef _ASCII +double lucene_tcstod(const TCHAR *value, TCHAR **end){ + int32_t len = _tcslen(value)+1; + char* avalue=_CL_NEWARRAY(char,len); + char* aend=NULL; + STRCPY_TtoA(avalue,value,len); + + double ret = strtod(avalue,&aend); + *end=(TCHAR*)value+(aend-avalue); + _CLDELETE_CaARRAY(avalue); + + return ret; +} +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp new file mode 100644 index 000000000..246d66c80 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tcstoll.cpp @@ -0,0 +1,46 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +#include "CLucene/StdHeader.h" + +int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix){ + #define LUCENE_TCSTOI64_RADIX(x,r) ((x>=_T('0') && x<=_T('9'))?x-_T('0'):((x>=_T('a') && x<=_T('z'))?x-_T('a')+10:((x>=_T('A') && x<=_T('Z'))?x-_T('A')+10:1000))) + + if (radix < 2 || radix > 36) + return 0; + + /* Skip white space. */ + while (_istspace (*str)) + ++str; + + int sign=1; + if ( str[0] == _T('+') ) + str++; + else if ( str[0] == _T('-') ){ + sign = -1; + str++; + } + + *end=(TCHAR*)str; + long r = -1; + while ( (r=LUCENE_TCSTOI64_RADIX(*end[0],radix)) >=0 && r=str;p-- ){ + int i=LUCENE_TCSTOI64_RADIX(p[0],radix); + if ( pos == 0 ) + ret=i; + else + ret += (int64_t)pow((qreal)radix,(qreal)pos) * i; //todo: might be quicker with a different pow overload + + pos++; + } + return sign*ret; +} diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp new file mode 100644 index 000000000..62cecb78b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tprintf.cpp @@ -0,0 +1,149 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CLucene/util/StringBuffer.h" + +#ifdef __CL_INCLUDE_TPRINTF + +CL_NS_USE(util) + +//print a variable argument to a stream +//currently special number formatting is not supported. it is very minimalistic +void lucene_vfnwprintf(StringBuffer* buffer, size_t count, const wchar_t * format, va_list& valist){ + const wchar_t *iter = format; + StringBuffer* tmp = NULL; + if ( buffer == NULL ) + tmp = _CLNEW StringBuffer; + else + tmp = buffer; + + while (*iter) + { + while (*iter && *iter != '%') + { + tmp->appendChar(*iter++); + } + if (*iter == '%') + { + if (iter[1] == '%') + { + //just print a % + tmp->appendChar('%'); + iter += 2; + continue; + } + + iter++; + switch (*iter) + { + case 's': + { + //todo: this is faulty. it doesn't heed count + + //print a string or null + TCHAR *wstr = va_arg(valist, TCHAR *); + if ( !wstr ) + wstr = _T("(null)"); + + tmp->append(wstr); + iter++; + break; + } + + case 'c': + tmp->appendChar((TCHAR)va_arg(valist, int)); + iter++; + break; + + default: + { + //todo: this is faulty. it doesn't heed count + + if (*iter == 'p') + tmp->appendInt((int32_t)va_arg(valist, long)); + else + { + if (*iter == 'a' || *iter == 'A' || + *iter == 'e' || *iter == 'E' || + *iter == 'f' || *iter == 'F' || + *iter == 'g' || *iter == 'G') + tmp->appendFloat((qreal)va_arg(valist, double),8); + else if (*iter == 'd' || *iter == 'i' ){ + tmp->appendInt((int32_t)va_arg(valist, int)); + }else if (*iter == 'l' ){ + TCHAR b[100]; + _i64tot((int64_t)va_arg(valist, int64_t),b,10); + tmp->append(b); + }/*else{ + TCHAR b[100]; + _i64tot((int64_t)va_arg(valist, void*),b,10); + tmp->append(b); + }*/ + } + iter++; + break; + } + } + } + } + + + if ( buffer == NULL ){ + //we are supposed to be writing to the console +#ifdef _UCS2 + TCHAR* pointer = tmp->getBuffer(); + char ob[MB_LEN_MAX]; + size_t v; + size_t len = tmp->length(); + for (size_t i=0;i 0 ){ + ob[v]='\0'; + fputs(ob,stdout); + } + pointer++; + } + + +#else + fputs(tmp->getBuffer(),stdout); +#endif + _CLDELETE(tmp); + } +} + +//print a list of arguments to a string +int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...){ + va_list ap; + va_start(ap, format); + StringBuffer buffer; + lucene_vfnwprintf(&buffer,count,format,ap); + va_end(ap); + + size_t ret = min(count,(size_t)(buffer.length()+1)); + _tcsncpy(strbuf,buffer.getBuffer(),ret); + return ret; +} + +//print a list of arguments to the stdout +void lucene_wprintf(const wchar_t * format, ...){ + va_list ap; + va_start(ap, format); + lucene_vfnwprintf(NULL,LUCENE_INT32_MAX_SHOULDBE,format,ap); + va_end(ap); +} + +//print a variable argument to a string +int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap){ + StringBuffer buffer; + lucene_vfnwprintf(&buffer,count,format,ap); + int ret = min((int32_t)count,buffer.length()+1); + _tcsncpy(strbuf,buffer.getBuffer(),ret); + return ret; +} + +#endif //__CL_INCLUDE_TPRINTF diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/repl_wchar.h b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_wchar.h new file mode 100644 index 000000000..3e05c311c --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/repl_wchar.h @@ -0,0 +1,121 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_repl_wchar_h +#define _lucene_repl_wchar_h + +#ifdef _UCS2 + +#ifndef _CL_HAVE_WCSCPY + //copy a string to another string + #error wcscpy is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSNCPY + //copy a specified amount of one string to another string. + #error wcsncpy is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSCAT + //copy a string onto the end of the other string + #error wcscat is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSCHR + //find location of one character + #error wcschr is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSSTR + //find location of a string + #error wcspy is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSLEN + //get length of a string + #error wcslen is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSCMP + //case sensitive compare two strings + #error wcscmp is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSNCMP + //case sensitive compare two strings of a specified length + #error wcsncmp is not defined, and a licensed replacement has not been written yet +#endif + +#ifndef _CL_HAVE_WCSCSPN + //Return the length of the maximum initial segment + //of WCS which contains only wide-characters not in REJECT. + #error wcscspn is not defined, and a licensed replacement has not been written yet +#endif + +#endif //_UCS2 + +//string function replacements +#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_WCSCASECMP)) || (defined(_ASCII) && !defined(_CL_HAVE_STRCASECMP)) + int lucene_tcscasecmp(const TCHAR *, const TCHAR *); + #undef _tcsicmp + #define _tcsicmp lucene_tcscasecmp +#endif +#if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_WCSLWR)) || (defined(_ASCII) && !defined(_CL_HAVE_STRLWR)) + TCHAR* lucene_tcslwr( TCHAR* str ); + #undef _tcslwr + #define _tcslwr lucene_tcslwr +#endif + +//conversion functions +#if (defined(_ASCII) && !defined(_CL_HAVE_LLTOA)) || (defined(_UCS2) && !defined(_CL_HAVE_LLTOW)) + TCHAR* lucene_i64tot( int64_t value, TCHAR* str, int radix); + #undef _i64tot + #define _i64tot lucene_i64tot +#endif +#if (defined(_UCS2) && !defined(_CL_HAVE_WCSTOLL)) || (defined(_ASCII) && !defined(_CL_HAVE_STRTOLL)) + int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix); + #undef _tcstoi64 + #define _tcstoi64 lucene_tcstoi64 +#endif +#if defined(_UCS2) && !defined(_CL_HAVE_WCSTOD) + double lucene_tcstod(const TCHAR *value, TCHAR **end); + #undef _tcstod + #define _tcstod lucene_tcstod +#endif + +//printf functions +#if defined(_UCS2) && (!defined(_CL_HAVE_SNWPRINTF) || defined(_CL_HAVE_SWPRINTF_BUG) ) + #undef _sntprintf + #define _sntprintf lucene_snwprintf + int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...); + + #ifndef __CL_INCLUDE_TPRINTF + #define __CL_INCLUDE_TPRINTF + #endif +#endif +#if defined(_UCS2) && !defined(_CL_HAVE_WPRINTF) + #undef _tprintf + #define _tprintf lucene_wprintf + void lucene_wprintf(const wchar_t * format, ...); + + #ifndef __CL_INCLUDE_TPRINTF + #define __CL_INCLUDE_TPRINTF + #endif +#endif +#if defined(_UCS2) && (!defined(_CL_HAVE_VSNWPRINTF) || defined(_CL_HAVE_SWPRINTF_BUG) ) + #undef _vsntprintf + #define _vsntprintf lucene_vsnwprintf + int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap); + + #ifndef __CL_INCLUDE_TPRINTF + #define __CL_INCLUDE_TPRINTF + #endif +#endif + +//todo: if _CL_HAVE_SNPRINTF_BUG fails(snprintf overflow),we should use our own +//function. but we don't have it currently, and our functions are dubious anyway... + +#endif //end of _lucene_repl_wchar_h diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/threadCSection.h b/src/assistant/3rdparty/clucene/src/CLucene/config/threadCSection.h new file mode 100644 index 000000000..ab1842051 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/threadCSection.h @@ -0,0 +1,71 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +//NOTE: do not include this file directly, it is included from lucene internally. + +#ifndef lucene_config_threadCSection_h +#define lucene_config_threadCSection_h +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(util) + + #if !defined(LUCENE_USE_WINDOWS_H) && !defined(_WINDOWS_) && !defined(__MINGW32__) + //we have not explicity included windows.h and windows.h has + //not been included (check _WINDOWS_), then we must define + //our own definitions to the thread locking functions: + struct CRITICAL_SECTION + { + struct critical_section_debug * DebugInfo; + long LockCount; + long RecursionCount; + void * OwningThread; + void * LockSemaphore; + #if defined(_WIN64) + unsigned __int64 SpinCount; + #else + unsigned long SpinCount; + #endif + }; + #endif + + ///a windows implementation of the lock mutex + ///todo: boost has a InterlockedExchange way of locking too. More backwards compatible/faster??? + class mutex_win32 + { + private: + CRITICAL_SECTION mtx; + public: + mutex_win32(const mutex_win32& clone); + mutex_win32(); + ~mutex_win32(); + void lock(); + void unlock(); + }; + + class CLuceneThreadIdCompare + { + public: + + enum + { // parameters for hash table + bucket_size = 4, // 0 < bucket_size + min_buckets = 8 + }; // min_buckets = 2 ^^ N, 0 < N + + bool operator()( DWORD t1, DWORD t2 ) const{ + return t1 < t2; + } + }; + + #define _LUCENE_SLEEP(x) Sleep(x) + #define _LUCENE_THREADMUTEX CL_NS(util)::mutex_win32 + #define _LUCENE_CURRTHREADID GetCurrentThreadId() + #define _LUCENE_THREADID_TYPE DWORD +CL_NS_END + +#endif //lucene_config_threadCSection_h diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/threadPthread.h b/src/assistant/3rdparty/clucene/src/CLucene/config/threadPthread.h new file mode 100644 index 000000000..d0ed9c4c9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/threadPthread.h @@ -0,0 +1,59 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +//NOTE: do not include this file directly, it is included from lucene internally. + +#ifndef lucene_config_threadPthread_h +#define lucene_config_threadPthread_h + +#include + +CL_NS_DEF(util) + +///a posix implementation of the lock mutex +///todo: we need a spinlock implemenation for usage in reference counting +class mutex_pthread +{ +private: + pthread_mutex_t mtx; + +public: + mutex_pthread(const mutex_pthread& clone); + mutex_pthread(); + ~mutex_pthread(); + void lock(); + void unlock(); + +private: + #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE + pthread_t lockOwner; + unsigned int lockCount; + #endif +}; + +#define _LUCENE_SLEEP(x) usleep(x*1000) //_LUCENE_SLEEP should be in millis, usleep is in micros +#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_pthread +#define _LUCENE_CURRTHREADID pthread_self() +#define _LUCENE_THREADID_TYPE pthread_t + +class CLuceneThreadIdCompare +{ +public: + enum + { // parameters for hash table + bucket_size = 4, // 0 < bucket_size + min_buckets = 8 + }; // min_buckets = 2 ^^ N, 0 < N + + bool operator()( pthread_t t1, pthread_t t2 ) const{ + return t1 < t2; + } +}; + + +CL_NS_END + +#endif //lucene_config_threadPthread_h diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/threads.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/threads.cpp new file mode 100644 index 000000000..427e58092 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/threads.cpp @@ -0,0 +1,162 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +#ifndef _CL_DISABLE_MULTITHREADING +CL_NS_DEF(util) + + +mutexGuard::mutexGuard(const mutexGuard& clone){ + //no autoclone + mrMutex = NULL; +} +mutexGuard::mutexGuard( _LUCENE_THREADMUTEX& rMutex ) : + mrMutex(&rMutex) +{ + mrMutex->lock(); +} +mutexGuard::~mutexGuard() +{ + mrMutex->unlock(); +} + +#if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX) + //do nothing + #if defined(_LUCENE_PRAGMA_WARNINGS) + #pragma message ("==================Not implementing any thread mutex==================") + #else + #warning "==================Not implementing any thread mutex==================" + #endif + + + +#elif defined(_CL_HAVE_WIN32_THREADS) + #include "CLucene/config/threadCSection.h" + + #if !defined(LUCENE_USE_WINDOWS_H) && !defined(_WINDOWS_) + //we have not explicity included windows.h and windows.h has + //not been included (check _WINDOWS_), then we must define + //our own definitions to the thread locking functions: + extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION *); + extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION *); + extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION *); + extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION *); + extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(); + #endif + + mutex_win32::mutex_win32(const mutex_win32& clone){ + InitializeCriticalSection(&mtx); + } + mutex_win32::mutex_win32() + { + InitializeCriticalSection(&mtx); + } + + mutex_win32::~mutex_win32() + { + DeleteCriticalSection(&mtx); + } + + void mutex_win32::lock() + { + EnterCriticalSection(&mtx); + } + + void mutex_win32::unlock() + { + LeaveCriticalSection(&mtx); + } + + + +#elif defined(_CL_HAVE_PTHREAD) + #include "CLucene/config/threadPthread.h" + + #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE + bool mutex_pthread_attr_initd=false; + pthread_mutexattr_t mutex_pthread_attr; + #endif + + #ifdef _CL__CND_DEBUG + #define _CLPTHREAD_CHECK(c,m) CND_PRECONDITION(c==0,m) + #else + #define _CLPTHREAD_CHECK(c,m) c; + #endif + + mutex_pthread::mutex_pthread(const mutex_pthread& clone){ + #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE + _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, &mutex_pthread_attr), "mutex_pthread(clone) constructor failed") + #else + #if defined(__hpux) && defined(_DECTHREADS_) + _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, pthread_mutexattr_default), "mutex_pthread(clone) constructor failed") + #else + _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, 0), "mutex_pthread(clone) constructor failed") + #endif + lockCount=0; + lockOwner=0; + #endif + } + mutex_pthread::mutex_pthread() + { + #ifdef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE + if ( mutex_pthread_attr_initd == false ){ + pthread_mutexattr_init(&mutex_pthread_attr); + pthread_mutexattr_settype(&mutex_pthread_attr, PTHREAD_MUTEX_RECURSIVE); + mutex_pthread_attr_initd = true; + } + _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, &mutex_pthread_attr), "mutex_pthread(clone) constructor failed") + #else + #if defined(__hpux) && defined(_DECTHREADS_) + _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, pthread_mutexattr_default), "mutex_pthread(clone) constructor failed") + #else + _CLPTHREAD_CHECK(pthread_mutex_init(&mtx, 0), "mutex_pthread(clone) constructor failed") + #endif + lockCount=0; + lockOwner=0; + #endif + } + + mutex_pthread::~mutex_pthread() + { + _CLPTHREAD_CHECK(pthread_mutex_destroy(&mtx), "~mutex_pthread destructor failed") + } + + void mutex_pthread::lock() + { + #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE + pthread_t currentThread = pthread_self(); + if( pthread_equal( lockOwner, currentThread ) ) { + ++lockCount; + } else { + _CLPTHREAD_CHECK(pthread_mutex_lock(&mtx), "mutex_pthread::lock") + lockOwner = currentThread; + lockCount = 1; + } + #else + _CLPTHREAD_CHECK(pthread_mutex_lock(&mtx), "mutex_pthread::lock") + #endif + } + + void mutex_pthread::unlock() + { + #ifndef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE + --lockCount; + if( lockCount == 0 ) + { + lockOwner = 0; + _CLPTHREAD_CHECK(pthread_mutex_unlock(&mtx), "mutex_pthread::unlock") + } + #else + _CLPTHREAD_CHECK(pthread_mutex_unlock(&mtx), "mutex_pthread::unlock") + #endif + } + +#endif //thread impl choice + + +CL_NS_END +#endif //!_CL_DISABLE_MULTITHREADING diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/utf8.cpp b/src/assistant/3rdparty/clucene/src/CLucene/config/utf8.cpp new file mode 100644 index 000000000..14ccf5aa9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/utf8.cpp @@ -0,0 +1,237 @@ +/* + * Copyright (C) 1999 Tom Tromey + * Copyright (C) 2000 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + ************************************************ + * Also licensed with permission from Tom Tromey + * and Owen Taylor under the Apache license. + * Original location: + * http://cvs.gnome.org/viewcvs/glib/glib/gutf8.c?rev=1.50&view=log + ************************************************ + * + * Copyright 2003-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #include "CLucene/StdHeader.h" + +typedef unsigned long gunichar; +typedef unsigned char guchar; + +#define UTF8_COMPUTE(Char, Mask, Len) \ + if (Char < 128) \ + { \ + Len = 1; \ + Mask = 0x7f; \ + } \ + else if ((Char & 0xe0) == 0xc0) \ + { \ + Len = 2; \ + Mask = 0x1f; \ + } \ + else if ((Char & 0xf0) == 0xe0) \ + { \ + Len = 3; \ + Mask = 0x0f; \ + } \ + else if ((Char & 0xf8) == 0xf0) \ + { \ + Len = 4; \ + Mask = 0x07; \ + } \ + else if ((Char & 0xfc) == 0xf8) \ + { \ + Len = 5; \ + Mask = 0x03; \ + } \ + else if ((Char & 0xfe) == 0xfc) \ + { \ + Len = 6; \ + Mask = 0x01; \ + } \ + else \ + Len = -1; + +/*#define UTF8_LENGTH(Char) \ + ((Char) < 0x80 ? 1 : \ + ((Char) < 0x800 ? 2 : \ + ((Char) < 0x10000 ? 3 : \ + ((Char) < 0x200000 ? 4 : \ + ((Char) < 0x4000000 ? 5 : 6)))))*/ + + +#define UTF8_GET(Result, Chars, Count, Mask, Len) \ + (Result) = (Chars)[0] & (Mask); \ + for ((Count) = 1; (Count) < (Len); ++(Count)) \ + { \ + if (((Chars)[(Count)] & 0xc0) != 0x80) \ + { \ + (Result) = -1; \ + break; \ + } \ + (Result) <<= 6; \ + (Result) |= ((Chars)[(Count)] & 0x3f); \ + } + + +/** + * lucene_wctoutf8: + * @c: a ISO10646 character code + * @outbuf: output buffer, must have at least 6 bytes of space. + * If %NULL, the length will be computed and returned + * and nothing will be written to @outbuf. + * + * Converts a single character to UTF-8. + * + * Return value: number of bytes written + **/ +size_t lucene_wctoutf8(char * outbuf, const wchar_t ch) +{ + gunichar c = ch; + guchar len = 0; + int first; + int i; + + if (c < 0x80) + { + first = 0; + len = 1; + } + else if (c < 0x800) + { + first = 0xc0; + len = 2; + } + else if (c < 0x10000) + { + first = 0xe0; + len = 3; + } + else if (c < 0x200000) + { + first = 0xf0; + len = 4; + } + else if (c < 0x4000000) + { + first = 0xf8; + len = 5; + } + else + { + first = 0xfc; + len = 6; + } + + if (outbuf) + { + for (i = len - 1; i > 0; --i) + { + outbuf[i] = (char)((c & 0x3f) | 0x80); + c >>= 6; + } + outbuf[0] = c | first; + } + + return len; +} + + +/** + * lucene_utf8towc: + * @p: a pointer to Unicode character encoded as UTF-8 + * + * Converts a sequence of bytes encoded as UTF-8 to a Unicode character. + * If @p does not point to a valid UTF-8 encoded character, results are + * undefined. If you are not sure that the bytes are complete + * valid Unicode characters, you should use lucene_utf8towc_validated() + * instead. + * + * Return value: the resulting character + **/ +size_t lucene_utf8towc(wchar_t *pwc, const char *p, size_t n) +{ + int i, mask = 0; + int result; + unsigned char c = (unsigned char) *p; + int len=0; + + UTF8_COMPUTE (c, mask, len); + if (len == -1) + return 0; + UTF8_GET (result, p, i, mask, len); + + *pwc = result; + return len; +} + + +//this function was not taken from gnome +size_t lucene_wcstoutf8(char * result, const wchar_t * str, size_t result_length){ + char *p=result; + int i = 0; + + while (p < result + result_length-1 && str[i] != 0) + p += lucene_wctoutf8(p,str[i++]); + + *p = '\0'; + + return p-result; +} +//this function was not taken from gnome +size_t lucene_utf8towcs(wchar_t * result, const char * str, size_t result_length){ + char *sp = (char*)str; + wchar_t *rp = result; + int i = 0; + + while (rp < result + result_length && *sp!=0){ + size_t r = lucene_utf8towc(rp,sp,6); + if ( r == -1 ) + return 0; + sp += r; + rp++; + } + + if ( sp-str < result_length ) + *rp = '\0'; + + size_t ret = sp-str; + return ret; +} +//get the number of bytes that make up the utf8 character. +//this function was not taken from gnome +size_t lucene_utf8charlen(const char *p) +{ + int mask = 0; + int len=0; + unsigned char c = (unsigned char) *p; + + UTF8_COMPUTE (c, mask, len); + return len; +} diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp b/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp new file mode 100644 index 000000000..855419451 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp @@ -0,0 +1,80 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "condition.h" +#include "CLucene/util/Misc.h" +#ifdef _CL__CND_DEBUG + +#define __CND_STR_PRECONDITION "PRECONDITION" +#define __CND_STR_CONDITION "CONDITION" +#define __CND_STR_WARNING "WARNING" +#define __CND_STR_MESSAGE "MESSAGE" +#define __CND_STR_DEBUGMESSAGE "DEBUG MESSAGE" +#define __CND_STR_EXIT "EXIT" + +#ifndef _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG +void _Cnd_OutDebug( const char* FormattedMsg, const char* StrTitle, const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ){ + #ifdef __WINDOWS_H + /*Display a standard messagebox*/ + MessageBox(NULL, FormattedMsg, StrTitle, (fatal==1 ? MB_ICONSTOP:MB_ICONEXCLAMATION) | MB_OK | MB_TASKMODAL); + #else + printf("%s\n",FormattedMsg); + #endif + + #if defined(_CND_DEBUG_WARN_DEBUGGER) /*attempt to signal windows debugger*/ + OutputDebugString(FormattedMsg); + DebugBreak(); /*Position debugger just before exit program*/ + #endif + + if ( fatal ) + debugFatalExit(1); +} +#endif + +void __cnd_FormatDebug( const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ) { + char M[512]; + char* StrTitle = NULL; + + if( Mes2 ) + _snprintf(M,512,"file:%s line:%d\n%s",File,Line,Mes2); + else + _snprintf(M,512,"file:%s line:%d",File,Line); + + /*Determine which title to use*/ + switch( Title ) { + case CND_STR_PRECONDITION: { + StrTitle = __CND_STR_PRECONDITION; + break; + } + case CND_STR_CONDITION: { + StrTitle = __CND_STR_CONDITION; + break; + } + case CND_STR_WARNING: { + StrTitle = __CND_STR_WARNING; + break; + } + case CND_STR_MESSAGE: { + StrTitle = __CND_STR_MESSAGE; + break; + } + case CND_STR_DEBUGMESSAGE: { + StrTitle = __CND_STR_DEBUGMESSAGE; + break; + } + case CND_STR_EXIT: { + StrTitle = __CND_STR_EXIT; + break; + } + default: + break; + }/*switch*/ + + _Cnd_OutDebug(M, StrTitle, File, Line, Title, Mes2, fatal); +} +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.h b/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.h new file mode 100644 index 000000000..ab227e508 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.h @@ -0,0 +1,64 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef __CONDITION_H +#define __CONDITION_H + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +/* +To enable condition debugging uncomment _CND_DEBUG in CLConfig.h +*/ + +#ifdef _CL__CND_DEBUG /* Don't include the debug code */ + #ifndef CND_STR_DEFINES + #define CND_STR_DEFINES + #define CND_STR_PRECONDITION 1 + #define CND_STR_CONDITION 2 + #define CND_STR_WARNING 3 + #define CND_STR_MESSAGE 4 + #define CND_STR_DEBUGMESSAGE 5 + #define CND_STR_EXIT 6 + #endif + + /* _CL__CND_DEBUG defined, include debug code */ + + #ifdef _CND_NODEBUGTEXT + #define CND_PRECONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_PRECONDITION,NULL) + #define CND_CONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_CONDITION,NULL) + #define CND_WARNING(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_WARNING,NULL) + #define CND_MESSAGE(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_MESSAGE,NULL) + #define CND_DEBUGMESSAGE(usermessage) CND__MESSAGE(__FILE__,__LINE__,CND_STR_DEBUGMESSAGE,NULL) + #else + #define CND_PRECONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_PRECONDITION,usermessage) + #define CND_CONDITION(cond,usermessage) CND__EXITCONDITION(cond,__FILE__,__LINE__,CND_STR_CONDITION,usermessage) + #define CND_WARNING(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_WARNING,usermessage) + #define CND_MESSAGE(cond,usermessage) CND__CONDITION(cond,__FILE__,__LINE__,CND_STR_MESSAGE,usermessage) + #define CND_DEBUGMESSAGE(usermessage) CND__MESSAGE(__FILE__,__LINE__,CND_STR_DEBUGMESSAGE,usermessage) + #endif + + //if _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG is defined, then you must implement + //this routine in the client application. The debug callback can then + //be better customised to the host application. + //Here is the default implementation: + void _Cnd_OutDebug( const char* FormattedMsg, const char* StrTitle, const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ); + + void __cnd_FormatDebug( const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ); + #define CND__EXIT(file,line,title,mes2) {__cnd_FormatDebug(file,line,title,mes2,1);} + #define CND__EXITCONDITION(cond,file,line,title,mes2) {if(!(cond)){__cnd_FormatDebug(file,line,title,mes2,1);}} + #define CND__CONDITION(cond,file,line,title,mes2) {if(!(cond)){__cnd_FormatDebug(file,line,title,mes2,0);}} + #define CND__MESSAGE(file,line,title,mes2) {__cnd_FormatDebug(file,line,title,mes2,0);} +#else + #define CND_PRECONDITION(cond, usermessage) + #define CND_CONDITION(cond, usermessage) + #define CND_WARNING(cond,usermessage) + #define CND_MESSAGE(cond,usermessage) + #define CND_DEBUGMESSAGE(usermessage) +#endif + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/error.cpp b/src/assistant/3rdparty/clucene/src/CLucene/debug/error.cpp new file mode 100644 index 000000000..53ea0e93b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/error.cpp @@ -0,0 +1,73 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +CL_NS_USE(util) + + +#ifdef _LUCENE_DISABLE_EXCEPTIONS + #ifdef _LUCENE_PRAGMA_WARNINGS + #pragma message ("==================Lucene exceptions are disabled==================") + #else + #warning "==================Lucene exceptions are disabled==================" + #endif +#else + CLuceneError::CLuceneError(int num, const char* str, bool ownstr) + { + error_number = num; + _awhat=STRDUP_AtoA(str); + _twhat=NULL; + if ( ownstr ) + _CLDELETE_CaARRAY(str); + } + + CLuceneError::CLuceneError(const CLuceneError& clone) + { + this->error_number = clone.error_number; + this->_awhat = NULL; + this->_twhat = NULL; + + if ( clone._awhat != NULL ) + this->_awhat = STRDUP_AtoA(clone._awhat); + if ( clone._twhat != NULL ) + this->_twhat = STRDUP_TtoT(clone._twhat); + } + CLuceneError::~CLuceneError() throw(){ + _CLDELETE_CARRAY(_twhat); + _CLDELETE_CaARRAY(_awhat); + } + char* CLuceneError::what(){ +#ifdef _ASCII + if ( _twhat != NULL ) + return _twhat; +#endif + if ( _awhat == NULL ) + _awhat = STRDUP_TtoA(_twhat); + return _awhat; + } + TCHAR* CLuceneError::twhat(){ +#ifdef _ASCII + if ( _awhat != NULL ) + return _awhat; +#endif + if ( _twhat == NULL ) + _twhat = STRDUP_AtoT(_awhat); + return _twhat; + } + +#ifndef _ASCII + CLuceneError::CLuceneError(int num, const TCHAR* str, bool ownstr) + { + error_number = 0; + _awhat=NULL; + _twhat=STRDUP_TtoT(str); + if ( ownstr ) + _CLDELETE_CARRAY(str); + } +#endif + +#endif //_LUCENE_DISABLE_EXCEPTIONS diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/error.h b/src/assistant/3rdparty/clucene/src/CLucene/debug/error.h new file mode 100644 index 000000000..5abcc802c --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/error.h @@ -0,0 +1,74 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_debug_error_ +#define _lucene_debug_error_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#define CL_ERR_UNKNOWN -1 +#define CL_ERR_IO 1 +#define CL_ERR_NullPointer 2 +#define CL_ERR_Runtime 3 +#define CL_ERR_IllegalArgument 4 +#define CL_ERR_Parse 5 +#define CL_ERR_TokenMgr 6 +#define CL_ERR_UnsupportedOperation 7 +#define CL_ERR_InvalidState 8 +#define CL_ERR_IndexOutOfBounds 9 +#define CL_ERR_TooManyClauses 10 +#define CL_ERR_RAMTransaction 11 +#define CL_ERR_InvalidCast 12 +#define CL_ERR_IllegalState 13 + + + +//////////////////////////////////////////////////////// +//error try/throw/catch definitions +//////////////////////////////////////////////////////// +#ifdef _CL_DISABLE_NATIVE_EXCEPTIONS + /*#define try _jpr_Try + #define _CLCATCH _jpr_Catch + #define _CLFINALLY(x) xxxx + #define _CLTHROWA(y) _jpr_Throw + #define _THROWA_DEL(y) _jpr_Throw + #define _RETHROW(x) _jpr_Throw + #define _CLTHROWT(y) _jpr_Throw + + #define _THROWS ,_jpr_Throws*/ +#else + class CLuceneError + { + int error_number; + char* _awhat; + TCHAR* _twhat; + public: + CLuceneError(const CLuceneError& clone); + CLuceneError(int num, const char* str, bool ownstr); +#ifdef _UCS2 + CLuceneError(int num, const TCHAR* str, bool ownstr); +#endif + int number(){return error_number;} + char* what(); + TCHAR* twhat(); + ~CLuceneError() throw(); + }; + + //#define _THROWS //does nothing + #define _CLFINALLY(x) catch(...){ x; throw; } x //note: code x is not run if return is called + #define _CLTHROWA(number, str) throw CLuceneError(number, str,false) + #define _CLTHROWT(number, str) throw CLuceneError(number, str,false) + #define _CLTHROWA_DEL(number, str) throw CLuceneError(number, str,true) //throw a string ensures the value is deleted + #define _CLTHROWT_DEL(number, str) throw CLuceneError(number, str,true) //throw a string ensures the value is deleted + + +#endif //_LUCENE_DISABLE_EXCEPTIONS +// +//////////////////////////////////////////////////////// + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/lucenebase.h b/src/assistant/3rdparty/clucene/src/CLucene/debug/lucenebase.h new file mode 100644 index 000000000..86cdae1c5 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/lucenebase.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_debug_lucenebase_ +#define _lucene_debug_lucenebase_ + +#ifdef _LUCENE_PRAGMA_ONCE +# pragma once +#endif + +CL_NS_DEF(debug) + +//Lucenebase is the superclass of all clucene objects. It provides +//memory debugging tracking and/or reference counting +class LuceneBase{ +public: +#ifdef LUCENE_ENABLE_MEMLEAKTRACKING + static void* operator new (size_t size); + static void operator delete (void *p); + int32_t __cl_initnum; ///< The order that the object was created at. This is then used to do a lookup in the objects list + + static void* operator new (size_t size, char const * file, int32_t line); + static void operator delete (void *p, char const * file, int32_t line); + + static void* __cl_voidpadd(void* data, const char* file, int line, size_t size); ///dummy__see_mem_h_for_details +#endif +#define _CL_POINTER(x) (x==NULL?NULL:(x->__cl_addref()>=0?x:x)) //return a add-ref'd object +#define LUCENE_REFBASE public CL_NS(debug)::LuceneBase //this is the base of classes who *always* need refcounting + +#if defined(_DEBUG) + #if !defined(LUCENE_BASE_CHECK) + #define LUCENE_BASE_CHECK(x) + #endif +#else + #undef LUCENE_BASE_CHECK + #define LUCENE_BASE_CHECK(x) +#endif + +//Macro for creating new arrays +#ifdef LUCENE_ENABLE_MEMLEAKTRACKING + #define _CL_NEWARRAY(type,size) (type*)CL_NS(debug)::LuceneBase::__cl_voidpadd(new type[(size_t)size],__FILE__,__LINE__,(size_t)size); + #define _CLDELETE_ARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__); delete [] x; x=NULL;} + #define _CLDELETE_LARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__);delete [] x;} + #ifndef _CLDELETE_CARRAY + #define _CLDELETE_CARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__);delete [] x; x=NULL;} + #define _CLDELETE_LCARRAY(x) if (x!=NULL){CL_NS(debug)::LuceneBase::__cl_voidpremove((const void*)x,__FILE__,__LINE__);delete [] x;} + #endif +#else + #define _CL_NEWARRAY(type,size) new type[size] + #define _CLDELETE_ARRAY(x) if (x!=NULL){delete [] x; x=NULL;} + #define _CLDELETE_LARRAY(x) if (x!=NULL){delete [] x;} + #ifndef _CLDELETE_CARRAY + #define _CLDELETE_CARRAY(x) if (x!=NULL){delete [] x; x=NULL;} + #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete [] x;} + #endif +#endif +//a shortcut for deleting a carray and all its contents +#define _CLDELETE_CARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE_CARRAY(x[xcda]);}_CLDELETE_ARRAY(x)}; +#define _CLDELETE_ARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE(x[xcda]);}_CLDELETE_ARRAY(x)}; +#ifndef _CLDELETE_CaARRAY + #define _CLDELETE_CaARRAY _CLDELETE_CARRAY + #define _CLDELETE_LCaARRAY _CLDELETE_LCARRAY +#endif + +//Macro for deleting +#ifdef LUCENE_ENABLE_REFCOUNT + #define _CLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } + #define _CLLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } +#else + #define _CLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; x=NULL; } + #define _CLLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; } +#endif + +//_CLDECDELETE deletes objects which are *always* refcounted +#define _CLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } +#define _CLLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } + +//_VDelete should be used for deleting non-clucene objects. +//when using reference counting, _CLDELETE casts the object +//into a LuceneBase*. +#define _CLVDELETE(x) if(x!=NULL){delete x; x=NULL;} + +template +class Array: LUCENE_BASE{ +public: + T* values; + size_t length; + + void deleteAll(){ + for (size_t i=0;ivalues = values; + this->length = length; + } + Array(size_t length){ + this->values = _CL_NEWARRAY(T,length); + this->length = length; + } + ~Array(){} + + const T operator[](size_t _Pos) const + { + if (length <= _Pos){ + _CLTHROWA(CL_ERR_IllegalArgument,"vector subscript out of range"); + } + return (*(values + _Pos)); + } + T operator[](size_t _Pos) + { + if (length <= _Pos){ + _CLTHROWA(CL_ERR_IllegalArgument,"vector subscript out of range"); + } + return (*(values + _Pos)); + } + +}; + +#endif //_lucene_debug_lucenebase_ diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/memtracking.cpp b/src/assistant/3rdparty/clucene/src/CLucene/debug/memtracking.cpp new file mode 100644 index 000000000..544a125a5 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/memtracking.cpp @@ -0,0 +1,371 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CLucene/util/Misc.h" + +bool _lucene_disable_debuglogging = true; //if LUCENE_ENABLE_CONSTRUCTOR_LOG is on, dont do log if this is true +bool _lucene_run_objectcheck = false; //run a memory check before deleting objects +int _lucene_counter_break = -1; //to break at this item, change this + //and put break points at points below + +CL_NS_USE(util) +CL_NS_DEF(debug) + +#ifdef LUCENE_ENABLE_MEMLEAKTRACKING +int32_t _instance_counter = 0; //counter for initnumber + +struct _file{ + int32_t refcount; ///times this has been used + char* value; ///reference to the the basefile +}; //structure for name counting +struct _pointers{ + _file* file; + int32_t initline; + int32_t initnumber; +};//structure for pointer-filename references + +typedef CL_NS(util)::CLSet > defFile; +typedef CL_NS(util)::CLSet,Deletor::Dummy,Deletor::Void<_pointers> > defPointer; +typedef CL_NS(util)::CLSet,Deletor::Dummy,Deletor::Void<_pointers> > defVoid; + +DEFINE_MUTEX(memleak_lock) +defFile LuceneBase_Files(false,true); //list of filenames used +defPointer LuceneBase_Pointers(false,true); //list of pointers counted +defVoid LuceneBase_Voids(false,true); //list of arbitary data added + +//variables to trim filenames to just the base names +char _files_trim_string[CL_MAX_DIR]; +int32_t _files_trim_start=-1; + +//trim the filename and return the refcounted _file* structure +_file* get_file(const char* file){ + if ( _files_trim_start == -1 ){ + //this trims the start of the name file name so + //that the whole of the filename is not stored - more asthetic :) + //need to find the base + _files_trim_start = strlen(__FILE__) - 21; //(length of debug/memtracking.cpp) + strcpy(_files_trim_string,__FILE__); + _files_trim_string[_files_trim_start] = 0; + } + if ( strncmp(file,_files_trim_string,_files_trim_start) == 0 ){ + //this file should be within the same directory area as we found lucenebase.cpp + //to be, lets trim the start + file+=_files_trim_start; + } + + //now return an existing files structure (with refcount++) or create a new one + defFile::iterator itr = LuceneBase_Files.find((const char*)file); + if ( itr != LuceneBase_Files.end() ){ + _file* bf = itr->second; + bf->refcount++; + return bf; + }else{ + _file* ref = new _file; + ref->value = new char[strlen(file)+1]; //cannot use _CL_NEWARRAY otherwise recursion + strcpy(ref->value,file); + + ref->refcount = 1; + LuceneBase_Files.insert(pair(ref->value,ref)); + return ref; + } +} + +void remove_file(_file* bf){ + bf->refcount--; + if ( bf->refcount <= 0 ){ + defFile::iterator fi = LuceneBase_Files.find(bf->value); + CND_PRECONDITION(fi!=LuceneBase_Files.end(),"fi==NULL"); + delete[] bf->value; + LuceneBase_Files.removeitr(fi); + } +} + +#ifdef LUCENE_ENABLE_CONSTRUCTOR_LOG + void constructor_log(const char* type,const char* file,const int line, const int size){ + if ( _lucene_disable_debuglogging ){ + FILE* f = fopen("clucene.log","a"); + char buf[CL_MAX_DIR+5]; + sprintf(buf,"%s,%s,%d,%d\n",type,file,line,size); + fwrite(buf,sizeof(char),strlen(buf),f); + fclose(f); + } + } + #define CONSTRUCTOR_LOG(type,file,line,size) constructor_log(type,file,line,size) +#else + #define CONSTRUCTOR_LOG(type,file,line,size) +#endif + +//////////////////////////////////////////////////////////////////////////////// +// the _CLNEW&_CLDELETE new/delete operators +//////////////////////////////////////////////////////////////////////////////// +void* LuceneBase::operator new (size_t size, const char * file, int32_t line) +{ + SCOPED_LOCK_MUTEX(memleak_lock) + + void* p = malloc (size); + LuceneBase* lb = (LuceneBase*)p; + + //create the pointer struct + _file* br = get_file(file); + _pointers* bp = new _pointers; + bp->file = br; + bp->initnumber = _instance_counter++; + bp->initline = line; + + //associate this object with the pointer + lb->__cl_initnum = bp->initnumber; + + //break if necessary + if ( _lucene_counter_break == lb->__cl_initnum ) + CLDebugBreak(); //put break point here + + //add the pointer object + LuceneBase_Pointers.insert(pair(lb, bp)); + + CONSTRUCTOR_LOG("newobj",file,line,size); + return p; +} +void LuceneBase::operator delete (void *p, char const * file, int32_t line) +{ + SCOPED_LOCK_MUTEX(memleak_lock) + + LuceneBase* lb=(LuceneBase*)p; + + defPointer::iterator itr = LuceneBase_Pointers.find(lb); + if ( itr != LuceneBase_Pointers.end() ){ + _pointers* bp = itr->second; + remove_file(bp->file); + + LuceneBase_Pointers.removeitr(itr); + }else{ + //break + } + free(p); +} + +/////////////////////////////////////////////////////////////////////////// +// the generic new/delete operators +/////////////////////////////////////////////////////////////////////////// +void* LuceneBase::operator new (size_t size) +{ + SCOPED_LOCK_MUTEX(memleak_lock) + + void* p = malloc (size); + LuceneBase* lb = (LuceneBase*)p; + + //create the pointer struct + _file* br = get_file("undefined"); + _pointers* bp = new _pointers; + bp->file = br; + bp->initnumber = _instance_counter++; + bp->initline = -1; + + //associate this object with the pointer + lb->__cl_initnum = bp->initnumber; + + //break if necessary + if ( _lucene_counter_break == lb->__cl_initnum ) + CLDebugBreak(); + + //add the pointer object + LuceneBase_Pointers.insert(pair(lb,bp)); + + CONSTRUCTOR_LOG("newobj","unknown",-1,size); + return p; +} +void LuceneBase::operator delete (void *p) +{ + SCOPED_LOCK_MUTEX(memleak_lock) + + LuceneBase* lb=(LuceneBase*)p; + + defPointer::iterator itr = LuceneBase_Pointers.find(lb); + if ( itr != LuceneBase_Pointers.end() ){ + _pointers* bp = itr->second; + remove_file(bp->file); + LuceneBase_Pointers.removeitr(itr); + }else{ + CLDebugBreak(); + } + free(p); +} + +/////////////////////////////////////////////////////////////////////////// +// other memtracking functions +/////////////////////////////////////////////////////////////////////////// +void LuceneBase::__cl_unregister(const void* obj){ + SCOPED_LOCK_MUTEX(memleak_lock) + + LuceneBase* lb=(LuceneBase*)obj; + defPointer::iterator itr = LuceneBase_Pointers.find(lb); + CND_PRECONDITION(itr != LuceneBase_Pointers.end(),"__cl_unregister object not found"); + _pointers* bp = itr->second; + LuceneBase_Pointers.removeitr(itr); +} + +void* LuceneBase::__cl_voidpadd(void* data, const char* file, int line,size_t size){ + SCOPED_LOCK_MUTEX(memleak_lock) + + _file* br = get_file(file); + _pointers* bp = new _pointers; + bp->file = br; + bp->initnumber = _instance_counter++; + bp->initline = line; + + LuceneBase_Voids.insert(pair(data,bp)); + CONSTRUCTOR_LOG("newarr",file,line,size); + return data; +} +void LuceneBase::__cl_voidpremove(const void* data, const char* file, int line){ + SCOPED_LOCK_MUTEX(memleak_lock) + defVoid::iterator itr = LuceneBase_Voids.find(data); + if ( itr != LuceneBase_Voids.end() ){ + _pointers* bp = itr->second; + remove_file(bp->file); + LuceneBase_Voids.removeitr(itr); + }else{ + printf("Data deleted when not added with _CL_NEWARRAY in %s at %d\n",file,line); + } +} + + +//////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////// +//The lucene base memory leak printout functions +//////////////////////////////////////////////////////////// +//static +void __internalcl_PrintUnclosedObject(bool isObject, string& sb,_pointers* bp,_file* bf, bool print){ + TCHAR ttmp[100]; + char atmp[100]; + + sb.append(" "); + { + _i64tot(bp->initnumber,ttmp,10); + STRCPY_TtoA(atmp,ttmp,100); + sb.append(atmp); + } + if ( isObject ){ + sb.append("(obj). "); + }else{ + sb.append(". "); + } + sb.append(bf->value); + sb.append(", line "); + { + _i64tot(bp->initline,ttmp,10); + STRCPY_TtoA(atmp,ttmp,100); + sb.append(atmp); + } + sb.append("\n"); + + if ( print && sb.length() > 0 ){ + printf("%s\n", sb.c_str()); + sb = ""; + } +} +char* __internalcl_GetUnclosedObjects(bool print){ + TCHAR ttmp[100]; + char atmp[100]; + SCOPED_LOCK_MUTEX(memleak_lock) + + string sb; + bool unknowns = false; + if ( LuceneBase_Pointers.size() > 0 ){ + { + _i64tot(LuceneBase_Pointers.size(),ttmp,10); + STRCPY_TtoA(atmp,ttmp,100); + sb.append(atmp); + } + sb.append(" clucene objects are still open\n"); + + defPointer::iterator itr = LuceneBase_Pointers.begin(); + while ( itr != LuceneBase_Pointers.end() ){ + _pointers* bp = itr->second; + _file* bf = bp->file; + + if ( bp->initline == -1 ) + unknowns = true; + __internalcl_PrintUnclosedObject(true, sb,bp,bf,print); + + ++itr; + } + + defVoid::iterator itr2 = LuceneBase_Voids.begin(); + while ( itr2 != LuceneBase_Voids.end() ){ + _pointers* bp = itr2->second; + _file* bf = bp->file; + + if ( bp->initline == -1 ) + unknowns = true; + __internalcl_PrintUnclosedObject(false, sb,bp,bf,print); + + itr2++; + } + } + + if ( unknowns == true ){ + sb.append("*** Some memory was not created with _CLNEW and was not tracked... ***\n"); + sb.append("*** Use _CLNEW instead of new when creating CLucene objects ***\n"); + sb.append("*** Memory may also have not been freed in the current context ***\n"); + } + + if ( print ){ + if ( sb.length() > 0 ){ + printf("%s\n", sb.c_str()); + sb = ""; + } + return NULL; + }else{ + if ( sb.length() > 0 ) + return STRDUP_AtoA(sb.c_str()); + else + return NULL; + } +} + +void LuceneBase::__cl_ClearMemory(){ + SCOPED_LOCK_MUTEX(memleak_lock) + + while ( LuceneBase_Files.size() > 0 ){ + defFile::iterator fi = LuceneBase_Files.begin(); + _file* f = fi->second; + delete[] f->value; + LuceneBase_Files.removeitr (fi); + } + LuceneBase_Pointers.clear(); + LuceneBase_Voids.clear(); +} +char* LuceneBase::__cl_GetUnclosedObjects(){ + return __internalcl_GetUnclosedObjects(false); +} +//static +int32_t LuceneBase::__cl_GetUnclosedObjectsCount(){ + return LuceneBase_Pointers.size(); +} + +const char* LuceneBase::__cl_GetUnclosedObject(int32_t item){ + SCOPED_LOCK_MUTEX(memleak_lock) + + defPointer::iterator itr=LuceneBase_Pointers.begin(); + int32_t i=0; + for ( ;itr!=LuceneBase_Pointers.end() && isecond->file->value; + else + return NULL; +} +void LuceneBase::__cl_PrintUnclosedObjects(){ + __internalcl_GetUnclosedObjects(true); +} +//////////////////////////////////////////////////////////// + +#endif //LUCENE_ENABLE_MEMLEAKTRACKING +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/document/DateField.cpp b/src/assistant/3rdparty/clucene/src/CLucene/document/DateField.cpp new file mode 100644 index 000000000..ff72b12bb --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/document/DateField.cpp @@ -0,0 +1,60 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +#include "DateField.h" +#include "CLucene/util/Misc.h" +CL_NS_USE(util) +CL_NS_DEF(document) + +DateField::~DateField(){ +} + +TCHAR* DateField::timeToString(const int64_t time) { + TCHAR* buf = _CL_NEWARRAY(TCHAR,DATEFIELD_DATE_LEN + 1); + timeToString(time,buf); + return buf; +} +void DateField::timeToString(const int64_t time, TCHAR* buf) { + CND_PRECONDITION (buf, "buf == NULL"); + *buf = '\0'; + if (time < 0) + _CLTHROWA (CL_ERR_IllegalArgument,"time too early"); //todo: make richer error + + if (time > DATEFIELD_DATE_MAX) + _CLTHROWA (CL_ERR_IllegalArgument, "time too late (past DATEFIELD_DATE_MAX"); //todo: make richer error + + _i64tot(time, buf, 36); + int32_t bufLen = _tcslen(buf); + + CND_PRECONDITION (bufLen <= DATEFIELD_DATE_LEN, "timeToString length is greater than 9"); + + /* Supply leading zeroes if necessary. */ + if (bufLen < DATEFIELD_DATE_LEN) { + const int32_t nMissingZeroes = DATEFIELD_DATE_LEN - bufLen; + /* Move buffer contents forward to make room for leading zeroes. */ + for (int32_t i = DATEFIELD_DATE_LEN - 1; i >= nMissingZeroes; i--) + buf[i] = buf[i - nMissingZeroes]; + + /* Insert leading zeroes. */ + {// MSVC6 scoping fix + for (int32_t i = 0; i < nMissingZeroes; i++) + buf[i] = '0'; + } + + buf[DATEFIELD_DATE_LEN] = 0; + } + + CND_PRECONDITION (_tcslen(buf) == DATEFIELD_DATE_LEN, "timeToString return is not equal to DATEFIELD_DATE_LEN"); +} + +int64_t DateField::stringToTime(const TCHAR* time) { + TCHAR* end; + return _tcstoi64(time, &end, 36); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/document/DateField.h b/src/assistant/3rdparty/clucene/src/CLucene/document/DateField.h new file mode 100644 index 000000000..712fe9b62 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/document/DateField.h @@ -0,0 +1,64 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_document_DateField_ +#define _lucene_document_DateField_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(document) + +//here are some constants used throughout clucene +//make date strings long enough to last a millenium +#define DATEFIELD_DATE_MAX _ILONGLONG(31536000000000) //1000L*365*24*60*60*1000 + +#define DATEFIELD_DATE_LEN 9 ////Long.toString(DATEFIELD_DATE_MAX, Character.MAX_RADIX).length() + +/** +* Provides support for converting dates to strings and vice-versa. +* The strings are structured so that lexicographic sorting orders by date, +* which makes them suitable for use as field values and search terms. +* +*

Note that this class saves dates with millisecond granularity, +* which is bad for {@link RangeQuery} and {@link PrefixQuery}, as those +* queries are expanded to a BooleanQuery with a potentially large number +* of terms when searching. Thus you might want to use +* {@link DateTools} instead. +* +*

+* Note: dates before 1970 cannot be used, and therefore cannot be +* indexed when using this class. See {@link DateTools} for an +* alternative without such a limitation. +* +* @deprecated If you build a new index, use {@link DateTools} instead. This class is included for use with existing +* indices and will be removed in a future release. +*/ +class DateField :LUCENE_BASE { +public: + ~DateField(); + + /** + * Converts a millisecond time to a string suitable for indexing. + * @throws RuntimeException if the time specified in the + * method argument is negative, that is, before 1970 + */ + static TCHAR* timeToString(const int64_t time); + + /** + * Converts a millisecond time to a string suitable for indexing. + * @throws CL_ERR_IllegalArgument if the time specified in the + * method argument is negative, that is, before 1970 + * @param str must be a character array DATEFIELD_DATE_LEN+1 or longer + */ + static void timeToString(const int64_t time, TCHAR* str); + + /** Converts a string-encoded date into a millisecond time. */ + static int64_t stringToTime(const TCHAR* s); +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/document/Document.cpp b/src/assistant/3rdparty/clucene/src/CLucene/document/Document.cpp new file mode 100644 index 000000000..a0ce03942 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/document/Document.cpp @@ -0,0 +1,237 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Document.h" +#include "Field.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(document) + + DocumentFieldEnumeration::DocumentFieldList::DocumentFieldList(Field* f, DocumentFieldList* n ) { + //Func - Constructor + //Pre - f != NULL + // n may be NULL + //Post - Instance has been created + CND_PRECONDITION(f != NULL, "f is NULL"); + + field = f; + next = n; + } + DocumentFieldEnumeration::DocumentFieldList::~DocumentFieldList(){ + //Func - Destructor + //Pre - true + //Post - Instance has been destroyed + + // Instead of recursively deleting the field list we do + // it iteratively to avoid stack overflows when + // dealing with several thousands of fields. + + if (!field) { + return; // nothing to do; deleted by different invocation of dtor + } + + DocumentFieldList* cur = next; + while (cur != NULL) + { + DocumentFieldList* temp = cur->next; + cur->next = NULL; + + _CLDELETE(cur); + cur = temp; + } + _CLDELETE(field); + } + + + DocumentFieldEnumeration::DocumentFieldEnumeration(const DocumentFieldList* fl){ + //Func - Constructor + //Pre - fl may be NULL + //Post - Instance has been created + + fields = fl; + } + + DocumentFieldEnumeration::~DocumentFieldEnumeration(){ + //Func - Destructor + //Pre - true + //Post - Instance has been destroyed + } + + bool DocumentFieldEnumeration::hasMoreElements() const { + return fields == NULL ? false : true; + } + + Field* DocumentFieldEnumeration::nextElement() { + //Func - Return the next element in the enumeration + //Pre - true + //Post - The next element is returned or NULL + + + Field* result = NULL; + //Check if fields is still valid + if (fields){ + result = fields->field; + fields = fields->next; + } + return result; + } + + /** Constructs a new document with no fields. */ + Document::Document(){ + //Func - Constructor + //Pre - true + //Post - Instance has been created + boost = 1.0f; + fieldList = NULL; + } + + Document::~Document(){ + //Func - Destructor + //Pre - true + //Post - Instance has been destroyed + boost = 1.0f; + _CLDELETE(fieldList); + } + + void Document::clear(){ + _CLDELETE(fieldList); + } + + void Document::add(Field& field) { + fieldList = _CLNEW DocumentFieldEnumeration::DocumentFieldList(&field, fieldList); + } + + void Document::setBoost(qreal boost) { + this->boost = boost; + } + + qreal Document::getBoost() const { + return boost; + } + + + Field* Document::getField(const TCHAR* name) const{ + CND_PRECONDITION(name != NULL, "name is NULL"); + + for (DocumentFieldEnumeration::DocumentFieldList* list = fieldList; list != NULL; list = list->next) + //cannot use interning here, because name is probably not interned + if ( _tcscmp(list->field->name(), name) == 0 ){ + return list->field; + } + + return NULL; + } + + const TCHAR* Document::get(const TCHAR* field) const { + CND_PRECONDITION(field != NULL, "field is NULL"); + Field *f = getField(field); + if (f!=NULL) + return f->stringValue(); //this returns null it is a binary(reader) + else + return NULL; + } + + DocumentFieldEnumeration* Document::fields() const { + return _CLNEW DocumentFieldEnumeration(fieldList); + } + + + TCHAR* Document::toString() const { + StringBuffer ret(_T("Document<")); + for (DocumentFieldEnumeration::DocumentFieldList* list = fieldList; list != NULL; list = list->next) { + TCHAR* tmp = list->field->toString(); + ret.append( tmp ); + if (list->next != NULL) + ret.append(_T(" ")); + _CLDELETE_ARRAY( tmp ); + } + ret.append(_T(">")); + return ret.toString(); + } + + + + void Document::removeField(const TCHAR* name) { + CND_PRECONDITION(name != NULL, "name is NULL"); + + DocumentFieldEnumeration::DocumentFieldList* previous = NULL; + DocumentFieldEnumeration::DocumentFieldList* current = fieldList; + while (current != NULL) { + //cannot use interning here, because name is probably not interned + if ( _tcscmp(current->field->name(),name) == 0 ){ + if (previous){ + previous->next = current->next; + }else + fieldList = current->next; + current->next=NULL; //ensure fieldlist destructor doesnt delete it + _CLDELETE(current); + return; + } + previous = current; + current = current->next; + } + } + + void Document::removeFields(const TCHAR* name) { + CND_PRECONDITION(name != NULL, "name is NULL"); + + DocumentFieldEnumeration::DocumentFieldList* previous = NULL; + DocumentFieldEnumeration::DocumentFieldList* current = fieldList; + while (current != NULL) { + //cannot use interning here, because name is probably not interned + if ( _tcscmp(current->field->name(),name) == 0 ){ + if (previous){ + previous->next = current->next; + }else + fieldList = current->next; + + current->next=NULL; //ensure fieldlist destructor doesnt delete it + _CLDELETE(current); + + if ( previous ) + current = previous->next; + else + current = fieldList; + }else{ + previous = current; + current = current->next; + } + } + } + + TCHAR** Document::getValues(const TCHAR* name) { + DocumentFieldEnumeration* it = fields(); + int32_t count = 0; + while ( it->hasMoreElements() ){ + Field* f = it->nextElement(); + //cannot use interning here, because name is probably not interned + if ( _tcscmp(f->name(),name) == 0 && f->stringValue() != NULL ) + count++; + } + _CLDELETE(it); + it = fields(); + + //todo: there must be a better way of doing this, we are doing two iterations of the fields + TCHAR** ret = NULL; + if ( count > 0 ){ + //start again + ret = _CL_NEWARRAY(TCHAR*,count+1); + int32_t i=0; + while ( it->hasMoreElements() ){ + Field* fld=it->nextElement(); + if ( _tcscmp(fld->name(),name)== 0 && fld->stringValue() != NULL ){ + ret[i] = stringDuplicate(fld->stringValue()); + i++; + } + } + ret[count]=NULL; + } + _CLDELETE(it); + return ret; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/document/Document.h b/src/assistant/3rdparty/clucene/src/CLucene/document/Document.h new file mode 100644 index 000000000..ba7a283f7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/document/Document.h @@ -0,0 +1,158 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_document_Document_ +#define _lucene_document_Document_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Field.h" + +///todo: jlucene has change from using DocumentFieldList/Enumeration +///to using a java List... do we want to do this too? +CL_NS_DEF(document) + +class Document; //predefine +class DocumentFieldEnumeration :LUCENE_BASE{ + class DocumentFieldList :LUCENE_BASE{ + public: + DocumentFieldList(Field* f, DocumentFieldList* n); + ~DocumentFieldList(); + Field* field; + DocumentFieldList* next; + }; + friend class Document; +private: + const DocumentFieldList* fields; +public: + DocumentFieldEnumeration(const DocumentFieldList* fl); + ~DocumentFieldEnumeration(); + bool hasMoreElements() const; + Field* nextElement(); +}; + +/** Documents are the unit of indexing and search. +* +* A Document is a set of fields. Each field has a name and a textual value. +* A field may be {@link Field#isStored() stored} with the document, in which +* case it is returned with search hits on the document. Thus each document +* should typically contain one or more stored fields which uniquely identify +* it. +* +*

Note that fields which are not {@link Field#isStored() stored} are +* not available in documents retrieved from the index, e.g. with {@link +* Hits#doc(int32_t, Document*)}, {@link Searcher#doc(int32_t, Document*)} or {@link +* IndexReader#document(int32_t, Document*)}. +*/ +class Document:LUCENE_BASE { +private: + DocumentFieldEnumeration::DocumentFieldList* fieldList; + qreal boost; +public: + Document(); + ~Document(); + + /** + *

Adds a field to a document. Several fields may be added with + * the same name. In this case, if the fields are indexed, their text is + * treated as though appended for the purposes of search.

+ *

Note that add like the removeField(s) methods only makes sense + * prior to adding a document to an index. These methods cannot + * be used to change the content of an existing index! In order to achieve this, + * a document has to be deleted from an index and a new changed version of that + * document has to be added.

+ * + */ + void add(Field& field); + /** Returns a field with the given name if any exist in this document, or + * null. If multiple fields exists with this name, this method returns the + * first value added. + * Note: name is case sensitive + */ + Field* getField(const TCHAR* name) const; + + /** Returns the string value of the field with the given name if any exist in + * this document, or null. If multiple fields exist with this name, this + * method returns the first value added. If only binary fields with this name + * exist, returns null. + * Note: name is case sensitive + */ + const TCHAR* get(const TCHAR* field) const; + + /** Returns an Enumeration of all the fields in a document. */ + DocumentFieldEnumeration* fields() const; + /** Prints the fields of a document for human consumption. */ + TCHAR* toString() const; + + /** Sets a boost factor for hits on any field of this document. This value + * will be multiplied into the score of all hits on this document. + * + *

Values are multiplied into the value of {@link Field#getBoost()} of + * each field in this document. Thus, this method in effect sets a default + * boost for the fields of this document. + * + * @see Field#setBoost(qreal) + */ + void setBoost(qreal boost); + + /** Returns the boost factor for hits on any field of this document. + * + *

The default value is 1.0. + * + *

Note: This value is not stored directly with the document in the index. + * Documents returned from {@link IndexReader#document(int32_t, Document*)} and + * {@link Hits#doc(int32_t, Document*)} may thus not have the same value present as when + * this document was indexed. + * + * @see #setBoost(qreal) + */ + qreal getBoost() const; + + + /** + *

Removes field with the specified name from the document. + * If multiple fields exist with this name, this method removes the first field that has been added. + * If there is no field with the specified name, the document remains unchanged.

+ *

Note that the removeField(s) methods like the add method only make sense + * prior to adding a document to an index. These methods cannot + * be used to change the content of an existing index! In order to achieve this, + * a document has to be deleted from an index and a new changed version of that + * document has to be added.

+ * Note: name is case sensitive + */ + void removeField(const TCHAR* name); + + /** + *

Removes all fields with the given name from the document. + * If there is no field with the specified name, the document remains unchanged.

+ *

Note that the removeField(s) methods like the add method only make sense + * prior to adding a document to an index. These methods cannot + * be used to change the content of an existing index! In order to achieve this, + * a document has to be deleted from an index and a new changed version of that + * document has to be added.

+ * Note: name is case sensitive + */ + void removeFields(const TCHAR* name); + + /** + * Returns an array of values of the field specified as the method parameter. + * This method can return null. + * Note: name is case sensitive + * + * @param name the name of the field + * @return a String[] of field values + */ + TCHAR** getValues(const TCHAR* name); + + /** + * Empties out the document so that it can be reused + */ + void clear(); +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/document/Field.cpp b/src/assistant/3rdparty/clucene/src/CLucene/document/Field.cpp new file mode 100644 index 000000000..8cd88a36b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/document/Field.cpp @@ -0,0 +1,315 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CLucene/util/Reader.h" +#include "Field.h" +#include "CLucene/util/Misc.h" +#include "CLucene/util/StringIntern.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(document) + +Field::Field(const TCHAR* Name, const TCHAR* String, bool store, bool index, bool token, const bool storeTermVector) +{ +//Func - Constructor +//Pre - Name != NULL and contains the name of the field +// String != NULL and contains the value of the field +// store indicates if the field must be stored +// index indicates if the field must be indexed +// token indicates if the field must be tokenized +//Post - The instance has been created + + CND_PRECONDITION(Name != NULL, "Name is NULL"); + CND_PRECONDITION(String != NULL,"String is NULL"); + CND_PRECONDITION(!(!index && storeTermVector),"cannot store a term vector for fields that are not indexed."); + + _name = CLStringIntern::intern( Name CL_FILELINE); + _stringValue = stringDuplicate( String ); + _readerValue = NULL; + _streamValue = NULL; + boost=1.0f; + omitNorms = false; + + int cfg = 0; + if ( store ) + cfg |= STORE_YES; + if ( index && token ) + cfg |= INDEX_TOKENIZED; + else if ( index && !token ) + cfg |= INDEX_UNTOKENIZED; + + if ( storeTermVector ) + _CLTHROWA(CL_ERR_IllegalArgument,"Stored term vector is deprecated with using this constructor"); + + setConfig(cfg); +} + +Field::Field(const TCHAR* Name, Reader* reader, bool store, bool index, bool token, const bool storeTermVector) +{ +//Func - Constructor +//Pre - Name != NULL and contains the name of the field +// reader != NULL and contains a Reader +// store indicates if the field must be stored +// index indicates if the field must be indexed +// token indicates if the field must be tokenized +//Post - The instance has been created + + CND_PRECONDITION(Name != NULL, "Name is NULL"); + CND_PRECONDITION(reader != NULL, "reader is NULL"); + + _name = CLStringIntern::intern( Name CL_FILELINE); + _stringValue = NULL; + _readerValue = reader; + _streamValue = NULL; + boost=1.0f; + omitNorms = false; + + int cfg = 0; + if ( store ) + cfg |= STORE_YES; + if ( index && token ) + cfg |= INDEX_TOKENIZED; + else if ( index && !token ) + cfg |= INDEX_UNTOKENIZED; + + if ( storeTermVector ) + _CLTHROWA(CL_ERR_IllegalArgument,"Stored term vector is deprecated with using this constructor"); + + setConfig(cfg); +} + +Field::Field(const TCHAR* Name, Reader* reader, int config) +{ + CND_PRECONDITION(Name != NULL, "Name is NULL"); + CND_PRECONDITION(reader != NULL, "reader is NULL"); + + _name = CLStringIntern::intern( Name CL_FILELINE); + _stringValue = NULL; + _readerValue = reader; + _streamValue = NULL; + boost=1.0f; + omitNorms = false; + + setConfig(config); +} + + +Field::Field(const TCHAR* Name, const TCHAR* Value, int config) +{ + CND_PRECONDITION(Name != NULL, "Name is NULL"); + CND_PRECONDITION(Value != NULL, "value is NULL"); + + _name = CLStringIntern::intern( Name CL_FILELINE); + _stringValue = stringDuplicate( Value ); + _readerValue = NULL; + _streamValue = NULL; + boost=1.0f; + omitNorms = false; + + setConfig(config); +} + +Field::Field(const TCHAR* Name, jstreams::StreamBase* Value, int config) +{ + CND_PRECONDITION(Name != NULL, "Name is NULL"); + CND_PRECONDITION(Value != NULL, "value is NULL"); + + _name = CLStringIntern::intern( Name CL_FILELINE); + _stringValue = NULL; + _readerValue = NULL; + _streamValue = Value; + boost=1.0f; + omitNorms = false; + + setConfig(config); +} + +Field::~Field(){ +//Func - Destructor +//Pre - true +//Post - Instance has been destroyed + + CLStringIntern::unintern(_name); + _CLDELETE_CARRAY(_stringValue); + _CLDELETE(_readerValue); + _CLVDELETE( _streamValue ); +} + + +/*===============FIELDS=======================*/ +const TCHAR* Field::name() { return _name; } ///* Field::streamValue() { return _streamValue; } ///omitNorms=omitNorms; } + +void Field::setBoost(qreal boost) { this->boost = boost; } +qreal Field::getBoost() { return boost; } + +void Field::setConfig(int x){ + int newConfig=0; + + //set storage settings + if ( (x & STORE_YES) || (x & STORE_COMPRESS) ){ + newConfig |= STORE_YES; + if ( x & STORE_COMPRESS ) + newConfig |= STORE_COMPRESS; + }else + newConfig |= STORE_NO; + + if ( (x & INDEX_NO)==0 ){ + bool index=false; + + if ( x & INDEX_NONORMS ){ + newConfig |= INDEX_NONORMS; + index = true; + } + + if ( x & INDEX_TOKENIZED && x & INDEX_UNTOKENIZED ) + _CLTHROWA(CL_ERR_IllegalArgument,"it doesn't make sense to have an untokenised and tokenised field"); + if ( x & INDEX_TOKENIZED ){ + newConfig |= INDEX_TOKENIZED; + index = true; + } + if ( x & INDEX_UNTOKENIZED ){ + newConfig |= INDEX_UNTOKENIZED; + index = true; + } + if ( !index ) + newConfig |= INDEX_NO; + }else + newConfig |= INDEX_NO; + + if ( newConfig & INDEX_NO && newConfig & STORE_NO ) + _CLTHROWA(CL_ERR_IllegalArgument,"it doesn't make sense to have a field that is neither indexed nor stored"); + + //set termvector settings + if ( (x & TERMVECTOR_NO) == 0 ){ + bool termVector=false; + if ( x & TERMVECTOR_YES ){ + termVector=true; + } + if ( x & TERMVECTOR_WITH_OFFSETS ){ + newConfig |= TERMVECTOR_WITH_OFFSETS; + termVector=true; + } + if ( x & TERMVECTOR_WITH_POSITIONS ){ + newConfig |= TERMVECTOR_WITH_POSITIONS; + termVector=true; + } + if ( termVector ){ + if ( newConfig & INDEX_NO ) + _CLTHROWA(CL_ERR_IllegalArgument,"cannot store a term vector for fields that are not indexed."); + + newConfig |= TERMVECTOR_YES; + }else + newConfig |= TERMVECTOR_NO; + }else + newConfig |= TERMVECTOR_NO; + + config = newConfig; +} + +TCHAR* Field::toString() { + CL_NS(util)::StringBuffer result; + if (isStored()) { + result.append( _T("stored") ); + } + if (isIndexed()) { + if (result.length() > 0) + result.append( _T(",") ); + result.append( _T("indexed") ); + } + if (isTokenized()) { + if (result.length() > 0) + result.append( _T(",") ); + result.append( _T("tokenized") ); + } + if (isTermVectorStored()) { + if (result.length() > 0) + result.append( _T(",") ); + result.append( _T("termVector") ); + } + if (isStoreOffsetWithTermVector()) { + if (result.length() > 0) + result.appendChar( ',' ); + result.append( _T("termVectorOffsets") ); + } + if (isStorePositionWithTermVector()) { + if (result.length() > 0) + result.appendChar( ',' ); + result.append( _T("termVectorPosition") ); + } + if (isBinary()) { + if (result.length() > 0) + result.appendChar( ',' ); + result.append( _T("binary") ); + } + if (getOmitNorms()) { + result.append( _T(",omitNorms") ); + } + result.appendChar('<'); + result.append(name()); + result.appendChar(':'); + + if (_stringValue != NULL) + result.append(_stringValue); + else if ( _readerValue != NULL ) + result.append( _T("Reader") ); + else if ( _streamValue != NULL ) + result.append( _T("Stream") ); + else + result.append( _T("NULL") ); + + result.appendChar('>'); + return result.toString(); +} + + +Field* Field::Keyword(const TCHAR* Name, const TCHAR* Value) { + return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_UNTOKENIZED); +} + +Field* Field::UnIndexed(const TCHAR* Name, const TCHAR* Value) { + return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_NO); +} + +Field* Field::Text(const TCHAR* Name, const TCHAR* Value, const bool storeTermVector) { + if ( storeTermVector ) + return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_TOKENIZED | Field::TERMVECTOR_YES); + else + return _CLNEW Field(Name,Value,Field::STORE_YES | Field::INDEX_TOKENIZED); +} + +Field* Field::UnStored(const TCHAR* Name, const TCHAR* Value, const bool storeTermVector) { + if ( storeTermVector ) + return _CLNEW Field(Name,Value,Field::STORE_NO | Field::INDEX_TOKENIZED | Field::TERMVECTOR_YES); + else + return _CLNEW Field(Name,Value,Field::STORE_NO | Field::INDEX_TOKENIZED); +} + +Field* Field::Text(const TCHAR* Name, Reader* Value, const bool storeTermVector) { + if ( storeTermVector ) + return _CLNEW Field(Name,Value,Field::INDEX_TOKENIZED | Field::TERMVECTOR_YES); + else + return _CLNEW Field(Name,Value,Field::INDEX_TOKENIZED); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/document/Field.h b/src/assistant/3rdparty/clucene/src/CLucene/document/Field.h new file mode 100644 index 000000000..771a1382b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/document/Field.h @@ -0,0 +1,261 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_document_Field_ +#define _lucene_document_Field_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/Reader.h" +#include "CLucene/util/streambase.h" + +CL_NS_DEF(document) +/** +A field is a section of a Document. Each field has two parts, a name and a +value. Values may be free text, provided as a String or as a Reader, or they +may be atomic keywords, which are not further processed. Such keywords may +be used to represent dates, urls, etc. Fields are optionally stored in the +index, so that they may be returned with hits on the document. + +PORTING: CLucene doesn't directly support compressed fields. However, it is easy +to reproduce this functionality by using the GZip streams in the contrib package. +Also note that binary fields are not read immediately in CLucene, a substream +is pointed directly to the field's data, in affect creating a lazy load ability. +This means that large fields are best saved in binary format (even if they are +text), so that they can be loaded lazily. +*/ +class Field :LUCENE_BASE{ +private: + const TCHAR* _name; + TCHAR* _stringValue; + CL_NS(util)::Reader* _readerValue; + jstreams::StreamBase* _streamValue; + + int config; + qreal boost; + bool omitNorms; +public: + enum Store{ + /** Store the original field value in the index. This is useful for short texts + * like a document's title which should be displayed with the results. The + * value is stored in its original form, i.e. no analyzer is used before it is + * stored. + */ + STORE_YES=1, + /** Do not store the field value in the index. */ + STORE_NO=2, + + /** Store the original field value in the index in a compressed form. This is + * useful for long documents and for binary valued fields. + * NOTE: CLucene does not directly support compressed fields, to store a + * compressed field. + * //TODO: need better documentation on how to add a compressed field + * //because actually we still need to write a GZipOutputStream... + */ + STORE_COMPRESS=4 + }; + + enum Index{ + /** Do not index the field value. This field can thus not be searched, + * but one can still access its contents provided it is + * {@link Field::Store stored}. */ + INDEX_NO=16, + /** Index the field's value so it can be searched. An Analyzer will be used + * to tokenize and possibly further normalize the text before its + * terms will be stored in the index. This is useful for common text. + */ + INDEX_TOKENIZED=32, + /** Index the field's value without using an Analyzer, so it can be searched. + * As no analyzer is used the value will be stored as a single term. This is + * useful for unique Ids like product numbers. + */ + INDEX_UNTOKENIZED=64, + /** Index the field's value without an Analyzer, and disable + * the storing of norms. No norms means that index-time boosting + * and field length normalization will be disabled. The benefit is + * less memory usage as norms take up one byte per indexed field + * for every document in the index. + */ + INDEX_NONORMS=128 + }; + + enum TermVector{ + /** Do not store term vectors. */ + TERMVECTOR_NO=256, + /** Store the term vectors of each document. A term vector is a list + * of the document's terms and their number of occurences in that document. */ + TERMVECTOR_YES=512, + /** + * Store the term vector + token position information + * + * @see #YES + */ + TERMVECTOR_WITH_POSITIONS=1024, + /** + * Store the term vector + Token offset information + * + * @see #YES + */ + TERMVECTOR_WITH_OFFSETS=2048 + }; + + _CL_DEPRECATED( another overload ) Field(const TCHAR* name, const TCHAR* value, bool store, bool index, bool token, const bool storeTermVector=false); + _CL_DEPRECATED( another overload ) Field(const TCHAR* name, CL_NS(util)::Reader* reader, bool store, bool index, bool token, const bool storeTermVector=false); + + Field(const TCHAR* name, const TCHAR* value, int configs); + Field(const TCHAR* name, CL_NS(util)::Reader* reader, int configs); + Field(const TCHAR* name, jstreams::StreamBase* stream, int configs); + ~Field(); + + /** Constructs a String-valued Field that is not tokenized, but is indexed + * and stored. Useful for non-text fields, e.g. date or url. + * @deprecated Use new Field(name,value,Field::STORE_YES | Field::INDEX_UNTOKENIZED) + */ + _CL_DEPRECATED( new Field(*) ) static Field* Keyword(const TCHAR* name, const TCHAR* value); + + /** Constructs a String-valued Field that is not tokenized nor indexed, + * but is stored in the index, for return with hits. + * @deprecated Use new Field(name,value,Field::STORE_YES | Field::INDEX_NO) + */ + _CL_DEPRECATED( new Field(*) ) static Field* UnIndexed(const TCHAR* name, const TCHAR* value); + + /** Constructs a String-valued Field that is tokenized and indexed, + * and is stored in the index, for return with hits. Useful for short text + * fields, like "title" or "subject". + * @deprecated Use new Field(name,value,Field::STORE_YES | Field::INDEX_TOKENIZED) + */ + _CL_DEPRECATED( new Field(*) ) static Field* Text(const TCHAR* name, const TCHAR* value, const bool storeTermVector=false); + + /** Constructs a String-valued Field that is tokenized and indexed, + * but that is not stored in the index. + * @deprecated Use new Field(name,value,Field::STORE_NO | Field::INDEX_TOKENIZED) + */ + _CL_DEPRECATED( new Field(*) ) static Field* UnStored(const TCHAR* name, const TCHAR* value, const bool storeTermVector=false); + + /** Constructs a Reader-valued Field that is tokenized and indexed, but is + * *not* stored in the index verbatim. Useful for longer text fields, like + * "body". + * @deprecated Use new Field(name,value, Field::INDEX_TOKENIZED) + */ + _CL_DEPRECATED( new Field(*) ) static Field* Text(const TCHAR* name, CL_NS(util)::Reader* value, const bool storeTermVector=false); + + /** The name of the field (e.g., "date", "subject", "title", "body", etc.) + * as an interned string. */ + const TCHAR* name(); ///* streamValue(); + + // True iff the value of the field is to be stored in the index for return + // with search hits. It is an error for this to be true if a field is + // Reader-valued. + bool isStored(); + + // True iff the value of the field is to be indexed, so that it may be + // searched on. + bool isIndexed(); + + // True iff the value of the field should be tokenized as text prior to + // indexing. Un-tokenized fields are indexed as a single word and may not be + // Reader-valued. + bool isTokenized(); + + /** True if the value of the field is stored and compressed within the index + * NOTE: CLucene does not actually support compressed fields, Instead, a reader + * will be returned with a pointer to a SubIndexInputStream. A GZipInputStream + * and a UTF8 reader must be used to actually read the content. This flag + * will only be set if the index was created by another lucene implementation. + */ + bool isCompressed(); + + //Set configs using XOR. This resets all the settings + //For example, to use term vectors with positions and offsets do: + //object->setConfig(TERMVECTOR_WITH_POSITIONS | TERMVECTOR_WITH_OFFSETS); + void setConfig(int termVector); + + /** True iff the term or terms used to index this field are stored as a term + * vector, available from {@link IndexReader#getTermFreqVector(int32_t,TCHAR*)}. + * These methods do not provide access to the original content of the field, + * only to terms used to index it. If the original content must be + * preserved, use the stored attribute instead. + * + * @see IndexReader#getTermFreqVector(int32_t, String) + */ + bool isTermVectorStored(); + + /** + * True iff terms are stored as term vector together with their offsets + * (start and end positon in source text). + */ + bool isStoreOffsetWithTermVector(); + + /** + * True iff terms are stored as term vector together with their token positions. + */ + bool isStorePositionWithTermVector(); + + /** Returns the boost factor for hits for this field. + * + *

The default value is 1.0. + * + *

Note: this value is not stored directly with the document in the index. + * Documents returned from {@link IndexReader#document(int)} and + * {@link Hits#doc(int)} may thus not have the same value present as when + * this field was indexed. + * + * @see #setBoost(float) + */ + qreal getBoost(); + + /** Sets the boost factor hits on this field. This value will be + * multiplied into the score of all hits on this field of this document. + * + *

The boost is multiplied by {@link Document#getBoost()} of the document + * containing this field. If a document has multiple fields with the same + * name, all such values are multiplied together. This product is then + * multipled by the value {@link Similarity#lengthNorm(String,int)}, and + * rounded by {@link Similarity#encodeNorm(float)} before it is stored in the + * index. One should attempt to ensure that this product does not overflow + * the range of that encoding. + * + * @see Document#setBoost(float) + * @see Similarity#lengthNorm(String, int) + * @see Similarity#encodeNorm(float) + */ + void setBoost(qreal value); + + /** True iff the value of the filed is stored as binary */ + bool isBinary(); + + /** True if norms are omitted for this indexed field */ + bool getOmitNorms(); + + /** Expert: + * + * If set, omit normalization factors associated with this indexed field. + * This effectively disables indexing boosts and length normalization for this field. + */ + void setOmitNorms(bool omitNorms); + + // Prints a Field for human consumption. + TCHAR* toString(); +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp new file mode 100644 index 000000000..efa0e2563 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.cpp @@ -0,0 +1,380 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CompoundFile.h" +#include "CLucene/util/Misc.h" + +CL_NS_USE(store) +CL_NS_USE(util) +CL_NS_DEF(index) + +CompoundFileReader::CSIndexInput::CSIndexInput(CL_NS(store)::IndexInput* base, + const int64_t fileOffset, const int64_t length) +{ + this->base = base; + this->fileOffset = fileOffset; + this->_length = length; +} + +void CompoundFileReader::CSIndexInput::readInternal(uint8_t* b, const int32_t len) +{ + SCOPED_LOCK_MUTEX(base->THIS_LOCK) + + int64_t start = getFilePointer(); + if(start + len > _length) + _CLTHROWA(CL_ERR_IO, "read past EOF"); + base->seek(fileOffset + start); + base->readBytes(b, len); +} + +CompoundFileReader::CSIndexInput::~CSIndexInput() +{ +} + +IndexInput* CompoundFileReader::CSIndexInput::clone() const +{ + return _CLNEW CSIndexInput(*this); +} + +CompoundFileReader::CSIndexInput::CSIndexInput(const CSIndexInput& clone) + : BufferedIndexInput(clone) +{ + this->base = clone.base; //no need to clone this.. + this->fileOffset = clone.fileOffset; + this->_length = clone._length; +} + +void CompoundFileReader::CSIndexInput::close() +{ +} + +CompoundFileReader::CompoundFileReader(Directory* dir, const QString& name) + : entries(false, true) +{ + directory = dir; + fileName = name; + + bool success = false; + try { + stream = dir->openInput(name); + + // read the directory and init files + int32_t count = stream->readVInt(); + FileEntry* entry = NULL; + TCHAR tid[CL_MAX_PATH]; + for (int32_t i = 0; i < count; i++) { + int64_t offset = stream->readLong(); + int32_t read = stream->readString(tid, CL_MAX_PATH); + QString aid(QString::fromWCharArray(tid, read)); + + // set length of the previous entry + if (entry != NULL) + entry->length = offset - entry->offset; + + entry = _CLNEW FileEntry(offset); + entries.put(aid, entry); + } + + // set the length of the final entry + if (entry != NULL) + entry->length = stream->length() - entry->offset; + success = true; + } _CLFINALLY ( + if (!success && (stream != NULL)) { + try { + stream->close(); + _CLDELETE(stream); + } catch (CLuceneError& err) { + if (err.number() != CL_ERR_IO) + throw err; + } + } + ) +} + +CompoundFileReader::~CompoundFileReader() +{ + close(); +} + +Directory* CompoundFileReader::getDirectory() +{ + return directory; +} + +QString CompoundFileReader::getName() const +{ + return fileName; +} + +void CompoundFileReader::close() +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + + if (stream != NULL) { + entries.clear(); + stream->close(); + _CLDELETE(stream); + } +} + +IndexInput* CompoundFileReader::openInput(const QString& id) +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + + if (stream == NULL) + _CLTHROWA(CL_ERR_IO, "Stream closed"); + + const FileEntry* entry = entries.get(id); + if (entry == NULL) { + char buf[CL_MAX_PATH + 30]; + strcpy(buf,"No sub-file with id "); + strncat(buf, id.toLocal8Bit().constData(), CL_MAX_PATH); + strcat(buf, " found"); + _CLTHROWA(CL_ERR_IO,buf); + } + return _CLNEW CSIndexInput(stream, entry->offset, entry->length); +} + +QStringList CompoundFileReader::list() const +{ + // for (EntriesType::const_iterator i=entries.begin();i!=entries.end();i++){ + // names->push_back(i->first); + // ++i; + // } + + QStringList names; + EntriesType::const_iterator itr; + // TODO: verify this, see old code above ??? + for (itr = entries.begin(); itr != entries.end(); ++itr) + names.push_back(itr->first); + + return names; +} + +bool CompoundFileReader::fileExists(const QString& name) const +{ + return entries.exists(name); +} + +int64_t CompoundFileReader::fileModified(const QString& name) const +{ + return directory->fileModified(fileName); +} + +void CompoundFileReader::touchFile(const QString& name) +{ + directory->touchFile(fileName); +} + +bool CompoundFileReader::doDeleteFile(const QString& name) +{ + _CLTHROWA(CL_ERR_UnsupportedOperation, + "UnsupportedOperationException: CompoundFileReader::doDeleteFile"); +} + +void CompoundFileReader::renameFile(const QString& from, const QString& to) +{ + _CLTHROWA(CL_ERR_UnsupportedOperation, + "UnsupportedOperationException: CompoundFileReader::renameFile"); +} + +int64_t CompoundFileReader::fileLength(const QString& name) const +{ + FileEntry* e = entries.get(name); + if (e == NULL) { + char buf[CL_MAX_PATH + 30]; + strcpy(buf,"File "); + strncat(buf, name.toLocal8Bit().constData(), CL_MAX_PATH); + strcat(buf," does not exist"); + _CLTHROWA(CL_ERR_IO,buf); + } + return e->length; +} + +IndexOutput* CompoundFileReader::createOutput(const QString& name) +{ + _CLTHROWA(CL_ERR_UnsupportedOperation, + "UnsupportedOperationException: CompoundFileReader::createOutput"); +} + +LuceneLock* CompoundFileReader::makeLock(const QString& name) +{ + _CLTHROWA(CL_ERR_UnsupportedOperation, + "UnsupportedOperationException: CompoundFileReader::makeLock"); +} + +QString CompoundFileReader::toString() const +{ + QString ret(QLatin1String("CompoundFileReader@")); + return ret.append(fileName); +} + +CompoundFileWriter::CompoundFileWriter(Directory* dir, const QString& name) + : ids(false) + , entries(true) +{ + if (dir == NULL) + _CLTHROWA(CL_ERR_NullPointer, "directory cannot be null"); + + if (name.isEmpty()) + _CLTHROWA(CL_ERR_NullPointer, "name cannot be null"); + + merged = false; + directory = dir; + fileName = name; +} + +CompoundFileWriter::~CompoundFileWriter() +{ +} + +Directory* CompoundFileWriter::getDirectory() +{ + return directory; +} + +/** Returns the name of the compound file. */ +QString CompoundFileWriter::getName() const +{ + return fileName; +} + +void CompoundFileWriter::addFile(const QString& file) +{ + if (merged) + _CLTHROWA(CL_ERR_IO, "Can't add extensions after merge has been called"); + + if (file.isEmpty()) + _CLTHROWA(CL_ERR_NullPointer, "file cannot be null"); + + if (ids.find(file) != ids.end()) { + char buf[CL_MAX_PATH + 30]; + strcpy(buf, "File "); + strncat(buf, file.toLocal8Bit().constData(), CL_MAX_PATH); + strcat(buf," already added"); + _CLTHROWA(CL_ERR_IO,buf); + } + ids.insert(file); + entries.push_back(_CLNEW WriterFileEntry(file)); +} + +void CompoundFileWriter::close() +{ + if (merged) + _CLTHROWA(CL_ERR_IO, "Merge already performed"); + + if (entries.size() == 0) // isEmpty() + _CLTHROWA(CL_ERR_IO, "No entries to merge have been defined"); + + merged = true; + + // open the compound stream + IndexOutput* os = NULL; + try { + os = directory->createOutput(fileName); + + // Write the number of entries + os->writeVInt(entries.size()); + + // Write the directory with all offsets at 0. + // Remember the positions of directory entries so that we can + // adjust the offsets later + { //msvc6 for scope fix + TCHAR tfile[CL_MAX_PATH]; + for (CLLinkedList::iterator i = entries.begin(); + i != entries.end(); i++) { + WriterFileEntry* fe = *i; + fe->directoryOffset = os->getFilePointer(); + os->writeLong(0); // for now + tfile[fe->file.toWCharArray(tfile)] = '\0'; + os->writeString(tfile, _tcslen(tfile)); + } + } + + // Open the files and copy their data into the stream. + // Remember the locations of each file's data section. + { //msvc6 for scope fix + int32_t bufferLength = 1024; + uint8_t buffer[1024]; + for (CLLinkedList::iterator i = entries.begin(); + i != entries.end(); i++) { + WriterFileEntry* fe = *i; + fe->dataOffset = os->getFilePointer(); + copyFile(fe, os, buffer, bufferLength); + } + } + + { //msvc6 for scope fix + // Write the data offsets into the directory of the compound stream + for (CLLinkedList::iterator i = entries.begin(); + i != entries.end(); i++) { + WriterFileEntry* fe = *i; + os->seek(fe->directoryOffset); + os->writeLong(fe->dataOffset); + } + } + + + } _CLFINALLY ( + if (os != NULL) { + try { + os->close(); + _CLDELETE(os); + } catch (...) { } + } + ); +} + +void CompoundFileWriter::copyFile(WriterFileEntry* source, IndexOutput* os, + uint8_t* buffer, int32_t bufferLength) +{ + IndexInput* is = NULL; + try { + int64_t startPtr = os->getFilePointer(); + + is = directory->openInput(source->file); + int64_t length = is->length(); + int64_t remainder = length; + int32_t chunk = bufferLength; + + while(remainder > 0) { + int32_t len = (int32_t)min((int64_t)chunk, remainder); + is->readBytes(buffer, len); + os->writeBytes(buffer, len); + remainder -= len; + } + + // Verify that remainder is 0 + if (remainder != 0) { + TCHAR buf[CL_MAX_PATH+100]; + _sntprintf(buf, CL_MAX_PATH + 100, _T("Non-zero remainder length ") + _T("after copying: %d (id: %s, length: %d, buffer size: %d)"), + remainder, source->file.toLocal8Bit().constData(), length, chunk); + _CLTHROWT(CL_ERR_IO, buf); + } + + // Verify that the output length diff is equal to original file + int64_t endPtr = os->getFilePointer(); + int64_t diff = endPtr - startPtr; + if (diff != length) { + TCHAR buf[100]; + _sntprintf(buf, 100, _T("Difference in the output file offsets %d ") + _T("does not match the original file length %d"), diff, length); + _CLTHROWT(CL_ERR_IO,buf); + } + } _CLFINALLY ( + if (is != NULL) { + is->close(); + _CLDELETE(is); + } + ); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.h b/src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.h new file mode 100644 index 000000000..84799a62f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/CompoundFile.h @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#ifndef _lucene_index_compoundfile_h +#define _lucene_index_compoundfile_h + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include + +#include "CLucene/store/IndexInput.h" +#include "CLucene/store/IndexOutput.h" +#include "CLucene/store/Directory.h" +#include "CLucene/store/Lock.h" +#include "CLucene/util/VoidList.h" +#include "CLucene/util/VoidMap.h" + +CL_NS_DEF(index) + +// Class for accessing a compound stream. +// This class implements a directory, but is limited to only read operations. +// Directory methods that would normally modify data throw an exception. +class CompoundFileReader : public CL_NS(store)::Directory +{ +private: + /** Implementation of an IndexInput that reads from a portion of the + * compound file. The visibility is left as "package" *only* because + * this helps with testing since JUnit test cases in a different class + * can then access package fields of this class. + */ + class CSIndexInput : public CL_NS(store)::BufferedIndexInput + { + private: + CL_NS(store)::IndexInput* base; + int64_t fileOffset; + int64_t _length; + protected: + /** Expert: implements buffer refill. Reads uint8_ts from the current + * position in the input. + * @param b the array to read uint8_ts into + * @param length the number of uint8_ts to read + */ + void readInternal(uint8_t* b, const int32_t len); + void seekInternal(const int64_t pos) {} + + public: + CSIndexInput(CL_NS(store)::IndexInput* base, const int64_t fileOffset, + const int64_t length); + CSIndexInput(const CSIndexInput& clone); + ~CSIndexInput(); + + /** Closes the stream to futher operations. */ + void close(); + CL_NS(store)::IndexInput* clone() const; + + int64_t length() { return _length; } + + QString getDirectoryType() const { + return CompoundFileReader::DirectoryType(); } + }; + + class FileEntry : LUCENE_BASE + { + public: + FileEntry() + : offset(0), length(0) {} + FileEntry(int64_t _offset) + : offset(_offset), length(0) {} + ~FileEntry() {} + + int64_t offset; + int64_t length; + }; + + // Base info + CL_NS(store)::Directory* directory; + QString fileName; + + CL_NS(store)::IndexInput* stream; + + typedef CL_NS(util)::CLHashMap > EntriesType; + EntriesType entries; +protected: + // Removes an existing file in the directory-> + bool doDeleteFile(const QString& name); + +public: + CompoundFileReader(CL_NS(store)::Directory* dir, const QString& name); + ~CompoundFileReader(); + CL_NS(store)::Directory* getDirectory(); + QString getName() const; + + void close(); + CL_NS(store)::IndexInput* openInput(const QString& id); + + /** Returns an array of strings, one for each file in the directory-> */ + QStringList list() const; + /** Returns true iff a file with the given name exists. */ + bool fileExists(const QString& name) const; + /** Returns the time the named file was last modified. */ + int64_t fileModified(const QString& name) const; + /** Set the modified time of an existing file to now. */ + void touchFile(const QString& name); + /** Renames an existing file in the directory-> + If a file already exists with the new name, then it is replaced. + This replacement should be atomic. */ + void renameFile(const QString& from, const QString& to); + /** Returns the length of a file in the directory. + * @throws IOException if the file does not exist */ + int64_t fileLength(const QString& name) const; + /** Not implemented + * @throws UnsupportedOperationException */ + CL_NS(store)::IndexOutput* createOutput(const QString& name); + /** Not implemented + * @throws UnsupportedOperationException */ + CL_NS(store)::LuceneLock* makeLock(const QString& name); + + QString toString() const; + + static QString DirectoryType() { return QLatin1String("CFS"); } + QString getDirectoryType() const { return DirectoryType(); } +}; + + + +// Combines multiple files into a single compound file. +// The file format:
+//

    +//
  • VInt fileCount
  • +//
  • {Directory} +// fileCount entries with the following structure:
  • +//
      +//
    • int64_t dataOffset
    • +//
    • UTFString extension
    • +//
    +//
  • {File Data} +// fileCount entries with the raw data of the corresponding file
  • +//
+// The fileCount integer indicates how many files are contained in this compound +// file. The {directory} that follows has that many entries. Each directory entry +// contains an encoding identifier, an int64_t pointer to the start of this file's +// data section, and a UTF String with that file's extension. +class CompoundFileWriter : LUCENE_BASE +{ + class WriterFileEntry : LUCENE_BASE { + public: + WriterFileEntry() + : dataOffset(0), directoryOffset(0) {} + WriterFileEntry(const QString& _file) + : file(_file), dataOffset(0), directoryOffset(0) {} + ~WriterFileEntry() {} + + QString file; + // temporary holder for the start of this file's data section + int64_t dataOffset; + // temporary holder for the start of directory entry for this file + int64_t directoryOffset; + }; + + bool merged; + QString fileName; + CL_NS(store)::Directory* directory; + + CL_NS(util)::CLHashSet ids; + + CL_NS(util)::CLLinkedList > entries; + + // Copy the contents of the file with specified extension into the + // provided output stream. Use the provided buffer for moving data + // to reduce memory allocation. + void copyFile(WriterFileEntry* source, CL_NS(store)::IndexOutput* os, + uint8_t* buffer, int32_t bufferLength); + +public: + // Create the compound stream in the specified file. The file name is the + // entire name (no extensions are added). + CompoundFileWriter(CL_NS(store)::Directory* dir, const QString& name); + ~CompoundFileWriter(); + + // Returns the directory of the compound file. + CL_NS(store)::Directory* getDirectory(); + + QString getName() const ; + /* Add a source stream. file is the string by which the + * sub-stream will be known in the compound stream. + * + * @throws IllegalStateException if this writer is closed + * @throws NullPointerException if file is null + * @throws IllegalArgumentException if a file with the same name + * has been added already + */ + void addFile(const QString& file); + /* Merge files with the extensions added up to now. + * All files with these extensions are combined sequentially into the + * compound stream. After successful merge, the source files + * @throws IllegalStateException if close() had been called before or + * if no file has been added to this object + * are deleted. + */ + void close(); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp new file mode 100644 index 000000000..dcbc31591 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.cpp @@ -0,0 +1,571 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" + +#include "DocumentWriter.h" +#include "FieldInfos.h" +#include "IndexWriter.h" +#include "FieldsWriter.h" +#include "Term.h" +#include "TermInfo.h" +#include "TermInfosWriter.h" + +#include "CLucene/analysis/AnalysisHeader.h" + +#include "CLucene/search/Similarity.h" +#include "TermInfosWriter.h" +#include "FieldsWriter.h" + +CL_NS_USE(util) +CL_NS_USE(store) +CL_NS_USE(analysis) +CL_NS_USE(document) +CL_NS_DEF(index) + +/*Posting*/ + +DocumentWriter::Posting::Posting(Term* t, const int32_t position, + TermVectorOffsetInfo* offset) +{ + //Func - Constructor + //Pre - t contains a valid reference to a Term + //Post - Instance has been created + freq = 1; + + term = _CL_POINTER(t); + positions.values = (int32_t*)malloc(sizeof(int32_t)); + positions.values[0] = position; + positions.length = 1; + + if ( offset != NULL ){ + this->offsets.values =(TermVectorOffsetInfo*)malloc(sizeof(TermVectorOffsetInfo)); + this->offsets.values[0] = *offset; + this->offsets.length = 1; + } +} + +DocumentWriter::Posting::~Posting() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + free(positions.values); + if ( this->offsets.values != NULL ) + free(this->offsets.values); + _CLDECDELETE(term); +} + +DocumentWriter::DocumentWriter(Directory* d, Analyzer* a, + CL_NS(search)::Similarity* sim, const int32_t mfl) + : analyzer(a) + , directory(d) + , maxFieldLength(mfl) + , fieldInfos(NULL) + , fieldLengths(NULL) + , similarity(sim) + , termIndexInterval(IndexWriter::DEFAULT_TERM_INDEX_INTERVAL) + , fieldPositions(NULL) + , fieldBoosts(NULL) + , termBuffer(_CLNEW Term) +{ + //Pre - d contains a valid reference to a Directory + // d contains a valid reference to a Analyzer + // mfl > 0 and contains the maximum field length + //Post - Instance has been created + + CND_PRECONDITION(((mfl > 0) || (mfl == IndexWriter::FIELD_TRUNC_POLICY__WARN)), + "mfl is 0 or smaller than IndexWriter::FIELD_TRUNC_POLICY__WARN") + + fieldInfos = NULL; + fieldLengths = NULL; +} + +DocumentWriter::DocumentWriter(CL_NS(store)::Directory* d, + CL_NS(analysis)::Analyzer* a, IndexWriter* writer) + : analyzer(a) + , directory(d) + , maxFieldLength(writer->getMaxFieldLength()) + , fieldInfos(NULL) + , fieldLengths(NULL) + , similarity(writer->getSimilarity()) + , termIndexInterval(writer->getTermIndexInterval()) + , fieldPositions(NULL) + , fieldBoosts(NULL) + , termBuffer(_CLNEW Term) +{ + //Pre - d contains a valid reference to a Directory + // d contains a valid reference to a Analyzer + // mfl > 0 and contains the maximum field length + //Post - Instance has been created + + CND_PRECONDITION(((maxFieldLength > 0) + || (maxFieldLength == IndexWriter::FIELD_TRUNC_POLICY__WARN)), + "mfl is 0 or smaller than IndexWriter::FIELD_TRUNC_POLICY__WARN") + + fieldInfos = NULL; + fieldLengths = NULL; + +} + +DocumentWriter::~DocumentWriter() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + clearPostingTable(); + _CLDELETE( fieldInfos ); + _CLDELETE_ARRAY(fieldLengths); + _CLDELETE_ARRAY(fieldPositions); + _CLDELETE_ARRAY(fieldBoosts); + _CLDELETE_ARRAY(fieldOffsets); + + _CLDECDELETE(termBuffer); +} + +void DocumentWriter::clearPostingTable() +{ + PostingTableType::iterator itr = postingTable.begin(); + while (itr != postingTable.end()){ + _CLDELETE(itr->second); + _CLLDECDELETE(itr->first); + ++itr; + } + postingTable.clear(); +} + +void DocumentWriter::addDocument(const QString& segment, Document* doc) +{ + CND_PRECONDITION(fieldInfos == NULL, "fieldInfos!=NULL") + + // write field names + fieldInfos = _CLNEW FieldInfos(); + fieldInfos->add(doc); + + QString buf = Misc::segmentname(segment, QLatin1String(".fnm")); + fieldInfos->write(directory, buf); + + // write field values + FieldsWriter fieldsWriter(directory, segment, fieldInfos); + try { + fieldsWriter.addDocument(doc); + } _CLFINALLY ( + fieldsWriter.close() + ); + + // clear postingTable + clearPostingTable(); + + int32_t fieldInfoSize = fieldInfos->size(); + fieldLengths = _CL_NEWARRAY(int32_t, fieldInfoSize); // init fieldLengths + fieldPositions = _CL_NEWARRAY(int32_t, fieldInfoSize); // init fieldPositions + fieldOffsets = _CL_NEWARRAY(int32_t, fieldInfoSize); // init fieldOffsets + fieldBoosts = _CL_NEWARRAY(qreal, fieldInfoSize); // init fieldBoosts + + qreal fbd = doc->getBoost(); + for (int32_t i = 0; i < fieldInfoSize; ++i) { + fieldLengths[i] = 0; + fieldPositions[i] = 0; + fieldOffsets[i] = 0; + //initialise fieldBoost array with default boost + fieldBoosts[i] = fbd; + } + + // invert doc into postingTable + invertDocument(doc); + + // sort postingTable into an array + Posting** postings = NULL; + int32_t postingsLength = 0; + sortPostingTable(postings, postingsLength); + + //DEBUG: + /*for (int32_t i = 0; i < postingsLength; i++) { + Posting* posting = postings[i]; + + TCHAR* b = posting->term->toString(); + _cout << b << " freq=" << posting->freq; + _CLDELETE(b); + + _cout << " pos=" << posting->positions[0]; + for (int32_t j = 1; j < posting->freq; j++) + _cout <<"," << posting->positions[j]; + + _cout << endl; + }*/ + + + // write postings + writePostings(postings, postingsLength, segment); + + // write norms of indexed fields + writeNorms(segment); + _CLDELETE_ARRAY(postings); +} + +void DocumentWriter::sortPostingTable(Posting**& array, int32_t& arraySize) +{ + // copy postingTable into an array + arraySize = postingTable.size(); + array = _CL_NEWARRAY(Posting*,arraySize); + PostingTableType::iterator postings = postingTable.begin(); + int32_t i=0; + while ( postings != postingTable.end() ){ + array[i] = (Posting*)postings->second; + postings++; + i++; + } + // sort the array + quickSort(array, 0, i - 1); +} + + +void DocumentWriter::invertDocument(const Document* doc) +{ + DocumentFieldEnumeration* fields = doc->fields(); + try { + while (fields->hasMoreElements()) { + Field* field = (Field*)fields->nextElement(); + const TCHAR* fieldName = field->name(); + const int32_t fieldNumber = fieldInfos->fieldNumber(fieldName); + + int32_t length = fieldLengths[fieldNumber]; // length of field + int32_t position = fieldPositions[fieldNumber]; // position in field + if (length>0) + position+=analyzer->getPositionIncrementGap(fieldName); + int32_t offset = fieldOffsets[fieldNumber]; // offset field + + if (field->isIndexed()) { + if (!field->isTokenized()) { // un-tokenized field + //FEATURE: this is bug in java: if using a Reader, then + //field value will not be added. With CLucene, an untokenized + //field with a reader will still be added (if it isn't stored, + //because if it's stored, then the reader has already been read. + const TCHAR* charBuf = NULL; + int64_t dataLen = 0; + + if (field->stringValue() == NULL && !field->isStored() ) { + CL_NS(util)::Reader* r = field->readerValue(); + // this call tries to read the entire stream + // this may invalidate the string for the further calls + // it may be better to do this via a FilterReader + // TODO make a better implementation of this + dataLen = r->read(charBuf, LUCENE_INT32_MAX_SHOULDBE); + if (dataLen == -1) + dataLen = 0; + //todo: would be better to pass the string length, in case + //a null char is passed, but then would need to test the output too. + } else { + charBuf = field->stringValue(); + dataLen = _tcslen(charBuf); + } + + if(field->isStoreOffsetWithTermVector()){ + TermVectorOffsetInfo tio; + tio.setStartOffset(offset); + tio.setEndOffset(offset + dataLen); + addPosition(fieldName, charBuf, position++, &tio ); + }else + addPosition(fieldName, charBuf, position++, NULL); + offset += dataLen; + length++; + } else { // field must be tokenized + CL_NS(util)::Reader* reader; // find or make Reader + bool delReader = false; + if (field->readerValue() != NULL) { + reader = field->readerValue(); + } else if (field->stringValue() != NULL) { + reader = _CLNEW CL_NS(util)::StringReader( + field->stringValue(),_tcslen(field->stringValue()), + false); + delReader = true; + } else { + _CLTHROWA(CL_ERR_IO,"field must have either String or Reader value"); + } + + try { + // Tokenize field and add to postingTable. + CL_NS(analysis)::TokenStream* stream = + analyzer->tokenStream(fieldName, reader); + + try { + CL_NS(analysis)::Token t; + int32_t lastTokenEndOffset = -1; + while (stream->next(&t)) { + position += (t.getPositionIncrement() - 1); + + if(field->isStoreOffsetWithTermVector()){ + TermVectorOffsetInfo tio; + tio.setStartOffset(offset + t.startOffset()); + tio.setEndOffset(offset + t.endOffset()); + addPosition(fieldName, t.termText(), position++, &tio); + } else + addPosition(fieldName, t.termText(), position++, NULL); + + lastTokenEndOffset = t.endOffset(); + length++; + // Apply field truncation policy. + if (maxFieldLength != IndexWriter::FIELD_TRUNC_POLICY__WARN) { + // The client programmer has explicitly authorized us to + // truncate the token stream after maxFieldLength tokens. + if ( length > maxFieldLength) + break; + } else if (length > IndexWriter::DEFAULT_MAX_FIELD_LENGTH) { + const TCHAR* errMsgBase = + _T("Indexing a huge number of tokens from a single") + _T(" field (\"%s\", in this case) can cause CLucene") + _T(" to use memory excessively.") + _T(" By default, CLucene will accept only %s tokens") + _T(" tokens from a single field before forcing the") + _T(" client programmer to specify a threshold at") + _T(" which to truncate the token stream.") + _T(" You should set this threshold via") + _T(" IndexReader::maxFieldLength (set to LUCENE_INT32_MAX") + _T(" to disable truncation, or a value to specify maximum number of fields)."); + + TCHAR defaultMaxAsChar[34]; + _i64tot(IndexWriter::DEFAULT_MAX_FIELD_LENGTH, + defaultMaxAsChar, 10 + ); + int32_t errMsgLen = _tcslen(errMsgBase) + + _tcslen(fieldName) + + _tcslen(defaultMaxAsChar); + TCHAR* errMsg = _CL_NEWARRAY(TCHAR,errMsgLen+1); + + _sntprintf(errMsg, errMsgLen,errMsgBase, fieldName, defaultMaxAsChar); + + _CLTHROWT_DEL(CL_ERR_Runtime,errMsg); + } + } // while token->next + + if(lastTokenEndOffset != -1 ) + offset += lastTokenEndOffset + 1; + } _CLFINALLY ( + stream->close(); + _CLDELETE(stream); + ); + } _CLFINALLY ( + if (delReader) { + _CLDELETE(reader); + } + ); + } // if/else field is to be tokenized + fieldLengths[fieldNumber] = length; // save field length + fieldPositions[fieldNumber] = position; // save field position + fieldBoosts[fieldNumber] *= field->getBoost(); + fieldOffsets[fieldNumber] = offset; + } // if field is to beindexed + } // while more fields available + } _CLFINALLY ( + _CLDELETE(fields); + ); +} + +void DocumentWriter::addPosition(const TCHAR* field, const TCHAR* text, + const int32_t position, TermVectorOffsetInfo* offset) +{ + termBuffer->set(field,text,false); + + Posting* ti = postingTable.get(termBuffer); + if (ti != NULL) { // word seen before + int32_t freq = ti->freq; + if (ti->positions.length == freq) { + // positions array is full, realloc its size + ti->positions.length = freq*2; + ti->positions.values = (int32_t*)realloc(ti->positions.values, ti->positions.length * sizeof(int32_t)); + } + ti->positions.values[freq] = position; // add new position + + if (offset != NULL) { + if (ti->offsets.length == freq){ + ti->offsets.length = freq*2; + ti->offsets.values = (TermVectorOffsetInfo*)realloc(ti->offsets.values, ti->offsets.length * sizeof(TermVectorOffsetInfo)); + } + ti->offsets[freq] = *offset; + } + + ti->freq = freq + 1; // update frequency + } else { // word not seen before + Term* term = _CLNEW Term( field, text, false); + postingTable.put(term, _CLNEW Posting(term, position, offset)); + } +} + +//static +void DocumentWriter::quickSort(Posting**& postings, const int32_t lo, const int32_t hi) +{ + if(lo >= hi) + return; + + int32_t mid = (lo + hi) / 2; + + if(postings[lo]->term->compareTo(postings[mid]->term) > 0) { + Posting* tmp = postings[lo]; + postings[lo] = postings[mid]; + postings[mid] = tmp; + } + + if(postings[mid]->term->compareTo(postings[hi]->term) > 0) { + Posting* tmp = postings[mid]; + postings[mid] = postings[hi]; + postings[hi] = tmp; + + if(postings[lo]->term->compareTo(postings[mid]->term) > 0) { + Posting* tmp2 = postings[lo]; + postings[lo] = postings[mid]; + postings[mid] = tmp2; + } + } + + int32_t left = lo + 1; + int32_t right = hi - 1; + + if (left >= right) + return; + + const Term* partition = postings[mid]->term; //not kept, so no need to finalize + + for( ;; ) { + while(postings[right]->term->compareTo(partition) > 0) + --right; + + while(left < right && postings[left]->term->compareTo(partition) <= 0) + ++left; + + if(left < right) { + Posting* tmp = postings[left]; + postings[left] = postings[right]; + postings[right] = tmp; + --right; + } else { + break; + } + } + + quickSort(postings, lo, left); + quickSort(postings, left + 1, hi); +} + +void DocumentWriter::writePostings(Posting** postings, + const int32_t postingsLength, const QString& segment) +{ + #define __DOCLOSE(obj) \ + if (obj!=NULL) { \ + try { \ + obj->close(); \ + _CLDELETE(obj); \ + } catch(CLuceneError &e) { \ + ierr = e.number(); \ + err = e.what(); \ + } catch(...) { \ + err = "Unknown error while closing posting tables"; \ + } \ + } + + IndexOutput* freq = NULL; + IndexOutput* prox = NULL; + TermInfosWriter* tis = NULL; + TermVectorsWriter* termVectorWriter = NULL; + try { + //open files for inverse index storage + QString buf = Misc::segmentname(segment, QLatin1String(".frq")); + freq = directory->createOutput(buf); + + buf = Misc::segmentname(segment, QLatin1String(".prx")); + prox = directory->createOutput(buf); + + tis = _CLNEW TermInfosWriter(directory, segment, fieldInfos, + termIndexInterval); + TermInfo* ti = _CLNEW TermInfo(); + const TCHAR* currentField = NULL; + for (int32_t i = 0; i < postingsLength; i++) { + Posting* posting = postings[i]; + + // add an entry to the dictionary with pointers to prox and freq files + ti->set(1, freq->getFilePointer(), prox->getFilePointer(), -1); + tis->add(posting->term, ti); + + // add an entry to the freq file + int32_t postingFreq = posting->freq; + if (postingFreq == 1) // optimize freq=1 + freq->writeVInt(1); // set low bit of doc num. + else { + freq->writeVInt(0); // the document number + freq->writeVInt(postingFreq); // frequency in doc + } + + int32_t lastPosition = 0; // write positions + for (int32_t j = 0; j < postingFreq; ++j) { // use delta-encoding + prox->writeVInt(posting->positions.values[j] - lastPosition); + lastPosition = posting->positions.values[j]; + } + + // check to see if we switched to a new field + const TCHAR* termField = posting->term->field(); + if ( currentField == NULL || _tcscmp(currentField,termField) != 0 ) { + //todo, can we do an intern'd check? + // changing field - see if there is something to save + currentField = termField; + FieldInfo* fi = fieldInfos->fieldInfo(currentField); + + if (fi->storeTermVector) { + if (termVectorWriter == NULL) { + termVectorWriter = _CLNEW TermVectorsWriter(directory, + segment, fieldInfos); + termVectorWriter->openDocument(); + } + termVectorWriter->openField(currentField); + } else if (termVectorWriter != NULL) { + termVectorWriter->closeField(); + } + } + if (termVectorWriter != NULL && termVectorWriter->isFieldOpen()) { + termVectorWriter->addTerm(posting->term->text(), postingFreq, + &posting->positions, &posting->offsets); + } + } + if (termVectorWriter != NULL) + termVectorWriter->closeDocument(); + _CLDELETE(ti); + } _CLFINALLY ( + const char* err = NULL; + int32_t ierr = 0; + + // make an effort to close all streams we can but remember and re-throw + // the first exception encountered in this process + __DOCLOSE(freq); + __DOCLOSE(prox); + __DOCLOSE(tis); + __DOCLOSE(termVectorWriter); + if (err != NULL) + _CLTHROWA(ierr,err); + ); +} + +void DocumentWriter::writeNorms(const QString& segment) +{ + for(int32_t n = 0; n < fieldInfos->size(); n++){ + FieldInfo* fi = fieldInfos->fieldInfo(n); + if(fi->isIndexed && !fi->omitNorms) { + qreal norm = fieldBoosts[n] * similarity->lengthNorm( + fi->name, fieldLengths[n]); + + QString fn(segment + QLatin1String(".f%1")); + IndexOutput* norms = directory->createOutput(fn.arg(n)); + try { + norms->writeByte(CL_NS(search)::Similarity::encodeNorm(norm)); + }_CLFINALLY ( + norms->close(); + _CLDELETE(norms); + ) + } + } +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.h b/src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.h new file mode 100644 index 000000000..7096ba3ee --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/DocumentWriter.h @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_DocumentWriter_ +#define _lucene_index_DocumentWriter_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/document/Document.h" +#include "CLucene/store/Directory.h" +#include "FieldInfos.h" +#include "IndexWriter.h" +#include "CLucene/util/VoidMap.h" +#include "CLucene/document/Field.h" +#include "TermInfo.h" +#include "CLucene/search/Similarity.h" +#include "TermInfosWriter.h" +#include "FieldsWriter.h" +#include "Term.h" + +CL_NS_DEF(index) + +class DocumentWriter : LUCENE_BASE +{ +public: + // info about a Term in a doc + class Posting : LUCENE_BASE + { + public: + Term* term; // the Term + int32_t freq; // its frequency in doc + Array positions; // positions it occurs at + Array offsets; + + Posting(Term* t, const int32_t position, TermVectorOffsetInfo* offset); + ~Posting(); + }; + +private: + CL_NS(analysis)::Analyzer* analyzer; + CL_NS(store)::Directory* directory; + FieldInfos* fieldInfos; //array + const int32_t maxFieldLength; + CL_NS(search)::Similarity* similarity; + int32_t termIndexInterval; + + // Keys are Terms, values are Postings. + // Used to buffer a document before it is written to the index. + typedef CL_NS(util)::CLHashtable PostingTableType; + PostingTableType postingTable; + int32_t* fieldLengths; //array + int32_t* fieldPositions; //array + int32_t* fieldOffsets; //array + qreal* fieldBoosts; //array + + Term* termBuffer; +public: + /** This ctor used by test code only. + * + * @param directory The directory to write the document information to + * @param analyzer The analyzer to use for the document + * @param similarity The Similarity function + * @param maxFieldLength The maximum number of tokens a field may have + */ + DocumentWriter(CL_NS(store)::Directory* d, CL_NS(analysis)::Analyzer* a, + CL_NS(search)::Similarity* similarity, const int32_t maxFieldLength); + + DocumentWriter(CL_NS(store)::Directory* directory, + CL_NS(analysis)::Analyzer* analyzer, IndexWriter* writer); + ~DocumentWriter(); + + void addDocument(const QString& segment, CL_NS(document)::Document* doc); + + +private: + // Tokenizes the fields of a document into Postings. + void invertDocument(const CL_NS(document)::Document* doc); + + void addPosition(const TCHAR* field, const TCHAR* text, + const int32_t position, TermVectorOffsetInfo* offset); + + void sortPostingTable(Posting**& array, int32_t& arraySize); + + static void quickSort(Posting**& postings, const int32_t lo, const int32_t hi); + + void writePostings(Posting** postings, const int32_t postingsLength, + const QString& segment); + + void writeNorms(const QString& segment); + + void clearPostingTable(); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfo.h b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfo.h new file mode 100644 index 000000000..387c4a6ac --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfo.h @@ -0,0 +1,16 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_FieldInfo_ +#define _lucene_index_FieldInfo_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#error "This header is deprecated, use FieldInfos.h instead" + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp new file mode 100644 index 000000000..0c66882f4 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.cpp @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "FieldInfos.h" + +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/document/Field.h" +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Misc.h" +#include "CLucene/util/StringIntern.h" + +CL_NS_USE(store) +CL_NS_USE(document) +CL_NS_USE(util) +CL_NS_DEF(index) + +FieldInfo::FieldInfo(const TCHAR* _fieldName, bool _isIndexed, + int32_t _fieldNumber, bool _storeTermVector, bool _storeOffsetWithTermVector, + bool _storePositionWithTermVector, bool _omitNorms) + : name(CLStringIntern::intern(_fieldName CL_FILELINE)) + , isIndexed(_isIndexed) + , number(_fieldNumber) + , storeTermVector(_storeTermVector) + , storeOffsetWithTermVector(_storeOffsetWithTermVector) + , storePositionWithTermVector(_storeTermVector) + , omitNorms(_omitNorms) +{ +} + +FieldInfo::~FieldInfo() +{ + CL_NS(util)::CLStringIntern::unintern(name); +} + +// #pragma mark -- FieldInfos + +FieldInfos::FieldInfos() + : byName(false, false) + , byNumber(true) +{ +} + +FieldInfos::~FieldInfos() +{ + byName.clear(); + byNumber.clear(); +} + +FieldInfos::FieldInfos(Directory* d, const QString& name) + : byName(false, false) + , byNumber(true) +{ + IndexInput* input = d->openInput(name); + try { + read(input); + } _CLFINALLY ( + input->close(); + _CLDELETE(input); + ); +} + +void FieldInfos::add(const Document* doc) +{ + DocumentFieldEnumeration* fields = doc->fields(); + Field* field; + while (fields->hasMoreElements()) { + field = fields->nextElement(); + add(field->name(), field->isIndexed(), field->isTermVectorStored()); + } + _CLDELETE(fields); +} + +void FieldInfos::add(const TCHAR* name, bool isIndexed, bool storeTermVector, + bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms) +{ + FieldInfo* fi = fieldInfo(name); + if (fi == NULL) { + addInternal(name, isIndexed, storeTermVector, + storePositionWithTermVector, + storeOffsetWithTermVector, omitNorms); + } else { + if (fi->isIndexed != isIndexed) { + // once indexed, always index + fi->isIndexed = true; + } + + if (fi->storeTermVector != storeTermVector) { + // once vector, always vector + fi->storeTermVector = true; + } + + if (fi->storePositionWithTermVector != storePositionWithTermVector) { + // once vector, always vector + fi->storePositionWithTermVector = true; + } + + if (fi->storeOffsetWithTermVector != storeOffsetWithTermVector) { + // once vector, always vector + fi->storeOffsetWithTermVector = true; + } + + if (fi->omitNorms != omitNorms) { + // once norms are stored, always store + fi->omitNorms = false; + } + } +} + +void FieldInfos::add(const TCHAR** names, bool isIndexed, bool storeTermVectors, + bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms) +{ + int32_t i=0; + while (names[i] != NULL) { + add(names[i], isIndexed, storeTermVectors, storePositionWithTermVector, + storeOffsetWithTermVector, omitNorms); + ++i; + } +} + +int32_t FieldInfos::fieldNumber(const TCHAR* fieldName) const +{ + FieldInfo* fi = fieldInfo(fieldName); + return (fi != NULL) ? fi->number : -1; +} + +FieldInfo* FieldInfos::fieldInfo(const TCHAR* fieldName) const +{ + return byName.get(fieldName); +} + +const TCHAR* FieldInfos::fieldName(const int32_t fieldNumber) const +{ + FieldInfo* fi = fieldInfo(fieldNumber); + return (fi == NULL) ? LUCENE_BLANK_STRING : fi->name; +} + +FieldInfo* FieldInfos::fieldInfo(const int32_t fieldNumber) const +{ + if (fieldNumber < 0 || (size_t)fieldNumber >= byNumber.size()) + return NULL; + return byNumber[fieldNumber]; +} + +int32_t FieldInfos::size() const +{ + return byNumber.size(); +} + +void FieldInfos::write(Directory* d, const QString& name) const +{ + IndexOutput* output = d->createOutput(name); + try { + write(output); + } _CLFINALLY ( + output->close(); + _CLDELETE(output); + ); +} + +void FieldInfos::write(IndexOutput* output) const +{ + output->writeVInt(size()); + FieldInfo* fi; + uint8_t bits; + for (int32_t i = 0; i < size(); ++i) { + fi = fieldInfo(i); + bits = 0x0; + if (fi->isIndexed) + bits |= IS_INDEXED; + + if (fi->storeTermVector) + bits |= STORE_TERMVECTOR; + + if (fi->storePositionWithTermVector) + bits |= STORE_POSITIONS_WITH_TERMVECTOR; + + if (fi->storeOffsetWithTermVector) + bits |= STORE_OFFSET_WITH_TERMVECTOR; + + if (fi->omitNorms) + bits |= OMIT_NORMS; + + output->writeString(fi->name, _tcslen(fi->name)); + output->writeByte(bits); + } +} + +void FieldInfos::read(IndexInput* input) +{ + int32_t size = input->readVInt(); + for (int32_t i = 0; i < size; ++i) { + // we could read name into a string buffer, but we can't be sure what + // the maximum field length will be. + TCHAR* name = input->readString(); + uint8_t bits = input->readByte(); + bool isIndexed = (bits & IS_INDEXED) != 0; + bool storeTermVector = (bits & STORE_TERMVECTOR) != 0; + bool storePositionsWithTermVector = + (bits & STORE_POSITIONS_WITH_TERMVECTOR) != 0; + bool storeOffsetWithTermVector = (bits & STORE_OFFSET_WITH_TERMVECTOR) != 0; + bool omitNorms = (bits & OMIT_NORMS) != 0; + + addInternal(name, isIndexed, storeTermVector, + storePositionsWithTermVector, storeOffsetWithTermVector, omitNorms); + _CLDELETE_CARRAY(name); + } +} + +void FieldInfos::addInternal(const TCHAR* name, bool isIndexed, + bool storeTermVector, bool storePositionWithTermVector, + bool storeOffsetWithTermVector, bool omitNorms) +{ + FieldInfo* fi = _CLNEW FieldInfo(name, isIndexed, byNumber.size(), + storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, + omitNorms); + byNumber.push_back(fi); + byName.put(fi->name, fi); +} + +bool FieldInfos::hasVectors() const +{ + for (int32_t i = 0; i < size(); i++) { + if (fieldInfo(i)->storeTermVector) + return true; + } + return false; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.h b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.h new file mode 100644 index 000000000..7b6d0f56d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldInfos.h @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_FieldInfos_ +#define _lucene_index_FieldInfos_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/VoidList.h" + +CL_NS_DEF(index) + +class FieldInfo : LUCENE_BASE +{ + public: + //name of the field + const TCHAR* name; + + //Is field indexed? true = yes false = no + bool isIndexed; + + //field number + const int32_t number; + + // true if term vector for this field should be stored + bool storeTermVector; + bool storeOffsetWithTermVector; + bool storePositionWithTermVector; + + bool omitNorms; // omit norms associated with indexed fields + + //Func - Constructor + // Initialises FieldInfo. + // na holds the name of the field + // tk indicates whether this field is indexed or not + // nu indicates its number + //Pre - na != NULL and holds the name of the field + // tk is true or false + // number >= 0 + //Post - The FieldInfo instance has been created and initialized. + // name holds the duplicated string of na + // isIndexed = tk + // number = nu + FieldInfo(const TCHAR* fieldName, bool isIndexed, int32_t fieldNumber, + bool storeTermVector, bool storeOffsetWithTermVector, + bool storePositionWithTermVector, bool omitNorms); + + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + ~FieldInfo(); +}; + +/* Access to the Field Info file that describes document fields and whether or + * not they are indexed. Each segment has a separate Field Info file. Objects + * of this class are thread-safe for multiple readers, but only one thread can + * be adding documents at a time, with no other reader or writer threads + * accessing this object. +*/ +class FieldInfos : LUCENE_BASE +{ +private: + // we now use internd field names, so we can use the voidCompare to + // directly compare the strings + typedef CL_NS(util)::CLHashMap defByName; + defByName byName; + + CL_NS(util)::CLArrayList > byNumber; + +public: + enum { + IS_INDEXED = 0x1, + STORE_TERMVECTOR = 0x2, + STORE_POSITIONS_WITH_TERMVECTOR = 0x4, + STORE_OFFSET_WITH_TERMVECTOR = 0x8, + OMIT_NORMS = 0x10 + }; + + FieldInfos(); + ~FieldInfos(); + + // Construct a FieldInfos object using the directory and the name of the + // file IndexInput + // @param d The directory to open the IndexInput from + // @param name Name of the file to open the IndexInput from in the Directory + // @throws IOException + // @see #read + FieldInfos(CL_NS(store)::Directory* d, const QString& name); + + int32_t fieldNumber(const TCHAR* fieldName)const; + + // Return the fieldinfo object referenced by the fieldNumber. + // @param fieldNumber + // @return the FieldInfo object or null when the given fieldNumber + // doesn't exist. + FieldInfo* fieldInfo(const TCHAR* fieldName) const; + + // Return the fieldName identified by its number. + // @param fieldNumber + // @return the fieldName or an empty string when the field + // with the given number doesn't exist. + const TCHAR* fieldName(const int32_t fieldNumber) const; + + FieldInfo* fieldInfo(const int32_t fieldNumber) const; + + int32_t size()const; + + bool hasVectors() const; + + // Adds field info for a Document. + void add(const CL_NS(document)::Document* doc); + + // Merges in information from another FieldInfos. + void add(FieldInfos* other); + + + /** If the field is not yet known, adds it. If it is known, checks to make + * sure that the isIndexed flag is the same as was given previously for this + * field. If not - marks it as being indexed. Same goes for the TermVector + * parameters. + * + * @param name The name of the field + * @param isIndexed true if the field is indexed + * @param storeTermVector true if the term vector should be stored + * @param storePositionWithTermVector true if the term vector with positions should be stored + * @param storeOffsetWithTermVector true if the term vector with offsets should be stored + */ + void add(const TCHAR* name, bool isIndexed, bool storeTermVector = false, + bool storePositionWithTermVector = false, + bool storeOffsetWithTermVector = false, bool omitNorms = false); + + /** + * Assumes the fields are not storing term vectors + * @param names The names of the fields + * @param isIndexed true if the field is indexed + * @param storeTermVector true if the term vector should be stored + * + * @see #add(String, boolean) + */ + void add(const TCHAR** names, bool isIndexed, bool storeTermVector = false, + bool storePositionWithTermVector = false, + bool storeOffsetWithTermVector = false, bool omitNorms = false); + + void write(CL_NS(store)::Directory* d, const QString& name) const; + void write(CL_NS(store)::IndexOutput* output) const; + +private: + void read(CL_NS(store)::IndexInput* input); + void addInternal(const TCHAR* name, bool isIndexed, bool storeTermVector, + bool storePositionWithTermVector, bool storeOffsetWithTermVector, + bool omitNorms); + +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp new file mode 100644 index 000000000..e3f9d1cc2 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.cpp @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "FieldsReader.h" + +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Misc.h" +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/document/Field.h" +#include "FieldInfos.h" +#include "FieldsWriter.h" + +CL_NS_USE(store) +CL_NS_USE(document) +CL_NS_USE(util) +CL_NS_DEF(index) + +FieldsReader::FieldsReader(Directory* d, const QString& segment, FieldInfos* fn) + : fieldInfos(fn) +{ + //Func - Constructor + //Pre - d contains a valid reference to a Directory + // segment != NULL + // fn contains a valid reference to a FieldInfos + //Post - The instance has been created + + CND_PRECONDITION(!segment.isEmpty(), "segment != NULL"); + + QString buf = Misc::segmentname(segment, QLatin1String(".fdt")); + fieldsStream = d->openInput(buf); + + buf = Misc::segmentname(segment, QLatin1String(".fdx")); + indexStream = d->openInput(buf); + + _size = (int32_t)indexStream->length() / 8; +} + +FieldsReader::~FieldsReader() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + close(); +} + +void FieldsReader::close() +{ + //Func - Closes the FieldsReader + //Pre - true + //Post - The FieldsReader has been closed + if (fieldsStream) { + fieldsStream->close(); + _CLDELETE(fieldsStream); + } + + if(indexStream) { + indexStream->close(); + _CLDELETE(indexStream); + } +} + +int32_t FieldsReader::size() const +{ + return _size; +} + +bool FieldsReader::doc(int32_t n, Document* doc) +{ + if ( n * 8L > indexStream->length() ) + return false; + + indexStream->seek(n * 8L); + int64_t position = indexStream->readLong(); + fieldsStream->seek(position); + + int32_t numFields = fieldsStream->readVInt(); + for (int32_t i = 0; i < numFields; i++) { + int32_t fieldNumber = fieldsStream->readVInt(); + FieldInfo* fi = fieldInfos->fieldInfo(fieldNumber); + + if ( fi == NULL ) + _CLTHROWA(CL_ERR_IO, "Field stream is invalid"); + + uint8_t bits = fieldsStream->readByte(); + if ((bits & FieldsWriter::FIELD_IS_BINARY) != 0) { + int32_t fieldLen = fieldsStream->readVInt(); + FieldsReader::FieldsStreamHolder* subStream = new + FieldsReader::FieldsStreamHolder(fieldsStream, fieldLen); + uint8_t bits = Field::STORE_YES; + Field* f = _CLNEW Field( + fi->name, // name + subStream, // read value + bits); + + doc->add(*f); + + //now skip over the rest of the field + if (fieldsStream->getFilePointer() + fieldLen + == fieldsStream->length()) { + // set to eof + fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen - 1); + fieldsStream->readByte(); + } else { + fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen); + } + } else { + uint8_t bits = Field::STORE_YES; + if (fi->isIndexed && (bits & FieldsWriter::FIELD_IS_TOKENIZED)!=0 ) + bits |= Field::INDEX_TOKENIZED; + else if (fi->isIndexed && (bits & FieldsWriter::FIELD_IS_TOKENIZED) == 0) + bits |= Field::INDEX_UNTOKENIZED; + else + bits |= Field::INDEX_NO; + + if (fi->storeTermVector) { + if (fi->storeOffsetWithTermVector) { + if (fi->storePositionWithTermVector) { + bits |= Field::TERMVECTOR_WITH_OFFSETS; + bits |= Field::TERMVECTOR_WITH_POSITIONS; + } else { + bits |= Field::TERMVECTOR_WITH_OFFSETS; + } + } else if (fi->storePositionWithTermVector) { + bits |= Field::TERMVECTOR_WITH_POSITIONS; + } else { + bits |= Field::TERMVECTOR_YES; + } + } else { + bits |= Field::TERMVECTOR_NO; + } + + if ( (bits & FieldsWriter::FIELD_IS_COMPRESSED) != 0 ) { + bits |= Field::STORE_COMPRESS; + int32_t fieldLen = fieldsStream->readVInt(); + FieldsStreamHolder* subStream = new + FieldsStreamHolder(fieldsStream, fieldLen); + + // TODO: we dont have gzip inputstream available, must alert + // user to somehow use a gzip inputstream + Field* f = _CLNEW Field( + fi->name, // name + subStream, // read value + bits); + + f->setOmitNorms(fi->omitNorms); + doc->add(*f); + + // now skip over the rest of the field + if (fieldsStream->getFilePointer() + fieldLen + == fieldsStream->length()) { + //set to eof + fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen - 1); + fieldsStream->readByte(); + } else { + fieldsStream->seek(fieldsStream->getFilePointer() + fieldLen); + } + } else { + TCHAR* fvalue = fieldsStream->readString(true); + Field* f = _CLNEW Field( + fi->name, // name + fvalue, // read value + bits); + // TODO: could optimise this + _CLDELETE_CARRAY(fvalue); + f->setOmitNorms(fi->omitNorms); + doc->add(*f); + } + } + } + return true; +} + +FieldsReader::FieldsStreamHolder::FieldsStreamHolder(IndexInput* indexInput, + int32_t subLength) +{ + this->indexInput = indexInput->clone(); + this->indexInputStream = new IndexInputStream(this->indexInput); + this->subStream = new jstreams::SubInputStream(indexInputStream, + subLength); + + this->size = subStream->getSize(); + this->position = subStream->getPosition(); + this->error = subStream->getError(); + this->status = subStream->getStatus(); +} + +FieldsReader::FieldsStreamHolder::~FieldsStreamHolder() +{ + delete subStream; + delete indexInputStream; + + indexInput->close(); + _CLDELETE(indexInput); +} + +int32_t FieldsReader::FieldsStreamHolder::read(const char*& start, int32_t _min, + int32_t _max) +{ + int32_t ret = subStream->read(start,_min,_max); + this->position = subStream->getPosition(); + this->error = subStream->getError(); + this->status = subStream->getStatus(); + return ret; +} + +int64_t FieldsReader::FieldsStreamHolder::skip(int64_t ntoskip) +{ + int64_t ret = subStream->skip(ntoskip); + this->position = subStream->getPosition(); + this->error = subStream->getError(); + this->status = subStream->getStatus(); + return ret; +} + +int64_t FieldsReader::FieldsStreamHolder::reset(int64_t pos) +{ + int64_t ret = subStream->reset(pos); + this->position = subStream->getPosition(); + this->error = subStream->getError(); + this->status = subStream->getStatus(); + return ret; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.h b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.h new file mode 100644 index 000000000..53589a5cc --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsReader.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_FieldsReader_ +#define _lucene_index_FieldsReader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/util/subinputstream.h" +#include "CLucene/store/IndexInput.h" + +CL_NS_DEF(index) + +class FieldInfos; + +class FieldsReader : LUCENE_BASE +{ +private: + const FieldInfos* fieldInfos; + CL_NS(store)::IndexInput* fieldsStream; + CL_NS(store)::IndexInput* indexStream; + int32_t _size; + + class FieldsStreamHolder : public jstreams::StreamBase + { + CL_NS(store)::IndexInput* indexInput; + CL_NS(store)::IndexInputStream* indexInputStream; + jstreams::SubInputStream* subStream; + + public: + FieldsStreamHolder(CL_NS(store)::IndexInput* indexInput, int32_t subLength); + ~FieldsStreamHolder(); + int32_t read(const char*& start, int32_t _min, int32_t _max); + int64_t skip(int64_t ntoskip); + int64_t reset(int64_t pos); + }; + +public: + FieldsReader(CL_NS(store)::Directory* d, const QString& segment, FieldInfos* fn); + ~FieldsReader(); + void close(); + int32_t size() const; + // loads the fields from n'th document into doc. returns true on success. + bool doc(int32_t n, CL_NS(document)::Document* doc); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp new file mode 100644 index 000000000..ceb6735cb --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.cpp @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "FieldsWriter.h" + +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Reader.h" +#include "CLucene/util/Misc.h" +#include "CLucene/store/Directory.h" +#include "CLucene/store/IndexOutput.h" +#include "CLucene/document/Document.h" +#include "CLucene/document/Field.h" +#include "FieldInfos.h" + +CL_NS_USE(store) +CL_NS_USE(util) +CL_NS_USE(document) +CL_NS_DEF(index) + +FieldsWriter::FieldsWriter(Directory* d, const QString& segment, FieldInfos* fn) + : fieldInfos(fn) +{ + //Func - Constructor + //Pre - d contains a valid reference to a directory + // segment != NULL and contains the name of the segment + //Post - fn contains a valid reference toa a FieldInfos + + CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); + + QString buf = Misc::segmentname(segment, QLatin1String(".fdt")); + fieldsStream = d->createOutput(buf); + + buf = Misc::segmentname(segment, QLatin1String(".fdx")); + indexStream = d->createOutput(buf); + + CND_CONDITION(indexStream != NULL, "indexStream is NULL"); +} + +FieldsWriter::~FieldsWriter() +{ + //Func - Destructor + //Pre - true + //Post - Instance has been destroyed + + close(); +} + +void FieldsWriter::close() +{ + //Func - Closes all streams and frees all resources + //Pre - true + //Post - All streams have been closed all resources have been freed + + //Check if fieldsStream is valid + if (fieldsStream) { + //Close fieldsStream + fieldsStream->close(); + _CLDELETE(fieldsStream); + } + + //Check if indexStream is valid + if (indexStream) { + //Close indexStream + indexStream->close(); + _CLDELETE(indexStream); + } +} + +void FieldsWriter::addDocument(Document* doc) +{ + //Func - Adds a document + //Pre - doc contains a valid reference to a Document + // indexStream != NULL + // fieldsStream != NULL + //Post - The document doc has been added + + CND_PRECONDITION(indexStream != NULL, "indexStream is NULL"); + CND_PRECONDITION(fieldsStream != NULL, "fieldsStream is NULL"); + + indexStream->writeLong(fieldsStream->getFilePointer()); + + int32_t storedCount = 0; + DocumentFieldEnumeration* fields = doc->fields(); + while (fields->hasMoreElements()) { + Field* field = fields->nextElement(); + if (field->isStored()) + storedCount++; + } + _CLDELETE(fields); + fieldsStream->writeVInt(storedCount); + + fields = doc->fields(); + while (fields->hasMoreElements()) { + Field* field = fields->nextElement(); + if (field->isStored()) { + fieldsStream->writeVInt(fieldInfos->fieldNumber(field->name())); + + uint8_t bits = 0; + if (field->isTokenized()) + bits |= FieldsWriter::FIELD_IS_TOKENIZED; + if (field->isBinary()) + bits |= FieldsWriter::FIELD_IS_BINARY; + if (field->isCompressed()) + bits |= FieldsWriter::FIELD_IS_COMPRESSED; + + fieldsStream->writeByte(bits); + + if ( field->isCompressed()) { + _CLTHROWA(CL_ERR_Runtime, + "CLucene does not directly support compressed fields. " + "Write a compressed byte array instead"); + } else { + // FEATURE: this problem in Java Lucene too, if using Reader, + // data is not stored. + // + // TODO: this is a logic bug... + // if the field is stored, and indexed, and is using a reader + // the field wont get indexed + // + // if we could write zero prefixed vints (therefore static + // length), then we could write a reader directly to the field + // indexoutput and then go back and write the data length. + // however this is not supported in lucene yet... + // if this is ever implemented, then it would make sense to + // also be able to combine the FieldsWriter and + // DocumentWriter::invertDocument process, and use a + // streamfilter to write the field data while the documentwrite + // analyses the document! how cool would that be! it would cut + // out all these buffers!!! + + // compression is disabled for the current field + if (field->isBinary()) { + // TODO: since we currently don't support static length vints, + // we have to read the entire stream into memory first.... ugly! + jstreams::StreamBase* stream = field->streamValue(); + const char* sd; + // how do we make sure we read the entire index in now??? + // TODO: we need to have a max amount, and guarantee its all + // in or throw an error... + int32_t rl = stream->read(sd,10000000,0); + + if ( rl < 0 ) { + // TODO: could we detect this earlier and not actually + // write the field?? + fieldsStream->writeVInt(0); + } else { + // TODO: if this int could be written with a constant + // length, then the stream could be read and written a + // bit at a time then the length is re-written at the end. + fieldsStream->writeVInt(rl); + fieldsStream->writeBytes((uint8_t*)sd, rl); + } + } else if (field->stringValue() == NULL ) { + // we must be using readerValue + CND_PRECONDITION(!field->isIndexed(), + "Cannot store reader if it is indexed too") + Reader* r = field->readerValue(); + + //read the entire string + const TCHAR* rv; + int64_t rl = r->read(rv, LUCENE_INT32_MAX_SHOULDBE); + if ( rl > LUCENE_INT32_MAX_SHOULDBE ) + _CLTHROWA(CL_ERR_Runtime, "Field length too long"); + else if ( rl < 0 ) + rl = 0; + + fieldsStream->writeString( rv, (int32_t)rl); + } else if (field->stringValue() != NULL ) { + fieldsStream->writeString(field->stringValue(), + _tcslen(field->stringValue())); + } else { + _CLTHROWA(CL_ERR_Runtime, "No values are set for the field"); + } + } + } + } + _CLDELETE(fields); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.h b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.h new file mode 100644 index 000000000..7dde5f225 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/FieldsWriter.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_FieldsWriter_ +#define _lucene_index_FieldsWriter_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/document/Document.h" +#include "CLucene/store/Directory.h" +#include "CLucene/store/IndexOutput.h" + +CL_NS_DEF(index) + +class FieldInfos; + +class FieldsWriter : LUCENE_BASE +{ +private: + FieldInfos* fieldInfos; + + CL_NS(store)::IndexOutput* fieldsStream; + CL_NS(store)::IndexOutput* indexStream; + +public: + LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_TOKENIZED = 0x1); + LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_BINARY = 0x2); + LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_COMPRESSED = 0x4); + + FieldsWriter(CL_NS(store)::Directory* d, const QString& segment, FieldInfos* fn); + ~FieldsWriter(); + + void close(); + + void addDocument(CL_NS(document)::Document* doc); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp new file mode 100644 index 000000000..1423cc7a8 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.cpp @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "IndexModifier.h" + +#include "Term.h" +#include "IndexWriter.h" +#include "IndexReader.h" + +CL_NS_DEF(index) +CL_NS_USE(util) +CL_NS_USE(store) +CL_NS_USE(analysis) +CL_NS_USE(document) + +IndexModifier::IndexModifier(Directory* directory, Analyzer* analyzer, bool create) { + init(directory, analyzer, create); +} + +IndexModifier::IndexModifier(const QString& dirName, Analyzer* analyzer, bool create) { + Directory* dir = FSDirectory::getDirectory(dirName, create); + init(dir, analyzer, create); +} + +void IndexModifier::init(Directory* directory, Analyzer* analyzer, bool create) { + indexWriter = NULL; + indexReader = NULL; + this->analyzer = analyzer; + open = false; + + useCompoundFile = true; + int32_t maxBufferedDocs = IndexWriter::DEFAULT_MAX_BUFFERED_DOCS; + this->maxFieldLength = IndexWriter::DEFAULT_MAX_FIELD_LENGTH; + int32_t mergeFactor = IndexWriter::DEFAULT_MERGE_FACTOR; + + this->directory = _CL_POINTER(directory); + createIndexReader(); + open = true; +} + +IndexModifier::~IndexModifier(){ + close(); +} + +void IndexModifier::assureOpen() const{ + if (!open) { + _CLTHROWA(CL_ERR_IllegalState,"Index is closed"); + } +} + +void IndexModifier::createIndexWriter() { + if (indexWriter == NULL) { + if (indexReader != NULL) { + indexReader->close(); + _CLDELETE(indexReader); + } + indexWriter = _CLNEW IndexWriter(directory, analyzer, false); + indexWriter->setUseCompoundFile(useCompoundFile); + //indexWriter->setMaxBufferedDocs(maxBufferedDocs); + indexWriter->setMaxFieldLength(maxFieldLength); + //indexWriter->setMergeFactor(mergeFactor); + } +} + +void IndexModifier::createIndexReader() { + if (indexReader == NULL) { + if (indexWriter != NULL) { + indexWriter->close(); + _CLDELETE(indexWriter); + } + indexReader = IndexReader::open(directory); + } +} + +void IndexModifier::flush() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + if (indexWriter != NULL) { + indexWriter->close(); + _CLDELETE(indexWriter); + createIndexWriter(); + } else { + indexReader->close(); + _CLDELETE(indexReader); + createIndexReader(); + } +} + +void IndexModifier::addDocument(Document* doc, Analyzer* docAnalyzer) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexWriter(); + if (docAnalyzer != NULL) + indexWriter->addDocument(doc, docAnalyzer); + else + indexWriter->addDocument(doc); +} + +int32_t IndexModifier::deleteDocuments(Term* term) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexReader(); + return indexReader->deleteDocuments(term); +} + +void IndexModifier::deleteDocument(int32_t docNum) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexReader(); + indexReader->deleteDocument(docNum); +} + +int32_t IndexModifier::docCount() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + if (indexWriter != NULL) + return indexWriter->docCount(); + else + return indexReader->numDocs(); +} + +void IndexModifier::optimize() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexWriter(); + indexWriter->optimize(); +} + +void IndexModifier::setUseCompoundFile(bool useCompoundFile) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + if (indexWriter != NULL) + indexWriter->setUseCompoundFile(useCompoundFile); + this->useCompoundFile = useCompoundFile; +} + +bool IndexModifier::getUseCompoundFile() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexWriter(); + return indexWriter->getUseCompoundFile(); +} + +void IndexModifier::setMaxFieldLength(int32_t maxFieldLength) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + if (indexWriter != NULL) + indexWriter->setMaxFieldLength(maxFieldLength); + this->maxFieldLength = maxFieldLength; +} + +int32_t IndexModifier::getMaxFieldLength() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexWriter(); + return indexWriter->getMaxFieldLength(); +} + +void IndexModifier::setMaxBufferedDocs(int32_t maxBufferedDocs) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + if (indexWriter != NULL) + indexWriter->setMaxBufferedDocs(maxBufferedDocs); + this->maxBufferedDocs = maxBufferedDocs; +} + +int32_t IndexModifier::getMaxBufferedDocs() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexWriter(); + return indexWriter->getMaxBufferedDocs(); +} +void IndexModifier::setMergeFactor(int32_t mergeFactor) { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + if (indexWriter != NULL) + indexWriter->setMergeFactor(mergeFactor); + this->mergeFactor = mergeFactor; +} + +int32_t IndexModifier::getMergeFactor() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexWriter(); + return indexWriter->getMergeFactor(); +} + +void IndexModifier::close() { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + if (indexWriter != NULL) { + indexWriter->close(); + _CLDELETE(indexWriter); + } else { + indexReader->close(); + _CLDELETE(indexReader); + } + _CLDECDELETE(directory) + open = false; +} + +QString IndexModifier::toString() const +{ + QString ret(QLatin1String("Index@")); + return ret.append(directory->toString()); +} + + + +int64_t IndexModifier::getCurrentVersion() const{ + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + return IndexReader::getCurrentVersion(directory); +} + +TermDocs* IndexModifier::termDocs(Term* term){ + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexReader(); + return indexReader->termDocs(term); +} + +TermEnum* IndexModifier::terms(Term* term){ + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexReader(); + if ( term != NULL ) + return indexReader->terms(term); + else + return indexReader->terms(); +} + + + CL_NS(document)::Document* IndexModifier::document(const int32_t n){ + Document* ret = _CLNEW Document; + if (!document(n,ret) ) + _CLDELETE(ret); + return ret; + } +bool IndexModifier::document(int32_t n, CL_NS(document)::Document* doc){ + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + assureOpen(); + createIndexReader(); + return indexReader->document(n, doc); +} +CL_NS(store)::Directory* IndexModifier::getDirectory(){ + return directory; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.h b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.h new file mode 100644 index 000000000..4e9963f5a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexModifier.h @@ -0,0 +1,316 @@ +/* +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_IndexModifier_ +#define _lucene_index_IndexModifier_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/analysis/AnalysisHeader.h" + +CL_NS_DEF(index) + +class IndexReader; +class IndexWriter; +class Term; +class TermDocs; +class TermEnum; + +/** +* A class to modify an index, i.e. to delete and add documents. This +* class hides {@link IndexReader} and {@link IndexWriter} so that you +* do not need to care about implementation details such as that adding +* documents is done via IndexWriter and deletion is done via IndexReader. +* +*

Note that you cannot create more than one IndexModifier object +* on the same directory at the same time. +* +*

Example usage: +* +*

+* +* +* +* +*
+* +* //note this code will leak memory :) +* Analyzer* analyzer = new StandardAnalyzer();
+* // create an index in /tmp/index, overwriting an existing one:
+* IndexModifier* indexModifier = new IndexModifier("/tmp/index", analyzer, true);
+* Document* doc = new Document*();
+* doc->add(*new Field("id", "1", Field::STORE_YES| Field::INDEX_UNTOKENIZED));
+* doc->add(*new Field("body", "a simple test", Field::STORE_YES, Field::INDEX_TOKENIZED));
+* indexModifier->addDocument(doc);
+* int32_t deleted = indexModifier->deleteDocuments(new Term("id", "1"));
+* printf("Deleted %d document", deleted);
+* indexModifier->flush();
+* printf( "$d docs in index", indexModifier->docCount() );
+* indexModifier->close(); +*
+*
+* +*

Not all methods of IndexReader and IndexWriter are offered by this +* class. If you need access to additional methods, either use those classes +* directly or implement your own class that extends IndexModifier. +* +*

Although an instance of this class can be used from more than one +* thread, you will not get the best performance. You might want to use +* IndexReader and IndexWriter directly for that (but you will need to +* care about synchronization yourself then). +* +*

While you can freely mix calls to add() and delete() using this class, +* you should batch you calls for best performance. For example, if you +* want to update 20 documents, you should first delete all those documents, +* then add all the new documents. +* +*/ +class IndexModifier : LUCENE_BASE +{ +protected: + IndexWriter* indexWriter; + IndexReader* indexReader; + + CL_NS(store)::Directory* directory; + CL_NS(analysis)::Analyzer* analyzer; + bool open; + + // Lucene defaults: + bool useCompoundFile; + int32_t maxBufferedDocs; + int32_t maxFieldLength; + int32_t mergeFactor; + +public: + + /** + * Open an index with write access. + * + * @param directory the index directory + * @param analyzer the analyzer to use for adding new documents + * @param create true to create the index or overwrite + * the existing one; false to append to the existing index + */ + IndexModifier(CL_NS(store)::Directory* directory, + CL_NS(analysis)::Analyzer* analyzer, bool create); + + ~IndexModifier(); + + /** + * Open an index with write access. + * + * @param dirName the index directory + * @param analyzer the analyzer to use for adding new documents + * @param create true to create the index or overwrite + * the existing one; false to append to the existing index + */ + IndexModifier(const QString& dirName, CL_NS(analysis)::Analyzer* analyzer, + bool create); + +protected: + + // Initialize an IndexWriter. @throws IOException + void init(CL_NS(store)::Directory* directory, + CL_NS(analysis)::Analyzer* analyzer, bool create); + + // Throw an IllegalStateException if the index is closed. + // @throws IllegalStateException + void assureOpen() const; + + // Close the IndexReader and open an IndexWriter. @throws IOException + void createIndexWriter(); + + // Close the IndexWriter and open an IndexReader. @throws IOException + void createIndexReader(); + +public: + // Make sure all changes are written to disk. @throws IOException + void flush(); + + // Adds a document to this index, using the provided analyzer instead of + // the one specific in the constructor. If the document contains more than + // {@link #setMaxFieldLength(int32_t)} terms for a given field, the + // remainder are discarded. + // @see IndexWriter#addDocument(Document*, Analyzer*) + // @throws IllegalStateException if the index is closed + void addDocument(CL_NS(document)::Document* doc, CL_NS(analysis)::Analyzer* + docAnalyzer = NULL); + + + /** + * Deletes all documents containing term. + * This is useful if one uses a document field to hold a unique ID string for + * the document. Then to delete such a document, one merely constructs a + * term with the appropriate field and the unique ID string as its text and + * passes it to this method. Returns the number of documents deleted. + * @return the number of documents deleted + * @see IndexReader#deleteDocuments(Term*) + * @throws IllegalStateException if the index is closed + */ + int32_t deleteDocuments(Term* term); + + /** + * Deletes the document numbered docNum. + * @see IndexReader#deleteDocument(int32_t) + * @throws IllegalStateException if the index is closed + */ + void deleteDocument(int32_t docNum); + + /** + * Returns the number of documents currently in this index. + * @see IndexWriter#docCount() + * @see IndexReader#numDocs() + * @throws IllegalStateException if the index is closed + */ + int32_t docCount(); + + /** + * Merges all segments together into a single segment, optimizing an index + * for search. + * @see IndexWriter#optimize() + * @throws IllegalStateException if the index is closed + */ + void optimize(); + + /** + * Setting to turn on usage of a compound file. When on, multiple files + * for each segment are merged into a single file once the segment creation + * is finished. This is done regardless of what directory is in use. + * @see IndexWriter#setUseCompoundFile(bool) + * @throws IllegalStateException if the index is closed + */ + void setUseCompoundFile(bool useCompoundFile); + + /** + * @throws IOException + * @see IndexModifier#setUseCompoundFile(bool) + */ + bool getUseCompoundFile(); + + /** + * The maximum number of terms that will be indexed for a single field in a + * document. This limits the amount of memory required for indexing, so that + * collections with very large files will not crash the indexing process by + * running out of memory.

+ * Note that this effectively truncates large documents, excluding from the + * index terms that occur further in the document. If you know your source + * documents are large, be sure to set this value high enough to accomodate + * the expected size. If you set it to Integer.MAX_VALUE, then the only limit + * is your memory, but you should anticipate an OutOfMemoryError.

+ * By default, no more than 10,000 terms will be indexed for a field. + * @see IndexWriter#setMaxFieldLength(int32_t) + * @throws IllegalStateException if the index is closed + */ + void setMaxFieldLength(int32_t maxFieldLength); + + /** + * @throws IOException + * @see IndexModifier#setMaxFieldLength(int32_t) + */ + int32_t getMaxFieldLength(); + + /* + * The maximum number of terms that will be indexed for a single field in a + * document. This limits the amount of memory required for indexing, so that + * collections with very large files will not crash the indexing process by + * running out of memory.

+ * Note that this effectively truncates large documents, excluding from the + * index terms that occur further in the document. If you know your source + * documents are large, be sure to set this value high enough to accomodate + * the expected size. If you set it to Integer.MAX_VALUE, then the only limit + * is your memory, but you should anticipate an OutOfMemoryError.

+ * By default, no more than 10,000 terms will be indexed for a field. + * @see IndexWriter#setMaxBufferedDocs(int32_t) + * @throws IllegalStateException if the index is closed + */ + void setMaxBufferedDocs(int32_t maxBufferedDocs); + + // @see IndexModifier#setMaxBufferedDocs(int32_t) @throws IOException + int32_t getMaxBufferedDocs(); + + /* + * Determines how often segment indices are merged by addDocument(). With + * smaller values, less RAM is used while indexing, and searches on + * unoptimized indices are faster, but indexing speed is slower. With larger + * values, more RAM is used during indexing, and while searches on unoptimized + * indices are slower, indexing is faster. Thus larger values (> 10) are + * best for batch index creation, and smaller values (< 10) for indices + * that are interactively maintained. + *

This must never be less than 2. The default value is 10. + * + * @see IndexWriter#setMergeFactor(int32_t) + * @throws IllegalStateException if the index is closed + */ + void setMergeFactor(int32_t mergeFactor); + + /** + * @throws IOException + * @see IndexModifier#setMergeFactor(int32_t) + */ + int32_t getMergeFactor(); + + /** + * Close this index, writing all pending changes to disk. + * + * @throws IllegalStateException if the index has been closed before already + */ + void close(); + + QString toString() const; + + /** + * Gets the version number of the currently open index. + */ + int64_t getCurrentVersion() const; + + /** + * Returns an enumeration of all the documents which contain term. + * + * Warning: This is not threadsafe. Make sure you lock the modifier object + * while using the TermDocs. If the IndexReader that the modifier manages + * is closed, the TermDocs object will fail. + */ + TermDocs* termDocs(Term* term = NULL); + + /** + * Returns an enumeration of all terms after a given term. + * If no term is given, an enumeration of all the terms + * in the index is returned. + * The enumeration is ordered by Term.compareTo(). Each term + * is greater than all that precede it in the enumeration. + * + * Warning: This is not threadsafe. Make sure you lock the modifier object + * while using the TermDocs. If the IndexReader that the modifier manages + * is closed, the Document will be invalid + */ + TermEnum* terms(Term* term = NULL); + + /** + * Returns the stored fields of the n-th Document in this index. + * + * Warning: This is not threadsafe. Make sure you lock the modifier object + * while using the TermDocs. If the IndexReader that the modifier manages + * is closed, the Document will be invalid + */ + bool document(const int32_t n, CL_NS(document)::Document* doc); + _CL_DEPRECATED(document(i, document)) + CL_NS(document)::Document* document(const int32_t n); + + // Returns the directory used by this index. + CL_NS(store)::Directory* getDirectory(); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.cpp new file mode 100644 index 000000000..91c735632 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.cpp @@ -0,0 +1,668 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +# include +# include + +#include "CLucene/StdHeader.h" +#include "IndexReader.h" +#include "IndexWriter.h" + +#include "CLucene/store/Directory.h" +#include "CLucene/store/FSDirectory.h" +#include "CLucene/store/Lock.h" +#include "CLucene/document/Document.h" +#include "CLucene/search/Similarity.h" +#include "SegmentInfos.h" +#include "MultiReader.h" +#include "Terms.h" + +CL_NS_USE(util) +CL_NS_USE(store) +CL_NS_DEF(index) + +IndexReader::IndexReader(Directory* dir) + : stale(false) + , hasChanges(false) + , closeDirectory(false) + , directoryOwner(false) + , segmentInfos(NULL) + , directory(_CL_POINTER(dir)) + , writeLock(NULL) +{ +} + +IndexReader::IndexReader(Directory* dir, SegmentInfos* infos, bool close) + : stale(false) + , hasChanges(false) + , closeDirectory(close) + , directoryOwner(true) + , segmentInfos(infos) + , directory(_CL_POINTER(dir)) + , writeLock(NULL) +{ +} + +IndexReader::~IndexReader() +{ + if (writeLock != NULL) { + writeLock->release(); + _CLDELETE(writeLock); + } + _CLDELETE(segmentInfos); + _CLDECDELETE(directory); +} + +IndexReader* IndexReader::open(const QString& path) +{ + //Func - Static method. + // Returns an IndexReader reading the index in an FSDirectory in the named path. + //Pre - path != NULL and contains the path of the index for which an IndexReader must be + // instantiated + // closeDir indicates if the directory needs to be closed + //Post - An IndexReader has been returned that reads tnhe index located at path + + CND_PRECONDITION(!path.isEmpty(), "path is NULL"); + + Directory* dir = FSDirectory::getDirectory(path, false); + IndexReader* reader = open(dir, true); + //because fsdirectory will now have a refcount of 1 more than + //if the reader had been opened with a directory object, + //we need to do a refdec + _CLDECDELETE(dir); + return reader; +} + +IndexReader* IndexReader::open(Directory* directory, bool closeDirectory) +{ + //Func - Static method. + // Returns an IndexReader reading the index in an FSDirectory in the named path. + //Pre - directory represents a directory + // closeDir indicates if the directory needs to be closed + //Post - An IndexReader has been returned that reads the index located at directory + + // in- & inter-process sync + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + + //Instantiate an IndexReader::LockWith which can produce an IndexReader + LuceneLock* lock = directory->makeLock(QLatin1String("commit.lock")); + IndexReader::LockWith with(lock, directory); + + IndexReader* ret = NULL; + try { + //Create an IndexReader reading the index + ret = with.runAndReturn(); + } _CLFINALLY ( + _CLDELETE(lock); + ); + + CND_CONDITION(ret != NULL, "ret is NULL"); + ret->closeDirectory = closeDirectory; + + return ret; +} + +CL_NS(document)::Document* IndexReader::document(const int32_t n) +{ + CL_NS(document)::Document* ret = _CLNEW CL_NS(document)::Document; + if (!document(n, ret)) + _CLDELETE(ret); + return ret; +} + +IndexReader* IndexReader::LockWith::doBody() +{ + //Func - Reads the segmentinfo file and depending on the number of segments found + // it returns a SegmentsReader or a SegmentReader + //Pre - directory != NULL + //Post - Depending on the number of Segments present in directory this method + // returns an empty SegmentsReader when there are no segments, a SegmentReader when + // directory contains 1 segment and a nonempty SegmentsReader when directory + // contains multiple segements + + CND_PRECONDITION(directory != NULL, "directory is NULL"); + + //Instantiate SegmentInfos + SegmentInfos* infos = _CLNEW SegmentInfos; + try { + //Have SegmentInfos read the segments file in directory + infos->read(directory); + } catch(...) { + //make sure infos is cleaned up + _CLDELETE(infos); + throw; + } + + // If there is at least one segment (if infos.size() >= 1), the last + // SegmentReader object will close the directory when the SegmentReader + // object itself is closed (see SegmentReader::doClose). + // If there are no segments, there will be no "last SegmentReader object" + // to fulfill this responsibility, so we need to explicitly close the + // directory in the segmentsreader.close + + //Count the number segments in the directory + const uint32_t nSegs = infos->size(); + + if (nSegs == 1 ) { + // index is optimized + return _CLNEW SegmentReader(infos, infos->info(0)); + } else { + //Instantiate an array of pointers to SegmentReaders of size nSegs (The number of segments in the index) + IndexReader** readers = NULL; + + if (nSegs > 0){ + uint32_t infosize = infos->size(); + readers = _CL_NEWARRAY(IndexReader*,infosize+1); + for (uint32_t i = 0; i < infosize; ++i) { + //Instantiate a SegementReader responsible for reading the i-th segment and store it in + //the readers array + readers[i] = _CLNEW SegmentReader(infos->info(i)); + } + readers[infosize] = NULL; + } + + //return an instance of SegmentsReader which is a reader that manages all Segments + return _CLNEW MultiReader(directory, infos, readers); + }// end if +} + +uint64_t IndexReader::lastModified(const QString& directory) +{ + //Func - Static method + // Returns the time the index in the named directory was last modified. + //Pre - directory != NULL and contains the path name of the directory to check + //Post - The last modified time of the index has been returned + + CND_PRECONDITION(!directory.isEmpty(), "directory is NULL"); + + return FSDirectory::fileModified(directory, QLatin1String("segments")); +} + +int64_t IndexReader::getCurrentVersion(Directory* directory) +{ + // in- & inter-process sync + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + + int64_t ret = 0; + bool locked = false; + LuceneLock* commitLock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + try { + locked = commitLock->obtain(IndexWriter::COMMIT_LOCK_TIMEOUT); + ret = SegmentInfos::readCurrentVersion(directory); + } _CLFINALLY ( + if (locked) + commitLock->release(); + _CLDELETE(commitLock); + ) + return ret; +} + +int64_t IndexReader::getCurrentVersion(const QString& directory) +{ + Directory* dir = FSDirectory::getDirectory(directory, false); + int64_t version = getCurrentVersion(dir); + dir->close(); + _CLDECDELETE(dir); + return version; +} + +int64_t IndexReader::getVersion() +{ + return segmentInfos->getVersion(); +} + +bool IndexReader::isCurrent() +{ + // in- & inter-process sync + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + + bool ret = false; + bool locked = false; + LuceneLock* commitLock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + try { + locked = commitLock->obtain(IndexWriter::COMMIT_LOCK_TIMEOUT); + ret = SegmentInfos::readCurrentVersion(directory) + == segmentInfos->getVersion(); + } _CLFINALLY( + if (locked) + commitLock->release(); + _CLDELETE(commitLock); + ) + return ret; +} + +uint64_t IndexReader::lastModified(const Directory* directory) +{ + //Func - Static method + // Returns the time the index in this directory was last modified. + //Pre - directory contains a valid reference + //Post - The last modified time of the index has been returned + + return directory->fileModified(QLatin1String("segments")); +} + + +bool IndexReader::indexExists(const QString& directory) +{ + //Func - Static method + // Checks if an index exists in the named directory + //Pre - directory != NULL + //Post - Returns true if an index exists at the specified directory-> + // If the directory does not exist or if there is no index in it. + // false is returned. + + CND_PRECONDITION(!directory.isEmpty(), "directory is NULL"); + return QFile(directory + QLatin1String("/segments")).exists(); +} + + +void IndexReader::setNorm(int32_t doc, const TCHAR* field, uint8_t value) +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + if(directoryOwner) + aquireWriteLock(); + doSetNorm(doc, field, value); + hasChanges = true; +} + +void IndexReader::aquireWriteLock() +{ + if (stale) { + _CLTHROWA(CL_ERR_IO, + "IndexReader out of date and no longer valid for delete, " + "undelete, or setNorm operations"); + } + + if (writeLock == NULL) { + LuceneLock* writeLock = directory->makeLock(QLatin1String("write.lock")); + if (!writeLock->obtain(IndexWriter::WRITE_LOCK_TIMEOUT)) // obtain write lock + _CLTHROWA(CL_ERR_IO,"Index locked for write"); // + writeLock + this->writeLock = writeLock; + + // we have to check whether index has changed since this reader was opened. + // if so, this reader is no longer valid for deletion + if (SegmentInfos::readCurrentVersion(directory) > segmentInfos->getVersion()) { + stale = true; + this->writeLock->release(); + _CLDELETE(this->writeLock); + _CLTHROWA(CL_ERR_IO,"IndexReader out of date and no longer valid " + "for delete, undelete, or setNorm operations"); + } + } +} + + +void IndexReader::setNorm(int32_t doc, const TCHAR* field, qreal value) +{ + setNorm(doc, field, CL_NS(search)::Similarity::encodeNorm(value)); +} + +bool IndexReader::indexExists(const Directory* directory) +{ + //Func - Static method + // Checks if an index exists in the directory + //Pre - directory is a valid reference + //Post - Returns true if an index exists at the specified directory-> + // If the directory does not exist or if there is no index in it. + // false is returned. + + return directory->fileExists(QLatin1String("segments")); +} + +TermDocs* IndexReader::termDocs(Term* term) const +{ + //Func - Returns an enumeration of all the documents which contain + // term. For each document, the document number, the frequency of + // the term in that document is also provided, for use in search scoring. + // Thus, this method implements the mapping: + // + // Term => * + // The enumeration is ordered by document number. Each document number + // is greater than all that precede it in the enumeration. + //Pre - term != NULL + //Post - A reference to TermDocs containing an enumeration of all found documents + // has been returned + + CND_PRECONDITION(term != NULL, "term is NULL"); + + //Reference an instantiated TermDocs instance + TermDocs* _termDocs = termDocs(); + //Seek all documents containing term + _termDocs->seek(term); + //return the enumaration + return _termDocs; +} + +TermPositions* IndexReader::termPositions(Term* term) const +{ + //Func - Returns an enumeration of all the documents which contain term. For each + // document, in addition to the document number and frequency of the term in + // that document, a list of all of the ordinal positions of the term in the document + // is available. Thus, this method implements the mapping: + // + // Term => >* + // + // This positional information faciliates phrase and proximity searching. + // The enumeration is ordered by document number. Each document number is greater than + // all that precede it in the enumeration. + //Pre - term != NULL + //Post - A reference to TermPositions containing an enumeration of all found documents + // has been returned + + CND_PRECONDITION(term != NULL, "term is NULL"); + + //Reference an instantiated termPositions instance + TermPositions* _termPositions = termPositions(); + //Seek all documents containing term + _termPositions->seek(term); + //return the enumeration + return _termPositions; +} + +void IndexReader::deleteDocument(const int32_t docNum) +{ + //Func - Deletes the document numbered docNum. Once a document is deleted it will not appear + // in TermDocs or TermPostitions enumerations. Attempts to read its field with the document + // method will result in an error. The presence of this document may still be reflected in + // the docFreq statistic, though this will be corrected eventually as the index is further modified. + //Pre - docNum >= 0 + //Post - If successful the document identified by docNum has been deleted. If no writelock + // could be obtained an exception has been thrown stating that the index was locked or has no write access + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CND_PRECONDITION(docNum >= 0, "docNum is negative"); + + if (directoryOwner) + aquireWriteLock(); + + //Have the document identified by docNum deleted + doDelete(docNum); + hasChanges = true; +} + +/** +* Commit changes resulting from delete, undeleteAll, or setNorm operations +* +* @throws IOException +*/ +void IndexReader::commit() +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + if(hasChanges){ + if(directoryOwner){ + { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync + + LuceneLock* commitLock = directory->makeLock(QLatin1String("commit.lock")); + IndexReader::CommitLockWith cl(commitLock,this); + cl.run(); + _CLDELETE(commitLock); + + } + if (writeLock != NULL) { + writeLock->release(); // release write lock + _CLDELETE(writeLock); + } + }else + doCommit(); + } + hasChanges = false; +} + + +void IndexReader::undeleteAll() +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + if(directoryOwner) + aquireWriteLock(); + doUndeleteAll(); + hasChanges = true; +} + +int32_t IndexReader::deleteDocuments(Term* term) +{ + //Func - Deletes all documents containing term. This is useful if one uses a + // document field to hold a unique ID string for the document. Then to delete such + // a document, one merely constructs a term with the appropriate field and the unique + // ID string as its text and passes it to this method. + //Pre - term != NULL + //Post - All documents containing term have been deleted. The number of deleted documents + // has been returned + + CND_PRECONDITION(term != NULL, "term is NULL"); + + //Search for the documents contain term + TermDocs* docs = termDocs(term); + + //Check if documents have been found + if ( docs == NULL ){ + return 0; + } + + //initialize + int32_t Counter = 0; + try { + //iterate through the found documents + while (docs->next()) { + //Delete the document + deleteDocument(docs->doc()); + ++Counter; + } + }_CLFINALLY( + //Close the enumeration + docs->close(); + ); + + //Delete the enumeration of found documents + _CLDELETE( docs ); + + //Return the number of deleted documents + return Counter; +} + +TCHAR** IndexReader::getFieldNames() +{ + CL_NS(util)::StringArrayWithDeletor array; + getFieldNames(IndexReader::ALL, array); + + array.setDoDelete(false); + TCHAR** ret = _CL_NEWARRAY(TCHAR*,array.size()+1); + int j=0; + CL_NS(util)::StringArrayWithDeletor::iterator itr = array.begin(); + while ( itr != array.end() ){ + ret[j]=*itr; + ++j;++itr; + } + ret[j]=NULL; + return ret; +} + +TCHAR** IndexReader::getFieldNames(bool indexed) +{ + CL_NS(util)::StringArrayWithDeletor array; + getFieldNames(indexed?IndexReader::INDEXED:IndexReader::UNINDEXED, array); + + array.setDoDelete(false); + TCHAR** ret = _CL_NEWARRAY(TCHAR*,array.size()+1); + int j=0; + CL_NS(util)::StringArrayWithDeletor::iterator itr = array.begin(); + while ( itr != array.end() ){ + ret[j]=*itr; + ++j;++itr; + } + ret[j]=NULL; + return ret; +} + +void IndexReader::close() +{ + //Func - Closes files associated with this index and also saves any new deletions to disk. + // No other methods should be called after this has been called. + //Pre - true + //Post - All files associated with this index have been deleted and new deletions have been + // saved to disk + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CloseCallbackMap::iterator iter; + for (iter = closeCallbacks.begin(); iter != closeCallbacks.end(); iter++) { + CloseCallback callback = *iter->first; + callback(this, iter->second); + } + + commit(); + doClose(); + + if(closeDirectory) { + directory->close(); + _CLDECDELETE(directory); + } +} + +bool IndexReader::isLocked(Directory* directory) +{ + //Func - Static method + // Checks if the index in the directory is currently locked. + //Pre - directory is a valid reference to a directory to check for a lock + //Post - Returns true if the index in the named directory is locked otherwise false + + //Check the existence of the file write.lock and return true when it does and false + //when it doesn't + LuceneLock* l1 = directory->makeLock(QLatin1String("write.lock")); + LuceneLock* l2 = directory->makeLock(QLatin1String("commit.lock")); + + bool ret = l1->isLocked() || l2->isLocked(); + + _CLDELETE(l1); + _CLDELETE(l2); + return ret; +} + +bool IndexReader::isLocked(const QString& directory) +{ + //Func - Static method + // Checks if the index in the named directory is currently locked. + //Pre - directory != NULL and contains the directory to check for a lock + //Post - Returns true if the index in the named directory is locked otherwise false + + CND_PRECONDITION(!directory.isEmpty(), "directory is NULL"); + + Directory* dir = FSDirectory::getDirectory(directory, false); + bool ret = isLocked(dir); + dir->close(); + _CLDECDELETE(dir); + + return ret; +} + +/** Returns true if there are norms stored for this field. */ +bool IndexReader::hasNorms(const TCHAR* field) +{ + // backward compatible implementation. + // SegmentReader has an efficient implementation. + return norms(field) != NULL; +} + +void IndexReader::unlock(const QString& path) +{ + FSDirectory* dir = FSDirectory::getDirectory(path, false); + unlock(dir); + dir->close(); + _CLDECDELETE(dir); +} + +void IndexReader::unlock(Directory* directory) +{ + //Func - Static method + // Forcibly unlocks the index in the named directory-> + // Caution: this should only be used by failure recovery code, + // when it is known that no other process nor thread is in fact + // currently accessing this index. + //Pre - directory is a valid reference to a directory + //Post - The directory has been forcibly unlocked + LuceneLock* lock; + + lock = directory->makeLock(QLatin1String("write.lock")); + lock->release(); + _CLDELETE(lock); + + lock = directory->makeLock(QLatin1String("commit.lock")); + lock->release(); + _CLDELETE(lock); +} + +bool IndexReader::isLuceneFile(const QString& filename) +{ + if (filename.isNull() || filename.isEmpty()) + return false; + + size_t len = filename.length(); + if (len < 6) //need at least x.frx + return false; + + if (filename == QLatin1String("segments")) + return true; + + if (filename == QLatin1String("segments.new")) + return true; + + if (filename == QLatin1String("deletable")) + return true; + + QStringList extList; + extList << QLatin1String(".cfs") + << QLatin1String(".fnm") << QLatin1String(".fdx") << QLatin1String(".fdt") + << QLatin1String(".tii") << QLatin1String(".tis") << QLatin1String(".frq") + << QLatin1String(".prx") << QLatin1String(".del") << QLatin1String(".tvx") + << QLatin1String(".tvd") << QLatin1String(".tvf") << QLatin1String(".tvp"); + + QString suffix = filename.right(4); + if (extList.contains(suffix, Qt::CaseInsensitive)) + return true; + + if (suffix.leftRef(2) == QLatin1String(".f")) { + suffix = suffix.remove(0, 2); + if (suffix.length() > 0) { + for (int i = 0; i < suffix.length(); ++i) { + if (!suffix.at(i).isDigit()) + return false; + } + return true; + } + } + return false; +} + +void IndexReader::addCloseCallback(CloseCallback callback, void* parameter) +{ + closeCallbacks.put(callback, parameter); +} + +// #pragma mark -- IndexReader::LockWith + +IndexReader::LockWith::LockWith(CL_NS(store)::LuceneLock* lock, CL_NS(store)::Directory* dir) + : CL_NS(store)::LuceneLockWith(lock, IndexWriter::COMMIT_LOCK_TIMEOUT) +{ + this->directory = dir; +} + +// #pragma mark -- IndexReader::CommitLockWith + +IndexReader::CommitLockWith::CommitLockWith(CL_NS(store)::LuceneLock* lock, IndexReader* r) + : CL_NS(store)::LuceneLockWith(lock,IndexWriter::COMMIT_LOCK_TIMEOUT) + , reader(r) +{ +} + +void IndexReader::CommitLockWith::doBody() +{ + reader->doCommit(); + reader->segmentInfos->write(reader->getDirectory()); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.h b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.h new file mode 100644 index 000000000..352d16e80 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexReader.h @@ -0,0 +1,485 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_IndexReader_ +#define _lucene_index_IndexReader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/store/FSDirectory.h" +#include "CLucene/store/Lock.h" +#include "CLucene/document/Document.h" +#include "CLucene/index/TermVector.h" +#include "SegmentInfos.h" +#include "Terms.h" + + +CL_NS_DEF(index) + + +/** IndexReader is an abstract class, providing an interface for accessing an + index. Search of an index is done entirely through this abstract interface, + so that any subclass which implements it is searchable. + +

Concrete subclasses of IndexReader are usually constructed with a call to + one of the static open() methods, e.g. {@link #open(String)}. + +

For efficiency, in this API documents are often referred to via + document numbers, non-negative integers which each name a unique + document in the index. These document numbers are ephemeral--they may change + as documents are added to and deleted from an index. Clients should thus not + rely on a given document having the same number between sessions. + +

An IndexReader can be opened on a directory for which an IndexWriter is + opened already, but it cannot be used to delete documents from the index then. +*/ +class IndexReader : LUCENE_BASE +{ +public: + //Callback for classes that need to know if IndexReader is closing. + typedef void (*CloseCallback)(IndexReader*, void*); + + class CloseCallbackCompare:public CL_NS(util)::Compare::_base{ + public: + bool operator()( CloseCallback t1, CloseCallback t2 ) const{ + return t1 > t2; + } + static void doDelete(CloseCallback dummy){ + } + }; + + + enum FieldOption { + // all fields + ALL = 1, + // all indexed fields + INDEXED = 2, + // all fields which are not indexed + UNINDEXED = 4, + // all fields which are indexed with termvectors enables + INDEXED_WITH_TERMVECTOR = 8, + // all fields which are indexed but don't have termvectors enabled + INDEXED_NO_TERMVECTOR = 16, + // all fields where termvectors are enabled. Please note that only standard termvector fields are returned + TERMVECTOR = 32, + // all field with termvectors wiht positions enabled + TERMVECTOR_WITH_POSITION = 64, + // all fields where termvectors with offset position are set + TERMVECTOR_WITH_OFFSET = 128, + // all fields where termvectors with offset and position values set + TERMVECTOR_WITH_POSITION_OFFSET = 256 + }; + + +private: + bool stale; + bool hasChanges; + bool closeDirectory; + bool directoryOwner; + + SegmentInfos* segmentInfos; + CL_NS(store)::Directory* directory; + CL_NS(store)::LuceneLock* writeLock; + + typedef CL_NS(util)::CLSet CloseCallbackMap; + CloseCallbackMap closeCallbacks; + + /** Internal use. Implements commit */ + virtual void doCommit() = 0; + + /** + * Tries to acquire the WriteLock on this directory. + * this method is only valid if this IndexReader is directory owner. + * + * @throws IOException If WriteLock cannot be acquired. + */ + void aquireWriteLock(); +protected: + /** + * Constructor used if IndexReader is not owner of its directory. + * This is used for IndexReaders that are used within other IndexReaders that take care or locking directories. + * + * @param directory Directory where IndexReader files reside. + */ + IndexReader(CL_NS(store)::Directory* dir); + + /** + * Constructor used if IndexReader is owner of its directory. + * If IndexReader is owner of its directory, it locks its directory in case of write operations. + * + * @param directory Directory where IndexReader files reside. + * @param segmentInfos Used for write-l + * @param closeDirectory + */ + IndexReader(CL_NS(store)::Directory* directory, SegmentInfos* segmentInfos, bool closeDirectory); + + + /// Implements close. + virtual void doClose() = 0; + + /** Implements setNorm in subclass.*/ + virtual void doSetNorm(int32_t doc, const TCHAR* field, uint8_t value) = 0; + + /** Implements actual undeleteAll() in subclass. */ + virtual void doUndeleteAll() = 0; + + + /** Implements deletion of the document numbered docNum. + * Applications should call {@link #deleteDocument(int32_t)} or {@link #deleteDocuments(Term*)}. + */ + virtual void doDelete(const int32_t docNum) = 0; + +public: + + DEFINE_MUTEX(THIS_LOCK) + + ///Do not access this directly, only public so that MultiReader can access it + virtual void commit(); + + + /** Undeletes all documents currently marked as deleted in this index.*/ + void undeleteAll(); + + /** + * Get a list of unique field names that exist in this index and have the specified + * field option information. + * @param fldOption specifies which field option should be available for the returned fields + * @return Collection of Strings indicating the names of the fields. + * @see IndexReader.FieldOption + */ + virtual void getFieldNames(FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor& retarray) = 0; + + _CL_DEPRECATED( getFieldNames(FieldOption, StringArrayWithDeletor&) ) virtual TCHAR** getFieldNames(); + _CL_DEPRECATED( getFieldNames(FieldOption, StringArrayWithDeletor&) ) virtual TCHAR** getFieldNames(bool indexed); + + /** Returns the byte-encoded normalization factor for the named field of + * every document. This is used by the search code to score documents. + * + * The number of bytes returned is the size of the IndexReader->maxDoc() + * MEMORY: The values are cached, so don't delete the returned byte array. + * @see Field#setBoost(qreal) + */ + virtual uint8_t* norms(const TCHAR* field) = 0; + + + /** Reads the byte-encoded normalization factor for the named field of every + * document. This is used by the search code to score documents. + * + * @see Field#setBoost(qreal) + */ + virtual void norms(const TCHAR* field, uint8_t* bytes) = 0; + + /** Expert: Resets the normalization factor for the named field of the named + * document. + * + * @see #norms(TCHAR*) + * @see Similarity#decodeNorm(uint8_t) + */ + void setNorm(int32_t doc, const TCHAR* field, qreal value); + + /** Expert: Resets the normalization factor for the named field of the named + * document. The norm represents the product of the field's {@link + * Field#setBoost(qreal) boost} and its {@link Similarity#lengthNorm(TCHAR*, + * int32_t) length normalization}. Thus, to preserve the length normalization + * values when resetting this, one should base the new value upon the old. + * + * @see #norms(TCHAR*) + * @see Similarity#decodeNorm(uint8_t) + */ + void setNorm(int32_t doc, const TCHAR* field, uint8_t value); + + /// Release the write lock, if needed. + virtual ~IndexReader(); + + /// Returns an IndexReader reading the index in an FSDirectory in the named path. + static IndexReader* open(const QString& path); + + /// Returns an IndexReader reading the index in the given Directory. + static IndexReader* open( CL_NS(store)::Directory* directory, bool closeDirectory=false); + + /** + * Returns the time the index in the named directory was last modified. + * Do not use this to check whether the reader is still up-to-date, use + * {@link #isCurrent()} instead. + */ + static uint64_t lastModified(const QString& directory); + + /** + * Returns the time the index in the named directory was last modified. + * Do not use this to check whether the reader is still up-to-date, use + * {@link #isCurrent()} instead. + */ + static uint64_t lastModified(const CL_NS(store)::Directory* directory); + + + /** + * Reads version number from segments files. The version number is + * initialized with a timestamp and then increased by one for each change of + * the index. + * + * @param directory where the index resides. + * @return version number. + * @throws IOException if segments file cannot be read + */ + static int64_t getCurrentVersion(CL_NS(store)::Directory* directory); + + /** + * Reads version number from segments files. The version number is + * initialized with a timestamp and then increased by one for each change of + * the index. + * + * @param directory where the index resides. + * @return version number. + * @throws IOException if segments file cannot be read + */ + static int64_t getCurrentVersion(const QString& directory); + + /** + * Version number when this IndexReader was opened. + */ + int64_t getVersion(); + + /** + * Check whether this IndexReader still works on a current version of the index. + * If this is not the case you will need to re-open the IndexReader to + * make sure you see the latest changes made to the index. + * + * @throws IOException + */ + bool isCurrent(); + + + /** + * Return an array of term frequency vectors for the specified document. + * The array contains a vector for each vectorized field in the document. + * Each vector contains terms and frequencies for all terms in a given vectorized field. + * If no such fields existed, the method returns null. The term vectors that are + * returned my either be of type TermFreqVector or of type TermPositionsVector if + * positions or offsets have been stored. + * + * @param docNumber document for which term frequency vectors are returned + * @return array of term frequency vectors. May be null if no term vectors have been + * stored for the specified document. + * @throws IOException if index cannot be accessed + * @see org.apache.lucene.document.Field.TermVector + */ + virtual bool getTermFreqVectors(int32_t docNumber, Array& result) =0; + + /** + * Return a term frequency vector for the specified document and field. The + * returned vector contains terms and frequencies for the terms in + * the specified field of this document, if the field had the storeTermVector + * flag set. If termvectors had been stored with positions or offsets, a + * TermPositionsVector is returned. + * + * @param docNumber document for which the term frequency vector is returned + * @param field field for which the term frequency vector is returned. + * @return term frequency vector May be null if field does not exist in the specified + * document or term vector was not stored. + * @throws IOException if index cannot be accessed + * @see org.apache.lucene.document.Field.TermVector + */ + virtual TermFreqVector* getTermFreqVector(int32_t docNumber, const TCHAR* field) = 0; + + /** + * Returns true if an index exists at the specified directory. + * If the directory does not exist or if there is no index in it. + * @param directory the directory to check for an index + * @return true if an index exists; false otherwise + */ + static bool indexExists(const QString& directory); + + /** + * Returns true if an index exists at the specified directory. + * If the directory does not exist or if there is no index in it. + * @param directory the directory to check for an index + * @return true if an index exists; false otherwise + * @throws IOException if there is a problem with accessing the index + */ + static bool indexExists(const CL_NS(store)::Directory* directory); + + /** Returns the number of documents in this index. */ + virtual int32_t numDocs() = 0; + + /** Returns one greater than the largest possible document number. + * This may be used to, e.g., determine how big to allocate an array which + * will have an element for every document number in an index. + */ + virtual int32_t maxDoc() const = 0; + + /** Gets the stored fields of the nth + * Document in this index. + * The fields are not cleared before retrieving the document, so the + * object should be new or just cleared. + */ + virtual bool document(int32_t n, CL_NS(document)::Document*) =0; + + _CL_DEPRECATED( document(i, document) ) CL_NS(document)::Document* document(const int32_t n); + + /** Returns true if document n has been deleted */ + virtual bool isDeleted(const int32_t n) = 0; + + /** Returns true if any documents have been deleted */ + virtual bool hasDeletions() const = 0; + + /** Returns true if there are norms stored for this field. */ + virtual bool hasNorms(const TCHAR* field); + + /** Returns an enumeration of all the terms in the index. + * The enumeration is ordered by Term.compareTo(). Each term + * is greater than all that precede it in the enumeration. + * @memory Caller must clean up + */ + virtual TermEnum* terms() const =0; + + /** Returns an enumeration of all terms after a given term. + * The enumeration is ordered by Term.compareTo(). Each term + * is greater than all that precede it in the enumeration. + * @memory Caller must clean up + */ + virtual TermEnum* terms(const Term* t) const = 0; + + /** Returns the number of documents containing the term t. */ + virtual int32_t docFreq(const Term* t) const = 0; + + /* Returns an unpositioned TermPositions enumerator. + * @memory Caller must clean up + */ + virtual TermPositions* termPositions() const = 0; + + /** Returns an enumeration of all the documents which contain + * term. For each document, in addition to the document number + * and frequency of the term in that document, a list of all of the ordinal + * positions of the term in the document is available. Thus, this method + * implements the mapping: + * + *

    + * Term    =>    <docNum, freq, + * <pos1, pos2, ... + * posfreq-1> + * >* + *
+ *

This positional information faciliates phrase and proximity searching. + *

The enumeration is ordered by document number. Each document number is + * greater than all that precede it in the enumeration. + * @memory Caller must clean up + */ + TermPositions* termPositions(Term* term) const; + + /** Returns an unpositioned {@link TermDocs} enumerator. + * @memory Caller must clean up + */ + virtual TermDocs* termDocs() const = 0; + + /** Returns an enumeration of all the documents which contain + * term. For each document, the document number, the frequency of + * the term in that document is also provided, for use in search scoring. + * Thus, this method implements the mapping: + *

    Term    =>    <docNum, freq>*
+ *

The enumeration is ordered by document number. Each document number + * is greater than all that precede it in the enumeration. + * @memory Caller must clean up + */ + TermDocs* termDocs(Term* term) const; + + /** Deletes the document numbered docNum. Once a document is + * deleted it will not appear in TermDocs or TermPostitions enumerations. + * Attempts to read its field with the {@link #document} + * method will result in an error. The presence of this document may still be + * reflected in the {@link #docFreq} statistic, though + * this will be corrected eventually as the index is further modified. + */ + void deleteDocument(const int32_t docNum); + + ///@deprecated. Use deleteDocument instead. + _CL_DEPRECATED( deleteDocument ) void deleteDoc(const int32_t docNum) + { deleteDocument(docNum); } + + /** Deletes all documents containing term. + * This is useful if one uses a document field to hold a unique ID string for + * the document. Then to delete such a document, one merely constructs a + * term with the appropriate field and the unique ID string as its text and + * passes it to this method. + * See {@link #deleteDocument(int)} for information about when this deletion will + * become effective. + * @return the number of documents deleted + */ + int32_t deleteDocuments(Term* term); + + ///@deprecated. Use deleteDocuments instead. + _CL_DEPRECATED( deleteDocuments ) int32_t deleteTerm(Term* term){ return deleteDocuments(term); } + + /** + * Closes files associated with this index and also saves any new deletions to disk. + * No other methods should be called after this has been called. + */ + void close(); + + ///Checks if the index in the named directory is currently locked. + static bool isLocked(CL_NS(store)::Directory* directory); + + ///Checks if the index in the named directory is currently locked. + static bool isLocked(const QString& directory); + + + ///Forcibly unlocks the index in the named directory. + ///Caution: this should only be used by failure recovery code, + ///when it is known that no other process nor thread is in fact + ///currently accessing this index. + static void unlock(CL_NS(store)::Directory* directory); + static void unlock(const QString& path); + + /** Returns the directory this index resides in. */ + CL_NS(store)::Directory* getDirectory() { return directory; } + + /** Returns true if the file is a lucene filename (based on extension or filename) */ + static bool isLuceneFile(const QString& filename); + + /** + * For classes that need to know when the IndexReader closes (such as caches, etc), + * should pass their callback function to this. + */ + void addCloseCallback(CloseCallback callback, void* parameter); + +protected: + class LockWith : public CL_NS(store)::LuceneLockWith + { + public: + LockWith(CL_NS(store)::LuceneLock* lock, CL_NS(store)::Directory* dir); + + //Reads the segmentinfo file and depending on the number of segments found + //it returns a MultiReader or a SegmentReader + IndexReader* doBody(); + + private: + CL_NS(store)::Directory* directory; + }; + friend class IndexReader::LockWith; + + class CommitLockWith : public CL_NS(store)::LuceneLockWith + { + public: + CommitLockWith(CL_NS(store)::LuceneLock* lock, IndexReader* r); + void doBody(); + + private: + IndexReader* reader; + }; + friend class IndexReader::CommitLockWith; +}; + +CL_NS_END +#endif + + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp new file mode 100644 index 000000000..5504cf6fa --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.cpp @@ -0,0 +1,697 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "IndexWriter.h" + +#include "CLucene/document/Document.h" +#include "CLucene/store/Directory.h" +#include "CLucene/store/Lock.h" +#include "CLucene/util/VoidList.h" +#include "DocumentWriter.h" +#include "SegmentInfos.h" +#include "SegmentMerger.h" + +CL_NS_USE(store) +CL_NS_USE(util) +CL_NS_USE(document) +CL_NS_USE(analysis) +CL_NS_DEF(index) + +const QLatin1String IndexWriter::WRITE_LOCK_NAME("write.lock"); +const QLatin1String IndexWriter::COMMIT_LOCK_NAME("commit.lock"); + +IndexWriter::IndexWriter(const QString& path, Analyzer* a, const bool create, + const bool _closeDir) + : directory(FSDirectory::getDirectory(path, create)) + , analyzer(a) + , segmentInfos(true) + , closeDir(_closeDir) +{ + //Func - Constructor + // Constructs an IndexWriter for the index in path. + //Pre - path != NULL and contains a named directory path + // a holds a valid reference to an analyzer and analyzes the text to + // be indexed create indicates if the indexWriter must create a new + // index located at path or just open it + //Post - If create is true, then a new, empty index has been created in + // path, replacing the index already there, if any. The named + // directory path is owned by this Instance + + CND_PRECONDITION(!path.isEmpty(), "path is NULL"); + + //Continue initializing the instance by _IndexWriter + _IndexWriter(create); +} + +IndexWriter::IndexWriter(Directory* d, Analyzer* a, const bool create, + const bool _closeDir) + : directory(_CL_POINTER(d)) + , analyzer(a) + , segmentInfos(true) + , closeDir(_closeDir) +{ + //Func - Constructor + // Constructs an IndexWriter for the index in path. + //Pre - d contains a valid reference to a directory + // a holds a valid reference to an analyzer and analyzes the text to + // be indexed create indicates if the indexWriter must create a new + // index located at path or just open it + //Post - If create is true, then a new, empty index has been created in + // path, replacing the index already there, if any. The directory d + // is not owned by this Instance + + //Continue initializing the instance by _IndexWriter + _IndexWriter ( create ); +} + +void IndexWriter::_IndexWriter(const bool create) +{ + //Func - Initialises the instances + //Pre - create indicates if the indexWriter must create a new index + // located at path or just open it + + similarity = CL_NS(search)::Similarity::getDefault(); + + useCompoundFile = true; + if ( directory->getDirectoryType() == RAMDirectory::DirectoryType() ) + useCompoundFile = false; + + //Create a ramDirectory + ramDirectory = _CLNEW TransactionalRAMDirectory; + + CND_CONDITION(ramDirectory != NULL, "ramDirectory is NULL"); + + //Initialize the writeLock to + writeLock = NULL; + + //initialise the settings... + maxFieldLength = DEFAULT_MAX_FIELD_LENGTH; + mergeFactor = DEFAULT_MERGE_FACTOR; + maxMergeDocs = DEFAULT_MAX_MERGE_DOCS; + writeLockTimeout = WRITE_LOCK_TIMEOUT; + commitLockTimeout = COMMIT_LOCK_TIMEOUT; + minMergeDocs = DEFAULT_MAX_BUFFERED_DOCS; + termIndexInterval = DEFAULT_TERM_INDEX_INTERVAL; + + //Create a new lock using the name "write.lock" + LuceneLock* newLock = directory->makeLock(IndexWriter::WRITE_LOCK_NAME); + + //Condition check to see if newLock has been allocated properly + CND_CONDITION(newLock != NULL, + "No memory could be allocated for LuceneLock newLock"); + + //Try to obtain a write lock + if (!newLock->obtain(writeLockTimeout)){ + //Write lock could not be obtained so delete it + _CLDELETE(newLock); + //Reset the instance + _finalize(); + //throw an exception because no writelock could be created or obtained + _CLTHROWA(CL_ERR_IO, "Index locked for write or no write access." ); + } + + //The Write Lock has been obtained so save it for later use + this->writeLock = newLock; + + //Create a new lock using the name "commit.lock" + LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + + //Condition check to see if lock has been allocated properly + CND_CONDITION(lock != NULL, "No memory could be allocated for LuceneLock lock"); + + LockWith2 with(lock, commitLockTimeout, this, NULL, create); + { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync + with.run(); + } + + //Release the commit lock + _CLDELETE(lock); + + isOpen = true; +} + +IndexWriter::~IndexWriter() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + close(); + _finalize(); +} + +void IndexWriter::close() +{ + //Func - Flushes all changes to an index, closes all associated files, and + // closes the directory that the index is stored in. + //Pre - closeDir indicates if the directory must be closed or not + //Post - All the changes have been flushed to disk and the write lock has + // been released. The ramDirectory has also been closed. The + // directory has been closed if the reference count of the directory + // reaches zero + + SCOPED_LOCK_MUTEX(THIS_LOCK) + if (isOpen) { + //Flush the Ram Segments + flushRamSegments(); + //Close the ram directory + if (ramDirectory != NULL) { + ramDirectory->close(); + _CLDECDELETE(ramDirectory); + } + + //Check if this instance must close the directory + if (closeDir) + directory->close(); + _CLDECDELETE(directory); + + // release write lock + if (writeLock != NULL) { + writeLock->release(); + _CLDELETE(writeLock); + } + isOpen = false; + } +} + +void IndexWriter::_finalize() +{ + //Func - Releases all the resources of the instance + //Pre - true + //Post - All the releases have been released + + if(writeLock != NULL) { + //release write lock + writeLock->release(); + _CLDELETE( writeLock ); + } + + //Delete the ramDirectory + if (ramDirectory != NULL) { + ramDirectory->close(); + _CLDECDELETE(ramDirectory); + } +} + +int32_t IndexWriter::docCount() +{ + //Func - Counts the number of documents in the index + //Pre - true + //Post - The number of documents have been returned + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + //Initialize count + int32_t count = 0; + + //Iterate through all segmentInfos + for (int32_t i = 0; i < segmentInfos.size(); i++) { + //Get the i-th SegmentInfo + SegmentInfo* si = segmentInfos.info(i); + //Retrieve the number of documents of the segment and add it to count + count += si->docCount; + } + return count; +} + +void IndexWriter::addDocument(Document* doc, Analyzer* analyzer) +{ + //Func - Adds a document to the index + //Pre - doc contains a valid reference to a document + // ramDirectory != NULL + //Post - The document has been added to the index of this IndexWriter + CND_PRECONDITION(ramDirectory != NULL, "ramDirectory is NULL"); + + if (analyzer == NULL) + analyzer = this->analyzer; + + ramDirectory->transStart(); + try { + QString segmentName = newSegmentName(); + CND_CONDITION(!segmentName.isEmpty(), "segmentName is NULL"); + try { + //Create the DocumentWriter using a ramDirectory and analyzer + // supplied by the IndexWriter (this). + DocumentWriter* dw = _CLNEW DocumentWriter(ramDirectory, analyzer, + this ); + CND_CONDITION(dw != NULL, "dw is NULL"); + try { + //Add the client-supplied document to the new segment. + dw->addDocument(segmentName, doc); + } _CLFINALLY ( + _CLDELETE(dw); + ); + + //Create a new SegmentInfo instance about this new segment. + SegmentInfo* si = _CLNEW SegmentInfo(segmentName, 1, ramDirectory); + CND_CONDITION(si != NULL, "Si is NULL"); + { + SCOPED_LOCK_MUTEX(THIS_LOCK) + + //Add the info object for this particular segment to the list + // of all segmentInfos-> + segmentInfos.add(si); + + //Check to see if the segments must be merged + maybeMergeSegments(); + } + } _CLFINALLY() + } catch (...) { + ramDirectory->transAbort(); + throw; +} + ramDirectory->transCommit(); +} + +void IndexWriter::optimize() +{ + //Func - Optimizes the index for which this Instance is responsible + //Pre - true + //Post - + SCOPED_LOCK_MUTEX(THIS_LOCK) + + //Flush the RamSegments to disk + flushRamSegments(); + while (segmentInfos.size() > 1 + || (segmentInfos.size() == 1 + && (SegmentReader::hasDeletions(segmentInfos.info(0)) + || segmentInfos.info(0)->getDir()!=directory + || (useCompoundFile + && (!SegmentReader::usesCompoundFile(segmentInfos.info(0)) + || SegmentReader::hasSeparateNorms(segmentInfos.info(0))))))) { + int32_t minSegment = segmentInfos.size() - mergeFactor; + mergeSegments(minSegment < 0 ? 0 : minSegment); + } +} + + +QString IndexWriter::newSegmentName() +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + return QLatin1Char('_') + QString::number(segmentInfos.counter++, 36); +} + +void IndexWriter::flushRamSegments() +{ + //Func - Merges all RAM-resident segments. + //Pre - ramDirectory != NULL + //Post - The RAM-resident segments have been merged to disk + + CND_PRECONDITION(ramDirectory != NULL, "ramDirectory is NULL"); + + int32_t minSegment = segmentInfos.size()-1; //don't make this unsigned... + CND_CONDITION(minSegment >= -1, "minSegment must be >= -1"); + + int32_t docCount = 0; + //Iterate through all the segements and check if the directory is a ramDirectory + while (minSegment >= 0 && + segmentInfos.info(minSegment)->getDir() == ramDirectory) { + docCount += segmentInfos.info(minSegment)->docCount; + minSegment--; + } + if (minSegment < 0 || // add one FS segment? + (docCount + segmentInfos.info(minSegment)->docCount) > mergeFactor || + !(segmentInfos.info(segmentInfos.size()-1)->getDir() == ramDirectory)) + minSegment++; + + CND_CONDITION(minSegment >= 0, "minSegment must be >= 0"); + if (minSegment >= segmentInfos.size()) + return; // none to merge + mergeSegments(minSegment); +} + +void IndexWriter::maybeMergeSegments() { + //Func - Incremental Segment Merger + //Pre - + //Post - + + int64_t targetMergeDocs = minMergeDocs; + + // find segments smaller than current target size + while (targetMergeDocs <= maxMergeDocs) { + int32_t minSegment = segmentInfos.size(); + int32_t mergeDocs = 0; + + while (--minSegment >= 0) { + SegmentInfo* si = segmentInfos.info(minSegment); + if (si->docCount >= targetMergeDocs) + break; + mergeDocs += si->docCount; + } + + if (mergeDocs >= targetMergeDocs){ + // found a merge to do + mergeSegments(minSegment+1); + }else + break; + + //increase target size + targetMergeDocs *= mergeFactor; + } +} + +void IndexWriter::mergeSegments(const uint32_t minSegment) +{ + mergeSegments(minSegment, segmentInfos.size()); +} + +void IndexWriter::mergeSegments(const uint32_t minSegment, const uint32_t end) +{ + CLVector segmentsToDelete(false); + QString mergedName = newSegmentName(); +#ifdef _CL_DEBUG_INFO + fprintf(_CL_DEBUG_INFO, "merging segments\n"); +#endif + SegmentMerger merger(this, mergedName); + for (size_t i = minSegment; i < end; i++) { + SegmentInfo* si = segmentInfos.info(i); +#ifdef _CL_DEBUG_INFO + fprintf(_CL_DEBUG_INFO, " %s (%d docs)\n", + si->name.toLocal8Bit().constData(), si->docCount); +#endif + SegmentReader* reader = _CLNEW SegmentReader(si); + merger.add(reader); + // if we own the directory + if ((reader->getDirectory() == this->directory) + || (reader->getDirectory() == this->ramDirectory)) { + // queue segment for deletion + segmentsToDelete.push_back(reader); + } + } + + int32_t mergedDocCount = merger.merge(); + +#ifdef _CL_DEBUG_INFO + fprintf(_CL_DEBUG_INFO, "\n into %s (%d docs)\n", + mergedName.toLocal8Bit().constData(), mergedDocCount); +#endif + + segmentInfos.clearto(minSegment);// remove old infos & add new + segmentInfos.add(_CLNEW SegmentInfo(mergedName, mergedDocCount, directory)); + + // close readers before we attempt to delete now-obsolete segments + merger.closeReaders(); + + LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + LockWith2 with (lock, commitLockTimeout, this, &segmentsToDelete, true); + { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync + with.run(); + } + _CLDELETE( lock ); + + if (useCompoundFile) { + QStringList filesToDelete; + merger.createCompoundFile(mergedName + QLatin1String(".tmp"), filesToDelete); + + LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + LockWithCFS with(lock, commitLockTimeout, directory, this, mergedName, + filesToDelete); + { + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) // in- & inter-process sync + with.run(); + } + _CLDELETE(lock); + } +} + +void IndexWriter::deleteSegments(CLVector* segments) +{ + QStringList deletable; + + {//scope delete deleteArray object + QStringList deleteArray; + readDeleteableFiles(deleteArray); + deleteFiles(deleteArray, deletable); // try to delete deleteable + } + + QStringList files; + for (uint32_t i = 0; i < segments->size(); i++) { + SegmentReader* reader = (*segments)[i]; + files.clear(); + reader->files(files); + if (reader->getDirectory() == this->directory) + deleteFiles(files, deletable); // try to delete our files + else + deleteFiles(files, reader->getDirectory()); // delete, eg, RAM files + } + + writeDeleteableFiles(deletable); // note files we can't delete +} + +void IndexWriter::deleteFiles(const QStringList& files) +{ + QStringList currentDeletable; + readDeleteableFiles(currentDeletable); + + // try to delete deleteable + QStringList deletable; + deleteFiles(currentDeletable, deletable); + + // try to delete our files + deleteFiles(files, deletable); + + // note files we can't delete + writeDeleteableFiles(deletable); +} + +void IndexWriter::readDeleteableFiles(QStringList& result) +{ + if (!directory->fileExists(QLatin1String("deletable"))) + return; + + IndexInput* input = directory->openInput(QLatin1String("deletable")); + try { + // read file names + TCHAR tname[CL_MAX_PATH]; + for (int32_t i = input->readInt(); i > 0; i--) { + int32_t read = input->readString(tname, CL_MAX_PATH); + result.push_back(QString::fromWCharArray(tname, read)); + } + } _CLFINALLY ( + input->close(); + _CLDELETE(input); + ); +} + +void IndexWriter::deleteFiles(const QStringList& files, QStringList& deletable) +{ + QStringList::const_iterator itr; + for (itr = files.begin(); itr != files.end(); ++itr) { + if (!getDirectory()->fileExists((*itr))) + continue; + + if (!getDirectory()->deleteFile((*itr), false)) { + if (directory->fileExists((*itr))) { +#ifdef _CL_DEBUG_INFO + fprintf(_CL_DEBUG_INFO, "%s; Will re-try later.\n", err.what()); +#endif + // add to deletable + deletable.push_back((*itr)); + } + } + } +} + +void IndexWriter::deleteFiles(const QStringList& files, Directory* directory) +{ + QStringList::const_iterator itr; + for (itr = files.begin(); itr != files.end(); ++itr) + directory->deleteFile((*itr), true); +} + +void IndexWriter::writeDeleteableFiles(const QStringList& files) +{ + IndexOutput* output = directory->createOutput(QLatin1String("deleteable.new")); + try { + output->writeInt(files.size()); + + TCHAR tfile[CL_MAX_PATH]; + QStringList::const_iterator itr; + for (itr = files.begin(); itr != files.end(); ++itr) { + tfile[(*itr).toWCharArray(tfile)] = '\0'; + output->writeString(tfile, _tcslen(tfile)); + } + } _CLFINALLY ( + output->close(); + _CLDELETE(output); + ); + + directory->renameFile(QLatin1String("deleteable.new"), + QLatin1String("deletable")); +} + +void IndexWriter::addIndexes(Directory** dirs) +{ + //Func - Add several indexes located in different directories into the current + // one managed by this instance + //Pre - dirs != NULL and contains directories of several indexes + // dirsLength > 0 and contains the number of directories + //Post - The indexes located in the directories in dirs have been merged with + // the pre(current) index. The Resulting index has also been optimized + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CND_PRECONDITION(dirs != NULL, "dirs is NULL"); + + // start with zero or 1 seg so optimize the current + optimize(); + + int32_t start = segmentInfos.size(); + + //Iterate through the directories + for (int32_t i = 0; dirs[i] != NULL; ++i) { + // DSR: Changed SegmentInfos constructor arg (see bug discussion below). + SegmentInfos sis(false); + sis.read(dirs[i]); + for (int32_t j = 0; j < sis.size(); j++) + segmentInfos.add(sis.info(j)); // add each info + } + + // commented out by tbusch to solve a bug and to be conform with + // java lucene + + // merge newly added segments in log(n) passes + //while (segmentInfos.size() > start + mergeFactor) { + // for (int32_t base = start; base < segmentInfos.size(); base++) { + // int32_t end = min(segmentInfos.size(), base + mergeFactor); + // if (end - base > 1) + // mergeSegments(base, end); + // } + //} + + // cleanup + optimize(); +} + + +void IndexWriter::addIndexes(IndexReader** readers) +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + optimize(); // start with zero or 1 seg + + QString mergedName = newSegmentName(); + SegmentMerger merger(this, mergedName); + + CLVector segmentsToDelete; + SegmentReader* sReader = NULL; + if (segmentInfos.size() == 1) { // add existing index, if any + sReader = _CLNEW SegmentReader(segmentInfos.info(0)); + merger.add(sReader); + segmentsToDelete.push_back(sReader); // queue segment for deletion + } + + int32_t readersLength = 0; + while (readers[readersLength] != NULL) + merger.add(readers[readersLength++]); + + int32_t docCount = merger.merge(); // merge 'em + + // pop old infos & add new + segmentInfos.clearto(0); + segmentInfos.add(_CLNEW SegmentInfo(mergedName, docCount, directory)); + + if (sReader != NULL) { + sReader->close(); + _CLDELETE(sReader); + } + + LuceneLock* lock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + LockWith2 with(lock, commitLockTimeout, this, &segmentsToDelete, true); + { + // in- & inter-process sync + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + with.run(); + } + _CLDELETE(lock); + + if (useCompoundFile) { + QStringList filesToDelete; + merger.createCompoundFile(mergedName + QLatin1String(".tmp"), + filesToDelete); + + LuceneLock* cfslock = directory->makeLock(IndexWriter::COMMIT_LOCK_NAME); + LockWithCFS with(cfslock, commitLockTimeout, directory, this, mergedName, + filesToDelete); + { + // in- & inter-process sync + SCOPED_LOCK_MUTEX(directory->THIS_LOCK) + with.run(); + } + _CLDELETE(cfslock); + } +} + +// #pragma mark -- IndexWriter::LockWith2 + +IndexWriter::LockWith2::LockWith2(CL_NS(store)::LuceneLock* lock, + int64_t lockWaitTimeout, + IndexWriter* indexWriter, + CL_NS(util)::CLVector* std, + bool _create) + : CL_NS(store)::LuceneLockWith(lock, lockWaitTimeout) + , create(_create) + , writer(indexWriter) + , segmentsToDelete(std) +{ +} + +void IndexWriter::LockWith2::doBody() +{ + //Func - Writes segmentInfos to or reads segmentInfos from disk + //Pre - writer != NULL + //Post - if create is true then segementInfos has been written to disk + // otherwise segmentInfos has been read from disk + + CND_PRECONDITION(writer != NULL, "writer is NULL"); + + if (create) { + writer->segmentInfos.write(writer->getDirectory()); + // delete now-unused segments + if (segmentsToDelete != NULL) + writer->deleteSegments(segmentsToDelete); + } else { + writer->segmentInfos.read(writer->getDirectory()); + } +} + +// #pragma mark -- IndexWriter::LockWithCFS + +IndexWriter::LockWithCFS::LockWithCFS(CL_NS(store)::LuceneLock* lock, + int64_t lockWaitTimeout, + CL_NS(store)::Directory* dir, + IndexWriter* indexWriter, + const QString& segmentName, + const QStringList& ftd) + : CL_NS(store)::LuceneLockWith(lock, lockWaitTimeout) + , segName(segmentName) + , writer(indexWriter) + , directory(dir) + , filesToDelete(ftd) +{ +} + +void IndexWriter::LockWithCFS::doBody() +{ + //Func - Writes segmentInfos to or reads segmentInfos from disk + //Pre - writer != NULL + //Post - if create is true then segementInfos has been written to disk + // otherwise segmentInfos has been read from disk + + CND_PRECONDITION(directory != NULL, "directory is NULL"); + CND_PRECONDITION(!segName.isEmpty(), "mergedName is NULL"); + + // make compound file visible for SegmentReaders + directory->renameFile(segName + QLatin1String(".tmp"), + segName + QLatin1String(".cfs")); + // delete now unused files of segment + writer->deleteFiles(filesToDelete); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.h b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.h new file mode 100644 index 000000000..80476c864 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/IndexWriter.h @@ -0,0 +1,425 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_IndexWriter_ +#define _lucene_index_IndexWriter_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include + +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/util/VoidList.h" +#include "CLucene/search/Similarity.h" +#include "CLucene/store/Lock.h" +#include "CLucene/store/TransactionalRAMDirectory.h" + +#include "SegmentHeader.h" + +CL_NS_DEF(index) + +/** +An IndexWriter creates and maintains an index. + +The third argument to the +constructor +determines whether a new index is created, or whether an existing index is +opened for the addition of new documents. + +In either case, documents are added with the addDocument method. +When finished adding documents, close should be called. + +

If an index will not have more documents added for a while and optimal search +performance is desired, then the optimize +method should be called before the index is closed. + +

Opening an IndexWriter creates a lock file for the directory in use. Trying to open +another IndexWriter on the same directory will lead to an IOException. The IOException +is also thrown if an IndexReader on the same directory is used to delete documents +from the index. + +@see IndexModifier IndexModifier supports the important methods of IndexWriter plus deletion +*/ +class IndexWriter : LUCENE_BASE +{ + class LockWith2 : public CL_NS(store)::LuceneLockWith + { + public: + LockWith2(CL_NS(store)::LuceneLock* lock, + int64_t lockWaitTimeout, + IndexWriter* wr, + CL_NS(util)::CLVector* std, + bool create); + + ~LockWith2() {} + + void doBody(); + + private: + bool create; + IndexWriter* writer; + CL_NS(util)::CLVector* segmentsToDelete; + }; + friend class LockWith2; + + class LockWithCFS : public CL_NS(store)::LuceneLockWith + { + public: + LockWithCFS(CL_NS(store)::LuceneLock* lock, + int64_t lockWaitTimeout, + CL_NS(store)::Directory* dir, + IndexWriter* wr, + const QString& segName, + const QStringList& ftd); + + ~LockWithCFS() {} + + void doBody(); + + private: + QString segName; + IndexWriter* writer; + CL_NS(store)::Directory* directory; + QStringList filesToDelete; + }; + friend class IndexWriter::LockWithCFS; + + // indicates if the writers is open - this way close can be called multiple + // times + bool isOpen; + + // how to analyze text + CL_NS(analysis)::Analyzer* analyzer; + + CL_NS(search)::Similarity* similarity; // how to normalize + + /** Use compound file setting. Normally defaults to true, except when + * using a RAMDirectory. This minimizes the number of files used. + * Setting this to false may improve indexing performance, but + * may also cause file handle problems. + */ + bool useCompoundFile; + bool closeDir; + + // for temp segs + CL_NS(store)::TransactionalRAMDirectory* ramDirectory; + + CL_NS(store)::LuceneLock* writeLock; + + void _IndexWriter(const bool create); + + void _finalize(); + + // where this index resides + CL_NS(store)::Directory* directory; + + + int32_t getSegmentsCounter() { return segmentInfos.counter; } + int32_t maxFieldLength; + int32_t mergeFactor; + int32_t minMergeDocs; + int32_t maxMergeDocs; + int32_t termIndexInterval; + + int64_t writeLockTimeout; + int64_t commitLockTimeout; +public: + DEFINE_MUTEX(THIS_LOCK) + + // Release the write lock, if needed. + SegmentInfos segmentInfos; + + // Release the write lock, if needed. + ~IndexWriter(); + + /** + * The Java implementation of Lucene silently truncates any tokenized + * field if the number of tokens exceeds a certain threshold. Although + * that threshold is adjustable, it is easy for the client programmer + * to be unaware that such a threshold exists, and to become its + * unwitting victim. + * CLucene implements a less insidious truncation policy. Up to + * DEFAULT_MAX_FIELD_LENGTH tokens, CLucene behaves just as JLucene + * does. If the number of tokens exceeds that threshold without any + * indication of a truncation preference by the client programmer, + * CLucene raises an exception, prompting the client programmer to + * explicitly set a truncation policy by adjusting maxFieldLength. + */ + LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_FIELD_LENGTH = 10000); + LUCENE_STATIC_CONSTANT(int32_t, FIELD_TRUNC_POLICY__WARN = -1); + int32_t getMaxFieldLength() const{ return maxFieldLength; } + void setMaxFieldLength(int32_t val){ maxFieldLength = val; } + + /** + * Default value is 10. Change using {@link #setMaxBufferedDocs(int)}. + */ + LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_BUFFERED_DOCS = 10); + /** Determines the minimal number of documents required before the buffered + * in-memory documents are merging and a new Segment is created. + * Since Documents are merged in a {@link RAMDirectory}, + * large value gives faster indexing. At the same time, mergeFactor limits + * the number of files open in a FSDirectory. + * + *

The default value is DEFAULT_MAX_BUFFERED_DOCS.*/ + void setMaxBufferedDocs(int32_t val){ minMergeDocs = val; } + /** + * @see #setMaxBufferedDocs + */ + int32_t getMaxBufferedDocs(){ return minMergeDocs; } + + /** + * Default value for the write lock timeout (1,000). + */ + LUCENE_STATIC_CONSTANT(int64_t, WRITE_LOCK_TIMEOUT = 1000); + /** + * Sets the maximum time to wait for a write lock (in milliseconds). + */ + void setWriteLockTimeout(int64_t writeLockTimeout) + { this->writeLockTimeout = writeLockTimeout; } + /** + * @see #setWriteLockTimeout + */ + int64_t getWriteLockTimeout() { return writeLockTimeout; } + + /** + * Default value for the commit lock timeout (10,000). + */ + LUCENE_STATIC_CONSTANT(int64_t, COMMIT_LOCK_TIMEOUT = 10000); + /** + * Sets the maximum time to wait for a commit lock (in milliseconds). + */ + void setCommitLockTimeout(int64_t commitLockTimeout) + { this->commitLockTimeout = commitLockTimeout; } + /** + * @see #setCommitLockTimeout + */ + int64_t getCommitLockTimeout() { return commitLockTimeout; } + + static const QLatin1String WRITE_LOCK_NAME; //"write.lock"; + static const QLatin1String COMMIT_LOCK_NAME; //"commit.lock"; + + /** + * Default value is 10. Change using {@link #setMergeFactor(int)}. + */ + LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MERGE_FACTOR = 10); + /* Determines how often segment indices are merged by addDocument(). With + * smaller values, less RAM is used while indexing, and searches on + * unoptimized indices are faster, but indexing speed is slower. With larger + * values more RAM is used while indexing and searches on unoptimized indices + * are slower, but indexing is faster. Thus larger values (> 10) are best + * for batched index creation, and smaller values (< 10) for indices that are + * interactively maintained. + * + *

This must never be less than 2. The default value is 10. + */ + int32_t getMergeFactor() const{ return mergeFactor; } + void setMergeFactor(int32_t val){ mergeFactor = val; } + + + /** Expert: The fraction of terms in the "dictionary" which should be stored + * in RAM. Smaller values use more memory, but make searching slightly + * faster, while larger values use less memory and make searching slightly + * slower. Searching is typically not dominated by dictionary lookup, so + * tweaking this is rarely useful. + */ + LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_TERM_INDEX_INTERVAL = 128); + /** Expert: Set the interval between indexed terms. Large values cause less + * memory to be used by IndexReader, but slow random-access to terms. Small + * values cause more memory to be used by an IndexReader, and speed + * random-access to terms. + * + * This parameter determines the amount of computation required per query + * term, regardless of the number of documents that contain that term. In + * particular, it is the maximum number of other terms that must be + * scanned before a term is located and its frequency and position information + * may be processed. In a large index with user-entered query terms, query + * processing time is likely to be dominated not by term lookup but rather + * by the processing of frequency and positional data. In a small index + * or when many uncommon query terms are generated (e.g., by wildcard + * queries) term lookup may become a dominant cost. + * + * In particular, numUniqueTerms/interval terms are read into + * memory by an IndexReader, and, on average, interval/2 terms + * must be scanned for each random term access. + * + * @see #DEFAULT_TERM_INDEX_INTERVAL + */ + void setTermIndexInterval(int32_t interval) { termIndexInterval = interval; } + /** Expert: Return the interval between indexed terms. + * + * @see #setTermIndexInterval(int) + */ + int32_t getTermIndexInterval() { return termIndexInterval; } + + /** Determines the minimal number of documents required before the buffered + * in-memory documents are merging and a new Segment is created. + * Since Documents are merged in a {@link RAMDirectory}, + * large value gives faster indexing. At the same time, mergeFactor limits + * the number of files open in a FSDirectory. + * + *

The default value is 10.*/ + int32_t getMinMergeDocs() const{ return minMergeDocs; } + void setMinMergeDocs(int32_t val){ minMergeDocs = val; } + + /** Determines the largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + *

The default value is {@link #DEFAULT_MAX_MERGE_DOCS}. + */ + LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_MERGE_DOCS = LUCENE_INT32_MAX_SHOULDBE); + /**Determines the largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + *

The default value is {@link Integer#MAX_VALUE}. + */ + int32_t getMaxMergeDocs() const{ return maxMergeDocs; } + void setMaxMergeDocs(int32_t val){ maxMergeDocs = val; } + + /** + * Constructs an IndexWriter for the index in path. + * Text will be analyzed with a. If create + * is true, then a new, empty index will be created in + * path, replacing the index already there, if any. + * + * @param path the path to the index directory + * @param a the analyzer to use + * @param create true to create the index or overwrite + * the existing one; false to append to the existing + * index + * @throws IOException if the directory cannot be read/written to, or + * if it does not exist, and create is + * false + */ + IndexWriter(const QString& path, CL_NS(analysis)::Analyzer* a, + const bool create, const bool closeDir = true); + + + /**Constructs an IndexWriter for the index in d. Text will be + * analyzed with a. If create is true, then a new, + * empty index will be created in d, replacing the index already + * there, if any. + */ + IndexWriter(CL_NS(store)::Directory* d, CL_NS(analysis)::Analyzer* a, + const bool create, const bool closeDir = false); + + // Flushes all changes to an index, closes all associated files, and closes + // the directory that the index is stored in. + void close(); + + // Returns the number of documents currently in this index. synchronized + int32_t docCount(); + + + // Adds a document to this index, using the provided analyzer instead of + // the value of {@link #getAnalyzer()}. If the document contains more than + // {@link #setMaxFieldLength(int)} terms for a given field, the remainder + // are discarded. + void addDocument(CL_NS(document)::Document* doc, + CL_NS(analysis)::Analyzer* analyzer = NULL); + + + // Merges all segments together into a single segment, optimizing an index + // for search. synchronized + void optimize(); + + + /**Merges all segments from an array of indices into this index. + * + *

This may be used to parallelize batch indexing. A large document + * collection can be broken into sub-collections. Each sub-collection can be + * indexed in parallel, on a different thread, process or machine. The + * complete index can then be created by merging sub-collection indices + * with this method. + * + *

After this completes, the index is optimized. + *@synchronized + */ + void addIndexes(CL_NS(store)::Directory** dirs); + + /** Merges the provided indexes into this index. + *

After this completes, the index is optimized.

+ *

The provided IndexReaders are not closed.

+ */ + void addIndexes(IndexReader** readers); + + + /** Returns the directory this index resides in. */ + CL_NS(store)::Directory* getDirectory() { return directory; } + + /** Get the current setting of whether to use the compound file format. + * Note that this just returns the value you set with setUseCompoundFile(boolean) + * or the default. You cannot use this to query the status of an existing index. + * @see #setUseCompoundFile(boolean) + */ + bool getUseCompoundFile() { return useCompoundFile; } + + /** Setting to turn on usage of a compound file. When on, multiple files + * for each segment are merged into a single file once the segment creation + * is finished. This is done regardless of what directory is in use. + */ + void setUseCompoundFile(bool value) { useCompoundFile = value; } + + + /** Expert: Set the Similarity implementation used by this IndexWriter. + * + * @see Similarity#setDefault(Similarity) + */ + void setSimilarity(CL_NS(search)::Similarity* similarity) + { this->similarity = similarity; } + + /** Expert: Return the Similarity implementation used by this IndexWriter. + * + *

This defaults to the current value of {@link Similarity#getDefault()}. + */ + CL_NS(search)::Similarity* getSimilarity() { return this->similarity; } + + /** Returns the analyzer used by this index. */ + CL_NS(analysis)::Analyzer* getAnalyzer() { return analyzer; } + +private: + /** Merges all RAM-resident segments. */ + void flushRamSegments(); + + /** Incremental segment merger. */ + void maybeMergeSegments(); + + // Pops segments off of segmentInfos stack down to minSegment, merges them, + // and pushes the merged index onto the top of the segmentInfos stack. + void mergeSegments(const uint32_t minSegment); + + // Merges the named range of segments, replacing them in the stack with a + // single segment. + void mergeSegments(const uint32_t minSegment, const uint32_t end); + + // Some operating systems (e.g. Windows) don't permit a file to be deleted + // while it is opened for read (e.g. by another process or thread). So we + // assume that when a delete fails it is because the file is open in another + // process, and queue the file for subsequent deletion. + void deleteSegments(CL_NS(util)::CLVector* segments); + + void deleteFiles(const QStringList& files); + void readDeleteableFiles(QStringList& files); + void deleteFiles(const QStringList& files, QStringList& deletable); + void deleteFiles(const QStringList& files, CL_NS(store)::Directory* directory); + void writeDeleteableFiles(const QStringList& files); + + // synchronized + QString newSegmentName(); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.cpp new file mode 100644 index 000000000..1260d04dc --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.cpp @@ -0,0 +1,722 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "MultiReader.h" + +#include "IndexReader.h" +#include "CLucene/document/Document.h" +#include "Terms.h" +#include "SegmentMergeQueue.h" + +CL_NS_USE(store) +CL_NS_USE(util) +CL_NS_DEF(index) + +MultiReader::MultiReader(IndexReader** subReaders): + IndexReader(subReaders == NULL || subReaders[0] == NULL ? NULL : subReaders[0]->getDirectory()), + normsCache(true, true) +{ + initialize(subReaders); +} + +MultiReader::MultiReader(Directory* directory, SegmentInfos* sis, IndexReader** subReaders): + IndexReader(directory, sis, false), + normsCache(true, true) +{ + initialize(subReaders); +} + + +MultiReader::~MultiReader() { +//Func - Destructor +//Pre - true +//Post - The instance has been destroyed all IndexReader instances +// this instance managed have been destroyed to + + _CLDELETE_ARRAY(ones); + _CLDELETE_ARRAY(starts); + + //Iterate through the subReaders and destroy each reader + if (subReaders && subReadersLength > 0) { + for (int32_t i = 0; i < subReadersLength; i++) { + _CLDELETE(subReaders[i]); + } + } + //Destroy the subReaders array + _CLDELETE_ARRAY(subReaders); +} + +void MultiReader::initialize(IndexReader** subReaders){ + this->subReadersLength = 0; + this->subReaders = subReaders; + + //count the subReaders size + if ( subReaders != NULL ){ + while ( subReaders[subReadersLength] != NULL ){ + subReadersLength++; + } + } + _maxDoc = 0; + _numDocs = -1; + ones = NULL; + + starts = _CL_NEWARRAY(int32_t,subReadersLength + 1); // build starts array + for (int32_t i = 0; i < subReadersLength; i++) { + starts[i] = _maxDoc; + + // compute maxDocs + _maxDoc += subReaders[i]->maxDoc(); + if (subReaders[i]->hasDeletions()) + _hasDeletions = true; + } + starts[subReadersLength] = _maxDoc; +} + +bool MultiReader::getTermFreqVectors(int32_t n, Array& result){ + int32_t i = readerIndex(n); // find segment num + return subReaders[i]->getTermFreqVectors(n - starts[i], result); // dispatch to segment +} + +TermFreqVector* MultiReader::getTermFreqVector(int32_t n, const TCHAR* field){ + int32_t i = readerIndex(n); // find segment num + return subReaders[i]->getTermFreqVector(n - starts[i], field); +} + + +int32_t MultiReader::numDocs() { + SCOPED_LOCK_MUTEX(THIS_LOCK) + if (_numDocs == -1) { // check cache + int32_t n = 0; // cache miss--recompute + for (int32_t i = 0; i < subReadersLength; i++) + n += subReaders[i]->numDocs(); // sum from readers + _numDocs = n; + } + return _numDocs; +} + +int32_t MultiReader::maxDoc() const { + return _maxDoc; +} + +bool MultiReader::document(int32_t n, CL_NS(document)::Document* doc){ + int32_t i = readerIndex(n); // find segment num + return subReaders[i]->document(n - starts[i],doc); // dispatch to segment reader +} + +bool MultiReader::isDeleted(const int32_t n) { + int32_t i = readerIndex(n); // find segment num + return subReaders[i]->isDeleted(n - starts[i]); // dispatch to segment reader +} + +uint8_t* MultiReader::norms(const TCHAR* field){ + SCOPED_LOCK_MUTEX(THIS_LOCK) + uint8_t* bytes; + bytes = normsCache.get(field); + if (bytes != NULL){ + return bytes; // cache hit + } + + if ( !hasNorms(field) ) + return fakeNorms(); + + bytes = _CL_NEWARRAY(uint8_t,maxDoc()); + for (int32_t i = 0; i < subReadersLength; i++) + subReaders[i]->norms(field, bytes + starts[i]); + + //Unfortunately the data in the normCache can get corrupted, since it's being loaded with string + //keys that may be deleted while still in use by the map. To prevent this field is duplicated + //and then stored in the normCache + TCHAR* key = STRDUP_TtoT(field); + //update cache + normsCache.put(key, bytes); + + return bytes; +} + +void MultiReader::norms(const TCHAR* field, uint8_t* result) { + SCOPED_LOCK_MUTEX(THIS_LOCK) + uint8_t* bytes = normsCache.get(field); + if (bytes==NULL && !hasNorms(field)) + bytes=fakeNorms(); + + if (bytes != NULL){ // cache hit + int32_t len = maxDoc(); + memcpy(result,bytes,len * sizeof(int32_t)); + } + + for (int32_t i = 0; i < subReadersLength; i++) // read from segments + subReaders[i]->norms(field, result + starts[i]); +} + + +void MultiReader::doSetNorm(int32_t n, const TCHAR* field, uint8_t value){ + normsCache.remove(field); // clear cache + int32_t i = readerIndex(n); // find segment num + subReaders[i]->setNorm(n-starts[i], field, value); // dispatch +} + +TermEnum* MultiReader::terms() const { + return _CLNEW MultiTermEnum(subReaders, starts, NULL); +} + +TermEnum* MultiReader::terms(const Term* term) const { + return _CLNEW MultiTermEnum(subReaders, starts, term); +} + +int32_t MultiReader::docFreq(const Term* t) const { + int32_t total = 0; // sum freqs in Multi + for (int32_t i = 0; i < subReadersLength; i++) + total += subReaders[i]->docFreq(t); + return total; +} + +TermDocs* MultiReader::termDocs() const { + TermDocs* ret = _CLNEW MultiTermDocs(subReaders, starts); + return ret; +} + +TermPositions* MultiReader::termPositions() const { + TermPositions* ret = (TermPositions*)_CLNEW MultiTermPositions(subReaders, starts); + return ret; +} + +void MultiReader::doDelete(const int32_t n) { + _numDocs = -1; // invalidate cache + int32_t i = readerIndex(n); // find segment num + subReaders[i]->deleteDocument(n - starts[i]); // dispatch to segment reader + _hasDeletions = true; +} + +int32_t MultiReader::readerIndex(const int32_t n) const { // find reader for doc n: + int32_t lo = 0; // search starts array + int32_t hi = subReadersLength - 1; // for first element less + // than n, return its index + while (hi >= lo) { + int32_t mid = (lo + hi) >> 1; + int32_t midValue = starts[mid]; + if (n < midValue) + hi = mid - 1; + else if (n > midValue) + lo = mid + 1; + else{ // found a match + while (mid+1 < subReadersLength && starts[mid+1] == midValue) { + mid++; // scan to last match + } + return mid; + } + } + return hi; +} + +bool MultiReader::hasNorms(const TCHAR* field) { + for (int i = 0; i < subReadersLength; i++) { + if (subReaders[i]->hasNorms(field)) + return true; + } + return false; +} +uint8_t* MultiReader::fakeNorms() { + if (ones==NULL) + ones=SegmentReader::createFakeNorms(maxDoc()); + return ones; +} + +void MultiReader::doUndeleteAll(){ + for (int32_t i = 0; i < subReadersLength; i++) + subReaders[i]->undeleteAll(); + _hasDeletions = false; + _numDocs = -1; +} +void MultiReader::doCommit() { + for (int32_t i = 0; i < subReadersLength; i++) + subReaders[i]->commit(); +} + +void MultiReader::doClose() { + SCOPED_LOCK_MUTEX(THIS_LOCK) + for (int32_t i = 0; i < subReadersLength; i++){ + subReaders[i]->close(); + } +} + + +void MultiReader::getFieldNames(FieldOption fldOption, StringArrayWithDeletor& retarray){ + StringArrayWithDeletor temp; + CLHashList hashList; + for (int32_t i = 0; i < subReadersLength; i++) { + IndexReader* reader = subReaders[i]; + reader->getFieldNames(fldOption, temp); + + //create a unique list of names. + StringArrayWithDeletor::iterator itr = temp.begin(); + while ( itr != temp.end() ){ + if ( hashList.find(*itr) == hashList.end() ) + hashList.insert(STRDUP_TtoT(*itr)); + itr++; + } + } + //move the items into the return + CLHashList::iterator itr = hashList.begin(); + while ( itr != hashList.end() ){ + retarray.push_back(*itr);//no need to copy, already done! + itr++; + } +} + + +MultiTermDocs::MultiTermDocs(){ +//Func - Default constructor +// Initialises an empty MultiTermDocs. +// This constructor is needed to allow the constructor of MultiTermPositions +// initialise the instance by itself +//Pre - true +//Post - An empty + + subReaders = NULL; + subReadersLength = 0; + starts = NULL; + base = 0; + pointer = 0; + current = NULL; + term = NULL; + readerTermDocs = NULL; +} + +MultiTermDocs::MultiTermDocs(IndexReader** r, const int32_t* s){ +//Func - Constructor +//Pre - if r is NULL then rLen must be 0 else if r != NULL then rLen > 0 +// s != NULL +//Post - The instance has been created + + //count readers + subReadersLength = 0; + subReaders = r; + + CND_PRECONDITION(s != NULL, "s is NULL"); + + if ( subReaders != NULL ){ + while ( subReaders[subReadersLength] != NULL ) + subReadersLength++; + } + + starts = s; + base = 0; + pointer = 0; + current = NULL; + term = NULL; + + readerTermDocs = NULL; + + //Check if there are subReaders + if(subReaders != NULL && subReadersLength > 0){ + readerTermDocs = _CL_NEWARRAY(TermDocs*, subReadersLength+1); + + CND_CONDITION(readerTermDocs != NULL,"No memory could be allocated for readerTermDocs"); + + //Initialize the readerTermDocs pointer array to NULLs + for ( int32_t i=0;idoc(); +} +int32_t MultiTermDocs::freq() const { + CND_PRECONDITION(current!=NULL,"current==NULL, check that next() was called"); + return current->freq(); +} + +void MultiTermDocs::seek(TermEnum* termEnum){ + seek(termEnum->term(false)); +} + +void MultiTermDocs::seek( Term* tterm) { +//Func - Resets the instance for a new search +//Pre - tterm != NULL +//Post - The instance has been reset for a new search + + CND_PRECONDITION(tterm != NULL, "tterm is NULL"); + + //Assigning tterm is done as below for a reason + //The construction ensures that if seek is called from within + //MultiTermDocs with as argument this->term (seek(this->term)) that the assignment + //will succeed and all referencecounters represent the correct situation + + //Get a pointer from tterm and increase its reference counter + Term *TempTerm = _CL_POINTER(tterm); + + //Finialize term to ensure we decrease the reference counter of the instance which term points to + _CLDECDELETE(term); + + //Assign TempTerm to term + term = TempTerm; + + base = 0; + pointer = 0; + current = NULL; +} + +bool MultiTermDocs::next() { + if (current != NULL && current->next()) { + return true; + } else if (pointer < subReadersLength) { + base = starts[pointer]; + current = termDocs(pointer++); + return next(); + } else + return false; +} + +int32_t MultiTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) { + while (true) { + while (current == NULL) { + if (pointer < subReadersLength) { // try next segment + base = starts[pointer]; + current = termDocs(pointer++); + } else { + return 0; + } + } + int32_t end = current->read(docs, freqs,length); + if (end == 0) { // none left in segment + current = NULL; + } else { // got some + int32_t b = base; // adjust doc numbers + for (int32_t i = 0; i < end; i++) + docs[i] += b; + return end; + } + } +} + +bool MultiTermDocs::skipTo(const int32_t target) { + do { + if (!next()) + return false; + } while (target > doc()); + return true; +} + +void MultiTermDocs::close() { +//Func - Closes all MultiTermDocs managed by this instance +//Pre - true +//Post - All the MultiTermDocs have been closed + + + //Check if readerTermDocs is valid + if (readerTermDocs){ + TermDocs* curTD = NULL; + //iterate through the readerTermDocs array + for (int32_t i = 0; i < subReadersLength; i++) { + //Retrieve the i-th TermDocs instance + curTD = readerTermDocs[i]; + + //Check if it is a valid pointer + if (curTD != NULL) { + //Close it + curTD->close(); + _CLDELETE(curTD); + } + } + + _CLDELETE_ARRAY(readerTermDocs); + } + + //current previously pointed to a member of readerTermDocs; ensure that + //it doesn't now point to invalid memory. + current = NULL; + base = 0; + pointer = 0; + + _CLDECDELETE(term); +} + +TermDocs* MultiTermDocs::termDocs(const IndexReader* reader) const { + TermDocs* ret = reader->termDocs(); + return ret; +} + +TermDocs* MultiTermDocs::termDocs(const int32_t i) const { + if (term == NULL) + return NULL; + TermDocs* result = readerTermDocs[i]; + if (result == NULL){ + readerTermDocs[i] = termDocs(subReaders[i]); + result = readerTermDocs[i]; + } + result->seek(term); + + return result; +} + + +MultiTermEnum::MultiTermEnum( + IndexReader** subReaders, const int32_t *starts, const Term* t){ +//Func - Constructor +// Opens all enumerations of all readers +//Pre - readers != NULL and contains an array of IndexReader instances each responsible for +// reading a single segment +// subReadersLength >= 0 and represents the number of readers in the readers array +// starts is an array of +//Post - An instance of has been created + +//Pre - if readers is NULL then subReadersLength must be 0 else if readers != NULL then subReadersLength > 0 +// s != NULL +//Post - The instance has been created + + int32_t subReadersLength = 0; + if ( subReaders != NULL ){ + while ( subReaders[subReadersLength] != NULL ) + subReadersLength++; + } + CND_PRECONDITION(starts != NULL,"starts is NULL"); + + //Temporary variables + IndexReader* reader = NULL; + TermEnum* termEnum = NULL; + SegmentMergeInfo* smi = NULL; + _docFreq = 0; + _term = NULL; + queue = _CLNEW SegmentMergeQueue(subReadersLength); + + CND_CONDITION (queue != NULL, "Could not allocate memory for queue"); + + //iterate through all the readers + for ( int32_t i=0;iterms(t); + }else{ + //termEnum is an enumeration of all the Terms and TermInfos in the set. + termEnum = reader->terms(); + } + + //Instantiate an new SegmentMerginfo + smi = _CLNEW SegmentMergeInfo(starts[i], termEnum, reader); + + // Note that in the call termEnum->getTerm(false) below false is required because + // otherwise a reference is leaked. By passing false getTerm is + // ordered to return an unowned reference instead. (Credits for DSR) + if (t == NULL ? smi->next() : termEnum->term(false) != NULL){ + // initialize queue + queue->put(smi); + } else{ + //Close the SegmentMergeInfo + smi->close(); + //And have it deleted + _CLDELETE(smi); + } + } + + //Check if the queue has elements + if (t != NULL && queue->size() > 0) { + next(); + } +} + +MultiTermEnum::~MultiTermEnum(){ +//Func - Destructor +//Pre - true +//Post - All the resource have been freed and the instance has been deleted + + //Close the enumeration + close(); + + //Delete the queue + _CLDELETE(queue); +} + +bool MultiTermEnum::next(){ +//Func - Move the current term to the next in the set of enumerations +//Pre - true +//Post - Returns true if term has been moved to the next in the set of enumerations +// Returns false if this was not possible + + SegmentMergeInfo* top = queue->top(); + if (top == NULL) { + _CLDECDELETE(_term); + _term = NULL; + return false; + } + + //The getTerm method requires the client programmer to indicate whether he + // owns the returned reference, so we can discard ours + // right away. + _CLDECDELETE(_term); + + //Assign term the term of top and make sure the reference counter is increased + _term = _CL_POINTER(top->term); + _docFreq = 0; + + //Find the next term + while (top != NULL && _term->compareTo(top->term) == 0) { + //don't delete, this is the top + queue->pop(); + // increment freq + _docFreq += top->termEnum->docFreq(); + if (top->next()){ + // restore queue + queue->put(top); + }else{ + // done with a segment + top->close(); + _CLDELETE(top); + } + top = queue->top(); + } + + return true; +} + + +Term* MultiTermEnum::term() { +//Func - Returns the current term of the set of enumerations +//Pre - pointer is true or false and indicates if the reference counter +// of term must be increased or not +// next() must have been called once! +//Post - pointer = true -> term has been returned with an increased reference counter +// pointer = false -> term has been returned + + return _CL_POINTER(_term); +} + +Term* MultiTermEnum::term(bool pointer) { + if ( pointer ) + return _CL_POINTER(_term); + else + return _term; +} + +int32_t MultiTermEnum::docFreq() const { +//Func - Returns the document frequency of the current term in the set +//Pre - termInfo != NULL +// next() must have been called once +//Post - The document frequency of the current enumerated term has been returned + + return _docFreq; +} + + +void MultiTermEnum::close() { +//Func - Closes the set of enumerations in the queue +//Pre - queue holds a valid reference to a SegmentMergeQueue +//Post - The queue has been closed all SegmentMergeInfo instance have been deleted by +// the closing of the queue +// term has been finalized and reset to NULL + + // Needed when this enumeration hasn't actually been exhausted yet + _CLDECDELETE(_term); + + //Close the queue This will destroy all SegmentMergeInfo instances! + queue->close(); + +} + + + + + +MultiTermPositions::MultiTermPositions(IndexReader** r, const int32_t* s){ +//Func - Constructor +//Pre - if r is NULL then rLen must be 0 else if r != NULL then rLen > 0 +// s != NULL +//Post - The instance has been created + + subReaders = r; + subReadersLength = 0; + if ( subReaders != NULL ){ + while ( subReaders[subReadersLength] != NULL ) + subReadersLength ++ ; + } + + CND_PRECONDITION(s != NULL, "s is NULL"); + + starts = s; + base = 0; + pointer = 0; + current = NULL; + term = NULL; + + readerTermDocs = NULL; + + //Check if there are readers + if(subReaders != NULL && subReadersLength > 0){ + readerTermDocs = (TermDocs**)_CL_NEWARRAY(SegmentTermPositions*,subReadersLength); + + CND_CONDITION(readerTermDocs != NULL,"No memory could be allocated for readerTermDocs"); + + //Initialize the readerTermDocs pointer array + for ( int32_t i=0;icurrent to always +// be a SegmentTermPositions rather than merely a SegmentTermDocs. +// To that end, we override the termDocs(IndexReader&) method to produce +// a SegmentTermPositions via the underlying reader's termPositions method +// rather merely producing a SegmentTermDocs via the reader's termDocs +// method. + + TermPositions* tp = reader->termPositions(); + TermDocs* ret = tp->__asTermDocs(); + + CND_CONDITION(ret != NULL, + "Dynamic downcast in MultiTermPositions::termDocs from" + " TermPositions to TermDocs failed." + ); + return ret; + } + +int32_t MultiTermPositions::nextPosition() { + //Func - + //Pre - current != NULL + //Post - + CND_PRECONDITION(current != NULL,"current is NULL"); + + TermPositions* curAsTP = current->__asTermPositions(); + + CND_CONDITION(curAsTP != NULL, + "Dynamic downcast in MultiTermPositions::nextPosition from" + " SegmentTermDocs to TermPositions failed." + ) + return curAsTP->nextPosition(); +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.h b/src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.h new file mode 100644 index 000000000..1d76814e1 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/MultiReader.h @@ -0,0 +1,202 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_MultiReader +#define _lucene_index_MultiReader + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SegmentHeader.h" +#include "IndexReader.h" +#include "CLucene/document/Document.h" +#include "Terms.h" +#include "SegmentMergeQueue.h" + +CL_NS_DEF(index) + +/** An IndexReader which reads multiple indexes, appending their content. +*/ +class MultiTermDocs:public virtual TermDocs { +private: +protected: + TermDocs** readerTermDocs; + + IndexReader** subReaders; + int32_t subReadersLength; + const int32_t* starts; + Term* term; + + int32_t base; + int32_t pointer; + + TermDocs* current; // == segTermDocs[pointer] +public: + MultiTermDocs(); + MultiTermDocs(IndexReader** subReaders, const int32_t* s); + virtual ~MultiTermDocs(); + + int32_t doc() const; + int32_t freq() const; + + void seek(TermEnum* termEnum); + void seek(Term* tterm); + bool next(); + + /** Optimized implementation. */ + int32_t read(int32_t* docs, int32_t* freqs, int32_t length); + + /** As yet unoptimized implementation. */ + bool skipTo(const int32_t target); + + void close(); + + virtual TermPositions* __asTermPositions(); +protected: + virtual TermDocs* termDocs(const IndexReader* reader) const; +private: + TermDocs* termDocs(const int32_t i) const; + +}; + + +//MultiTermEnum represents the enumeration of all terms of all readers +class MultiTermEnum:public TermEnum { +private: + SegmentMergeQueue* queue; + + Term* _term; + int32_t _docFreq; +public: + //Constructor + //Opens all enumerations of all readers + MultiTermEnum(IndexReader** subReaders, const int32_t* starts, const Term* t); + + //Destructor + ~MultiTermEnum(); + + //Move the current term to the next in the set of enumerations + bool next(); + + //Returns a pointer to the current term of the set of enumerations + Term* term(); + Term* term(bool pointer); + + //Returns the document frequency of the current term in the set + int32_t docFreq() const; + + //Closes the set of enumerations in the queue + void close(); + + + const char* getObjectName(){ return MultiTermEnum::getClassName(); } + static const char* getClassName(){ return "MultiTermEnum"; } +}; + + +class MultiTermPositions:public MultiTermDocs,public TermPositions { +public: + MultiTermPositions(IndexReader** subReaders, const int32_t* s); + ~MultiTermPositions() {}; + int32_t nextPosition(); + + + virtual TermDocs* __asTermDocs(); + virtual TermPositions* __asTermPositions(); +protected: + TermDocs* termDocs(const IndexReader* reader) const; +}; + + +class MultiReader:public IndexReader{ +private: + bool _hasDeletions; + IndexReader** subReaders; + int32_t subReadersLength; + int32_t* starts; // 1st docno for each segment + + CL_NS(util)::CLHashtable > normsCache; + int32_t _maxDoc; + int32_t _numDocs; + void initialize(IndexReader** subReaders); + + int32_t readerIndex(const int32_t n) const; + + bool hasNorms(const TCHAR* field); + uint8_t* ones; + uint8_t* fakeNorms(); +protected: + void doSetNorm(int32_t n, const TCHAR* field, uint8_t value); + void doUndeleteAll(); + void doCommit(); + // synchronized + void doClose(); + + // synchronized + void doDelete(const int32_t n); +public: + /** Construct reading the named set of readers. */ + MultiReader(CL_NS(store)::Directory* directory, SegmentInfos* sis, IndexReader** subReaders); + + /** + *

Construct a MultiReader aggregating the named set of (sub)readers. + * Directory locking for delete, undeleteAll, and setNorm operations is + * left to the subreaders.

+ *

Note that all subreaders are closed if this Multireader is closed.

+ * @param subReaders set of (sub)readers + * @throws IOException + */ + MultiReader(IndexReader** subReaders); + + ~MultiReader(); + + /** Return an array of term frequency vectors for the specified document. + * The array contains a vector for each vectorized field in the document. + * Each vector vector contains term numbers and frequencies for all terms + * in a given vectorized field. + * If no such fields existed, the method returns null. + */ + bool getTermFreqVectors(int32_t n, Array& result); + TermFreqVector* getTermFreqVector(int32_t n, const TCHAR* field); + + + // synchronized + int32_t numDocs(); + + int32_t maxDoc() const; + + bool document(int32_t n, CL_NS(document)::Document* doc); + + bool isDeleted(const int32_t n); + bool hasDeletions() const{ return _hasDeletions; } + + // synchronized + uint8_t* norms(const TCHAR* field); + void norms(const TCHAR* field, uint8_t* result); + + TermEnum* terms() const; + TermEnum* terms(const Term* term) const; + + //Returns the document frequency of the current term in the set + int32_t docFreq(const Term* t=NULL) const; + TermDocs* termDocs() const; + TermPositions* termPositions() const; + + + /** + * @see IndexReader#getFieldNames(IndexReader.FieldOption fldOption) + */ + void getFieldNames(FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor& retarray); +}; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentHeader.h b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentHeader.h new file mode 100644 index 000000000..00b08991d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentHeader.h @@ -0,0 +1,314 @@ +/* +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_SegmentHeader_ +#define _lucene_index_SegmentHeader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include + +#include "SegmentInfos.h" +#include "CLucene/util/BitSet.h" +#include "CLucene/util/VoidMap.h" +#include "Term.h" +#include "FieldInfos.h" +#include "FieldsReader.h" +#include "IndexReader.h" +#include "TermInfosReader.h" +#include "CompoundFile.h" +#include "CLucene/util/ThreadLocal.h" + +CL_NS_DEF(index) + +class SegmentReader; + +class SegmentTermDocs : public virtual TermDocs +{ + int32_t _doc; + int32_t skipInterval; + int32_t numSkips; + int32_t skipCount; + CL_NS(store)::IndexInput* skipStream; + int32_t skipDoc; + int64_t freqPointer; + int64_t proxPointer; + int64_t skipPointer; + bool haveSkipped; + +protected: + // SegmentReader parent + const SegmentReader* parent; + CL_NS(store)::IndexInput* freqStream; + int32_t count; + int32_t df; + int32_t _freq; + CL_NS(util)::BitSet* deletedDocs; +public: + virtual ~SegmentTermDocs(); + + virtual void seek(TermEnum* termEnum); + virtual void seek(Term* term); + virtual void seek(const TermInfo* ti); + + virtual void close(); + virtual int32_t doc()const; + virtual int32_t freq()const; + + virtual bool next(); + + /** Optimized implementation. */ + virtual int32_t read(int32_t* docs, int32_t* freqs, int32_t length); + + /** Optimized implementation. */ + virtual bool skipTo(const int32_t target); + + virtual TermPositions* __asTermPositions(); + + // \param Parent must be a segment reader + SegmentTermDocs( const SegmentReader* Parent); +protected: + virtual void skippingDoc(){} + virtual void skipProx(int64_t proxPointer){} +}; + + +class SegmentTermPositions : public SegmentTermDocs, public TermPositions +{ +private: + CL_NS(store)::IndexInput* proxStream; + int32_t proxCount; + int32_t position; + +public: + // \param Parent must be a segment reader + SegmentTermPositions(const SegmentReader* Parent); + ~SegmentTermPositions(); + + void seek(const TermInfo* ti); + void close(); + int32_t nextPosition(); + bool next(); + int32_t read(int32_t* docs, int32_t* freqs, int32_t length); + virtual TermDocs* __asTermDocs(); + virtual TermPositions* __asTermPositions(); + + //resolve SegmentTermDocs/TermPositions ambiguity + void seek(Term* term){ SegmentTermDocs::seek(term); } + void seek(TermEnum* termEnum){ SegmentTermDocs::seek(termEnum); } + int32_t doc() const{ return SegmentTermDocs::doc(); } + int32_t freq() const{ return SegmentTermDocs::freq(); } + bool skipTo(const int32_t target){ return SegmentTermDocs::skipTo(target); } + +protected: + void skippingDoc(); + /** Called by super.skipTo(). */ + void skipProx(int64_t proxPointer); +}; + +// An IndexReader responsible for reading 1 segment of an index +class SegmentReader : public IndexReader +{ + /** + * The class Norm represents the normalizations for a field. + * These normalizations are read from an IndexInput in into an array of bytes called bytes + */ + class Norm : LUCENE_BASE + { + int32_t number; + SegmentReader* reader; + QString segment; // segment name + + public: + CL_NS(store)::IndexInput* in; + uint8_t* bytes; + bool dirty; + //Constructor + Norm(CL_NS(store)::IndexInput* instrm, int32_t number, + SegmentReader* reader, const QString& segment); + //Destructor + ~Norm(); + + void reWrite(); + }; + friend class SegmentReader::Norm; + + //Holds the name of the segment that is being read + QString segment; + + //Indicates if there are documents marked as deleted + bool deletedDocsDirty; + bool normsDirty; + bool undeleteAll; + + //Holds all norms for all fields in the segment + typedef CL_NS(util)::CLHashtable NormsType; + NormsType _norms; + + uint8_t* ones; + uint8_t* fakeNorms(); + + // Compound File Reader when based on a compound file segment + CompoundFileReader* cfsReader; + // Reads the Field Info file + FieldsReader* fieldsReader; + TermVectorsReader* termVectorsReaderOrig; + CL_NS(util)::ThreadLocal >termVectorsLocal; + + void initialize(SegmentInfo* si); + + // Create a clone from the initial TermVectorsReader and store it in the + // ThreadLocal. @return TermVectorsReader + TermVectorsReader* getTermVectorsReader(); + +protected: + // Marks document docNum as deleted + void doDelete(const int32_t docNum); + void doUndeleteAll(); + void doCommit(); + void doSetNorm(int32_t doc, const TCHAR* field, uint8_t value); + + // can return null if norms aren't stored + uint8_t* getNorms(const TCHAR* field); + +public: + /** + Func - Constructor. + Opens all files of a segment + .fnm -> Field Info File + Field names are stored in the field info file, with suffix .fnm. + .frq -> Frequency File + The .frq file contains the lists of documents which contain + each term, along with the frequency of the term in that document. + .prx -> Prox File + The prox file contains the lists of positions that each term occurs + at within documents. + .tis -> Term Info File + This file is sorted by Term. Terms are ordered first lexicographically + by the term's field name, and within that lexicographically by the term's text. + .del -> Deletion File + The .del file is optional, and only exists when a segment contains deletions + .f[0-9]* -> Norm File + Contains s, for each document, a byte that encodes a value that is + multiplied into the score for hits on that field: + */ + SegmentReader(SegmentInfo* si); + + SegmentReader(SegmentInfos* sis, SegmentInfo* si); + // Destructor. + virtual ~SegmentReader(); + + // Closes all streams to the files of a single segment + void doClose(); + + // Checks if a segment managed by SegmentInfo si has deletions + static bool hasDeletions(const SegmentInfo* si); + bool hasDeletions() const; + bool hasNorms(const TCHAR* field) const; + + // Returns all file names managed by this SegmentReader + void files(QStringList& retarray); + // Returns an enumeration of all the Terms and TermInfos in the set. + TermEnum* terms() const; + // Returns an enumeration of terms starting at or after the named term t + TermEnum* terms(const Term* t) const; + + // Gets the document identified by n + bool document(int32_t n, CL_NS(document)::Document* doc); + + // Checks if the n-th document has been marked deleted + bool isDeleted(const int32_t n); + + // Returns an unpositioned TermDocs enumerator. + TermDocs* termDocs() const; + // Returns an unpositioned TermPositions enumerator. + TermPositions* termPositions() const; + + // Returns the number of documents which contain the term t + int32_t docFreq(const Term* t) const; + + // Returns the actual number of documents in the segment + int32_t numDocs(); + // Returns the number of all the documents in the segment including the + // ones that have been marked deleted + int32_t maxDoc() const; + + // Returns the bytes array that holds the norms of a named field. + // Returns fake norms if norms aren't available + uint8_t* norms(const TCHAR* field); + + // Reads the Norms for field from disk + void norms(const TCHAR* field, uint8_t* bytes); + + // concatenating segment with ext and x + QString SegmentName(const QString& ext, const int32_t x = -1); + // Creates a filename in buffer by concatenating segment with ext and x + void SegmentName(QString& buffer, int32_t bufferLen, const QString& ext, + const int32_t x = -1); + + /** + * @see IndexReader#getFieldNames(IndexReader.FieldOption fldOption) + */ + void getFieldNames(FieldOption fldOption, CL_NS(util)::StringArrayWithDeletor& retarray); + + static bool usesCompoundFile(SegmentInfo* si); + + /** Return a term frequency vector for the specified document and field. The + * vector returned contains term numbers and frequencies for all terms in + * the specified field of this document, if the field had storeTermVector + * flag set. If the flag was not set, the method returns null. + * @throws IOException + */ + TermFreqVector* getTermFreqVector(int32_t docNumber, const TCHAR* field = NULL); + + /** Return an array of term frequency vectors for the specified document. + * The array contains a vector for each vectorized field in the document. + * Each vector vector contains term numbers and frequencies for all terms + * in a given vectorized field. + * If no such fields existed, the method returns null. + * @throws IOException + */ + bool getTermFreqVectors(int32_t docNumber, Array& result); + +private: + //Open all norms files for all fields + void openNorms(CL_NS(store)::Directory* cfsDir); + //Closes all norms files + void closeNorms(); + + // a bitVector that manages which documents have been deleted + CL_NS(util)::BitSet* deletedDocs; + // an IndexInput to the frequency file + CL_NS(store)::IndexInput* freqStream; + // For reading the fieldInfos file + FieldInfos* fieldInfos; + // For reading the Term Dictionary .tis file + TermInfosReader* tis; + // an IndexInput to the prox file + CL_NS(store)::IndexInput* proxStream; + + static bool hasSeparateNorms(SegmentInfo* si); + static uint8_t* createFakeNorms(int32_t size); + + // allow various classes to access the internals of this. this allows us + // to have a more tight idea of the package + friend class IndexReader; + friend class IndexWriter; + friend class SegmentTermDocs; + friend class SegmentTermPositions; + friend class MultiReader; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp new file mode 100644 index 000000000..f62c4061a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.cpp @@ -0,0 +1,259 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#include "CLucene/StdHeader.h" +#include "SegmentInfos.h" + +#include "CLucene/store/Directory.h" +#include "CLucene/util/Misc.h" + +CL_NS_USE(store) +CL_NS_USE(util) +CL_NS_DEF(index) + +SegmentInfo::SegmentInfo(const QString& Name, const int32_t DocCount, + CL_NS(store)::Directory* Dir) + : docCount(DocCount) + , dir(Dir) +{ + //Func - Constructor. Initialises SegmentInfo. + //Pre - Name holds the unique name in the directory Dir + // DocCount holds the number of documents in the segment + // Dir holds the Directory where the segment resides + //Post - The instance has been created. name contains the duplicated string + // Name. docCount = DocCount and dir references Dir + name = Name; +} + +SegmentInfo::~SegmentInfo() +{ +} + +SegmentInfos::SegmentInfos(bool _deleteMembers) + : deleteMembers(_deleteMembers) +{ + //Func - Constructor + //Pre - deleteMembers indicates if the instance to be created must delete + // all SegmentInfo instances it manages when the instance is destroyed + // or not true -> must delete, false may not delete + //Post - An instance of SegmentInfos has been created. + + //initialize counter to 0 + counter = 0; + version = Misc::currentTimeMillis(); +} + +SegmentInfos::~SegmentInfos() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed. Depending on the constructor used + // the SegmentInfo instances that this instance managed have been + // deleted or not. + + if (deleteMembers) { + segmentInfosType::iterator it; + for (it = infos.begin(); it != infos.end(); ++it) + _CLLDELETE(*it); + } + //Clear the list of SegmentInfo instances - make sure everything is deleted + infos.clear(); +} + +SegmentInfo* SegmentInfos::info(int32_t i) const +{ + //Func - Returns a reference to the i-th SegmentInfo in the list. + //Pre - i >= 0 + //Post - A reference to the i-th SegmentInfo instance has been returned + + CND_PRECONDITION(i >= 0, "i contains negative number"); + + //Get the i-th SegmentInfo instance + SegmentInfo *ret = infos.value(i, 0); + + //Condition check to see if the i-th SegmentInfo has been retrieved + CND_CONDITION(ret != NULL, "No SegmentInfo instance found"); + + return ret; +} + +void SegmentInfos::clearto(size_t _min) +{ + // Make sure we actually need to remove + if (infos.size() > _min) { + segmentInfosType::iterator itr; + segmentInfosType::iterator eitr = infos.end(); + segmentInfosType::iterator bitr = infos.begin() + _min; + + for(itr = bitr; itr != eitr; ++itr) + _CLLDELETE((*itr)); + infos.erase(bitr, eitr); + } +} + +void SegmentInfos::add(SegmentInfo* info) +{ + infos.push_back(info); +} + +int32_t SegmentInfos::size() const +{ + return infos.size(); +} + +void SegmentInfos::read(Directory* directory) +{ + //Func - Reads segments file that resides in directory. + //Pre - directory contains a valid reference + //Post - The segments file has been read and for each segment found + // a SegmentsInfo intance has been created and stored. + + //Open an IndexInput to the segments file and check if valid + IndexInput* input = directory->openInput(QLatin1String("segments")); + if (input) { + try { + int32_t format = input->readInt(); + // file contains explicit format info + if (format < 0) { + // check that it is a format we can understand + if (format < FORMAT) { + TCHAR err[30]; + _sntprintf(err, 30, _T("Unknown format version: %d"), format); + _CLTHROWT(CL_ERR_Runtime, err); + } + // read version + version = input->readLong(); + // read counter + counter = input->readInt(); + } else { + // file is in old format without explicit format info + counter = format; + } + + //Temporary variable for storing the name of the segment + char aname[CL_MAX_PATH] = { 0 }; + TCHAR tname[CL_MAX_PATH] = { 0 }; + + //read segmentInfos + for (int32_t i = input->readInt(); i > 0; --i) { + // read the name of the segment + input->readString(tname, CL_MAX_PATH); + STRCPY_TtoA(aname, tname, CL_MAX_PATH); + + //Instantiate a new SegmentInfo Instance + SegmentInfo* si = _CLNEW SegmentInfo(QLatin1String(aname), + input->readInt(), directory); + + //Condition check to see if si points to an instance + CND_CONDITION(si != NULL, "Memory allocation for si failed") ; + + //store SegmentInfo si + infos.push_back(si); + } + + if (format >= 0) { + // in old format the version number may be at the end of the file + if (input->getFilePointer() >= input->length()) { + // old file format without version number + version = Misc::currentTimeMillis(); + } else { + // read version + version = input->readLong(); + } + } + } _CLFINALLY ( + //destroy the inputStream input. The destructor of IndexInput will + //also close the Inputstream input + _CLDELETE(input); + ); + } +} + +void SegmentInfos::write(Directory* directory) +{ + //Func - Writes a new segments file based upon the SegmentInfo instances it manages + //Pre - directory is a valid reference to a Directory + //Post - The new segment has been written to disk + + //Open an IndexOutput to the segments file and check if valid + IndexOutput* output = directory->createOutput(QLatin1String("segments.new")); + if (output) { + try { + // write FORMAT + output->writeInt(FORMAT); + // every write changes the index + output->writeLong(++version); + // Write the counter + output->writeInt(counter); + + // Write the number of SegmentInfo Instances which is equal to the number + // of segments in directory as each SegmentInfo manages a single segment + output->writeInt(infos.size()); + + //temporary value for wide segment name + TCHAR tname[CL_MAX_PATH]; + + //Iterate through all the SegmentInfo instances + for (uint32_t i = 0; i < infos.size(); ++i) { + //Retrieve the SegmentInfo + SegmentInfo *si = infos.value(i, 0); + //Condition check to see if si has been retrieved + CND_CONDITION(si != NULL, "No SegmentInfo instance found"); + + //Write the name of the current segment + int32_t count = si->name.toWCharArray(tname); + tname[count] = '\0'; + output->writeString(tname, _tcslen(tname)); + + //Write the number of documents in the segment + output->writeInt(si->docCount); + } + } _CLFINALLY( + output->close(); + _CLDELETE(output); + ); + + // install new segment info + directory->renameFile(QLatin1String("segments.new"), + QLatin1String("segments")); + } +} + + +int64_t SegmentInfos::readCurrentVersion(Directory* directory) +{ + int32_t format = 0; + int64_t version = 0; + IndexInput* input = directory->openInput(QLatin1String("segments")); + try { + format = input->readInt(); + if (format < 0){ + if (format < FORMAT) { + TCHAR err[30]; + _sntprintf(err, 30, _T("Unknown format version: %d"), format); + _CLTHROWT(CL_ERR_Runtime, err); + } + // read version + version = input->readLong(); + } + } _CLFINALLY ( + input->close(); + _CLDELETE(input); + ); + + if (format < 0) + return version; + + // We cannot be sure about the format of the file. Therefore we have to + // read the whole file and cannot simply seek to the version entry. + SegmentInfos segmentInfos; + segmentInfos.read(directory); + return segmentInfos.getVersion(); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.h b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.h new file mode 100644 index 000000000..ce7183820 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentInfos.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#ifndef _lucene_index_SegmentInfos_ +#define _lucene_index_SegmentInfos_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include + +#include "CLucene/store/Directory.h" + +CL_NS_DEF(index) + +class SegmentInfo : LUCENE_BASE +{ +public: + SegmentInfo(const QString& Name, const int32_t DocCount, + CL_NS(store)::Directory* Dir); + ~SegmentInfo(); + + ///Gets the Directory where the segment resides + CL_NS(store)::Directory* getDir() const { return dir; } + + //Unique name in directory dir + QString name; + + //Number of docs in the segment + const int32_t docCount; + +private: + //Directory where the segment resides + CL_NS(store)::Directory* dir; +}; + +typedef QVector segmentInfosType; + +//SegmentInfos manages a list of SegmentInfo instances +//Each SegmentInfo contains information about a segment in a directory. +// +//The active segments in the index are stored in the segment info file. +//An index only has a single file in this format, and it is named "segments". +//This lists each segment by name, and also contains the size of each segment. +//The format of the file segments is defined as follows: +// +// SegCount +//Segments --> SegCount, +// +//SegCount, SegSize --> UInt32 +// +//SegName --> String +// +//SegName is the name of the segment, and is used as the file name prefix +//for all of the files that compose the segment's index. +// +//SegSize is the number of documents contained in the segment index. +// +//Note: +//At http://jakarta.apache.org/lucene/docs/fileformats.html the definition +//of all file formats can be found. Note that java lucene currently +//defines Segments as follows: +// +//Segments --> Format, Version, SegCount, SegCount +// +//Format, SegCount, SegSize --> UInt32 +// +//Format and Version have not been implemented yet +class SegmentInfos : LUCENE_BASE +{ +public: + SegmentInfos(bool deleteMembers = true); + ~SegmentInfos(); + + //delete and clears objects 'from' from to 'to' + void clearto(size_t to); + + //count of segment infos + int32_t size() const; + + //add a segment info + void add(SegmentInfo* info); + + //Returns a reference to the i-th SegmentInfo in the list. + SegmentInfo* info(int32_t i) const; + + // version number when this SegmentInfos was generated. + int64_t getVersion() const { return version; } + + static int64_t readCurrentVersion(CL_NS(store)::Directory* directory); + + //Reads segments file that resides in directory + void read(CL_NS(store)::Directory* directory); + + //Writes a new segments file based upon the SegmentInfo instances it manages + void write(CL_NS(store)::Directory* directory); + +private: + // The file format version, a negative number. + // Works since counter, the old 1st entry, is always >= 0 + LUCENE_STATIC_CONSTANT(int32_t, FORMAT = -1); + + // counts how often the index has been changed by adding or deleting docs. + // starting with the current time in milliseconds forces to create unique + // version numbers. + int64_t version; + + segmentInfosType infos; + + // used to name new segments + int32_t counter; + + // allow IndexWriter to use counter + friend class IndexWriter; + + bool deleteMembers; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp new file mode 100644 index 000000000..85ac784ad --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.cpp @@ -0,0 +1,104 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SegmentMergeInfo.h" + +#include "SegmentTermEnum.h" +#include "SegmentHeader.h" + +CL_NS_DEF(index) + +SegmentMergeInfo::SegmentMergeInfo(const int32_t b, TermEnum* te, IndexReader* r): + reader(r),termEnum(te),base(b), docMap(NULL) { +//Func - Constructor +//Pre - b >= 0 +// te contains a valid reference to a SegmentTermEnum instance +// r contains a valid reference to a SegmentReader instance +//Post - The instance has been created + + CND_PRECONDITION(b >= 0, "b is a negative number"); + + postings=NULL; + term = te->term(); +} + +SegmentMergeInfo::~SegmentMergeInfo(){ +//Func - Destructor +//Pre - true +//Post - The instance has been destroyed + + close(); +} + +int32_t* SegmentMergeInfo::getDocMap(){ + if ( docMap == NULL ){ + // build array which maps document numbers around deletions + if (reader->hasDeletions()) { + //Get the total number of documents managed by the reader including the deleted ones + int32_t maxDoc = reader->maxDoc(); + //Create a map for all documents + docMap = _CL_NEWARRAY(int32_t,maxDoc); + int32_t j = 0; + //Iterate through all the document numbers + for (int32_t i = 0; i < maxDoc; i++) { + //Check if document i is marked deleted + if (reader->isDeleted(i)){ + //Document i has not been marked deleted so assign -1 + docMap[i] = -1; + }else{ + docMap[i] = j++; + } + } + } + } + return docMap; +} + +TermPositions* SegmentMergeInfo::getPositions() { + if (postings == NULL) { + postings = reader->termPositions(); + } + return postings; +} + + +bool SegmentMergeInfo::next() { +//Func - Moves the current term of the enumeration termEnum to the next and term +// points to this new current term +//Pre - true +//Post - Returns true if the term has been moved to the next otherwise false + if (termEnum->next()) { + _CLDECDELETE(term); + term = termEnum->term(); + return true; + } else { + _CLDECDELETE(term); //TODO: test HighFreqTerms errors with this + term = NULL; + return false; + } +} + +void SegmentMergeInfo::close() { +//Func - Closes the the resources +//Pre - true +//Post - The resources have been closed + + //First make sure posting has been closed + if ( postings != NULL ){ + postings->close(); + _CLVDELETE(postings); //todo: not a clucene object... should be + } + + if ( termEnum != NULL ){ + termEnum->close(); + _CLDELETE(termEnum); + } + _CLDECDELETE(term); + _CLDELETE_ARRAY(docMap); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h new file mode 100644 index 000000000..7ffd46ade --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeInfo.h @@ -0,0 +1,47 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_SegmentMergeInfo_ +#define _lucene_index_SegmentMergeInfo_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SegmentTermEnum.h" +#include "SegmentHeader.h" + +CL_NS_DEF(index) +class SegmentMergeInfo:LUCENE_BASE { + int32_t* docMap; // maps around deleted docs + TermPositions* postings; +public: + TermEnum* termEnum; + Term* term; + int32_t base; + IndexReader* reader; + + //Constructor + SegmentMergeInfo(const int32_t b, TermEnum* te, IndexReader* r); + + //Destructor + ~SegmentMergeInfo(); + + //Moves the current term of the enumeration termEnum to the next and term + //points to this new current term + bool next(); + + //Closes the the resources + void close(); + + // maps around deleted docs + int32_t* getDocMap(); + + TermPositions* getPositions(); +}; +CL_NS_END +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp new file mode 100644 index 000000000..879781287 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.cpp @@ -0,0 +1,74 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SegmentMergeQueue.h" + +#include "SegmentMergeInfo.h" +CL_NS_DEF(index) + + + SegmentMergeQueue::SegmentMergeQueue(const int32_t size) { + //Func - Constructor + // Creates a queue of length size + //Pre - size >= 0 + //Post - The queue has been created of length size + + //BVK: bug. changed condition from size > 0 to size >= 0 + //if size is 0, as it is when retrieving a TermEnum + //from an empty index this should this should not fail. + CND_PRECONDITION(size >= 0, "size is too small"); + + //Call the initialize method of its superclass. The boolean value passed here + //indicates that the superclass PriorityQueue takes the responsibility to have its elements deleted + //The destructor of SegmentMergInfo will make sure that each intstance it will be closed properly + //before it is deleted + initialize(size,true); + } + + SegmentMergeQueue::~SegmentMergeQueue(){ + //Func - Destructor + // Does nothing as its parent class will clean up everything + //Pre - true + //Post - true + close(); + } + + void SegmentMergeQueue::close() { + //Func - Closes and destroyes all SegmentMergeInfo Instances in the queue + //Pre - true + //post - All SegmentMergeInfo Instances in the queue have been closed and deleted + // The queue is now empty but can still be used + + //call the clear method of the parent class PriorityQueue + clear(); + } + + bool SegmentMergeQueue::lessThan(SegmentMergeInfo* stiA, SegmentMergeInfo* stiB) { + //Func - Overloaded method that implements the lessThan operator for the parent class + // This method is used by the parent class Priority queue to reorder its internal + // data structures. This implementation check if stiA is less than the current term of stiB. + //Pre - stiA != NULL + // stiB != NULL + //Post - true is returned if stiA < stiB otherwise false + + CND_PRECONDITION(stiA != NULL, "stiA is NULL"); + CND_PRECONDITION(stiB != NULL, "stiB is NULL"); + + //Compare the two terms + int32_t comparison = stiA->term->compareTo(stiB->term); + //Check if they match + if (comparison == 0){ //todo: can we do an optimized compare here? compare using equals, then compare properly? + //If the match check if the base of stiA is smaller than the base of stiB + //Note that different bases means that the terms of stiA an stiB ly in different segments + return stiA->base < stiB->base; + }else{ + //Terms didn't match so return the difference in positions + return comparison < 0; + } + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h new file mode 100644 index 000000000..faa690252 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMergeQueue.h @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_SegmentMergeQueue_ +#define _lucene_index_SegmentMergeQueue_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/PriorityQueue.h" +#include "SegmentMergeInfo.h" + +CL_NS_DEF(index) + class SegmentMergeQueue :public CL_NS(util)::PriorityQueue > { + public: + //Constructor + //Creates a queue of length size + SegmentMergeQueue(const int32_t size); + + //Destructor + //Does nothing as its parent class will clean up everything + ~SegmentMergeQueue(); + + //Closes and destroyes all SegmentMergeInfo Instances in the queue + void close(); + protected: + //Overloaded method that implements the lessThan operator for the parent class + //This method is used by the parent class Priority queue to reorder its internal + //data structures. This implementation check if stiA is less than the current term of stiB. + bool lessThan(SegmentMergeInfo* stiA, SegmentMergeInfo* stiB); + + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp new file mode 100644 index 000000000..40814da0c --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.cpp @@ -0,0 +1,723 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "SegmentMerger.h" + +CL_NS_USE(util) +CL_NS_USE(document) +CL_NS_USE(store) +CL_NS_DEF(index) + +// File extensions of old-style index files +int COMPOUND_EXTENSIONS_LENGTH = 7; +const char* COMPOUND_EXTENSIONS = "fnm\0" "frq\0" "prx\0" "fdx\0" "fdt\0" "tii\0" "tis\0"; + +int VECTOR_EXTENSIONS_LENGTH = 3; +const char* VECTOR_EXTENSIONS = "tvx\0" "tvd\0" "tvf\0"; + +SegmentMerger::SegmentMerger(IndexWriter* writer, const QString& name) +{ + //Func - Constructor + //Pre - dir holds a valid reference to a Directory + // name != NULL + //Post - Instance has been created + + CND_PRECONDITION(!name.isEmpty(), "name is NULL"); + + freqOutput = NULL; + proxOutput = NULL; + termInfosWriter = NULL; + queue = NULL; + fieldInfos = NULL; + useCompoundFile = writer->getUseCompoundFile(); + skipBuffer = _CLNEW CL_NS(store)::RAMIndexOutput(); + + segment = name; + directory = writer->getDirectory(); + termIndexInterval = writer->getTermIndexInterval(); + + lastSkipDoc=0; + lastSkipFreqPointer=0; + lastSkipProxPointer=0; + skipInterval=0; +} + +SegmentMerger::~SegmentMerger() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + //Clear the readers set + readers.clear(); + + //Delete field Infos + _CLDELETE(fieldInfos); + //Close and destroy the IndexOutput to the Frequency File + if (freqOutput != NULL) { + freqOutput->close(); + _CLDELETE(freqOutput); + } + //Close and destroy the IndexOutput to the Prox File + if (proxOutput != NULL) { + proxOutput->close(); + _CLDELETE(proxOutput); + } + //Close and destroy the termInfosWriter + if (termInfosWriter != NULL) { + termInfosWriter->close(); + _CLDELETE(termInfosWriter); + } + //Close and destroy the queue + if (queue != NULL) { + queue->close(); + _CLDELETE(queue); + } + //close and destory the skipBuffer + if (skipBuffer != NULL) { + skipBuffer->close(); + _CLDELETE(skipBuffer); + } +} + +void SegmentMerger::add(IndexReader* reader) +{ + //Func - Adds a IndexReader to the set of readers + //Pre - reader contains a valid reference to a IndexReader + //Post - The SegementReader reader has been added to the set of readers + + readers.push_back(reader); +} + +IndexReader* SegmentMerger::segmentReader(const int32_t i) +{ + //Func - Returns a reference to the i-th IndexReader + //Pre - 0 <= i < readers.size() + //Post - A reference to the i-th IndexReader has been returned + + CND_PRECONDITION(i >= 0, "i is a negative number"); + CND_PRECONDITION((size_t)i < readers.size(), + "i is bigger than the number of IndexReader instances"); + + //Retrieve the i-th IndexReader + IndexReader* ret = readers[i]; + CND_CONDITION(ret != NULL, "No IndexReader found"); + + return ret; +} + +int32_t SegmentMerger::merge() +{ + int32_t value = mergeFields(); + mergeTerms(); + mergeNorms(); + + if (fieldInfos->hasVectors()) + mergeVectors(); + + return value; +} + +void SegmentMerger::closeReaders() +{ + for (uint32_t i = 0; i < readers.size(); i++) { + // close readers + IndexReader* reader = readers[i]; + reader->close(); + } +} + +void SegmentMerger::createCompoundFile(const QString& filename, QStringList& files) +{ + CompoundFileWriter* cfsWriter = _CLNEW CompoundFileWriter(directory, filename); + + { //msvc6 scope fix + // Basic files + for (int32_t i = 0; i < COMPOUND_EXTENSIONS_LENGTH; i++) { + files.push_back(Misc::qjoin(segment, QLatin1String("."), + QLatin1String(COMPOUND_EXTENSIONS+(i*4)))); + } + } + + { //msvc6 scope fix + // Field norm files + for (int32_t i = 0; i < fieldInfos->size(); i++) { + FieldInfo* fi = fieldInfos->fieldInfo(i); + if (fi->isIndexed && !fi->omitNorms) { + TCHAR tbuf[10]; + char abuf[10]; + _i64tot(i, tbuf, 10); + STRCPY_TtoA(abuf, tbuf, 10); + + files.push_back(Misc::qjoin(segment, QLatin1String(".f"), + QLatin1String(abuf))); + } + } + } + + // Vector files + if (fieldInfos->hasVectors()) { + for (int32_t i = 0; i < VECTOR_EXTENSIONS_LENGTH; i++) { + files.push_back(Misc::qjoin(segment, QLatin1String("."), + QLatin1String(VECTOR_EXTENSIONS+(i*4)))); + } + } + + { //msvc6 scope fix + // Now merge all added files + for (size_t i=0;iaddFile(files[i]); + } + } + + // Perform the merge + cfsWriter->close(); + _CLDELETE(cfsWriter); +} + +void SegmentMerger::addIndexed(IndexReader* reader, FieldInfos* fieldInfos, + StringArrayWithDeletor& names, bool storeTermVectors, + bool storePositionWithTermVector, bool storeOffsetWithTermVector) +{ + StringArrayWithDeletor::const_iterator itr = names.begin(); + while (itr != names.end()) { + fieldInfos->add(*itr, true, + storeTermVectors, storePositionWithTermVector, + storeOffsetWithTermVector, !reader->hasNorms(*itr)); + ++itr; + } +} + +int32_t SegmentMerger::mergeFields() +{ + //Func - Merge the fields of all segments + //Pre - true + //Post - The field infos and field values of all segments have been merged. + + //Create a new FieldInfos + fieldInfos = _CLNEW FieldInfos(); // merge field names + + //Condition check to see if fieldInfos points to a valid instance + CND_CONDITION(fieldInfos != NULL, "Memory allocation for fieldInfos failed"); + + IndexReader* reader = NULL; + + int32_t docCount = 0; + + //Iterate through all readers + for (uint32_t i = 0; i < readers.size(); i++) { + //get the i-th reader + reader = readers[i]; + //Condition check to see if reader points to a valid instance + CND_CONDITION(reader != NULL,"No IndexReader found"); + + StringArrayWithDeletor tmp; + + tmp.clear(); + reader->getFieldNames(IndexReader::TERMVECTOR_WITH_POSITION_OFFSET, tmp); + addIndexed(reader, fieldInfos, tmp, true, true, true); + + tmp.clear(); + reader->getFieldNames(IndexReader::TERMVECTOR_WITH_POSITION, tmp); + addIndexed(reader, fieldInfos, tmp, true, true, false); + + tmp.clear(); + reader->getFieldNames(IndexReader::TERMVECTOR_WITH_OFFSET, tmp); + addIndexed(reader, fieldInfos, tmp, true, false, true); + + tmp.clear(); + reader->getFieldNames(IndexReader::TERMVECTOR, tmp); + addIndexed(reader, fieldInfos, tmp, true, false, false); + + tmp.clear(); + reader->getFieldNames(IndexReader::INDEXED, tmp); + addIndexed(reader, fieldInfos, tmp, false, false, false); + + tmp.clear(); + reader->getFieldNames(IndexReader::UNINDEXED, tmp); + if (tmp.size() > 0) { + TCHAR** arr = _CL_NEWARRAY(TCHAR*,tmp.size()+1); + tmp.toArray(arr); + fieldInfos->add((const TCHAR**)arr, false); + _CLDELETE_ARRAY(arr); + //no need to delete the contents, since tmp is responsible for it + } + } + + //Create the filename of the new FieldInfos file + QString buf = Misc::segmentname(segment, QLatin1String(".fnm")); + //Write the new FieldInfos file to the directory + fieldInfos->write(directory, buf); + + // merge field values + // Instantiate Fieldswriter which will write in directory for the segment + // name segment using the new merged fieldInfos + FieldsWriter* fieldsWriter = _CLNEW FieldsWriter(directory, segment, fieldInfos); + + //Condition check to see if fieldsWriter points to a valid instance + CND_CONDITION(fieldsWriter != NULL, "Memory allocation for fieldsWriter failed"); + + try { + IndexReader* reader = NULL; + int32_t maxDoc = 0; + //Iterate through all readers + for (uint32_t i = 0; i < readers.size(); i++) { + // get the i-th reader + reader = readers[i]; + + + // Condition check to see if reader points to a valid instance + CND_CONDITION(reader != NULL, "No IndexReader found"); + + // Get the total number documents including the documents that have + // been marked deleted + int32_t maxDoc = reader->maxDoc(); + + //document buffer + Document doc; + + //Iterate through all the documents managed by the current reader + for (int32_t j = 0; j < maxDoc; j++) { + //Check if the j-th document has been deleted, if so skip it + if (!reader->isDeleted(j)) { + //Get the document + if (reader->document(j, &doc)) { + //Add the document to the new FieldsWriter + fieldsWriter->addDocument(&doc); + docCount++; + //doc is cleard for re-use + doc.clear(); + } + } + } + } + } _CLFINALLY ( + //Close the fieldsWriter + fieldsWriter->close(); + //And have it deleted as it not used any more + _CLDELETE(fieldsWriter); + ); + + return docCount; +} + +void SegmentMerger::mergeVectors() +{ + TermVectorsWriter* termVectorsWriter = + _CLNEW TermVectorsWriter(directory, segment, fieldInfos); + + try { + for (uint32_t r = 0; r < readers.size(); r++) { + IndexReader* reader = readers[r]; + int32_t maxDoc = reader->maxDoc(); + for (int32_t docNum = 0; docNum < maxDoc; docNum++) { + // skip deleted docs + if (reader->isDeleted(docNum)) + continue; + + Array tmp; + if (reader->getTermFreqVectors(docNum, tmp)) + termVectorsWriter->addAllDocVectors(tmp); + tmp.deleteAll(); + } + } + } _CLFINALLY ( + _CLDELETE(termVectorsWriter); + ); +} + + +void SegmentMerger::mergeTerms() +{ + //Func - Merge the terms of all segments + //Pre - fieldInfos != NULL + //Post - The terms of all segments have been merged + + CND_PRECONDITION(fieldInfos != NULL, "fieldInfos is NULL"); + + try{ + //create a filename for the new Frequency File for segment + QString buf = Misc::segmentname(segment, QLatin1String(".frq")); + //Open an IndexOutput to the new Frequency File + freqOutput = directory->createOutput(buf); + + //create a filename for the new Prox File for segment + buf = Misc::segmentname(segment, QLatin1String(".prx")); + //Open an IndexOutput to the new Prox File + proxOutput = directory->createOutput(buf); + + //Instantiate a new termInfosWriter which will write in directory + //for the segment name segment using the new merged fieldInfos + termInfosWriter = _CLNEW TermInfosWriter(directory, segment, fieldInfos, + termIndexInterval); + + //Condition check to see if termInfosWriter points to a valid instance + CND_CONDITION(termInfosWriter != NULL, + "Memory allocation for termInfosWriter failed"); + + skipInterval = termInfosWriter->skipInterval; + queue = _CLNEW SegmentMergeQueue(readers.size()); + + //And merge the Term Infos + mergeTermInfos(); + } _CLFINALLY ( + //Close and destroy the IndexOutput to the Frequency File + if (freqOutput != NULL) { + freqOutput->close(); _CLDELETE(freqOutput); + } + + //Close and destroy the IndexOutput to the Prox File + if (proxOutput != NULL) + { + proxOutput->close(); + _CLDELETE(proxOutput); + } + + //Close and destroy the termInfosWriter + if (termInfosWriter != NULL) { + termInfosWriter->close(); + _CLDELETE(termInfosWriter); + } + + //Close and destroy the queue + if (queue != NULL) { + queue->close(); + _CLDELETE(queue); + } + ); +} + +void SegmentMerger::mergeTermInfos() +{ + //Func - Merges all TermInfos into a single segment + //Pre - true + //Post - All TermInfos have been merged into a single segment + + //Condition check to see if queue points to a valid instance + CND_CONDITION(queue != NULL, "Memory allocation for queue failed"); + + //base is the id of the first document in a segment + int32_t base = 0; + + IndexReader* reader = NULL; + SegmentMergeInfo* smi = NULL; + + //iterate through all the readers + for (uint32_t i = 0; i < readers.size(); i++) { + //Get the i-th reader + reader = readers[i]; + + //Condition check to see if reader points to a valid instance + CND_CONDITION(reader != NULL, "No IndexReader found"); + + //Get the term enumeration of the reader + TermEnum* termEnum = reader->terms(); + //Instantiate a new SegmentMerginfo for the current reader and enumeration + smi = _CLNEW SegmentMergeInfo(base, termEnum, reader); + + //Condition check to see if smi points to a valid instance + CND_CONDITION(smi != NULL, "Memory allocation for smi failed") ; + + //Increase the base by the number of documents that have not been marked deleted + //so base will contain a new value for the first document of the next iteration + base += reader->numDocs(); + //Get the next current term + if (smi->next()) { + //Store the SegmentMergeInfo smi with the initialized SegmentTermEnum TermEnum + //into the queue + queue->put(smi); + } else { + //Apparently the end of the TermEnum of the SegmentTerm has been reached so + //close the SegmentMergeInfo smi + smi->close(); + //And destroy the instance and set smi to NULL (It will be used later in this method) + _CLDELETE(smi); + } + } + + //Instantiate an array of SegmentMergeInfo instances called match + SegmentMergeInfo** match = _CL_NEWARRAY(SegmentMergeInfo*,readers.size()+1); + + //Condition check to see if match points to a valid instance + CND_CONDITION(match != NULL, "Memory allocation for match failed") ; + + SegmentMergeInfo* top = NULL; + + //As long as there are SegmentMergeInfo instances stored in the queue + while (queue->size() > 0) { + int32_t matchSize = 0; + + // pop matching terms + + //Pop the first SegmentMergeInfo from the queue + match[matchSize++] = queue->pop(); + //Get the Term of match[0] + Term* term = match[0]->term; + + //Condition check to see if term points to a valid instance + CND_CONDITION(term != NULL,"term is NULL") ; + + //Get the current top of the queue + top = queue->top(); + + //For each SegmentMergInfo still in the queue + //Check if term matches the term of the SegmentMergeInfo instances in the queue + while (top != NULL && term->equals(top->term)) { + //A match has been found so add the matching SegmentMergeInfo to the match array + match[matchSize++] = queue->pop(); + //Get the next SegmentMergeInfo + top = queue->top(); + } + match[matchSize]=NULL; + + //add new TermInfo + mergeTermInfo(match); //matchSize + + //Restore the SegmentTermInfo instances in the match array back into the queue + while (matchSize > 0) { + smi = match[--matchSize]; + + //Condition check to see if smi points to a valid instance + CND_CONDITION(smi != NULL, "smi is NULL"); + + //Move to the next term in the enumeration of SegmentMergeInfo smi + if (smi->next()) { + //There still are some terms so restore smi in the queue + queue->put(smi); + + } else { + //Done with a segment + //No terms anymore so close this SegmentMergeInfo instance + smi->close(); + _CLDELETE(smi); + } + } + } + + _CLDELETE_ARRAY(match); +} + +void SegmentMerger::mergeTermInfo(SegmentMergeInfo** smis) +{ + //Func - Merge the TermInfo of a term found in one or more segments. + //Pre - smis != NULL and it contains segments that are positioned at the same term. + // n is equal to the number of SegmentMergeInfo instances in smis + // freqOutput != NULL + // proxOutput != NULL + //Post - The TermInfo of a term has been merged + + CND_PRECONDITION(smis != NULL, "smis is NULL"); + CND_PRECONDITION(freqOutput != NULL, "freqOutput is NULL"); + CND_PRECONDITION(proxOutput != NULL, "proxOutput is NULL"); + + //Get the file pointer of the IndexOutput to the Frequency File + int64_t freqPointer = freqOutput->getFilePointer(); + //Get the file pointer of the IndexOutput to the Prox File + int64_t proxPointer = proxOutput->getFilePointer(); + + //Process postings from multiple segments all positioned on the same term. + int32_t df = appendPostings(smis); + + int64_t skipPointer = writeSkip(); + + //df contains the number of documents across all segments where this term was found + if (df > 0) { + //add an entry to the dictionary with pointers to prox and freq files + termInfo.set(df, freqPointer, proxPointer, (int32_t)(skipPointer - freqPointer)); + //Precondition check for to be sure that the reference to + //smis[0]->term will be valid + CND_PRECONDITION(smis[0]->term != NULL, "smis[0]->term is NULL"); + //Write a new TermInfo + termInfosWriter->add(smis[0]->term, &termInfo); + } +} + + +int32_t SegmentMerger::appendPostings(SegmentMergeInfo** smis) +{ + //Func - Process postings from multiple segments all positioned on the + // same term. Writes out merged entries into freqOutput and + // the proxOutput streams. + //Pre - smis != NULL and it contains segments that are positioned at the same term. + // n is equal to the number of SegmentMergeInfo instances in smis + // freqOutput != NULL + // proxOutput != NULL + //Post - Returns number of documents across all segments where this term was found + + CND_PRECONDITION(smis != NULL, "smis is NULL"); + CND_PRECONDITION(freqOutput != NULL, "freqOutput is NULL"); + CND_PRECONDITION(proxOutput != NULL, "proxOutput is NULL"); + + int32_t lastDoc = 0; + int32_t df = 0; //Document Counter + + resetSkip(); + SegmentMergeInfo* smi = NULL; + + //Iterate through all SegmentMergeInfo instances in smis + int32_t i = 0; + while ((smi=smis[i]) != NULL) { + //Get the i-th SegmentMergeInfo + + //Condition check to see if smi points to a valid instance + CND_PRECONDITION(smi != NULL, " is NULL"); + + //Get the term positions + TermPositions* postings = smi->getPositions(); + //Get the base of this segment + int32_t base = smi->base; + //Get the docMap so we can see which documents have been deleted + int32_t* docMap = smi->getDocMap(); + //Seek the termpost + postings->seek(smi->termEnum); + while (postings->next()) { + int32_t doc = postings->doc(); + //Check if there are deletions + if (docMap != NULL) + doc = docMap[doc]; // map around deletions + doc += base; // convert to merged space + + //Condition check to see doc is eaqual to or bigger than lastDoc + CND_CONDITION(doc >= lastDoc,"docs out of order"); + + //Increase the total frequency over all segments + df++; + + if ((df % skipInterval) == 0) { + bufferSkip(lastDoc); + } + + //Calculate a new docCode + //use low bit to flag freq=1 + int32_t docCode = (doc - lastDoc) << 1; + lastDoc = doc; + + //Get the frequency of the Term + int32_t freq = postings->freq(); + if (freq == 1) { + //write doc & freq=1 + freqOutput->writeVInt(docCode | 1); + } else { + //write doc + freqOutput->writeVInt(docCode); + //write frequency in doc + freqOutput->writeVInt(freq); + } + + int32_t lastPosition = 0; + // write position deltas + for (int32_t j = 0; j < freq; j++) { + //Get the next position + int32_t position = postings->nextPosition(); + //Write the difference between position and the last position + proxOutput->writeVInt(position - lastPosition); + lastPosition = position; + } + } + + i++; + } + + //Return total number of documents across all segments where term was found + return df; +} + +void SegmentMerger::resetSkip() +{ + skipBuffer->reset(); + lastSkipDoc = 0; + lastSkipFreqPointer = freqOutput->getFilePointer(); + lastSkipProxPointer = proxOutput->getFilePointer(); +} + +void SegmentMerger::bufferSkip(int32_t doc) +{ + int64_t freqPointer = freqOutput->getFilePointer(); + int64_t proxPointer = proxOutput->getFilePointer(); + + skipBuffer->writeVInt(doc - lastSkipDoc); + skipBuffer->writeVInt((int32_t) (freqPointer - lastSkipFreqPointer)); + skipBuffer->writeVInt((int32_t) (proxPointer - lastSkipProxPointer)); + + lastSkipDoc = doc; + lastSkipFreqPointer = freqPointer; + lastSkipProxPointer = proxPointer; +} + +int64_t SegmentMerger::writeSkip() +{ + int64_t skipPointer = freqOutput->getFilePointer(); + skipBuffer->writeTo(freqOutput); + return skipPointer; +} + +// Func - Merges the norms for all fields +// Pre - fieldInfos != NULL +// Post - The norms for all fields have been merged +void SegmentMerger::mergeNorms() +{ + CND_PRECONDITION(fieldInfos != NULL, "fieldInfos is NULL"); + + //iterate through all the Field Infos instances + for (int32_t i = 0; i < fieldInfos->size(); i++) { + //Get the i-th FieldInfo + FieldInfo* fi = fieldInfos->fieldInfo(i); + //Is this Field indexed? + if (fi->isIndexed && !fi->omitNorms) { + //Create and Instantiate an IndexOutput to that norm file + QString buf = Misc::segmentname(segment, QLatin1String(".f"), i); + IndexOutput* output = directory->createOutput(buf); + + //Condition check to see if output points to a valid instance + CND_CONDITION(output != NULL, "No Outputstream retrieved"); + + uint8_t* input = NULL; + try { + for (uint32_t j = 0; j < readers.size(); ++j) { + // get the next index reader + condition check + IndexReader* reader = readers[j]; + CND_CONDITION(reader != NULL, "No reader found"); + + // Get the total number of documents including the documents + // that have been marked deleted + int32_t maxDoc = reader->maxDoc(); + if (maxDoc > 0) { + // if there are docs, allocate buffer to read it's norms + uint8_t* data = (uint8_t*)realloc(input, maxDoc * + sizeof(uint8_t)); + if (data) { + input = data; + memset(input, 0, maxDoc * sizeof(uint8_t)); + // Get an IndexInput to the norm file for this + // field in this segment + reader->norms(fi->name, input); + + //Iterate through all the documents + for(int32_t k = 0; k < maxDoc; k++) { + //Check if document k is deleted + if (!reader->isDeleted(k)) { + //write the new norm + output->writeByte(input[k]); + } + } + } + } + } + } _CLFINALLY ( + if (output != NULL) { + output->close(); + _CLDELETE(output); + } + free(input); + ); + } + } +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.h b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.h new file mode 100644 index 000000000..230843b00 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentMerger.h @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_SegmentMerger_ +#define _lucene_index_SegmentMerger_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/store/RAMDirectory.h" +#include "CLucene/util/VoidList.h" +#include "SegmentMergeInfo.h" +#include "SegmentMergeQueue.h" +#include "IndexWriter.h" +#include "FieldInfos.h" +#include "FieldsWriter.h" +#include "TermInfosWriter.h" + +CL_NS_DEF(index) + +/** +* The SegmentMerger class combines two or more Segments, represented by an IndexReader ({@link #add}, +* into a single Segment. After adding the appropriate readers, call the merge method to combine the +* segments. +*

+* If the compoundFile flag is set, then the segments will be merged into a compound file. +* +* +* @see #merge +* @see #add +*/ +class SegmentMerger : LUCENE_BASE +{ + bool useCompoundFile; + + CL_NS(store)::RAMIndexOutput* skipBuffer; + int32_t lastSkipDoc; + int64_t lastSkipFreqPointer; + int64_t lastSkipProxPointer; + + void resetSkip(); + void bufferSkip(int32_t doc); + int64_t writeSkip(); + + //Directory of the segment + CL_NS(store)::Directory* directory; + //name of the new segment + QString segment; + //Set of IndexReaders + CL_NS(util)::CLVector > readers; + //Field Infos for t he FieldInfo instances of all fields + FieldInfos* fieldInfos; + + //The queue that holds SegmentMergeInfo instances + SegmentMergeQueue* queue; + //IndexOutput to the new Frequency File + CL_NS(store)::IndexOutput* freqOutput; + //IndexOutput to the new Prox File + CL_NS(store)::IndexOutput* proxOutput; + //Writes Terminfos that have been merged + TermInfosWriter* termInfosWriter; + TermInfo termInfo; //(new) minimize consing + + int32_t termIndexInterval; + int32_t skipInterval; + +public: + /** + * + * @param dir The Directory to merge the other segments into + * @param name The name of the new segment + * @param compoundFile true if the new segment should use a compoundFile + */ + SegmentMerger( IndexWriter* writer, const QString& name ); + + //Destructor + ~SegmentMerger(); + + /** + * Add an IndexReader to the collection of readers that are to be merged + * @param reader + */ + void add(IndexReader* reader); + + /** + * + * @param i The index of the reader to return + * @return The ith reader to be merged + */ + IndexReader* segmentReader(const int32_t i); + + /** + * Merges the readers specified by the {@link #add} method into the + * directory passed to the constructor + * @return The number of documents that were merged + * @throws IOException + */ + int32_t merge(); + /** + * close all IndexReaders that have been added. + * Should not be called before merge(). + * @throws IOException + */ + void closeReaders(); +private: + void addIndexed(IndexReader* reader, FieldInfos* fieldInfos, + CL_NS(util)::StringArrayWithDeletor& names, + bool storeTermVectors, bool storePositionWithTermVector, + bool storeOffsetWithTermVector); + + /** + * Merge the fields of all segments + * @return The number of documents in all of the readers + * @throws IOException + */ + int32_t mergeFields(); + + /** + * Merge the TermVectors from each of the segments into the new one. + * @throws IOException + */ + void mergeVectors(); + + /** Merge the terms of all segments */ + void mergeTerms(); + + /** Merges all TermInfos into a single segment */ + void mergeTermInfos(); + + /** Merge one term found in one or more segments. The array smis + * contains segments that are positioned at the same term. N + * is the number of cells in the array actually occupied. + * + * @param smis array of segments + * @param n number of cells in the array actually occupied + */ + void mergeTermInfo( SegmentMergeInfo** smis); + + /** Process postings from multiple segments all positioned on the + * same term. Writes out merged entries into freqOutput and + * the proxOutput streams. + * + * @param smis array of segments + * @param n number of cells in the array actually occupied + * @return number of documents across all segments where this term was found + */ + int32_t appendPostings(SegmentMergeInfo** smis); + + //Merges the norms for all fields + void mergeNorms(); + + void createCompoundFile(const QString& filename, QStringList& files); + friend class IndexWriter; //allow IndexWriter to use createCompoundFile +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp new file mode 100644 index 000000000..ba061714b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentReader.cpp @@ -0,0 +1,816 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#include "CLucene/StdHeader.h" +#include "SegmentHeader.h" + +#include "FieldInfos.h" +#include "FieldsReader.h" +#include "IndexReader.h" +#include "TermInfosReader.h" +#include "Terms.h" +#include "CLucene/search/Similarity.h" + +CL_NS_USE(util) +CL_NS_USE(store) +CL_NS_USE(document) +CL_NS_USE(search) +CL_NS_DEF(index) + +SegmentReader::Norm::Norm(IndexInput* instrm, int32_t n, SegmentReader* r, + const QString& seg) + : number(n) + , reader(r) + , segment(seg) + , in(instrm) + , bytes(NULL) + , dirty(false) +{ + //Func - Constructor + //Pre - instrm is a valid reference to an IndexInput + //Post - A Norm instance has been created with an empty bytes array + bytes = NULL; + dirty = false; +} + +SegmentReader::Norm::~Norm() +{ + //Func - Destructor + //Pre - true + //Post - The IndexInput in has been deleted (and closed by its destructor) + // and the array too. + + //Close and destroy the inputstream in-> The inputstream will be closed + // by its destructor. Note that the IndexInput 'in' actually is a pointer!!!!! + _CLDELETE(in); + + //Delete the bytes array + _CLDELETE_ARRAY(bytes); + +} + +void SegmentReader::Norm::reWrite() +{ + QString buf(segment + QLatin1String(".tmp")); + + // NOTE: norms are re-written in regular directory, not cfs + IndexOutput* out = reader->getDirectory()->createOutput(buf); + try { + out->writeBytes(bytes, reader->maxDoc()); + } _CLFINALLY ( + out->close(); + _CLDELETE(out) + ); + + QString fileName(segment); + if (reader->cfsReader == NULL) + fileName.append(QLatin1String(".f%1")).arg(number); + else // use a different file name if we have compound format + fileName.append(QLatin1String(".s%1")).arg(number); + + reader->getDirectory()->renameFile(buf, fileName); + this->dirty = false; +} + +SegmentReader::SegmentReader(SegmentInfo* si) + : IndexReader(si->getDir()) + , _norms(false, false) +{ + initialize(si); +} + +SegmentReader::SegmentReader(SegmentInfos* sis, SegmentInfo* si) + : IndexReader(si->getDir(), sis, false) + , _norms(false, false) +{ + initialize(si); +} + +void SegmentReader::initialize(SegmentInfo* si) +{ + //Pre - si-> is a valid reference to SegmentInfo instance + // identified by si-> + //Post - All files of the segment have been read + + deletedDocs = NULL; + ones = NULL; + //There are no documents yet marked as deleted + deletedDocsDirty = false; + + normsDirty=false; + undeleteAll=false; + + //Duplicate the name of the segment from SegmentInfo to segment + segment = si->name; + // make sure that all index files have been read or are kept open + // so that if an index update removes them we'll still have them + freqStream = NULL; + proxStream = NULL; + + //instantiate a buffer large enough to hold a directory path + QString buf; + + // Use compound file directory for some files, if it exists + Directory* cfsDir = getDirectory(); + SegmentName(buf, CL_MAX_PATH, QLatin1String(".cfs")); + if (cfsDir->fileExists(buf)) { + cfsReader = _CLNEW CompoundFileReader(cfsDir, buf); + cfsDir = cfsReader; + }else + cfsReader = NULL; + + // Create the name of the field info file with suffix .fnm in buf + SegmentName(buf, CL_MAX_PATH, QLatin1String(".fnm")); + fieldInfos = _CLNEW FieldInfos(cfsDir, buf ); + + // Condition check to see if fieldInfos points to a valid instance + CND_CONDITION(fieldInfos != NULL, + "No memory could be allocated for fieldInfos"); + + // Create the name of the frequence file with suffix .frq in buf + SegmentName(buf ,CL_MAX_PATH, QLatin1String(".frq")); + + // Open an IndexInput freqStream to the frequency file + freqStream = cfsDir->openInput( buf ); + + // Condition check to see if freqStream points to a valid instance and was + // able to open the frequency file + CND_CONDITION(freqStream != NULL, + "IndexInput freqStream could not open the frequency file"); + + // Create the name of the prox file with suffix .prx in buf + SegmentName(buf, CL_MAX_PATH, QLatin1String(".prx")); + + // Open an IndexInput proxStream to the prox file + proxStream = cfsDir->openInput( buf ); + + // Condition check to see if proxStream points to a valid instance and was + // able to open the prox file + CND_CONDITION(proxStream != NULL, + "IndexInput proxStream could not open proximity file"); + + // Instantiate a FieldsReader for reading the Field Info File + fieldsReader = _CLNEW FieldsReader(cfsDir, segment, fieldInfos); + + // Condition check to see if fieldsReader points to a valid instance + CND_CONDITION(fieldsReader != NULL, + "No memory could be allocated for fieldsReader"); + + //Instantiate a TermInfosReader for reading the Term Dictionary .tis file + tis = _CLNEW TermInfosReader(cfsDir, segment, fieldInfos); + + //Condition check to see if tis points to a valid instance + CND_CONDITION(tis != NULL,"No memory could be allocated for tis"); + + // Check if the segment has deletion according to the SegmentInfo instance + // si-> NOTE: the bitvector is stored using the regular directory, not cfs + if (hasDeletions(si)) { + //Create a deletion file with suffix .del + SegmentName(buf, CL_MAX_PATH, QLatin1String(".del")); + // Instantiate a BitVector that manages which documents have been deleted + deletedDocs = _CLNEW BitSet(getDirectory(), buf); + } + + // Open the norm file. There's a norm file for each indexed field with a + // byte for each document. The .f[0-9]* file contains, for each document, + // a byte that encodes a value that is multiplied into the score for hits + // on that field + openNorms(cfsDir); + + termVectorsReaderOrig = NULL; + if (fieldInfos->hasVectors()) // open term vector files only as needed + termVectorsReaderOrig = _CLNEW TermVectorsReader(cfsDir, segment, fieldInfos); +} + +SegmentReader::~SegmentReader() +{ + //Func - Destructor. + //Pre - doClose has been invoked! + //Post - the instance has been destroyed + + doClose(); //this means that index reader doesn't need to be closed manually + + _CLDELETE(fieldInfos); + _CLDELETE(fieldsReader); + _CLDELETE(tis); + _CLDELETE(freqStream); + _CLDELETE(proxStream); + _CLDELETE(deletedDocs); + _CLDELETE_ARRAY(ones); + _CLDELETE(termVectorsReaderOrig); + _CLDECDELETE(cfsReader); +} + +void SegmentReader::doCommit() +{ + QString bufdel(segment + QLatin1String(".del")); + + if (deletedDocsDirty) { // re-write deleted + QString buftmp(segment + QLatin1String(".tmp")); + deletedDocs->write(getDirectory(), buftmp); + getDirectory()->renameFile(buftmp, bufdel); + } + + if(undeleteAll && getDirectory()->fileExists(bufdel)) + getDirectory()->deleteFile(bufdel, true); + + if (normsDirty) { // re-write norms + NormsType::iterator itr = _norms.begin(); + while (itr != _norms.end()) { + Norm* norm = itr->second; + if (norm->dirty) { + norm->reWrite(); + } + ++itr; + } + } + deletedDocsDirty = false; + normsDirty = false; + undeleteAll = false; +} + +void SegmentReader::doClose() +{ + //Func - Closes all streams to the files of a single segment + //Pre - fieldsReader != NULL + // tis != NULL + //Post - All streams to files have been closed + + CND_PRECONDITION(fieldsReader != NULL, "fieldsReader is NULL"); + CND_PRECONDITION(tis != NULL, "tis is NULL"); + + //Close the fieldsReader + fieldsReader->close(); + //Close the TermInfosReader + tis->close(); + + //Close the frequency stream + if (freqStream != NULL){ + freqStream->close(); + } + //Close the prox stream + if (proxStream != NULL){ + proxStream->close(); + } + + //Close the norm file + closeNorms(); + + if (termVectorsReaderOrig != NULL) + termVectorsReaderOrig->close(); + + if (cfsReader != NULL) + cfsReader->close(); +} + +bool SegmentReader::hasDeletions() const +{ + return deletedDocs != NULL; +} + +//static +bool SegmentReader::usesCompoundFile(SegmentInfo* si) +{ + return si->getDir()->fileExists(si->name + QLatin1String(".cfs")); +} + +//static +bool SegmentReader::hasSeparateNorms(SegmentInfo* si) +{ + QString pattern(si->name); + pattern.append(QLatin1String(".s")); + size_t patternLength = pattern.length(); + + QStringList names = si->getDir()->list(); + foreach (const QString& name, names) { + int length = name.length(); + if (length > patternLength && name.left(patternLength) == pattern) { + if (name.at(patternLength) >= QLatin1Char('0') + && name.at(patternLength) <= QLatin1Char('9')) { + return true; + } + } + } + return false; +} + +bool SegmentReader::hasDeletions(const SegmentInfo* si) +{ + //Func - Static method + // Checks if a segment managed by SegmentInfo si-> has deletions + //Pre - si-> holds a valid reference to an SegmentInfo instance + //Post - if the segement contains deleteions true is returned otherwise flas + + //Check if the deletion file exists and return the result + QString f; + Misc::segmentname(f, CL_MAX_PATH, si->name, QLatin1String(".del"), -1); + return si->getDir()->fileExists(f); +} + +//synchronized +void SegmentReader::doDelete(const int32_t docNum) +{ + //Func - Marks document docNum as deleted + //Pre - docNum >=0 and DocNum < maxDoc() + // docNum contains the number of the document that must be + // marked deleted + //Post - The document identified by docNum has been marked deleted + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CND_PRECONDITION(docNum >= 0, "docNum is a negative number"); + CND_PRECONDITION(docNum < maxDoc(), + "docNum is bigger than the total number of documents"); + + //Check if deletedDocs exists + if (deletedDocs == NULL) { + deletedDocs = _CLNEW BitSet(maxDoc()); + + //Condition check to see if deletedDocs points to a valid instance + CND_CONDITION(deletedDocs != NULL, + "No memory could be allocated for deletedDocs"); + } + //Flag that there are documents marked deleted + deletedDocsDirty = true; + undeleteAll = false; + //Mark document identified by docNum as deleted + deletedDocs->set(docNum); + +} + +void SegmentReader::doUndeleteAll() +{ + _CLDELETE(deletedDocs); + deletedDocsDirty = false; + undeleteAll = true; +} + +void SegmentReader::files(QStringList& retarray) +{ + //Func - Returns all file names managed by this SegmentReader + //Pre - segment != NULL + //Post - All filenames managed by this SegmentRead have been returned + + CND_PRECONDITION(segment != NULL, "segment is NULL"); + + QString temp; + #define _ADD_SEGMENT(ext) \ + temp = SegmentName(ext); \ + if (getDirectory()->fileExists(temp)) \ + retarray.push_back(temp); + + //Add the name of the Field Info file + _ADD_SEGMENT(QLatin1String(".cfs")); + _ADD_SEGMENT(QLatin1String(".fnm")); + _ADD_SEGMENT(QLatin1String(".fdx")); + _ADD_SEGMENT(QLatin1String(".fdt")); + _ADD_SEGMENT(QLatin1String(".tii")); + _ADD_SEGMENT(QLatin1String(".tis")); + _ADD_SEGMENT(QLatin1String(".frq")); + _ADD_SEGMENT(QLatin1String(".prx")); + _ADD_SEGMENT(QLatin1String(".del")); + _ADD_SEGMENT(QLatin1String(".tvx")); + _ADD_SEGMENT(QLatin1String(".tvd")); + _ADD_SEGMENT(QLatin1String(".tvf")); + _ADD_SEGMENT(QLatin1String(".tvp")); + + //iterate through the field infos + for (int32_t i = 0; i < fieldInfos->size(); ++i) { + //Get the field info for the i-th field + FieldInfo* fi = fieldInfos->fieldInfo(i); + //Check if the field has been indexed + if (fi->isIndexed && !fi->omitNorms) { + QString name; + if (cfsReader == NULL) + name = SegmentName(QLatin1String(".f"), i); + else + name = SegmentName(QLatin1String(".s"), i); + + //The field has been indexed so add its norm file + if (getDirectory()->fileExists(name)) + retarray.push_back(name); + } + } +} + +TermEnum* SegmentReader::terms() const +{ + //Func - Returns an enumeration of all the Terms and TermInfos in the set. + //Pre - tis != NULL + //Post - An enumeration of all the Terms and TermInfos in the set has been returned + + CND_PRECONDITION(tis != NULL, "tis is NULL"); + + return tis->terms(); +} + +TermEnum* SegmentReader::terms(const Term* t) const +{ + //Func - Returns an enumeration of terms starting at or after the named term t + //Pre - t != NULL + // tis != NULL + //Post - An enumeration of terms starting at or after the named term t + + CND_PRECONDITION(t != NULL, "t is NULL"); + CND_PRECONDITION(tis != NULL, "tis is NULL"); + + return tis->terms(t); +} + +bool SegmentReader::document(int32_t n, Document* doc) +{ + //Func - Returns a document identified by n + //Pre - n >=0 and identifies the document n + //Post - if the document has been deleted then an exception has been thrown + // otherwise a reference to the found document has been returned + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CND_PRECONDITION(n >= 0, "n is a negative number"); + + //Check if the n-th document has been marked deleted + if (isDeleted(n)) + _CLTHROWA(CL_ERR_InvalidState, "attempt to access a deleted document" ); + + //Retrieve the n-th document + return fieldsReader->doc(n, doc); +} + +bool SegmentReader::isDeleted(const int32_t n) +{ + //Func - Checks if the n-th document has been marked deleted + //Pre - n >=0 and identifies the document n + //Post - true has been returned if document n has been deleted otherwise fralse + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CND_PRECONDITION(n >= 0, "n is a negative number"); + + //Is document n deleted + return (deletedDocs != NULL && deletedDocs->get(n)); +} + +TermDocs* SegmentReader::termDocs() const +{ + //Func - Returns an unpositioned TermDocs enumerator. + //Pre - true + //Post - An unpositioned TermDocs enumerator has been returned + + return _CLNEW SegmentTermDocs(this); +} + +TermPositions* SegmentReader::termPositions() const +{ + //Func - Returns an unpositioned TermPositions enumerator. + //Pre - true + //Post - An unpositioned TermPositions enumerator has been returned + + return _CLNEW SegmentTermPositions(this); +} + +int32_t SegmentReader::docFreq(const Term* t) const +{ + //Func - Returns the number of documents which contain the term t + //Pre - t holds a valid reference to a Term + //Post - The number of documents which contain term t has been returned + + //Get the TermInfo ti for Term t in the set + TermInfo* ti = tis->get(t); + //Check if an TermInfo has been returned + if (ti) { + //Get the frequency of the term + int32_t ret = ti->docFreq; + //TermInfo ti is not needed anymore so delete it + _CLDELETE( ti ); + //return the number of documents which containt term t + return ret; + } + + //No TermInfo returned so return 0 + return 0; +} + +int32_t SegmentReader::numDocs() +{ + //Func - Returns the actual number of documents in the segment + //Pre - true + //Post - The actual number of documents in the segments + + //Get the number of all the documents in the segment including the ones that have + //been marked deleted + int32_t n = maxDoc(); + + //Check if there any deleted docs + if (deletedDocs != NULL) + //Substract the number of deleted docs from the number returned by maxDoc + n -= deletedDocs->count(); + + //return the actual number of documents in the segment + return n; +} + +int32_t SegmentReader::maxDoc() const +{ + //Func - Returns the number of all the documents in the segment including + // the ones that have been marked deleted + //Pre - true + //Post - The total number of documents in the segment has been returned + + return fieldsReader->size(); +} + +void SegmentReader::getFieldNames(FieldOption fldOption, + StringArrayWithDeletor& retarray) +{ + size_t len = fieldInfos->size(); + for (size_t i = 0; i < len; i++) { + bool v = false; + FieldInfo* fi = fieldInfos->fieldInfo(i); + if (fldOption & IndexReader::ALL) { + v = true; + } else { + if (!fi->isIndexed && (fldOption & IndexReader::UNINDEXED)) { + v = true; + } + + if (fi->isIndexed && (fldOption & IndexReader::INDEXED)) { + v = true; + } + + if (fi->isIndexed && fi->storeTermVector == false + && (fldOption & IndexReader::INDEXED_NO_TERMVECTOR)) { + v = true; + } + + if ((fldOption & IndexReader::TERMVECTOR) + && fi->storeTermVector == true + && fi->storePositionWithTermVector == false + && fi->storeOffsetWithTermVector == false) { + v = true; + } + + if (fi->isIndexed && fi->storeTermVector + && (fldOption & IndexReader::INDEXED_WITH_TERMVECTOR)) { + v = true; + } + + if (fi->storePositionWithTermVector + && fi->storeOffsetWithTermVector == false + && (fldOption & IndexReader::TERMVECTOR_WITH_POSITION)) { + v = true; + } + + if (fi->storeOffsetWithTermVector + && fi->storePositionWithTermVector == false + && (fldOption & IndexReader::TERMVECTOR_WITH_OFFSET)) { + v = true; + } + + if ((fi->storeOffsetWithTermVector && fi->storePositionWithTermVector) + && (fldOption & IndexReader::TERMVECTOR_WITH_POSITION_OFFSET)) { + v = true; + } + } + + if (v) + retarray.push_back(STRDUP_TtoT(fi->name)); + } +} + +bool SegmentReader::hasNorms(const TCHAR* field) const +{ + return _norms.find(field) != _norms.end(); +} + + +void SegmentReader::norms(const TCHAR* field, uint8_t* bytes) +{ + //Func - Reads the Norms for field from disk starting at offset in the inputstream + //Pre - field != NULL + // bytes != NULL is an array of bytes which is to be used to read the norms into. + // it is advisable to have bytes initalized by zeroes! + //Post - The if an inputstream to the norm file could be retrieved the bytes have been read + // You are never sure whether or not the norms have been read into bytes properly!!!!!!!!!!!!!!!!! + + CND_PRECONDITION(field != NULL, "field is NULL"); + CND_PRECONDITION(bytes != NULL, "field is NULL"); + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + Norm* norm = _norms.get(field); + if ( norm == NULL ){ + memcpy(bytes, fakeNorms(), maxDoc()); + return; + } + + if (norm->bytes != NULL) { // can copy from cache + memcpy(bytes, norm->bytes, maxDoc()); + return; + } + + IndexInput* _normStream = norm->in->clone(); + CND_PRECONDITION(_normStream != NULL, "normStream==NULL") + + // read from disk + try { + _normStream->seek(0); + _normStream->readBytes(bytes, maxDoc()); + } _CLFINALLY ( + //Have the normstream closed + _normStream->close(); + //Destroy the normstream + _CLDELETE( _normStream ); + ); +} + +uint8_t* SegmentReader::createFakeNorms(int32_t size) +{ + uint8_t* ones = _CL_NEWARRAY(uint8_t,size); + memset(ones, DefaultSimilarity::encodeNorm(1.0f), size); + return ones; +} + +uint8_t* SegmentReader::fakeNorms() +{ + if (ones == NULL) + ones = createFakeNorms(maxDoc()); + return ones; +} + +// can return null if norms aren't stored +uint8_t* SegmentReader::getNorms(const TCHAR* field) +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + Norm* norm = _norms.get(field); + if (norm == NULL) + return NULL; // not indexed, or norms not stored + + if (norm->bytes == NULL) { // value not yet read + uint8_t* bytes = _CL_NEWARRAY(uint8_t, maxDoc()); + norms(field, bytes); + norm->bytes = bytes; // cache it + } + return norm->bytes; +} + +uint8_t* SegmentReader::norms(const TCHAR* field) +{ + //Func - Returns the bytes array that holds the norms of a named field + //Pre - field != NULL and contains the name of the field for which the norms + // must be retrieved + //Post - If there was norm for the named field then a bytes array has been allocated + // and returned containing the norms for that field. If the named field is unknown NULL is returned. + + CND_PRECONDITION(field != NULL, "field is NULL"); + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + uint8_t* bytes = getNorms(field); + if (bytes == NULL) + bytes = fakeNorms(); + return bytes; +} + +void SegmentReader::doSetNorm(int32_t doc, const TCHAR* field, uint8_t value) +{ + Norm* norm = _norms.get(field); + if (norm == NULL) // not an indexed field + return; + + norm->dirty = true; // mark it dirty + normsDirty = true; + + uint8_t* bits = norms(field); + bits[doc] = value; // set the value +} + +QString SegmentReader::SegmentName(const QString& ext, const int32_t x) +{ + //Func - Returns an allocated buffer in which it creates a filename by + // concatenating segment with ext and x + //Pre ext != NULL and holds the extension + // x contains a number + //Post - A buffer has been instantiated an when x = -1 buffer contains the concatenation of + // segment and ext otherwise buffer contains the contentation of segment, ext and x + + CND_PRECONDITION(!ext.isEmpty(), "ext is NULL"); + + QString buf; + SegmentName(buf, CL_MAX_PATH, ext, x); + return buf; +} + +void SegmentReader::SegmentName(QString& buffer, int32_t bufferLen, + const QString& ext, const int32_t x) +{ + //Func - Creates a filename in buffer by concatenating segment with ext and x + //Pre - buffer != NULL + // ext != NULL + // x contains a number + //Post - When x = -1 buffer contains the concatenation of segment and ext otherwise + // buffer contains the contentation of segment, ext and x + + CND_PRECONDITION(!segment.isEmpty(), "Segment is NULL"); + + Misc::segmentname(buffer, bufferLen, segment, ext, x); +} + +void SegmentReader::openNorms(Directory* cfsDir) +{ + //Func - Open all norms files for all fields + // Creates for each field a norm Instance with an open inputstream to + // a corresponding norm file ready to be read + //Pre - true + //Post - For each field a norm instance has been created with an open inputstream to + // a corresponding norm file ready to be read + + //Iterate through all the fields + for (int32_t i = 0; i < fieldInfos->size(); i++) { + //Get the FieldInfo for the i-th field + FieldInfo* fi = fieldInfos->fieldInfo(i); + //Check if the field is indexed + if (fi->isIndexed && !fi->omitNorms ) { + //Allocate a buffer + QString fileName; + + // look first if there are separate norms in compound format + SegmentName(fileName, CL_MAX_PATH, QLatin1String(".s"), fi->number); + Directory* d = getDirectory(); + if(!d->fileExists(fileName)){ + SegmentName(fileName, CL_MAX_PATH, QLatin1String(".f"), fi->number); + d = cfsDir; + } + + _norms.put(fi->name, _CLNEW Norm(d->openInput(fileName), + fi->number, this, segment)); + } + } +} + +void SegmentReader::closeNorms() +{ + //Func - Close all the norms stored in norms + //Pre - true + //Post - All the norms have been destroyed + + SCOPED_LOCK_MUTEX(_norms.THIS_LOCK) + + //Create an interator initialized at the beginning of norms + NormsType::iterator itr = _norms.begin(); + //Iterate through all the norms + while (itr != _norms.end()) { + // Get, delete the norm + _CLDELETE(itr->second); + // Move the interator to the next norm in the norms collection. + // Note ++ is an overloaded operator + ++itr; + } + _norms.clear(); //bvk: they're deleted, so clear them so that they are not re-used +} + +TermVectorsReader* SegmentReader::getTermVectorsReader() +{ + TermVectorsReader* tvReader = termVectorsLocal.get(); + if (tvReader == NULL) { + tvReader = termVectorsReaderOrig->clone(); + termVectorsLocal.set(tvReader); + } + return tvReader; +} + +TermFreqVector* SegmentReader::getTermFreqVector(int32_t docNumber, + const TCHAR* field) +{ + if (field) { + FieldInfo* fi = fieldInfos->fieldInfo(field); + // Check if this field is invalid or has no stored term vector + if (fi == NULL || !fi->storeTermVector || termVectorsReaderOrig == NULL) + return NULL; + } + + TermVectorsReader* termVectorsReader = getTermVectorsReader(); + if (termVectorsReader == NULL) + return NULL; + + return termVectorsReader->get(docNumber, field); +} + +bool SegmentReader::getTermFreqVectors(int32_t docNumber, + Array& result) +{ + if (termVectorsReaderOrig == NULL) + return false; + + TermVectorsReader* termVectorsReader = getTermVectorsReader(); + if (termVectorsReader == NULL) + return false; + + return termVectorsReader->get(docNumber, result); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp new file mode 100644 index 000000000..50951e9ba --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp @@ -0,0 +1,216 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SegmentHeader.h" + +#include "CLucene/store/IndexInput.h" +#include "Term.h" + +CL_NS_DEF(index) + + SegmentTermDocs::SegmentTermDocs(const SegmentReader* _parent){ + //Func - Constructor + //Pre - Paren != NULL + //Post - The instance has been created + + CND_PRECONDITION(_parent != NULL,"Parent is NULL"); + + parent = _parent; + deletedDocs = parent->deletedDocs; + + _doc = 0; + _freq = 0; + count = 0; + df = 0; + + skipInterval=0; + numSkips=0; + skipCount=0; + skipStream=NULL; + skipDoc=0; + freqPointer=0; + proxPointer=0; + skipPointer=0; + haveSkipped=false; + + freqStream = parent->freqStream->clone(); + skipInterval = parent->tis->getSkipInterval(); + } + + SegmentTermDocs::~SegmentTermDocs() { + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + close(); + } + + TermPositions* SegmentTermDocs::__asTermPositions(){ + return NULL; + } + + void SegmentTermDocs::seek(Term* term) { + TermInfo* ti = parent->tis->get(term); + seek(ti); + _CLDELETE(ti); + } + + void SegmentTermDocs::seek(TermEnum* termEnum){ + TermInfo* ti=NULL; + + // use comparison of fieldinfos to verify that termEnum belongs to the same segment as this SegmentTermDocs + if ( termEnum->getObjectName() == SegmentTermEnum::getClassName() ){ + SegmentTermEnum* te = (SegmentTermEnum*)termEnum; + te->fieldInfos = parent->fieldInfos; + ti = te->getTermInfo(); + }else{ + ti = parent->tis->get(termEnum->term(false)); + } + + seek(ti); + _CLDELETE(ti); + } + void SegmentTermDocs::seek(const TermInfo* ti) { + count = 0; + if (ti == NULL) { + df = 0; + } else { + df = ti->docFreq; + _doc = 0; + skipDoc = 0; + skipCount = 0; + numSkips = df / skipInterval; + freqPointer = ti->freqPointer; + proxPointer = ti->proxPointer; + skipPointer = freqPointer + ti->skipOffset; + freqStream->seek(freqPointer); + haveSkipped = false; + } + } + + void SegmentTermDocs::close() { + + //Check if freqStream still exists + if (freqStream != NULL){ + freqStream->close(); //todo: items like these can probably be delete, because deleting the object also closes it...do everywhere + _CLDELETE( freqStream ); + } + if (skipStream != NULL){ + skipStream->close(); + _CLDELETE( skipStream ); + } + } + + int32_t SegmentTermDocs::doc()const { + return _doc; + } + int32_t SegmentTermDocs::freq()const { + return _freq; + } + + +bool SegmentTermDocs::next() +{ + while (true) { + if (count == df) + return false; + + uint32_t docCode = freqStream->readVInt(); + _doc += docCode >> 1; //unsigned shift + if ((docCode & 1) != 0) // if low bit is set + _freq = 1; // _freq is one + else + _freq = freqStream->readVInt(); // else read _freq + count++; + + if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) + break; + skippingDoc(); + } + return true; +} + + +int32_t SegmentTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) +{ + int32_t i = 0; + // TODO: one optimization would be to get the pointer buffer for ram or mmap + // dirs and iterate over them instead of using readByte() intensive functions. + while (i < length && count < df) { + uint32_t docCode = freqStream->readVInt(); + _doc += docCode >> 1; + if ((docCode & 1) != 0) // if low bit is set + _freq = 1; // _freq is one + else + _freq = freqStream->readVInt(); // else read _freq + count++; + + if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) { + docs[i] = _doc; + freqs[i] = _freq; + i++; + } + } + return i; +} + + bool SegmentTermDocs::skipTo(const int32_t target){ + if (df >= skipInterval) { // optimized case + if (skipStream == NULL) + skipStream = freqStream->clone(); // lazily clone + + if (!haveSkipped) { // lazily seek skip stream + skipStream->seek(skipPointer); + haveSkipped = true; + } + + // scan skip data + int32_t lastSkipDoc = skipDoc; + int64_t lastFreqPointer = freqStream->getFilePointer(); + int64_t lastProxPointer = -1; + int32_t numSkipped = -1 - (count % skipInterval); + + while (target > skipDoc) { + lastSkipDoc = skipDoc; + lastFreqPointer = freqPointer; + lastProxPointer = proxPointer; + + if (skipDoc != 0 && skipDoc >= _doc) + numSkipped += skipInterval; + + if(skipCount >= numSkips) + break; + + skipDoc += skipStream->readVInt(); + freqPointer += skipStream->readVInt(); + proxPointer += skipStream->readVInt(); + + skipCount++; + } + + // if we found something to skip, then skip it + if (lastFreqPointer > freqStream->getFilePointer()) { + freqStream->seek(lastFreqPointer); + skipProx(lastProxPointer); + + _doc = lastSkipDoc; + count += numSkipped; + } + + } + + // done skipping, now just scan + + do { + if (!next()) + return false; + } while (target > _doc); + return true; + } + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp new file mode 100644 index 000000000..20e286fd1 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.cpp @@ -0,0 +1,389 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SegmentTermEnum.h" + +#include "Terms.h" +#include "FieldInfos.h" +#include "Term.h" +#include "TermInfo.h" +#include "TermInfosWriter.h" + +CL_NS_USE(store) +CL_NS_DEF(index) + + SegmentTermEnum::SegmentTermEnum(IndexInput* i, FieldInfos* fis, const bool isi): + fieldInfos(fis){ + //Func - Constructor + //Pre - i holds a reference to an instance of IndexInput + // fis holds a reference to an instance of FieldInfos + // isi + //Post - An instance of SegmentTermEnum has been created + input = i; + position = -1; + //Instantiate a Term with empty field, empty text and which is interned (see term.h what interned means) + _term = _CLNEW Term; + isIndex = isi; + termInfo = _CLNEW TermInfo(); + indexPointer = 0; + buffer = NULL; + bufferLength = 0; + prev = NULL; + formatM1SkipInterval = 0; + + //Set isClone to false as the instance is not clone of another instance + isClone = false; + + + int32_t firstInt = input->readInt(); + if (firstInt >= 0) { + // original-format file, without explicit format version number + format = 0; + size = firstInt; + + // back-compatible settings + indexInterval = 128; + skipInterval = LUCENE_INT32_MAX_SHOULDBE; // switch off skipTo optimization + + } else { + // we have a format version number + format = firstInt; + + // check that it is a format we can understand + if (format < TermInfosWriter::FORMAT){ + TCHAR err[30]; + _sntprintf(err,30,_T("Unknown format version: %d"), format); + _CLTHROWT(CL_ERR_Runtime,err); + } + + size = input->readLong(); // read the size + + if(format == -1){ + if (!isIndex) { + indexInterval = input->readInt(); + formatM1SkipInterval = input->readInt(); + } + // switch off skipTo optimization for file format prior to 1.4rc2 in order to avoid a bug in + // skipTo implementation of these versions + skipInterval = LUCENE_INT32_MAX_SHOULDBE; + }else{ + indexInterval = input->readInt(); + skipInterval = input->readInt(); + } + } + } + + SegmentTermEnum::SegmentTermEnum(const SegmentTermEnum& clone): + fieldInfos(clone.fieldInfos) + { + //Func - Constructor + // The instance is created by cloning all properties of clone + //Pre - clone holds a valid reference to SegmentTermEnum + //Post - An instance of SegmentTermEnum with the same properties as clone + + input = clone.input->clone(); + //Copy the postion from the clone + position = clone.position; + + if ( clone._term != NULL ){ + _term = _CLNEW Term; + _term->set(clone._term,clone._term->text()); + }else + _term = NULL; + isIndex = clone.isIndex; + termInfo = _CLNEW TermInfo(clone.termInfo); + indexPointer = clone.indexPointer; + buffer = clone.buffer==NULL?NULL:(TCHAR*)malloc(sizeof(TCHAR) * (clone.bufferLength+1)); + bufferLength = clone.bufferLength; + prev = clone.prev==NULL?NULL:_CLNEW Term(clone.prev->field(),clone.prev->text(),false); + size = clone.size; + + format = clone.format; + indexInterval= clone.indexInterval; + skipInterval = clone.skipInterval; + formatM1SkipInterval = clone.formatM1SkipInterval; + //Set isClone to true as this instance is a clone of another instance + isClone = true; + + //Copy the contents of buffer of clone to the buffer of this instance + if ( clone.buffer != NULL ) + memcpy(buffer,clone.buffer,bufferLength * sizeof(TCHAR)); + } + + SegmentTermEnum::~SegmentTermEnum(){ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed. If this instance was a clone + // then the inputstream is closed and deleted too. + + //todo: revisit this... close() should clean up most of everything. + + //Finalize prev + _CLDECDELETE(prev ); + //Finalize term + _CLDECDELETE( _term ); + + + //Delete the buffer if necessary + free(buffer); + //Delete termInfo if necessary + _CLDELETE(termInfo); + + //Check if this instance is a clone + if ( isClone ){ + //Close the inputstream + input->close(); + //delete the inputstream + _CLDELETE(input); + } + } + + bool SegmentTermEnum::next(){ + //Func - Moves the current of the set to the next in the set + //Pre - true + //Post - If the end has been reached NULL is returned otherwise the term has + // become the next Term in the enumeration + + //Increase position by and and check if the end has been reached + if (position++ >= size-1) { + //delete term + _CLDECDELETE(_term); + return false; + } + + //delete the previous enumerated term + Term* tmp=NULL; + if ( prev != NULL ){ + int32_t usage = prev->__cl_refcount; + if ( usage > 1 ){ + _CLDECDELETE(prev); //todo: tune other places try and delete its term + }else + tmp = prev; //we are going to re-use this term + } + //prev becomes the current enumerated term + prev = _term; + //term becomes the next term read from inputStream input + _term = readTerm(tmp); + + //Read docFreq, the number of documents which contain the term. + termInfo->docFreq = input->readVInt(); + //Read freqPointer, a pointer into the TermFreqs file (.frq) + termInfo->freqPointer += input->readVLong(); + + //Read proxPointer, a pointer into the TermPosition file (.prx). + termInfo->proxPointer += input->readVLong(); + + if(format == -1){ + // just read skipOffset in order to increment file pointer; + // value is never used since skipTo is switched off + if (!isIndex) { + if (termInfo->docFreq > formatM1SkipInterval) { + termInfo->skipOffset = input->readVInt(); + } + } + }else{ + if (termInfo->docFreq >= skipInterval) + termInfo->skipOffset = input->readVInt(); + } + + //Check if the enumeration is an index + if (isIndex) + //read index pointer + indexPointer += input->readVLong(); + + return true; + } + + Term* SegmentTermEnum::term() { + //Func - Returns the current term. + //Pre - pointer is true or false and indicates if the reference counter + // of term must be increased or not + // next() must have been called once! + //Post - pointer = true -> term has been returned with an increased reference counter + // pointer = false -> term has been returned + + return _CL_POINTER(_term); + } + Term* SegmentTermEnum::term(bool pointer) { + if ( pointer ) + return _CL_POINTER(_term); + else + return _term; + } + + void SegmentTermEnum::scanTo(const Term *term){ + //Func - Scan for Term without allocating new Terms + //Pre - term != NULL + //Post - The iterator term has been moved to the position where Term is expected to be + // in the enumeration + while ( term->compareTo(this->_term) > 0 && next()) + { + } + } + + void SegmentTermEnum::close() { + //Func - Closes the enumeration to further activity, freeing resources. + //Pre - true + //Post - The inputStream input has been closed + + input->close(); + } + + int32_t SegmentTermEnum::docFreq() const { + //Func - Returns the document frequency of the current term in the set + //Pre - termInfo != NULL + // next() must have been called once + //Post - The document frequency of the current enumerated term has been returned + + return termInfo->docFreq; + } + + void SegmentTermEnum::seek(const int64_t pointer, const int32_t p, Term* t, TermInfo* ti) { + //Func - Repositions term and termInfo within the enumeration + //Pre - pointer >= 0 + // p >= 0 and contains the new position within the enumeration + // t is a valid reference to a Term and is the new current term in the enumeration + // ti is a valid reference to a TermInfo and is corresponding TermInfo form the new + // current Term + //Post - term and terminfo have been repositioned within the enumeration + + //Reset the IndexInput input to pointer + input->seek(pointer); + //Assign the new position + position = p; + + //finalize the current term + if ( _term == NULL || _term->__cl_refcount > 1 ){ + _CLDECDELETE(_term); + //Get a pointer from t and increase the reference counter of t + _term = _CLNEW Term; //cannot use reference, because TermInfosReader uses non ref-counted array + } + _term->set(t,t->text()); + + //finalize prev + _CLDECDELETE(prev); + + //Change the current termInfo so it matches the new current term + termInfo->set(ti); + + //Have the buffer grown if needed + if ( bufferLength <= _term->textLength() ) + growBuffer(_term->textLength(), true ); // copy term text into buffer + else + _tcsncpy(buffer,_term->text(),bufferLength); //just copy the buffer + } + + TermInfo* SegmentTermEnum::getTermInfo()const { + //Func - Returns a clone of the current termInfo + //Pre - termInfo != NULL + // next() must have been called once + //Post - A clone of the current termInfo has been returned + + return _CLNEW TermInfo(*termInfo); //clone + } + + void SegmentTermEnum::getTermInfo(TermInfo* ti)const { + //Func - Retrieves a clone of termInfo through the reference ti + //Pre - ti contains a valid reference to TermInfo + // termInfo != NULL + // next() must have been called once + //Post - ti contains a clone of termInfo + + ti->set(termInfo); + } + + int64_t SegmentTermEnum::freqPointer()const { + //Func - Returns the freqpointer of the current termInfo + //Pre - termInfo != NULL + // next() must have been called once + //Post - The freqpointer of the current termInfo has been returned + + return termInfo->freqPointer; + } + + int64_t SegmentTermEnum::proxPointer()const { + //Func - Returns the proxPointer of the current termInfo + //Pre - termInfo != NULL + // next() must have been called once + //Post - the proxPointer of the current termInfo has been returned + + return termInfo->proxPointer; + } + + SegmentTermEnum* SegmentTermEnum::clone() const { + //Func - Returns a clone of this instance + //Pre - true + //Post - An clone of this instance has been returned + + return _CLNEW SegmentTermEnum(*this); + } + + Term* SegmentTermEnum::readTerm(Term* reuse) { + //Func - Reads the next term in the enumeration + //Pre - true + //Post - The next Term in the enumeration has been read and returned + + //Read the start position from the inputStream input + int32_t start = input->readVInt(); + //Read the length of term in the inputStream input + int32_t length = input->readVInt(); + + //Calculated the total lenght of bytes that buffer must be to contain the current + //chars in buffer and the new ones yet to be read + uint32_t totalLength = start + length; + + if (static_cast(bufferLength) < totalLength+1) + growBuffer(totalLength, false); + + //Read a length number of characters into the buffer from position start in the inputStream input + input->readChars(buffer, start, length); + //Null terminate the string + buffer[totalLength] = 0; + + //Return a new Term + int32_t field = input->readVInt(); + const TCHAR* fieldname = fieldInfos->fieldName(field); + if ( reuse == NULL ) + reuse = _CLNEW Term; + + reuse->set(fieldname, buffer, false); + return reuse; + } + + void SegmentTermEnum::growBuffer(const uint32_t length, bool force_copy) { + //Func - Instantiate a buffer of length length+1 + //Pre - length > 0 + //Post - pre(buffer) has been deleted with its contents. A new buffer + // has been allocated of length length+1 and the text of term has been copied + // to buffer + //todo: we could guess that we will need to re-grow this + //buffer a few times...so start off with a reasonable grow + //value... + if ( bufferLength > length ) + return; + + //Store the new bufferLength + if ( length - bufferLength < LUCENE_SEGMENTTERMENUM_GROWSIZE ) + bufferLength = length+LUCENE_SEGMENTTERMENUM_GROWSIZE; + else + bufferLength = length+1; + + bool copy = buffer==NULL; + + //Instantiate the new buffer + 1 is needed for terminator '\0' + if ( buffer == NULL ) + buffer = (TCHAR*)malloc(sizeof(TCHAR) * (bufferLength+1)); + else + buffer = (TCHAR*)realloc(buffer, sizeof(TCHAR) * (bufferLength+1)); + + if ( copy || force_copy){ + //Copy the text of term into buffer + _tcsncpy(buffer,_term->text(),bufferLength); + } + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h new file mode 100644 index 000000000..0d50103f3 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermEnum.h @@ -0,0 +1,138 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_SegmentTermEnum_ +#define _lucene_index_SegmentTermEnum_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Terms.h" +#include "FieldInfos.h" +#include "TermInfo.h" + +CL_NS_DEF(index) + +/** + * SegmentTermEnum is an enumeration of all Terms and TermInfos + */ +class SegmentTermEnum:public TermEnum{ +private: + Term* _term; ///points to the current Term in the enumeration + TermInfo* termInfo; ///points to the TermInfo matching the current Term in the enumeration + + bool isIndex; ///Indicates if the Segment is a an index + bool isClone; ///Indicates if SegmentTermEnum is an orignal instance or + ///a clone of another SegmentTermEnum + + TCHAR* buffer; ///The buffer that contains the data read from the Term Infos File + uint32_t bufferLength; ///Length of the buffer + + int32_t format; + int32_t formatM1SkipInterval; + + CL_NS(store)::IndexInput* input; ///The IndexInput that reads from the Term Infos File + FieldInfos* fieldInfos; ///contains the Field Infos for the segment + int64_t size; ///The size of the enumeration + int64_t position; ///The position of the current (term) in the enumeration + int64_t indexPointer; + Term* prev; ///The previous current + int32_t indexInterval; + int32_t skipInterval; + + friend class TermInfosReader; + friend class SegmentTermDocs; +protected: + + /** + * Constructor. + * The instance is created by cloning all properties of clone + */ + SegmentTermEnum( const SegmentTermEnum& clone); + +public: + ///Constructor + SegmentTermEnum(CL_NS(store)::IndexInput* i, FieldInfos* fis, const bool isi ); + + ///Destructor + ~SegmentTermEnum(); + + /** + * Moves the current of the set to the next in the set + */ + bool next(); + + /** + * Returns a pointer to the current term. + */ + Term* term(); + /** + * Returns the current term. + */ + Term* term(bool pointer); + + /** + * Scan for Term term without allocating new Terms + */ + void scanTo(const Term *term); + + /** + * Closes the enumeration to further activity, freeing resources. + */ + void close(); + + /** + * Returns the document frequency of the current term in the set + */ + int32_t docFreq() const; + + /** + * Repositions term and termInfo within the enumeration + */ + void seek(const int64_t pointer, const int32_t p, Term* t, TermInfo* ti); + + /** + * Returns a clone of the current termInfo + */ + TermInfo* getTermInfo()const; + + /** + * Retrieves a clone of termInfo through the reference ti + */ + void getTermInfo(TermInfo* ti)const; + + /** + * Returns the freqPointer from the current TermInfo in the enumeration. + */ + int64_t freqPointer() const; + + /** + * Returns the proxPointer from the current TermInfo in the enumeration. + */ + int64_t proxPointer() const; + + /** + * Returns a clone of this instance + */ + SegmentTermEnum* clone() const; + + const char* getObjectName(){ return SegmentTermEnum::getClassName(); } + static const char* getClassName(){ return "SegmentTermEnum"; } + +private: + /** + * Reads the next term in the enumeration + */ + Term* readTerm(Term* reuse); + /** + * Instantiate a buffer of length length+1 + */ + void growBuffer(const uint32_t length, bool force_copy); + +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp new file mode 100644 index 000000000..e481838e9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp @@ -0,0 +1,101 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SegmentHeader.h" + +#include "Terms.h" + +CL_NS_USE(util) +CL_NS_DEF(index) + +SegmentTermPositions::SegmentTermPositions(const SegmentReader* _parent): + SegmentTermDocs(_parent){ +//Func - Constructor +//Pre - Parent != NULL +//Post - The instance has been created + + CND_PRECONDITION(_parent != NULL, "Parent is NULL"); + + proxStream = _parent->proxStream->clone(); + + CND_CONDITION(proxStream != NULL,"proxStream is NULL"); + + position = 0; + proxCount = 0; +} + +SegmentTermPositions::~SegmentTermPositions() { +//Func - Destructor +//Pre - true +//Post - The intance has been closed + close(); +} + +TermDocs* SegmentTermPositions::__asTermDocs(){ + return (TermDocs*) this; +} +TermPositions* SegmentTermPositions::__asTermPositions(){ + return (TermPositions*) this; +} + +void SegmentTermPositions::seek(const TermInfo* ti) { + SegmentTermDocs::seek(ti); + if (ti != NULL) + proxStream->seek(ti->proxPointer); + proxCount = 0; +} + +void SegmentTermPositions::close() { +//Func - Frees the resources +//Pre - true +//Post - The resources have been freed + + SegmentTermDocs::close(); + //Check if proxStream still exists + if(proxStream){ + proxStream->close(); + _CLDELETE( proxStream ); + } +} + +int32_t SegmentTermPositions::nextPosition() { + /* DSR:CL_BUG: Should raise exception if proxCount == 0 at the + ** beginning of this method, as in + ** if (--proxCount == 0) throw ...; + ** The JavaDocs for TermPositions.nextPosition declare this constraint, + ** but CLucene doesn't enforce it. */ + proxCount--; + return position += proxStream->readVInt(); +} + +bool SegmentTermPositions::next() { + for (int32_t f = proxCount; f > 0; f--) // skip unread positions + proxStream->readVInt(); + + if (SegmentTermDocs::next()) { // run super + proxCount = _freq; // note frequency + position = 0; // reset position + return true; + } + return false; +} + +int32_t SegmentTermPositions::read(int32_t* docs, int32_t* freqs, int32_t length) { + _CLTHROWA(CL_ERR_InvalidState,"TermPositions does not support processing multiple documents in one call. Use TermDocs instead."); +} + +void SegmentTermPositions::skippingDoc() { + for (int32_t f = _freq; f > 0; f--) // skip all positions + proxStream->readVInt(); +} + +void SegmentTermPositions::skipProx(int64_t proxPointer){ + proxStream->seek(proxPointer); + proxCount = 0; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp new file mode 100644 index 000000000..5e9ac3c3b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/SegmentTermVector.cpp @@ -0,0 +1,188 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "TermVector.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(index) + +Array SegmentTermPositionVector::EMPTY_TERM_POS; + +SegmentTermVector::SegmentTermVector(const TCHAR* field, TCHAR** terms, Array* termFreqs) { + this->field = STRDUP_TtoT(field); + this->terms = terms; + this->termsLen = -1; //lazily get the size of the terms + this->termFreqs = termFreqs; +} + +SegmentTermVector::~SegmentTermVector(){ + _CLDELETE_CARRAY(field); + _CLDELETE_CARRAY_ALL(terms); + + _CLDELETE_ARRAY(termFreqs->values); + _CLDELETE(termFreqs); +} +TermPositionVector* SegmentTermVector::__asTermPositionVector(){ + return NULL; +} + +const TCHAR* SegmentTermVector::getField() { +return field; +} + +TCHAR* SegmentTermVector::toString() const{ +StringBuffer sb; +sb.appendChar('{'); +sb.append(field); +sb.append(_T(": ")); + +int32_t i=0; +while ( terms && terms[i] != NULL ){ + if (i>0) + sb.append(_T(", ")); + sb.append(terms[i]); + sb.appendChar('/'); + + sb.appendInt((*termFreqs)[i]); +} +sb.appendChar('}'); +return sb.toString(); +} + +int32_t SegmentTermVector::size() { +if ( terms == NULL ) + return 0; + +if ( termsLen == -1 ){ + termsLen=0; + while ( terms[termsLen] != 0 ) + termsLen++; +} +return termsLen; +} + +const TCHAR** SegmentTermVector::getTerms() { + return (const TCHAR**)terms; +} + +const Array* SegmentTermVector::getTermFrequencies() { + return termFreqs; +} + +int32_t SegmentTermVector::binarySearch(TCHAR** a, const int32_t arraylen, const TCHAR* key) const +{ + int32_t low = 0; + int32_t hi = arraylen - 1; + int32_t mid = 0; + while (low <= hi) + { + mid = (low + hi) >> 1; + + int32_t c = _tcscmp(a[mid],key); + if (c==0) + return mid; + else if (c > 0) + hi = mid - 1; + else // This gets the insertion point right on the last loop. + low = ++mid; + } + return -mid - 1; +} + +int32_t SegmentTermVector::indexOf(const TCHAR* termText) { + if(terms == NULL) + return -1; + int32_t res = binarySearch(terms, size(), termText); + return res >= 0 ? res : -1; +} + +void SegmentTermVector::indexesOf(const TCHAR** termNumbers, const int32_t start, const int32_t len, Array& ret) { + // TODO: there must be a more efficient way of doing this. + // At least, we could advance the lower bound of the terms array + // as we find valid indexes. Also, it might be possible to leverage + // this even more by starting in the middle of the termNumbers array + // and thus dividing the terms array maybe in half with each found index. + ret.length = len; + ret.values = _CL_NEWARRAY(int32_t,len); + for (int32_t i=0; i* termFreqs, Array< Array >* positions, Array< Array >* offsets): + SegmentTermVector(field,terms,termFreqs) +{ + this->offsets = offsets; + this->positions = positions; +} + +SegmentTermPositionVector::~SegmentTermPositionVector(){ + if ( offsets ){ + for (size_t i=0;ilength;i++){ + if ( offsets->values != NULL ){ + Array& offs = offsets->values[i]; + for ( size_t j=0;jvalues); + _CLDELETE(offsets); + } + if ( positions ){ + for (size_t i=0;ilength;i++){ + if ( positions->values != NULL ){ + Array& pos = positions->values[i]; + for ( size_t j=0;jvalues); + _CLDELETE(positions); + } +} + +TermPositionVector* SegmentTermPositionVector::__asTermPositionVector(){ + return this; +} +/** +* Returns an array of TermVectorOffsetInfo in which the term is found. +* +* @param index The position in the array to get the offsets from +* @return An array of TermVectorOffsetInfo objects or the empty list +* @see org.apache.lucene.analysis.Token +*/ +Array* SegmentTermPositionVector::getOffsets(int32_t index) { + if(offsets == NULL) + return NULL; + if (index >=0 && index < offsets->length) + return &offsets->values[index]; + else + return &TermVectorOffsetInfo::EMPTY_OFFSET_INFO; +} + +/** +* Returns an array of positions in which the term is found. +* Terms are identified by the index at which its number appears in the +* term String array obtained from the indexOf method. +*/ +Array* SegmentTermPositionVector::getTermPositions(int32_t index) { + if(positions == NULL) + return NULL; + + if (index >=0 && index < positions->length) + return &positions->values[index]; + else + return &EMPTY_TERM_POS; +} +CL_NS_END + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/Term.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/Term.cpp new file mode 100644 index 000000000..5ff7bb264 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/Term.cpp @@ -0,0 +1,182 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ + +#include "CLucene/StdHeader.h" +#include "Term.h" +#include "CLucene/util/StringIntern.h" + +CL_NS_USE(util) +CL_NS_DEF(index) + +Term::Term() +{ + init(); +} + +Term::Term(const TCHAR* fld, const TCHAR* txt, bool internField) +{ + init(); + set(fld, txt, internField); +} + +Term::Term(const Term* fieldTerm, const TCHAR* txt) +{ + init(); + set(fieldTerm, txt); +} + +Term::Term(const TCHAR* fld, const TCHAR* txt) +{ + init(); + set(fld, txt); +} + +Term::~Term() +{ + if (internF) + CLStringIntern::unintern(_field); + _field = NULL; + +#ifndef LUCENE_TERM_TEXT_LENGTH + if (_text != LUCENE_BLANK_STRING) + _CLDELETE_CARRAY(_text); +#endif +} + +const TCHAR* Term::field() const +{ + return _field; +} + +const TCHAR* Term::text() const +{ + return _text; +} + +void Term::set(const Term* term, const TCHAR* txt) +{ + set(term->field(), txt, false); +} + +void Term::set(const TCHAR* fld, const TCHAR* txt,bool internField) +{ + CND_PRECONDITION(fld != NULL, "fld contains NULL"); + CND_PRECONDITION(txt != NULL, "txt contains NULL"); + + //save field for unintern later + const TCHAR* oldField = _field; + cachedHashCode = 0; + textLen = _tcslen(txt); + + //Delete text if it is the owner +#ifdef LUCENE_TERM_TEXT_LENGTH + if (textLen > LUCENE_TERM_TEXT_LENGTH) + textLen = LUCENE_TERM_TEXT_LENGTH; + + _tcsncpy(_text,txt,textLen+1); + _text[textLen]=0; +#else + //if the term text buffer is bigger than what we have + if (_text && textLen > textLenBuf) { + if (_text != LUCENE_BLANK_STRING) { + _CLDELETE_ARRAY(_text); + } else { + _text = NULL; + } + textLenBuf = 0; + } + + if (_text == LUCENE_BLANK_STRING) { + _text = LUCENE_BLANK_STRING; + } else if (_text == NULL) { + if (txt[0] == 0) { + //if the string is blank and we aren't re-using the buffer... + _text = LUCENE_BLANK_STRING; + } else { + //duplicate the text + _text = stringDuplicate(txt); + textLenBuf = textLen; + } + } else { + //re-use the buffer + _tcscpy(_text,txt); + } +#endif + + //Set Term Field + if (internField) { + _field = CLStringIntern::intern(fld CL_FILELINE); + } else { + _field = fld; + } + + //unintern old field after interning new one, + if (internF) + CLStringIntern::unintern(oldField); + internF = internField; + + CND_PRECONDITION(_tcscmp(fld, _field) == 0, "field not equal"); +} + +bool Term::equals(const Term* other) const +{ + if (cachedHashCode != 0 && other->cachedHashCode != 0 + && other->cachedHashCode != cachedHashCode) + return false; + + if (_field == other->_field) { + if (textLen == other->textLen) + return (_tcscmp(_text, other->_text) == 0); + return false; + } + + return false; +} + +size_t Term::hashCode() +{ + if (cachedHashCode == 0) + cachedHashCode = Misc::thashCode(_field) + Misc::thashCode(_text, textLen); + + return cachedHashCode; +} + +int32_t Term::compareTo(const Term* other) const +{ + //Check ret to see if text needs to be compared + if (_field == other->_field) + return _tcscmp(_text, other->_text); + + int32_t ret = _tcscmp(_field, other->_field); + if (ret == 0) + ret = _tcscmp(_text, other->_text); + return ret; +} + +TCHAR* Term::toString() const +{ + return CL_NS(util)::Misc::join(_field, _T(":"), _text); +} + +void Term::init() +{ + textLen = 0; + internF = false; + cachedHashCode = 0; + _field = LUCENE_BLANK_STRING; + +#ifdef LUCENE_TERM_TEXT_LENGTH + _text[0] = 0; +#else + _text = LUCENE_BLANK_STRING; + textLenBuf = 0; +#endif +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/Term.h b/src/assistant/3rdparty/clucene/src/CLucene/index/Term.h new file mode 100644 index 000000000..68eefd194 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/Term.h @@ -0,0 +1,146 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_Term_ +#define _lucene_index_Term_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/Misc.h" +#include "CLucene/util/StringIntern.h" + +CL_NS_DEF(index) + +/* +A Term represents a word from text. This is the unit of search. It is +composed of two elements, the text of the word, as a string, and the name of +the field that the text occured in, an interned string. + +Note that terms may represent more than words from text fields, but also +things like dates, email addresses, urls, etc. + +IMPORTANT NOTE: +Term inherits from the template class LUCENE_REFBASE which tries to do +some garbage collection by counting the references an instance has. As a result +of this construction you MUST use _CLDECDELETE(obj) when you want to delete an +of Term! + +ABOUT intrn + +intrn indicates if field and text are interned or not. Interning of Strings +is the process of converting duplicated strings to shared ones. + +*/ +class Term : LUCENE_REFBASE +{ +private: + const TCHAR* _field; + bool internF; // Indicates if Term Field is interned(and therefore must be uninternd). + size_t cachedHashCode; + size_t textLen; // a cache of text len, this allows for a preliminary comparison of text lengths + +#ifdef LUCENE_TERM_TEXT_LENGTH + TCHAR _text[LUCENE_TERM_TEXT_LENGTH + 1]; +#else + TCHAR* _text; + size_t textLenBuf; //a cache of text len, this allows for a preliminary comparison of text lengths +#endif + + void init(); +public: + + //uses the specified fieldTerm's field. this saves on intern'ing time. + Term(const Term* fieldTerm, const TCHAR* txt); + + ///Constructs a blank term + Term(); + + // TODO: need to be private, a few other things need to be changed first... + Term(const TCHAR* fld, const TCHAR* txt, bool internField); + + /** + * Constructor. Constructs a Term with the given field and text. Field and + * text are not copied Field and text are deleted in destructor only if + * intern is false. + */ + Term(const TCHAR* fld, const TCHAR* txt); + + ///Destructor. + ~Term(); + + ///Returns the field of this term, an interned string. The field indicates + ///the part of a document which this term came from. + const TCHAR* field() const; /// + TCHAR* toString() const; + + size_t hashCode(); + + class Equals:public CL_NS_STD(binary_function) + { + public: + bool operator()( const Term* val1, const Term* val2 ) const + { + return val1->equals(val2); + } + }; + + class Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base // + { + public: + bool operator()(Term* t1, Term* t2) const + { + return (t1->compareTo(t2) < 0); + } + + size_t operator()(Term* t) const + { + return t->hashCode(); + } + }; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.cpp new file mode 100644 index 000000000..ac1107317 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.cpp @@ -0,0 +1,53 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ + +#include "CLucene/StdHeader.h" +#include "TermInfo.h" + +CL_NS_DEF(index) + +TermInfo::TermInfo() +{ + set(0, 0, 0, 0); +} + +TermInfo::~TermInfo() +{ +} + +TermInfo::TermInfo(int32_t df, int64_t fp, int64_t pp) +{ + set(df, fp, pp, 0); +} + +TermInfo::TermInfo(const TermInfo* ti) +{ + if (ti) + set(ti); +} + +void TermInfo::set(const TermInfo* ti) +{ + if (ti) + set(ti->docFreq, ti->freqPointer, ti->proxPointer, ti->skipOffset); +} + +void TermInfo::set(int32_t df, int64_t fp, int64_t pp, int32_t so) +{ + CND_PRECONDITION(df >= 0, "df contains negative number"); + CND_PRECONDITION(fp >= 0, "fp contains negative number"); + CND_PRECONDITION(pp >= 0, "pp contains negative number"); + + docFreq = df; + freqPointer = fp; + proxPointer = pp; + skipOffset = so; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.h b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.h new file mode 100644 index 000000000..57b7a9a76 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfo.h @@ -0,0 +1,61 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_TermInfo +#define _lucene_index_TermInfo + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(index) + +// A TermInfo is the record of information stored for a term. +class TermInfo : LUCENE_BASE +{ +public: + // The number of documents which contain the term. + int32_t docFreq; + + //A pointer into the TermFreqs file (.frq) + //The .frq file contains the lists of documents which contain each term, + //along with the frequency of the term in that document. + int64_t freqPointer; + + //A pointer into the TermPosition file (.prx). + //The .prx file contains the lists of positions that each term + //occurs at within documents. + int64_t proxPointer; + + int32_t skipOffset; + + //Constructor + TermInfo(); + + //Constructor + TermInfo(int32_t df, int64_t fp, int64_t pp); + + //Constructor + //Initialises this instance by copying the values of another TermInfo ti + TermInfo(const TermInfo* ti); + + //Destructor + ~TermInfo(); + + //Sets a new document frequency, a new freqPointer and a new proxPointer + void set(int32_t docFreq, int64_t freqPointer, int64_t proxPointer, + int32_t skipOffset); + + //Sets a new document frequency, a new freqPointer and a new proxPointer + //by copying these values from another instance of TermInfo + void set(const TermInfo* ti); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp new file mode 100644 index 000000000..8f9e43dec --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.cpp @@ -0,0 +1,443 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "TermInfosReader.h" + +#include "CLucene/store/Directory.h" +#include "CLucene/util/Misc.h" +#include "FieldInfos.h" +#include "Term.h" +#include "Terms.h" +#include "TermInfo.h" +#include "TermInfosWriter.h" + +CL_NS_USE(store) +CL_NS_USE(util) +CL_NS_DEF(index) + +TermInfosReader::TermInfosReader(Directory* dir, const QString& seg, + FieldInfos* fis) + : directory(dir) + , fieldInfos (fis) +{ + //Func - Constructor. + // Reads the TermInfos file (.tis) and eventually the Term Info Index file (.tii) + //Pre - dir is a reference to a valid Directory + // Fis contains a valid reference to an FieldInfos instance + // seg != NULL and contains the name of the segment + //Post - An instance has been created and the index named seg has been read. (Remember + // a segment is nothing more then an independently readable index) + + CND_PRECONDITION(!seg.isEmpty(), "seg is NULL"); + + //Initialize the name of the segment + segment = seg; + //There are no indexTerms yet + indexTerms = NULL; + //So there are no indexInfos + indexInfos = NULL; + //So there are no indexPointers + indexPointers = NULL; + //Create a filname fo a Term Info File + QString tisFile = Misc::segmentname(segment, QLatin1String(".tis")); + QString tiiFile = Misc::segmentname(segment, QLatin1String(".tii")); + + //Create an SegmentTermEnum for storing all the terms read of the segment + origEnum = _CLNEW SegmentTermEnum( directory->openInput( tisFile ), fieldInfos, false); + indexEnum = _CLNEW SegmentTermEnum( directory->openInput( tiiFile ), fieldInfos, true); + + //Check if enumerator points to a valid instance + CND_CONDITION(origEnum != NULL, "No memory could be allocated for orig enumerator"); + CND_CONDITION(indexEnum != NULL, "No memory could be allocated for index enumerator"); + + //Get the size of the enumeration and store it in size + _size = origEnum->size; +} + +TermInfosReader::~TermInfosReader() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + //Close the TermInfosReader to be absolutly sure that enumerator has been closed + //and the arrays indexTerms, indexPointers and indexInfos and their elements + //have been destroyed + close(); +} + +void TermInfosReader::close() +{ + //Func - Close the enumeration of TermInfos + //Pre - true + //Post - The _enumeration has been closed and the arrays + + //Check if indexTerms and indexInfos exist + if (indexTerms && indexInfos){ + //Iterate through arrays indexTerms and indexPointer to + //destroy their elements +#ifdef _DEBUG + for (int32_t i = 0; i < indexTermsLength; ++i) { + if (indexTerms[i].__cl_refcount != 1) { + CND_PRECONDITION(indexTerms[i].__cl_refcount == 1, + "TermInfosReader term was references more than internally"); + } + // _CLDECDELETE(indexTerms[i]); + //_CLDELETE(indexInfos[i]); + } +#endif + //Delete the arrays + _CLDELETE_ARRAY(indexTerms); + _CLDELETE_ARRAY(indexInfos); + } + + //Delete the arrays + _CLDELETE_ARRAY(indexPointers); + + if (origEnum != NULL) { + origEnum->close(); + + //Get a pointer to IndexInput used by the enumeration but + //instantiated in the constructor by directory.open( tisFile ) + IndexInput *is = origEnum->input; + + //Delete the enumuration enumerator + _CLDELETE(origEnum); + + //Delete the IndexInput + _CLDELETE(is); + } + + if (indexEnum != NULL){ + indexEnum->close(); + + //Get a pointer to IndexInput used by the enumeration but + //instantiated in the constructor by directory.open( tiiFile ) + IndexInput *is = indexEnum->input; + + //Delete the enumuration enumerator + _CLDELETE(indexEnum); + + //Delete the IndexInput + _CLDELETE(is); + } +} + +int64_t TermInfosReader::size() const +{ + //Func - Return the size of the enumeration of TermInfos + //Pre - true + //Post - size has been returened + + return _size; +} + +Term* TermInfosReader::get(const int32_t position) +{ + //Func - Returns the nth term in the set + //Pre - position > = 0 + //Post - The n-th term in the set has been returned + + //Check if the size is 0 because then there are no terms + if (_size == 0) + return NULL; + + SegmentTermEnum* enumerator = getEnum(); + + if (enumerator != NULL //an enumeration exists + && enumerator->term(false) != NULL // term is at or past current + && position >= enumerator->position + && position < (enumerator->position + enumerator->indexInterval)) { + return scanEnum(position); // can avoid seek + } + + //random-access: must seek + seekEnum(position / enumerator->indexInterval); + + //Get the Term at position + return scanEnum(position); +} + +// TODO: currently there is no way of cleaning up a thread, if the thread ends. +// we are stuck with the terminfosreader of that thread. Hopefully this won't +// be too big a problem... solutions anyone? +SegmentTermEnum* TermInfosReader::getEnum() +{ + SegmentTermEnum* termEnum = enumerators.get(); + if (termEnum == NULL) { + termEnum = terms(); + enumerators.set(termEnum); + } + return termEnum; +} + +TermInfo* TermInfosReader::get(const Term* term) +{ + //Func - Returns a TermInfo for a term + //Pre - term holds a valid reference to term + //Post - if term can be found its TermInfo has been returned otherwise NULL + + //If the size of the enumeration is 0 then no Terms have been read + if (_size == 0) + return NULL; + + ensureIndexIsRead(); + + // optimize sequential access: first try scanning cached enum w/o seeking + SegmentTermEnum* enumerator = getEnum(); + + // optimize sequential access: first try scanning cached enumerator w/o seeking + // if the current term of the enumeration enumerator is not at the end + if (enumerator->term(false) != NULL + // AND there exists a previous current called prev and term is + // positioned after this prev + && ((enumerator->prev != NULL && term->compareTo(enumerator->prev) > 0) + // OR term is positioned at the same position as the current of + // enumerator or at a higher position + || term->compareTo(enumerator->term(false)) >= 0)) { + //Calculate the offset for the position + int32_t _enumOffset = (int32_t) + (enumerator->position / enumerator->indexInterval) + 1; + + // but before end of block the length of indexTerms (the number of + // terms in enumerator) equals _enum_offset + if (indexTermsLength == _enumOffset + // OR term is positioned in front of term found at _enumOffset in + // indexTerms + || term->compareTo(&indexTerms[_enumOffset]) < 0) { + //no need to seek, retrieve the TermInfo for term + return scanEnum(term); + } + } + + //Reposition current term in the enumeration + seekEnum(getIndexOffset(term)); + //Return the TermInfo for term + return scanEnum(term); +} + +int64_t TermInfosReader::getPosition(const Term* term) +{ + //Func - Returns the position of a Term in the set + //Pre - term holds a valid reference to a Term + // enumerator != NULL + //Post - If term was found then its position is returned otherwise -1 + + //if the enumeration is empty then return -1 + if (_size == 0) + return -1; + + ensureIndexIsRead(); + + //Retrieve the indexOffset for term + int32_t indexOffset = getIndexOffset(term); + seekEnum(indexOffset); + + SegmentTermEnum* enumerator = getEnum(); + + while(term->compareTo(enumerator->term(false)) > 0 && enumerator->next()) {} + + if (term->equals(enumerator->term(false))) + return enumerator->position; + + return -1; +} + +SegmentTermEnum* TermInfosReader::terms(const Term* term) +{ + //Func - Returns an enumeration of terms starting at or after the named term. + // If term is null then enumerator is set to the beginning + //Pre - term holds a valid reference to a Term + // enumerator != NULL + //Post - An enumeration of terms starting at or after the named term has been returned + + SegmentTermEnum* enumerator = NULL; + if (term != NULL) { + //Seek enumerator to term; delete the new TermInfo that's returned. + TermInfo* ti = get(term); + _CLDELETE(ti); + enumerator = getEnum(); + } else { + enumerator = origEnum; + } + //Clone the entire enumeration + SegmentTermEnum* cln = enumerator->clone(); + + //Check if cln points to a valid instance + CND_CONDITION(cln != NULL, "cln is NULL"); + + return cln; +} + +void TermInfosReader::ensureIndexIsRead() +{ + //Func - Reads the term info index file or .tti file. + // This file contains every IndexInterval-th entry from the .tis file, + // along with its location in the "tis" file. This is designed to be + // read entirely into memory and used to provide random access to the + // "tis" file. + //Pre - indexTerms = NULL + // indexInfos = NULL + // indexPointers = NULL + //Post - The term info index file has been read into memory + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + if ( indexTerms != NULL ) + return; + + try { + indexTermsLength = (size_t)indexEnum->size; + + // Instantiate an block of Term's,so that each one doesn't have to be new'd + indexTerms = _CL_NEWARRAY(Term,indexTermsLength); + + // Check if is indexTerms is a valid array + CND_CONDITION(indexTerms != NULL, + "No memory could be allocated for indexTerms"); + + // Instantiate an big block of TermInfo's, so that each one doesn't + // have to be new'd + indexInfos = _CL_NEWARRAY(TermInfo,indexTermsLength); + + // Check if is indexInfos is a valid array + CND_CONDITION(indexInfos != NULL, + "No memory could be allocated for indexInfos"); + + // Instantiate an array indexPointers that contains pointers to the + // term info index file + indexPointers = _CL_NEWARRAY(int64_t,indexTermsLength); + + // Check if is indexPointers is a valid array + CND_CONDITION(indexPointers != NULL, + "No memory could be allocated for indexPointers"); + + //Iterate through the terms of indexEnum + for (int32_t i = 0; indexEnum->next(); ++i) { + indexTerms[i].set(indexEnum->term(false), indexEnum->term(false)->text()); + indexEnum->getTermInfo(&indexInfos[i]); + indexPointers[i] = indexEnum->indexPointer; + } + } _CLFINALLY ( + indexEnum->close(); + // Close and delete the IndexInput is. The close is done by the destructor. + _CLDELETE( indexEnum->input ); + _CLDELETE( indexEnum ); + ); +} + +int32_t TermInfosReader::getIndexOffset(const Term* term) +{ + //Func - Returns the offset of the greatest index entry which is less than + // or equal to term. + //Pre - term holds a reference to a valid term + // indexTerms != NULL + //Post - The new offset has been returned + + //Check if is indexTerms is a valid array + CND_PRECONDITION(indexTerms != NULL, "indexTerms is NULL"); + + int32_t lo = 0; + int32_t hi = indexTermsLength - 1; + int32_t mid; + int32_t delta; + + while (hi >= lo) { + //Start in the middle betwee hi and lo + mid = (lo + hi) >> 1; + + //Check if is indexTerms[mid] is a valid instance of Term + CND_PRECONDITION(&indexTerms[mid] != NULL, "indexTerms[mid] is NULL"); + CND_PRECONDITION(mid < indexTermsLength, "mid >= indexTermsLength"); + + //Determine if term is before mid or after mid + delta = term->compareTo(&indexTerms[mid]); + if (delta < 0) { + //Calculate the new hi + hi = mid - 1; + } else if (delta > 0) { + //Calculate the new lo + lo = mid + 1; + } else { + //term has been found so return its position + return mid; + } + } + // the new starting offset + return hi; +} + +void TermInfosReader::seekEnum(const int32_t indexOffset) +{ + //Func - Reposition the current Term and TermInfo to indexOffset + //Pre - indexOffset >= 0 + // indexTerms != NULL + // indexInfos != NULL + // indexPointers != NULL + //Post - The current Term and Terminfo have been repositioned to indexOffset + + CND_PRECONDITION(indexOffset >= 0, "indexOffset contains a negative number"); + CND_PRECONDITION(indexTerms != NULL, "indexTerms is NULL"); + CND_PRECONDITION(indexInfos != NULL, "indexInfos is NULL"); + CND_PRECONDITION(indexPointers != NULL, "indexPointers is NULL"); + + SegmentTermEnum* enumerator = getEnum(); + enumerator->seek(indexPointers[indexOffset], + (indexOffset * enumerator->indexInterval) - 1, + &indexTerms[indexOffset], &indexInfos[indexOffset]); +} + +TermInfo* TermInfosReader::scanEnum(const Term* term) +{ + //Func - Scans the Enumeration of terms for term and returns the + // corresponding TermInfo instance if found. The search is started + // from the current term. + //Pre - term contains a valid reference to a Term + // enumerator != NULL + //Post - if term has been found the corresponding TermInfo has been returned + // otherwise NULL has been returned + + SegmentTermEnum* enumerator = getEnum(); + enumerator->scanTo(term); + + //Check if the at the position the Term term can be found + if (enumerator->term(false) != NULL && term->equals(enumerator->term(false))) { + //Return the TermInfo instance about term + return enumerator->getTermInfo(); + } + + //term was not found so no TermInfo can be returned + return NULL; +} + +Term* TermInfosReader::scanEnum(const int32_t position) +{ + //Func - Scans the enumeration to the requested position and returns the + // Term located at that position + //Pre - position > = 0 + // enumerator != NULL + //Post - The Term at the requested position has been returned + + SegmentTermEnum* enumerator = getEnum(); + + // As long the position of the enumeration enumerator is smaller than the + // requested one + while(enumerator->position < position) { + //Move the current of enumerator to the next + if (!enumerator->next()) { + //If there is no next it means that the requested position was to big + return NULL; + } + } + + //Return the Term a the requested position + return enumerator->term(); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.h b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.h new file mode 100644 index 000000000..ed202e750 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosReader.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_TermInfosReader_ +#define _lucene_index_TermInfosReader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/util/ThreadLocal.h" +#include "SegmentTermEnum.h" + +CL_NS_DEF(index) + +class FieldInfos; +class Term; +class TermInfo; +class TermInfos; +class TermInfosWriter; + +// PORT STATUS: 365707 (jlucene 1.9) +// This stores a monotonically increasing set of pairs in a +// Directory. Pairs are accessed either by Term or by ordinal position the set. +class TermInfosReader : LUCENE_BASE +{ +private: + CL_NS(store)::Directory* directory; + QString segment; + FieldInfos* fieldInfos; + + CL_NS(util)::ThreadLocal > enumerators; + + SegmentTermEnum* getEnum(); + SegmentTermEnum* origEnum; + SegmentTermEnum* indexEnum; + int64_t _size; + + Term* indexTerms; + int32_t indexTermsLength; + TermInfo* indexInfos; + int64_t* indexPointers; + + DEFINE_MUTEX(THIS_LOCK) + +public: + // Reads the TermInfos file(.tis) and eventually the Term Info Index(.tii) + TermInfosReader(CL_NS(store)::Directory* dir, const QString& segment, + FieldInfos* fis); + ~TermInfosReader(); + + //Close the enumeration of TermInfos + void close(); + + //Return the size of the enumeration of TermInfos + int64_t size() const; + + int32_t getSkipInterval() { + return origEnum->skipInterval; } + + // Returns an enumeration of terms starting at or after the named term. + // If no term is specified, an enumeration of all the Terms + // and TermInfos in the set is returned. + SegmentTermEnum* terms(const Term* term = NULL); + + // Returns the TermInfo for a Term in the set + // synchronized + TermInfo* get(const Term* term); + +private: + // Reads the term info index file or .tti file. + void ensureIndexIsRead(); + + // Returns the offset of the greatest index entry which is less than term. + int32_t getIndexOffset(const Term* term); + + // Reposition the current Term and TermInfo to indexOffset + void seekEnum(const int32_t indexOffset); + + // Scans the Enumeration of terms for term and returns the corresponding + // TermInfo instance if found. The search is started from the current term. + TermInfo* scanEnum(const Term* term); + + // Scans the enumeration to the requested position and returns the Term + // located at that position + Term* scanEnum(const int32_t position); + + // Returns the position of a Term in the set. synchronized + int64_t getPosition(const Term* term); + + // Returns the nth term in the set. synchronized + Term* get(const int32_t position); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp new file mode 100644 index 000000000..c5b5340c3 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.cpp @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "TermInfosWriter.h" + +#include "CLucene/store/Directory.h" +#include "CLucene/util/Misc.h" +#include "FieldInfos.h" +#include "Term.h" +#include "TermInfo.h" +#include "IndexWriter.h" + +CL_NS_USE(util) +CL_NS_USE(store) +CL_NS_DEF(index) + +TermInfosWriter::TermInfosWriter(Directory* directory, const QString& segment, + FieldInfos* fis, int32_t interval) + : fieldInfos(fis) +{ + //Func - Constructor + //Pre - directory contains a valid reference to a Directory + // segment != NULL + // fis contains a valid reference to a reference FieldInfos + //Post - The instance has been created + + CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); + //Initialize instance + initialise(directory, segment, interval, false); + + other = _CLNEW TermInfosWriter(directory, segment, fieldInfos, interval, true); + + CND_CONDITION(other != NULL, "other is NULL"); + + other->other = this; +} + +TermInfosWriter::TermInfosWriter(Directory* directory, const QString& segment, + FieldInfos* fis, int32_t interval, bool isIndex) + : fieldInfos(fis) +{ + //Func - Constructor + //Pre - directory contains a valid reference to a Directory + // segment != NULL + // fis contains a valid reference to a reference FieldInfos + // isIndex is true or false + //Post - The instance has been created + + CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); + initialise(directory, segment, interval, isIndex); +} + +void TermInfosWriter::initialise(Directory* directory, const QString& segment, + int32_t interval, bool IsIndex) +{ + //Func - Helps constructors to initialize Instance + //Pre - directory contains a valid reference to a Directory + // segment != NULL + // fis contains a valid reference to a reference FieldInfos + //Post - The instance has been initialized + + lastTerm = _CLNEW Term; + + CND_CONDITION(lastTerm != NULL, "Could not allocate memory for lastTerm"); + + lastTi = _CLNEW TermInfo(); + + CND_CONDITION(lastTi != NULL, "Could not allocate memory for lastTi"); + + lastIndexPointer = 0; + size = 0; + isIndex = IsIndex; + indexInterval = interval; + skipInterval = LUCENE_DEFAULT_TERMDOCS_SKIP_INTERVAL; + + QString buf = Misc::segmentname(segment, QLatin1String(isIndex ? ".tii" : ".tis")); + output = directory->createOutput(buf); + + output->writeInt(FORMAT); // write format + output->writeLong(0); // leave space for size + output->writeInt(indexInterval);// write indexInterval + output->writeInt(skipInterval); // write skipInterval + + //Set other to NULL by Default + other = NULL; +} + +TermInfosWriter::~TermInfosWriter() +{ + //Func - Destructor + //Pre - true + //Post - de instance has been destroyed + + close(); +} + +void TermInfosWriter::add(Term* term, const TermInfo* ti) +{ + //Func - Writes a Term and TermInfo to the outputstream + //Pre - Term must be lexicographically greater than all previous Terms added. + // Pointers of TermInfo ti (freqPointer and proxPointer) must be + // positive and greater than all previous. + + CND_PRECONDITION(isIndex || (!isIndex && term->compareTo(lastTerm) > 0),"term out of order"); + CND_PRECONDITION(ti->freqPointer >= lastTi->freqPointer,"freqPointer out of order"); + CND_PRECONDITION(ti->proxPointer >= lastTi->proxPointer,"proxPointer out of order"); + + if (!isIndex && size % indexInterval == 0) { + //add an index term + other->add(lastTerm, lastTi); + } + + //write term + writeTerm(term); + // write doc freq + output->writeVInt(ti->docFreq); + //write pointers + output->writeVLong(ti->freqPointer - lastTi->freqPointer); + output->writeVLong(ti->proxPointer - lastTi->proxPointer); + if (ti->docFreq >= skipInterval) { + output->writeVInt(ti->skipOffset); + } + + if (isIndex){ + output->writeVLong(other->output->getFilePointer() - lastIndexPointer); + lastIndexPointer = other->output->getFilePointer(); // write pointer + } + + lastTi->set(ti); + size++; +} + +void TermInfosWriter::close() { + //Func - Closes the TermInfosWriter + //Pre - true + //Post - The TermInfosWriter has been closed + + if (output){ + //write size at start + output->seek(4); // write size after format + output->writeLong(size); + output->close(); + _CLDELETE(output); + + if (!isIndex){ + if(other){ + other->close(); + _CLDELETE( other ); + } + } + _CLDECDELETE(lastTerm); + + _CLDELETE(lastTi); + } +} + +void TermInfosWriter::writeTerm(Term* term) +{ + int32_t start = Misc::stringDifference(lastTerm->text(),lastTerm->textLength(), + term->text(),term->textLength()); + int32_t length = term->textLength() - start; + + output->writeVInt(start); // write shared prefix length + output->writeVInt(length); // write delta length + output->writeChars(term->text(), start, length); // write delta chars + + int32_t fieldnum = fieldInfos->fieldNumber(term->field()); + CND_PRECONDITION(fieldnum>=-1&&fieldnumsize(),"Fieldnum is out of range"); + output->writeVInt(fieldnum); // write field num + + if ( lastTerm->__cl_refcount == 1 ){ + lastTerm->set(term,term->text()); + }else{ + _CLDECDELETE(lastTerm); + lastTerm = _CL_POINTER(term); + } +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h new file mode 100644 index 000000000..7e3c68699 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermInfosWriter.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_TermInfosWriter_ +#define _lucene_index_TermInfosWriter_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "FieldInfos.h" +#include "TermInfo.h" +#include "Term.h" + +CL_NS_DEF(index) + + +// This stores a monotonically increasing set of pairs in a +// Directory. A TermInfos can be written once, in order. +class TermInfosWriter : LUCENE_BASE +{ +private: + FieldInfos* fieldInfos; + CL_NS(store)::IndexOutput* output; + Term* lastTerm; + TermInfo* lastTi; + int64_t size; + int64_t lastIndexPointer; + bool isIndex; + TermInfosWriter* other; + + //inititalize + TermInfosWriter(CL_NS(store)::Directory* directory, + const QString& segment, FieldInfos* fis, int32_t interval, bool isIndex); +public: + /** The file format version, a negative number. */ + LUCENE_STATIC_CONSTANT(int32_t,FORMAT=-2); + + /** + * Expert: The fraction of terms in the "dictionary" which should be stored + * in RAM. Smaller values use more memory, but make searching slightly + * faster, while larger values use less memory and make searching slightly + * slower. Searching is typically not dominated by dictionary lookup, so + * tweaking this is rarely useful. + */ + int32_t indexInterval;// = 128 + + /** + * Expert: The fraction of {@link TermDocs} entries stored in skip tables, + * used to accellerate {@link TermDocs#SkipTo(int32_t)}. Larger values result in + * smaller indexes, greater acceleration, but fewer accelerable cases, while + * smaller values result in bigger indexes, less acceleration and more + * accelerable cases. More detailed experiments would be useful here. + */ + int32_t skipInterval;// = 16 + + TermInfosWriter(CL_NS(store)::Directory* directory, + const QString& segment, FieldInfos* fis, int32_t interval); + + ~TermInfosWriter(); + + /** + * Adds a new pair to the set. + * Term must be lexicographically greater than all previous Terms added. + * TermInfo pointers must be positive and greater than all previous. + */ + void add(Term* term, const TermInfo* ti); + + /** Called to complete TermInfos creation. */ + void close(); + +private: + /** Helps constructors to initialize instances */ + void initialise(CL_NS(store)::Directory* directory, + const QString& segment, int32_t interval, bool IsIndex); + void writeTerm(Term* term); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermVector.h b/src/assistant/3rdparty/clucene/src/CLucene/index/TermVector.h new file mode 100644 index 000000000..8601fbf53 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermVector.h @@ -0,0 +1,418 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_index_termvector_h +#define _lucene_index_termvector_h + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" +#include "CLucene/store/IndexOutput.h" +#include "FieldInfos.h" + +CL_NS_DEF(index) + +struct TermVectorOffsetInfo; +class TermPositionVector; + +// Provides access to stored term vector of a document field. +class TermFreqVector : LUCENE_BASE +{ +public: + virtual ~TermFreqVector() {} + + // @return The field this vector is associated with. + virtual const TCHAR* getField() = 0; + + // @return The number of terms in the term vector. + virtual int32_t size() = 0; + + // @return An Array of term texts in ascending order. + virtual const TCHAR** getTerms() = 0; + + + /* Array of term frequencies. Locations of the array correspond one to one + * to the terms in the array obtained from getTerms + * method. Each location in the array contains the number of times this + * term occurs in the document or the document field. + * + * The size of the returned array is size() + * @memory Returning a pointer to internal data. Do not delete. + */ + virtual const Array* getTermFrequencies() = 0; + + + /* Return an index in the term numbers array returned from + * getTerms at which the term with the specified + * term appears. If this term does not appear in the array, + * return -1. + */ + virtual int32_t indexOf(const TCHAR* term) = 0; + + + /* Just like indexOf(int32_t) but searches for a number of terms + * at the same time. Returns an array that has the same size as the number + * of terms searched for, each slot containing the result of searching for + * that term number. + * + * @param terms array containing terms to look for + * @param start index in the array where the list of terms starts + * @param len the number of terms in the list + */ + virtual void indexesOf(const TCHAR** terms, const int32_t start, + const int32_t len, Array& ret) = 0; + + // Solve the diamond inheritence problem by providing a reinterpret function. + // No dynamic casting is required and no RTTI data is needed to do this + virtual TermPositionVector* __asTermPositionVector() = 0; +}; + + +/** +* Writer works by opening a document and then opening the fields within the document and then +* writing out the vectors for each field. +* +* Rough usage: +* + +for each document +{ +writer.openDocument(); +for each field on the document +{ +writer.openField(field); +for all of the terms +{ +writer.addTerm(...) +} +writer.closeField +} +writer.closeDocument() +} + +*/ +class TermVectorsWriter : LUCENE_BASE +{ +private: + class TVField : LUCENE_BASE + { + public: + int32_t number; + int64_t tvfPointer; + int32_t length; // number of distinct term positions + bool storePositions; + bool storeOffsets; + + TVField(int32_t number, bool storePos, bool storeOff) + : tvfPointer(0) + , length(0) + { + this->number = number; + this->storePositions = storePos; + this->storeOffsets = storeOff; + } + ~TVField() {} + }; + + class TVTerm : LUCENE_BASE + { + const TCHAR* termText; + int32_t termTextLen; //textlen cache + + public: + TVTerm(); + ~TVTerm(); + + int32_t freq; + Array* positions; + Array* offsets; + + const TCHAR* getTermText() const; + size_t getTermTextLen(); + void setTermText(const TCHAR* val); + }; + + CL_NS(store)::IndexOutput* tvx, *tvd, *tvf; + CL_NS(util)::CLVector > fields; + CL_NS(util)::CLVector > terms; + FieldInfos* fieldInfos; + + TVField* currentField; + int64_t currentDocPointer; + + void addTermInternal(const TCHAR* termText, const int32_t freq, + Array* positions, Array* offsets); + + void writeField(); + void writeDoc(); + + void openField(int32_t fieldNumber, bool storePositionWithTermVector, + bool storeOffsetWithTermVector); + +public: + LUCENE_STATIC_CONSTANT(int32_t, FORMAT_VERSION = 2); + + // The size in bytes that the FORMAT_VERSION will take up at the beginning + // of each file + LUCENE_STATIC_CONSTANT(int32_t, FORMAT_SIZE = 4); + + LUCENE_STATIC_CONSTANT(uint8_t, STORE_POSITIONS_WITH_TERMVECTOR = 0x1); + LUCENE_STATIC_CONSTANT(uint8_t, STORE_OFFSET_WITH_TERMVECTOR = 0x2); + + static const QLatin1String LUCENE_TVX_EXTENSION; + static const QLatin1String LUCENE_TVD_EXTENSION; + static const QLatin1String LUCENE_TVF_EXTENSION; + + TermVectorsWriter(CL_NS(store)::Directory* directory, const QString& segment, + FieldInfos* fieldInfos); + + ~TermVectorsWriter(); + void openDocument(); + void closeDocument(); + + /** Close all streams. */ + void close(); + bool isDocumentOpen() const; + + /** Start processing a field. This can be followed by a number of calls to + * addTerm, and a final call to closeField to indicate the end of + * processing of this field. If a field was previously open, it is + * closed automatically. + */ + void openField(const TCHAR* field); + + /** Finished processing current field. This should be followed by a call to + * openField before future calls to addTerm. + */ + void closeField(); + + /** Return true if a field is currently open. */ + bool isFieldOpen() const; + + /** + * Add a complete document specified by all its term vectors. If document has no + * term vectors, add value for tvx. + * + * @param vectors + * @throws IOException + */ + void addAllDocVectors(Array& vectors); + + /** Add term to the field's term vector. Field must already be open. + * Terms should be added in + * increasing order of terms, one call per unique termNum. ProxPointer + * is a pointer into the TermPosition file (prx). Freq is the number of + * times this term appears in this field, in this document. + * @throws IllegalStateException if document or field is not open + */ + void addTerm(const TCHAR* termText, int32_t freq, + Array* positions = NULL, Array* offsets = NULL); +}; + +class SegmentTermVector : public virtual TermFreqVector +{ +private: + const TCHAR* field; + TCHAR** terms; + int32_t termsLen; //cache + Array* termFreqs; + + int32_t binarySearch(TCHAR** a, const int32_t arraylen, const TCHAR* key) const; +public: + //note: termFreqs must be the same length as terms + SegmentTermVector(const TCHAR* field, TCHAR** terms, Array* termFreqs); + virtual ~SegmentTermVector(); + + /** + * + * @return The number of the field this vector is associated with + */ + const TCHAR* getField(); + TCHAR* toString() const; + int32_t size(); + const TCHAR** getTerms(); + const Array* getTermFrequencies(); + int32_t indexOf(const TCHAR* termText); + void indexesOf(const TCHAR** termNumbers, const int32_t start, const int32_t len, Array& ret); + + virtual TermPositionVector* __asTermPositionVector(); +}; + +class TermVectorsReader : LUCENE_BASE +{ +private: + FieldInfos* fieldInfos; + + CL_NS(store)::IndexInput* tvx; + CL_NS(store)::IndexInput* tvd; + CL_NS(store)::IndexInput* tvf; + int64_t _size; + + int32_t tvdFormat; + int32_t tvfFormat; + + + int32_t checkValidFormat(CL_NS(store)::IndexInput* in); + + void readTermVectors(const TCHAR** fields, const int64_t* tvfPointers, + const int32_t len, Array& _return); + + /** + * + * @param field The field to read in + * @param tvfPointer The pointer within the tvf file where we should start reading + * @return The TermVector located at that position + * @throws IOException + */ + SegmentTermVector* readTermVector(const TCHAR* field, const int64_t tvfPointer); + + int64_t size(); + + + DEFINE_MUTEX(THIS_LOCK) + TermVectorsReader(const TermVectorsReader& copy); +public: + TermVectorsReader(CL_NS(store)::Directory* d, const QString& segment, + FieldInfos* fieldInfos); + ~TermVectorsReader(); + + void close(); + TermVectorsReader* clone() const; + + /** + * Retrieve the term vector for the given document and field + * @param docNum The document number to retrieve the vector for + * @param field The field within the document to retrieve + * @return The TermFreqVector for the document and field or null if there is no termVector for this field. + * @throws IOException if there is an error reading the term vector files + */ + TermFreqVector* get(const int32_t docNum, const TCHAR* field); + + + /** + * Return all term vectors stored for this document or null if the could not be read in. + * + * @param docNum The document number to retrieve the vector for + * @return All term frequency vectors + * @throws IOException if there is an error reading the term vector files + */ + bool get(int32_t docNum, Array& result); +}; + + +struct TermVectorOffsetInfo +{ + int startOffset; + int endOffset; + +public: + static Array EMPTY_OFFSET_INFO; + TermVectorOffsetInfo(); + ~TermVectorOffsetInfo(); + TermVectorOffsetInfo(int32_t startOffset, int32_t endOffset); + int32_t getEndOffset() const; + void setEndOffset(int32_t endOffset); + int32_t getStartOffset() const; + void setStartOffset(int32_t startOffset); + bool equals(TermVectorOffsetInfo* o); + size_t hashCode() const; +}; + + +/* Extends TermFreqVector to provide additional information about + * positions in which each of the terms is found. A TermPositionVector not + * necessarily contains both positions and offsets, but at least one of these + * arrays exists. +*/ +class TermPositionVector : public virtual TermFreqVector +{ +public: + + /** Returns an array of positions in which the term is found. + * Terms are identified by the index at which its number appears in the + * term String array obtained from the indexOf method. + * May return null if positions have not been stored. + */ + virtual Array* getTermPositions(int32_t index) = 0; + + /** + * Returns an array of TermVectorOffsetInfo in which the term is found. + * May return null if offsets have not been stored. + * + * @see org.apache.lucene.analysis.Token + * + * @param index The position in the array to get the offsets from + * @return An array of TermVectorOffsetInfo objects or the empty list + */ + virtual Array* getOffsets(int32_t index) = 0; + + virtual ~TermPositionVector(){ + } +}; + + +class SegmentTermPositionVector: public SegmentTermVector, public TermPositionVector +{ +protected: + Array< Array >* positions; + Array< Array >* offsets; + static Array EMPTY_TERM_POS; +public: + SegmentTermPositionVector(const TCHAR* field, TCHAR** terms, + Array* termFreqs, Array< Array >* positions, + Array< Array >* offsets); + ~SegmentTermPositionVector(); + + /** + * Returns an array of TermVectorOffsetInfo in which the term is found. + * + * @param index The position in the array to get the offsets from + * @return An array of TermVectorOffsetInfo objects or the empty list + * @see org.apache.lucene.analysis.Token + */ + Array* getOffsets(int32_t index); + + /** + * Returns an array of positions in which the term is found. + * Terms are identified by the index at which its number appears in the + * term String array obtained from the indexOf method. + */ + Array* getTermPositions(int32_t index); + + const TCHAR* getField() { + return SegmentTermVector::getField(); } + + TCHAR* toString() const { + return SegmentTermVector::toString(); } + + int32_t size() { + return SegmentTermVector::size(); } + + const TCHAR** getTerms() { + return SegmentTermVector::getTerms(); } + + const Array* getTermFrequencies() { + return SegmentTermVector::getTermFrequencies(); } + + int32_t indexOf(const TCHAR* termText) { + return SegmentTermVector::indexOf(termText); } + + void indexesOf(const TCHAR** termNumbers, const int32_t start, + const int32_t len, Array& ret) { + SegmentTermVector::indexesOf(termNumbers, start, len, ret); } + + virtual TermPositionVector* __asTermPositionVector(); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp new file mode 100644 index 000000000..53d909b29 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorReader.cpp @@ -0,0 +1,393 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "TermVector.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(index) + +TermVectorsReader::TermVectorsReader(CL_NS(store)::Directory* d, + const QString& segment, FieldInfos* fieldInfos) +{ + if (d->fileExists(segment + TermVectorsWriter::LUCENE_TVX_EXTENSION)) { + tvx = d->openInput(segment + TermVectorsWriter::LUCENE_TVX_EXTENSION); + checkValidFormat(tvx); + + tvd = d->openInput(segment + TermVectorsWriter::LUCENE_TVD_EXTENSION); + tvdFormat = checkValidFormat(tvd); + + tvf = d->openInput(segment + TermVectorsWriter::LUCENE_TVF_EXTENSION); + tvfFormat = checkValidFormat(tvf); + + _size = tvx->length() / 8; + }else{ + tvx = NULL; + tvd = NULL; + tvf = NULL; + _size = 0; + } + + this->fieldInfos = fieldInfos; +} + +TermVectorsReader::TermVectorsReader(const TermVectorsReader& copy) +{ + tvx = copy.tvx->clone(); + tvd = copy.tvd->clone(); + tvf = copy.tvf->clone(); + + tvdFormat = copy.tvdFormat; + tvfFormat = copy.tvfFormat; + _size = copy._size; + fieldInfos = copy.fieldInfos; +} +TermVectorsReader* TermVectorsReader::clone() const{ + if (tvx == NULL || tvd == NULL || tvf == NULL) + return NULL; + return _CLNEW TermVectorsReader(*this); +} + +TermVectorsReader::~TermVectorsReader(){ + close(); +} + +void TermVectorsReader::close(){ + // why don't we trap the exception and at least make sure that + // all streams that we can close are closed? + CLuceneError keep(0,"",false); + bool thrown = false; + + if (tvx != NULL){ + try{ + tvx->close(); + }catch(CLuceneError& err){ + if ( err.number() == CL_ERR_IO ){ + keep = err; + thrown = true; + }else + throw err; + } + _CLDELETE(tvx);//delete even if error thrown + } + if (tvd != NULL){ + try{ + tvd->close(); + }catch(CLuceneError& err){ + if ( err.number() == CL_ERR_IO ){ + keep = err; + thrown = true; + }else + throw err; + } + _CLDELETE(tvd); + } + if (tvf != NULL){ + try{ + tvf->close(); + }catch(CLuceneError& err){ + if ( err.number() == CL_ERR_IO ){ + keep = err; + thrown = true; + }else + throw err; + } + _CLDELETE(tvf); + } + + if ( thrown ) + throw keep; +} + +TermFreqVector* TermVectorsReader::get(const int32_t docNum, const TCHAR* field){ + // Check if no term vectors are available for this segment at all + int32_t fieldNumber = fieldInfos->fieldNumber(field); + TermFreqVector* result = NULL; + if (tvx != NULL) { + //We need to account for the FORMAT_SIZE at when seeking in the tvx + //We don't need to do this in other seeks because we already have the + // file pointer + //that was written in another file + tvx->seek((docNum * 8L) + TermVectorsWriter::FORMAT_SIZE); + int64_t position = tvx->readLong(); + + tvd->seek(position); + int32_t fieldCount = tvd->readVInt(); + // There are only a few fields per document. We opt for a full scan + // rather then requiring that they be ordered. We need to read through + // all of the fields anyway to get to the tvf pointers. + int32_t number = 0; + int32_t found = -1; + for (int32_t i = 0; i < fieldCount; ++i) { + if(tvdFormat == TermVectorsWriter::FORMAT_VERSION) + number = tvd->readVInt(); + else + number += tvd->readVInt(); + if (number == fieldNumber) + found = i; + } + + // This field, although valid in the segment, was not found in this + // document + if (found != -1) { + // Compute position in the tvf file + position = 0; + for (int32_t i = 0; i <= found; ++i) + position += tvd->readVLong(); + result = readTermVector(field, position); + } + } + return result; +} + + +bool TermVectorsReader::get(int32_t docNum, Array& result){ + // Check if no term vectors are available for this segment at all + if (tvx != NULL) { + //We need to offset by + tvx->seek((docNum * 8L) + TermVectorsWriter::FORMAT_SIZE); + int64_t position = tvx->readLong(); + + tvd->seek(position); + int32_t fieldCount = tvd->readVInt(); + + // No fields are vectorized for this document + if (fieldCount != 0) { + int32_t number = 0; + const TCHAR** fields = _CL_NEWARRAY(const TCHAR*,fieldCount+1); + + { //msvc6 scope fix + for (int32_t i = 0; i < fieldCount; ++i) { + if(tvdFormat == TermVectorsWriter::FORMAT_VERSION) + number = tvd->readVInt(); + else + number += tvd->readVInt(); + fields[i] = fieldInfos->fieldName(number); + } + } + fields[fieldCount]=NULL; + + // Compute position in the tvf file + position = 0; + int64_t* tvfPointers = _CL_NEWARRAY(int64_t,fieldCount); + { //msvc6 scope fix + for (int32_t i = 0; i < fieldCount; ++i) { + position += tvd->readVLong(); + tvfPointers[i] = position; + } + } + + readTermVectors(fields, tvfPointers, fieldCount, result); + _CLDELETE_ARRAY(tvfPointers); + _CLDELETE_ARRAY(fields); + } + return true; + } + return false; +} + + +int32_t TermVectorsReader::checkValidFormat(CL_NS(store)::IndexInput* in) +{ + int32_t format = in->readInt(); + if (format > TermVectorsWriter::FORMAT_VERSION) + { + CL_NS(util)::StringBuffer err; + err.append(_T("Incompatible format version: ")); + err.appendInt(format); + err.append(_T(" expected ")); + err.appendInt(TermVectorsWriter::FORMAT_VERSION); + err.append(_T(" or less")); + _CLTHROWT(CL_ERR_Runtime,err.getBuffer()); + } + return format; +} + +void TermVectorsReader::readTermVectors(const TCHAR** fields, + const int64_t* tvfPointers, const int32_t len, Array& result) +{ + result.length = len; + result.values = _CL_NEWARRAY(TermFreqVector*,len); + for (int32_t i = 0; i < len; ++i) { + result.values[i] = readTermVector(fields[i], tvfPointers[i]); + } +} + +SegmentTermVector* TermVectorsReader::readTermVector(const TCHAR* field, + const int64_t tvfPointer) +{ + // Now read the data from specified position. We don't need to offset by + // the FORMAT here since the pointer already includes the offset + tvf->seek(tvfPointer); + + int32_t numTerms = tvf->readVInt(); + // If no terms - return a constant empty termvector. However, this should never occur! + if (numTerms == 0) + return _CLNEW SegmentTermVector(field, NULL, NULL); + + bool storePositions; + bool storeOffsets; + + if(tvfFormat == TermVectorsWriter::FORMAT_VERSION){ + uint8_t bits = tvf->readByte(); + storePositions = (bits & TermVectorsWriter::STORE_POSITIONS_WITH_TERMVECTOR) != 0; + storeOffsets = (bits & TermVectorsWriter::STORE_OFFSET_WITH_TERMVECTOR) != 0; + } + else{ + tvf->readVInt(); + storePositions = false; + storeOffsets = false; + } + + TCHAR** terms = _CL_NEWARRAY(TCHAR*,numTerms+1); + Array* termFreqs = _CLNEW Array(numTerms); + + // we may not need these, but declare them + Array< Array >* positions = NULL; + Array< Array >* offsets = NULL; + if(storePositions){ + Array* tmp = _CL_NEWARRAY(Array,numTerms); + positions = _CLNEW Array< Array >(tmp, numTerms); + } + if(storeOffsets){ + Array* tmp = _CL_NEWARRAY(Array,numTerms); + offsets = _CLNEW Array< Array >(tmp, numTerms); + } + + int32_t start = 0; + int32_t deltaLength = 0; + int32_t totalLength = 0; + int32_t bufferLen=10; // init the buffer with a length of 10 character + TCHAR* buffer = (TCHAR*)malloc(bufferLen * sizeof(TCHAR)); + + for (int32_t i = 0; i < numTerms; ++i) { + start = tvf->readVInt(); + deltaLength = tvf->readVInt(); + totalLength = start + deltaLength; + if (bufferLen < totalLength) // increase buffer + { + buffer=(TCHAR*)realloc(buffer,totalLength * sizeof(TCHAR)); + bufferLen = totalLength; + } + + //read the term + tvf->readChars(buffer, start, deltaLength); + terms[i] = _CL_NEWARRAY(TCHAR,totalLength+1); + _tcsncpy(terms[i],buffer,totalLength); + terms[i][totalLength] = '\0'; //null terminate term + + //read the frequency + int32_t freq = tvf->readVInt(); + termFreqs->values[i] = freq; + + if (storePositions) { //read in the positions + Array& pos = positions->values[i]; + pos.length = freq; + pos.values = _CL_NEWARRAY(int32_t,freq); + + int32_t prevPosition = 0; + for (int32_t j = 0; j < freq; ++j) + { + pos.values[j] = prevPosition + tvf->readVInt(); + prevPosition = pos.values[j]; + } + } + + if (storeOffsets) { + Array& offs = offsets->values[i]; + offs.length = freq; + offs.values = _CL_NEWARRAY(TermVectorOffsetInfo,freq); + + int32_t prevOffset = 0; + for (int32_t j = 0; j < freq; ++j) { + int32_t startOffset = prevOffset + tvf->readVInt(); + int32_t endOffset = startOffset + tvf->readVInt(); + offs.values[j].setStartOffset(startOffset); + offs.values[j].setEndOffset(endOffset); + prevOffset = endOffset; + } + } + } + free(buffer); + terms[numTerms]=NULL; //null terminate terms array + + SegmentTermVector* tv = NULL; + if (storePositions || storeOffsets){ + return _CLNEW SegmentTermPositionVector(field, terms, termFreqs, positions, offsets); + }else { + return _CLNEW SegmentTermVector(field, terms, termFreqs); + } +} + +int64_t TermVectorsReader::size() +{ + return _size; +} + + + + +Array TermVectorOffsetInfo::EMPTY_OFFSET_INFO; + +TermVectorOffsetInfo::TermVectorOffsetInfo() +{ + startOffset = 0; + endOffset=0; +} + +TermVectorOffsetInfo::~TermVectorOffsetInfo() +{ +} + +TermVectorOffsetInfo::TermVectorOffsetInfo(int32_t startOffset, int32_t endOffset) +{ + this->endOffset = endOffset; + this->startOffset = startOffset; +} + +int32_t TermVectorOffsetInfo::getEndOffset() const +{ + return endOffset; +} + +void TermVectorOffsetInfo::setEndOffset(int32_t endOffset) +{ + this->endOffset = endOffset; +} + +int32_t TermVectorOffsetInfo::getStartOffset() const +{ + return startOffset; +} + +void TermVectorOffsetInfo::setStartOffset(int32_t startOffset) +{ + this->startOffset = startOffset; +} + +bool TermVectorOffsetInfo::equals(TermVectorOffsetInfo* termVectorOffsetInfo) +{ + if (this == termVectorOffsetInfo) + return true; + + if (endOffset != termVectorOffsetInfo->endOffset) return false; + if (startOffset != termVectorOffsetInfo->startOffset) return false; + + return true; +} + +size_t TermVectorOffsetInfo::hashCode() const +{ + size_t result; + result = startOffset; + result = 29 * result + endOffset; + return result; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp new file mode 100644 index 000000000..276b1bbd0 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/TermVectorWriter.cpp @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "TermVector.h" +#include "CLucene/util/Misc.h" + +CL_NS_USE(util) +CL_NS_DEF(index) + +const QLatin1String TermVectorsWriter::LUCENE_TVX_EXTENSION(".tvx"); +const QLatin1String TermVectorsWriter::LUCENE_TVD_EXTENSION(".tvd"); +const QLatin1String TermVectorsWriter::LUCENE_TVF_EXTENSION(".tvf"); + +TermVectorsWriter::TermVectorsWriter(CL_NS(store)::Directory* directory, + const QString& segment,FieldInfos* fieldInfos) +{ + // Open files for TermVector storage + tvx = directory->createOutput(segment + LUCENE_TVX_EXTENSION); + tvx->writeInt(FORMAT_VERSION); + + tvd = directory->createOutput(segment + LUCENE_TVD_EXTENSION); + tvd->writeInt(FORMAT_VERSION); + + tvf = directory->createOutput(segment + LUCENE_TVF_EXTENSION); + tvf->writeInt(FORMAT_VERSION); + + this->fieldInfos = fieldInfos; + + currentField = NULL; + currentDocPointer = -1; +} + +TermVectorsWriter::~TermVectorsWriter() +{ + if (tvx != NULL) { + tvx->close(); + _CLDELETE(tvx); + } + + if (tvd != NULL) { + tvd->close(); + _CLDELETE(tvd); + } + + if (tvf != NULL){ + tvf->close(); + _CLDELETE(tvf); + } +} + +void TermVectorsWriter::openDocument() +{ + closeDocument(); + currentDocPointer = tvd->getFilePointer(); +} + +void TermVectorsWriter::closeDocument() +{ + if (isDocumentOpen()) { + closeField(); + writeDoc(); + fields.clear(); + currentDocPointer = -1; + } +} + +bool TermVectorsWriter::isDocumentOpen() const +{ + return currentDocPointer != -1; +} + + +void TermVectorsWriter::openField(int32_t fieldNumber, + bool storePositionWithTermVector, bool storeOffsetWithTermVector) +{ + if (!isDocumentOpen()) + _CLTHROWA(CL_ERR_InvalidState,"Cannot open field when no document is open."); + + closeField(); + currentField = _CLNEW TVField(fieldNumber, storePositionWithTermVector, + storeOffsetWithTermVector); +} + +void TermVectorsWriter::openField(const TCHAR* field) +{ + FieldInfo* fieldInfo = fieldInfos->fieldInfo(field); + openField(fieldInfo->number, fieldInfo->storePositionWithTermVector, + fieldInfo->storeOffsetWithTermVector); +} + +void TermVectorsWriter::closeField() +{ + if (isFieldOpen()) { + /* DEBUG */ + //System.out.println("closeField()"); + /* DEBUG */ + + // save field and terms + writeField(); + fields.push_back(currentField); + terms.clear(); + currentField = NULL; + } +} + +bool TermVectorsWriter::isFieldOpen() const +{ + return currentField != NULL; +} + +void TermVectorsWriter::addTerm(const TCHAR* termText, int32_t freq, + Array* positions, Array* offsets) +{ + if (!isDocumentOpen()) + _CLTHROWA(CL_ERR_InvalidState, "Cannot add terms when document is not open"); + + if (!isFieldOpen()) + _CLTHROWA(CL_ERR_InvalidState, "Cannot add terms when field is not open"); + + addTermInternal(termText, freq, positions, offsets); +} + +void TermVectorsWriter::addTermInternal(const TCHAR* termText, int32_t freq, + Array* positions, Array* offsets) +{ + TVTerm* term = _CLNEW TVTerm(); + term->setTermText(termText); + term->freq = freq; + term->positions = positions; + term->offsets = offsets; + terms.push_back(term); +} + +void TermVectorsWriter::addAllDocVectors(Array& vectors) +{ + openDocument(); + + for (int32_t i = 0; i < vectors.length; ++i) { + bool storePositionWithTermVector = false; + bool storeOffsetWithTermVector = false; + + if ( vectors[i]->__asTermPositionVector() != NULL ) { + TermPositionVector* tpVector = vectors[i]->__asTermPositionVector(); + + if (tpVector->size() > 0 && tpVector->getTermPositions(0) != NULL) + storePositionWithTermVector = true; + if (tpVector->size() > 0 && tpVector->getOffsets(0) != NULL) + storeOffsetWithTermVector = true; + + FieldInfo* fieldInfo = fieldInfos->fieldInfo(tpVector->getField()); + openField(fieldInfo->number, storePositionWithTermVector, storeOffsetWithTermVector); + + for (int32_t j = 0; j < tpVector->size(); ++j) + addTermInternal(tpVector->getTerms()[j], + (*tpVector->getTermFrequencies())[j], + tpVector->getTermPositions(j), + tpVector->getOffsets(j)); + + closeField(); + + } else { + TermFreqVector* tfVector = vectors[i]; + + FieldInfo* fieldInfo = fieldInfos->fieldInfo(tfVector->getField()); + openField(fieldInfo->number, storePositionWithTermVector, storeOffsetWithTermVector); + + for (int32_t j = 0; j < tfVector->size(); ++j) + addTermInternal(tfVector->getTerms()[j], + (*tfVector->getTermFrequencies())[j], NULL, NULL); + + closeField(); + } + } + + closeDocument(); +} + + +void TermVectorsWriter::close() +{ + try { + closeDocument(); + + // make an effort to close all streams we can but remember and re-throw + // the first exception encountered in this process +#define _DOTVWCLOSE(x) \ + if (x != NULL) { \ + try { \ + x->close(); \ + _CLDELETE(x) \ + } catch (CLuceneError& e) { \ + if ( e.number() != CL_ERR_IO ) \ + throw e; \ + if (ikeep == 0) \ + ikeep = e.number(); \ + if (keep[0] == 0) \ + strcpy(keep,e.what()); \ + } catch (...) { \ + if (keep[0] == 0) \ + strcpy(keep, "Unknown error while closing " #x);\ + } \ + } + } _CLFINALLY ( \ + char keep[200]; + int32_t ikeep = 0; + keep[0] = 0; + _DOTVWCLOSE(tvx); + _DOTVWCLOSE(tvd); + _DOTVWCLOSE(tvf); + if (keep[0] != 0) + _CLTHROWA(ikeep, keep); + ); +} + +void TermVectorsWriter::writeField() +{ + // remember where this field is written + currentField->tvfPointer = tvf->getFilePointer(); + //System.out.println("Field Pointer: " + currentField.tvfPointer); + int32_t size = terms.size(); + + tvf->writeVInt(size); + + bool storePositions = currentField->storePositions; + bool storeOffsets = currentField->storeOffsets; + uint8_t bits = 0x0; + if (storePositions) + bits |= STORE_POSITIONS_WITH_TERMVECTOR; + if (storeOffsets) + bits |= STORE_OFFSET_WITH_TERMVECTOR; + tvf->writeByte(bits); + + const TCHAR* lastTermText = LUCENE_BLANK_STRING; + int32_t lastTermTextLen = 0; + + for (int32_t i = 0; i < size; ++i) { + TVTerm* term = terms[i]; + int32_t start = CL_NS(util)::Misc::stringDifference(lastTermText, + lastTermTextLen, term->getTermText(),term->getTermTextLen()); + int32_t length = term->getTermTextLen() - start; + tvf->writeVInt(start); // write shared prefix length + tvf->writeVInt(length); // write delta length + tvf->writeChars(term->getTermText(), start, length); // write delta chars + tvf->writeVInt(term->freq); + + lastTermText = term->getTermText(); + lastTermTextLen = term->getTermTextLen(); + + if (storePositions) { + if(term->positions == NULL) + _CLTHROWA(CL_ERR_IllegalState, "Trying to write positions that are NULL!"); + + // use delta encoding for positions + int32_t position = 0; + for (int32_t j = 0; j < term->freq; ++j){ + tvf->writeVInt((*term->positions)[j] - position); + position = (*term->positions)[j]; + } + } + + if (storeOffsets) { + if(term->offsets == NULL) + _CLTHROWA(CL_ERR_IllegalState, "Trying to write offsets that are NULL!"); + + // use delta encoding for offsets + int32_t position = 0; + for (int32_t j = 0; j < term->freq; ++j) { + tvf->writeVInt((*term->offsets)[j].getStartOffset() - position); + //Save the diff between the two. + tvf->writeVInt((*term->offsets)[j].getEndOffset() - + (*term->offsets)[j].getStartOffset()); + position = (*term->offsets)[j].getEndOffset(); + } + } + } +} + +void TermVectorsWriter::writeDoc() +{ + if (isFieldOpen()) { + _CLTHROWA(CL_ERR_InvalidState, + "Field is still open while writing document"); + } + + // write document index record + tvx->writeLong(currentDocPointer); + + // write document data record + int32_t size = fields.size(); + + // write the number of fields + tvd->writeVInt(size); + + // write field numbers + for (int32_t j = 0; j < size; ++j) { + tvd->writeVInt(fields[j]->number); + } + + // write field pointers + int64_t lastFieldPointer = 0; + for (int32_t i = 0; i < size; ++i) { + TVField* field = (TVField*) fields[i]; + tvd->writeVLong(field->tvfPointer - lastFieldPointer); + + lastFieldPointer = field->tvfPointer; + } +} + +const TCHAR* TermVectorsWriter::TVTerm::getTermText() const +{ + return termText; +} + +size_t TermVectorsWriter::TVTerm::getTermTextLen() +{ + if (termTextLen==-1) + termTextLen = _tcslen(termText); + return termTextLen; +} + +void TermVectorsWriter::TVTerm::setTermText(const TCHAR* val) +{ + _CLDELETE_CARRAY(termText); + termText = STRDUP_TtoT(val); + termTextLen = -1; + +} + +TermVectorsWriter::TVTerm::TVTerm() + : freq(0) + , positions(NULL) + , offsets(NULL) +{ + termText=NULL; + termTextLen=-1; +} + +TermVectorsWriter::TVTerm::~TVTerm() +{ + _CLDELETE_CARRAY(termText) +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/index/Terms.h b/src/assistant/3rdparty/clucene/src/CLucene/index/Terms.h new file mode 100644 index 000000000..806441876 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/index/Terms.h @@ -0,0 +1,174 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_Terms_ +#define _lucene_index_Terms_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Term.h" +CL_NS_DEF(index) + +class TermEnum; //predefine +class TermPositions; + +/** TermDocs provides an interface for enumerating <document, frequency> + pairs for a term.

The document portion names each document containing + the term. Documents are indicated by number. The frequency portion gives + the number of times the term occurred in each document.

The pairs are + ordered by document number. + + @see IndexReader#termDocs() + */ +class TermDocs: LUCENE_BASE { +public: + virtual ~TermDocs(){ + } + + // Sets this to the data for a term. + // The enumeration is reset to the start of the data for this term. + virtual void seek(Term* term)=0; + + /** Sets this to the data for the current term in a {@link TermEnum}. + * This may be optimized in some implementations. + */ + virtual void seek(TermEnum* termEnum)=0; + + // Returns the current document number.

This is invalid until {@link + // #next()} is called for the first time. + virtual int32_t doc() const=0; + + // Returns the frequency of the term within the current document.

This + // is invalid until {@link #next()} is called for the first time. + virtual int32_t freq() const=0; + + // Moves to the next pair in the enumeration.

Returns true iff there is + // such a next pair in the enumeration. + virtual bool next() =0; + + // Attempts to read multiple entries from the enumeration, up to length of + // docs. Document numbers are stored in docs, and term + // frequencies are stored in freqs. The freqs array must be as + // int64_t as the docs array. + // + //

Returns the number of entries read. Zero is only returned when the + // stream has been exhausted. + virtual int32_t read(int32_t* docs, int32_t* freqs, int32_t length)=0; + + // Skips entries to the first beyond the current whose document number is + // greater than or equal to target.

Returns true iff there is such + // an entry.

Behaves as if written:

+	//   bool skipTo(int32_t target) {
+	//     do {
+	//       if (!next())
+	// 	     return false;
+	//     } while (target > doc());
+	//     return true;
+	//   }
+	// 
+ // Some implementations are considerably more efficient than that. + virtual bool skipTo(const int32_t target)=0; + + // Frees associated resources. + virtual void close() = 0; + + + /** Solve the diamond inheritence problem by providing a reinterpret function. + * No dynamic casting is required and no RTTI data is needed to do this + */ + virtual TermPositions* __asTermPositions()=0; +}; + + +// Abstract class for enumerating terms. +// +//

Term enumerations are always ordered by Term.compareTo(). Each term in +//the enumeration is greater than all that precede it. +class TermEnum: LUCENE_BASE { +public: + // Increments the enumeration to the next element. True if one exists. + virtual bool next()=0; + + // Returns a pointer to the current Term in the enumeration. + virtual Term* term()=0; + + // Returns the current Term in the enumeration. + virtual Term* term(bool pointer){ + Term* ret = term(); + if ( !pointer ) + ret->__cl_decref(); + return ret; + } + + // Returns the docFreq of the current Term in the enumeration. + virtual int32_t docFreq() const=0; + + // Closes the enumeration to further activity, freeing resources. + virtual void close() =0; + + virtual ~TermEnum(){ + } + + // Term Vector support + /** Skips terms to the first beyond the current whose value is + * greater or equal to target.

Returns true iff there is such + * an entry.

Behaves as if written:

+	*   public boolean skipTo(Term target) {
+	*     do {
+	*       if (!next())
+	* 	     return false;
+	*     } while (target > term());
+	*     return true;
+	*   }
+	* 
+ * Some implementations are considerably more efficient than that. + */ + virtual bool skipTo(Term* target){ + do { + if (!next()) + return false; + } while (target->compareTo(term(false)) > 0); + return true; + } + + /** + * Because we need to know how to cast the object, we need the objects name. + */ + virtual const char* getObjectName() = 0; +}; + + + +/** + * TermPositions provides an interface for enumerating the <document, + * frequency, <position>* > tuples for a term.

The document and + * frequency are the same as for a TermDocs. The positions portion lists the ordinal + * positions of each occurrence of a term in a document. + * + * @see IndexReader#termPositions() + */ +class TermPositions: public virtual TermDocs { +public: + // Returns next position in the current document. It is an error to call + // this more than {@link #freq()} times + // without calling {@link #next()}

This is + // invalid until {@link #next()} is called for + // the first time. + virtual int32_t nextPosition() = 0; + + virtual ~TermPositions(){ + } + + /** Solve the diamond inheritence problem by providing a reinterpret function. + * No dynamic casting is required and no RTTI data is needed to do this + */ + virtual TermDocs* __asTermDocs()=0; + virtual TermPositions* __asTermPositions()=0; +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp new file mode 100644 index 000000000..861c5d3cb --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.cpp @@ -0,0 +1,371 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Lexer.h" + +#include "CLucene/util/FastCharStream.h" +#include "CLucene/util/Reader.h" +#include "CLucene/util/StringBuffer.h" +#include "TokenList.h" +#include "QueryToken.h" +#include "QueryParserBase.h" + +CL_NS_USE(util) + +CL_NS_DEF(queryParser) +Lexer::Lexer(QueryParserBase* queryparser, const TCHAR* query) { + //Func - Constructor + //Pre - query != NULL and contains the query string + //Post - An instance of Lexer has been created + + this->queryparser = queryparser; + + CND_PRECONDITION(query != NULL, "query is NULL"); + + //The InputStream of Reader must be destroyed in the destructor + delSR = true; + + StringReader *r = _CLNEW StringReader(query); + + //Check to see if r has been created properly + CND_CONDITION(r != NULL, "Could not allocate memory for StringReader r"); + + //Instantie a FastCharStream instance using r and assign it to reader + reader = _CLNEW FastCharStream(r); + + //Check to see if reader has been created properly + CND_CONDITION(reader != NULL, "Could not allocate memory for FastCharStream reader"); + + //The InputStream of Reader must be destroyed in the destructor + delSR = true; + +} + + +Lexer::Lexer(QueryParserBase* queryparser, Reader* source) { + //Func - Constructor + // Initializes a new instance of the Lexer class with the specified + // TextReader to lex. + //Pre - Source contains a valid reference to a Reader + //Post - An instance of Lexer has been created using source as the reader + + this->queryparser = queryparser; + + //Instantie a FastCharStream instance using r and assign it to reader + reader = _CLNEW FastCharStream(source); + + //Check to see if reader has been created properly + CND_CONDITION(reader != NULL, "Could not allocate memory for FastCharStream reader"); + + //The InputStream of Reader must not be destroyed in the destructor + delSR = false; +} + + +Lexer::~Lexer() { + //Func - Destructor + //Pre - true + //Post - if delSR was true the InputStream input of reader has been deleted + // The instance of Lexer has been destroyed + + if (delSR) { + _CLDELETE(reader->input); + } + + _CLDELETE(reader); +} + + +void Lexer::Lex(TokenList *tokenList) { + //Func - Breaks the input stream onto the tokens list tokens + //Pre - tokens != NULL and contains a TokenList in which the tokens can be stored + //Post - The tokens have been added to the TokenList tokens + + CND_PRECONDITION(tokenList != NULL, "tokens is NULL"); + + //Get all the tokens + while(true) { + //Add the token to the tokens list + + //Get the next token + QueryToken* token = _CLNEW QueryToken; + if ( !GetNextToken(token) ){ + _CLDELETE(token); + break; + } + tokenList->add(token); + } + + //The end has been reached so create an EOF_ token + //Add the final token to the TokenList _tokens + tokenList->add(_CLNEW QueryToken( QueryToken::EOF_)); +} + + +bool Lexer::GetNextToken(QueryToken* token) { + while(!reader->Eos()) { + int ch = reader->GetNext(); + + if ( ch == -1 ) + break; + + // skipping whitespaces + if( _istspace(ch)!=0 ) { + continue; + } + TCHAR buf[2] = {ch,'\0'}; + switch(ch) { + case '+': + token->set(buf, QueryToken::PLUS); + return true; + case '-': + token->set(buf, QueryToken::MINUS); + return true; + case '(': + token->set(buf, QueryToken::LPAREN); + return true; + case ')': + token->set(buf, QueryToken::RPAREN); + return true; + case ':': + token->set(buf, QueryToken::COLON); + return true; + case '!': + token->set(buf, QueryToken::NOT); + return true; + case '^': + token->set(buf, QueryToken::CARAT); + return true; + case '~': + if( _istdigit( reader->Peek() )!=0 ) { + TCHAR number[LUCENE_MAX_FIELD_LEN]; + ReadIntegerNumber(ch, number,LUCENE_MAX_FIELD_LEN); + token->set(number, QueryToken::SLOP); + return true; + }else{ + token->set(buf, QueryToken::FUZZY); + return true; + } + break; + case '"': + return ReadQuoted(ch, token); + case '[': + return ReadInclusiveRange(ch, token); + case '{': + return ReadExclusiveRange(ch, token); + case ']': + case '}': + case '*': + queryparser->throwParserException( _T("Unrecognized TCHAR %d at %d::%d."), + ch, reader->Column(), reader->Line() ); + return false; + default: + return ReadTerm(ch, token); + + // end of swith + } + + } + return false; +} + + +void Lexer::ReadIntegerNumber(const TCHAR ch, TCHAR* buf, int buflen) { + int bp=0; + buf[bp++] = ch; + + int c = reader->Peek(); + while( c!=-1 && _istdigit(c)!=0 && bpGetNext(); + c = reader->Peek(); + } + buf[bp++] = 0; +} + + +bool Lexer::ReadInclusiveRange(const TCHAR prev, QueryToken* token) { + int ch = prev; + StringBuffer range; + range.appendChar(ch); + + while(!reader->Eos()) { + ch = reader->GetNext(); + if ( ch == -1 ) + break; + range.appendChar(ch); + + if(ch == ']'){ + token->set(range.getBuffer(), QueryToken::RANGEIN); + return true; + } + } + queryparser->throwParserException(_T("Unterminated inclusive range! %d %d::%d"),' ', + reader->Column(),reader->Column()); + return false; +} + + +bool Lexer::ReadExclusiveRange(const TCHAR prev, QueryToken* token) { + int ch = prev; + StringBuffer range; + range.appendChar(ch); + + while(!reader->Eos()) { + ch = reader->GetNext(); + + if (ch==-1) + break; + range.appendChar(ch); + + if(ch == '}'){ + token->set(range.getBuffer(), QueryToken::RANGEEX); + return true; + } + } + queryparser->throwParserException(_T("Unterminated exclusive range! %d %d::%d"),' ', + reader->Column(),reader->Column() ); + return false; +} + +bool Lexer::ReadQuoted(const TCHAR prev, QueryToken* token) { + int ch = prev; + StringBuffer quoted; + quoted.appendChar(ch); + + while(!reader->Eos()) { + ch = reader->GetNext(); + + if (ch==-1) + break; + + quoted.appendChar(ch); + + if(ch == '"'){ + token->set(quoted.getBuffer(), QueryToken::QUOTED); + return true; + } + } + queryparser->throwParserException(_T("Unterminated string! %d %d::%d"),' ', + reader->Column(),reader->Column()); + return false; +} + + +bool Lexer::ReadTerm(const TCHAR prev, QueryToken* token) { + int ch = prev; + bool completed = false; + int32_t asteriskCount = 0; + bool hasQuestion = false; + + StringBuffer val; + TCHAR buf[3]; //used for readescaped + + while(true) { + switch(ch) { + case -1: + break; + case '\\': + { + if ( ReadEscape(ch, buf) ) + val.append( buf ); + else + return false; + } + break; + + case LUCENE_WILDCARDTERMENUM_WILDCARD_STRING: + asteriskCount++; + val.appendChar(ch); + break; + case LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR: + hasQuestion = true; + val.appendChar(ch); + break; + case '\n': + case '\t': + case ' ': + case '+': + case '-': + case '!': + case '(': + case ')': + case ':': + case '^': + case '[': + case ']': + case '{': + case '}': + case '~': + case '"': + // create new QueryToken + reader->UnGet(); + completed = true; + break; + default: + val.appendChar(ch); + break; + // end of switch + } + + if(completed || ch==-1 || reader->Eos() ) + break; + else + ch = reader->GetNext(); + } + + // create new QueryToken + if(hasQuestion) + token->set(val.getBuffer(), QueryToken::WILDTERM); + else if(asteriskCount == 1 && val.getBuffer()[val.length() - 1] == '*') + token->set(val.getBuffer(), QueryToken::PREFIXTERM); + else if(asteriskCount > 0) + token->set(val.getBuffer(), QueryToken::WILDTERM); + else if( _tcsicmp(val.getBuffer(), _T("AND"))==0 || _tcscmp(val.getBuffer(), _T("&&"))==0 ) + token->set(val.getBuffer(), QueryToken::AND_); + else if( _tcsicmp(val.getBuffer(), _T("OR"))==0 || _tcscmp(val.getBuffer(), _T("||"))==0) + token->set(val.getBuffer(), QueryToken::OR); + else if( _tcsicmp(val.getBuffer(), _T("NOT"))==0 ) + token->set(val.getBuffer(), QueryToken::NOT); + else { + bool isnum = true; + int32_t nlen=val.length(); + for (int32_t i=0;iset(val.getBuffer(), QueryToken::NUMBER); + else + token->set(val.getBuffer(), QueryToken::TERM); + } + return true; +} + + +bool Lexer::ReadEscape(TCHAR prev, TCHAR* buf) { + TCHAR ch = prev; + int bp=0; + buf[bp++] = ch; + + ch = reader->GetNext(); + int32_t idx = _tcscspn( buf, _T("\\+-!():^[]{}\"~*") ); + if(idx == 0) { + buf[bp++] = ch; + buf[bp++]=0; + return true; + } + queryparser->throwParserException(_T("Unrecognized escape sequence at %d %d::%d"), ' ', + reader->Column(),reader->Line()); + return false; +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.h b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.h new file mode 100644 index 000000000..b3b55523e --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/Lexer.h @@ -0,0 +1,67 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#ifndef _lucene_queryParser_Lexer_ +#define _lucene_queryParser_Lexer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/FastCharStream.h" +#include "CLucene/util/Reader.h" +#include "CLucene/util/StringBuffer.h" + +#include "TokenList.h" + +CL_NS_DEF(queryParser) +class QueryParserBase; + // A simple Lexer that is used by QueryParser. + class Lexer:LUCENE_BASE + { + private: + CL_NS(util)::FastCharStream* reader; + QueryParserBase* queryparser; //holds the queryparser so that we can do callbacks + bool delSR; //Indicates if the reader must be deleted or not + + public: + // Initializes a new instance of the Lexer class with the specified + // query to lex. + Lexer(QueryParserBase* queryparser, const TCHAR* query); + + // Initializes a new instance of the Lexer class with the specified + // TextReader to lex. + Lexer(QueryParserBase* queryparser, CL_NS(util)::Reader* source); + + //Breaks the input stream onto the tokens list tokens + void Lex(TokenList *tokens); + + ~Lexer(); + + private: + bool GetNextToken(QueryToken* token); + + // Reads an integer number. buf should quite large, probably as large as a field should ever be + void ReadIntegerNumber(const TCHAR ch, TCHAR* buf, int buflen); + + // Reads an inclusive range like [some words] + bool ReadInclusiveRange(const TCHAR prev, QueryToken* token); + + // Reads an exclusive range like {some words} + bool ReadExclusiveRange(const TCHAR prev, QueryToken* token); + + // Reads quoted string like "something else" + bool ReadQuoted(const TCHAR prev, QueryToken* token); + + bool ReadTerm(const TCHAR prev, QueryToken* token); + + //reads an escaped character into the buf. Buf requires at least 3 characters + bool ReadEscape(const TCHAR prev, TCHAR* buf); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp new file mode 100644 index 000000000..b57896b66 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp @@ -0,0 +1,215 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "MultiFieldQueryParser.h" +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/search/BooleanQuery.h" +#include "CLucene/search/PhraseQuery.h" +#include "CLucene/search/SearchHeader.h" +#include "QueryParser.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_USE(search) +CL_NS_USE(analysis) + +CL_NS_DEF(queryParser) + +MultiFieldQueryParser::MultiFieldQueryParser(const TCHAR** fields, + CL_NS(analysis)::Analyzer* analyzer, BoostMap* boosts) + : QueryParser(NULL, analyzer) +{ + this->fields = fields; + this->boosts = boosts; +} + +MultiFieldQueryParser::~MultiFieldQueryParser() +{ +} + +//static +Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, + Analyzer* analyzer) +{ + BooleanQuery* bQuery = _CLNEW BooleanQuery(); + int32_t i = 0; + while (fields[i] != NULL){ + Query* q = QueryParser::parse(query, fields[i], analyzer); + if (q && (q->getQueryName() != _T("BooleanQuery") + || ((BooleanQuery*)q)->getClauseCount() > 0)) { + bQuery->add(q , true, false, false); + } else { + _CLDELETE(q); + } + i++; + } + return bQuery; +} + +//static +Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, + const uint8_t* flags, Analyzer* analyzer) +{ + BooleanQuery* bQuery = _CLNEW BooleanQuery(); + int32_t i = 0; + while ( fields[i] != NULL ) { + Query* q = QueryParser::parse(query, fields[i], analyzer); + if (q && (q->getQueryName() != _T("BooleanQuery") + || ((BooleanQuery*)q)->getClauseCount() > 0)) { + uint8_t flag = flags[i]; + switch (flag) { + case MultiFieldQueryParser::REQUIRED_FIELD: + bQuery->add(q, true, true, false); + break; + case MultiFieldQueryParser::PROHIBITED_FIELD: + bQuery->add(q, true, false, true); + break; + default: + bQuery->add(q, true, false, false); + break; + } + } else { + _CLDELETE(q); + } + i++; + } + return bQuery; +} + + +Query* MultiFieldQueryParser::GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop){ + if (field == NULL) { + CL_NS_STD(vector) clauses; + for (int i = 0; fields[i]!=NULL; ++i) { + Query* q = QueryParser::GetFieldQuery(fields[i], queryText); + if (q != NULL) { + //If the user passes a map of boosts + if (boosts != NULL) { + //Get the boost from the map and apply them + BoostMap::const_iterator itr = boosts->find(fields[i]); + if (itr != boosts->end()) { + q->setBoost(itr->second); + } + } + if (q->getQueryName() == PhraseQuery::getClassName()) { + ((PhraseQuery*)q)->setSlop(slop); + } + //if (q instanceof MultiPhraseQuery) { + // ((MultiPhraseQuery) q).setSlop(slop); + //} + q = QueryAddedCallback(fields[i], q); + if ( q ) + clauses.push_back(_CLNEW BooleanClause(q, true, false,false)); + } + } + if (clauses.size() == 0) // happens for stopwords + return NULL; + Query* q = QueryParser::GetBooleanQuery(clauses); + return q; + }else{ + Query* q = QueryParser::GetFieldQuery(field, queryText); + if ( q ) + q = QueryAddedCallback(field,q); + return q; + } +} + + +Query* MultiFieldQueryParser::GetFieldQuery(const TCHAR* field, TCHAR* queryText){ + return GetFieldQuery(field, queryText, 0); +} + + +CL_NS(search)::Query* MultiFieldQueryParser::GetFuzzyQuery(const TCHAR* field, TCHAR* termStr){ + if (field == NULL) { + CL_NS_STD(vector) clauses; + for (int i = 0; fields[i]!=NULL; ++i) { + Query* q = QueryParser::GetFuzzyQuery(fields[i], termStr); //todo: , minSimilarity + if ( q ){ + q = QueryAddedCallback(fields[i], q); + if ( q ){ + clauses.push_back(_CLNEW BooleanClause(q,true,false,false) ); + } + } + } + return QueryParser::GetBooleanQuery(clauses); + }else{ + Query* q = QueryParser::GetFuzzyQuery(field, termStr);//todo: , minSimilarity + if ( q ) + q = QueryAddedCallback(field,q); + return q; + } +} + +Query* MultiFieldQueryParser::GetPrefixQuery(const TCHAR* field, TCHAR* termStr){ + if (field == NULL) { + CL_NS_STD(vector) clauses; + for (int i = 0; fields[i]!=NULL; ++i) { + Query* q = QueryParser::GetPrefixQuery(fields[i], termStr); + if ( q ){ + q = QueryAddedCallback(fields[i],q); + if ( q ){ + clauses.push_back(_CLNEW BooleanClause(q,true,false,false)); + } + } + } + return QueryParser::GetBooleanQuery(clauses); + }else{ + Query* q = QueryParser::GetPrefixQuery(field, termStr); + if ( q ) + q = QueryAddedCallback(field,q); + return q; + } +} + +Query* MultiFieldQueryParser::GetWildcardQuery(const TCHAR* field, TCHAR* termStr){ + if (field == NULL) { + CL_NS_STD(vector) clauses; + for (int i = 0; fields[i]!=NULL; ++i) { + Query* q = QueryParser::GetWildcardQuery(fields[i], termStr); + if ( q ){ + q = QueryAddedCallback(fields[i],q); + if ( q ){ + clauses.push_back(_CLNEW BooleanClause(q,true,false,false)); + } + } + } + return QueryParser::GetBooleanQuery(clauses); + }else{ + Query* q = QueryParser::GetWildcardQuery(field, termStr); + if ( q ) + q = QueryAddedCallback(field,q); + return q; + } +} + + +Query* MultiFieldQueryParser::GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive){ + if (field == NULL) { + CL_NS_STD(vector) clauses; + for (int i = 0; fields[i]!=NULL; ++i) { + Query* q = QueryParser::GetRangeQuery(fields[i], part1, part2, inclusive); + if ( q ){ + q = QueryAddedCallback(fields[i],q); + if ( q ){ + clauses.push_back(_CLNEW BooleanClause(q,true,false,false)); + } + } + } + return QueryParser::GetBooleanQuery(clauses); + }else{ + Query* q = QueryParser::GetRangeQuery(field, part1, part2, inclusive); + if ( q ) + q = QueryAddedCallback(field,q); + return q; + } +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h new file mode 100644 index 000000000..bf7d652a7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.h @@ -0,0 +1,136 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef MultiFieldQueryParser_H +#define MultiFieldQueryParser_H + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/search/SearchHeader.h" +#include "QueryParser.h" + + +CL_NS_DEF(queryParser) + +typedef CL_NS(util)::CLHashMap BoostMap; + + /** + * A QueryParser which constructs queries to search multiple fields. + * + */ + class MultiFieldQueryParser: public QueryParser + { + protected: + const TCHAR** fields; + BoostMap* boosts; + public: + LUCENE_STATIC_CONSTANT(uint8_t, NORMAL_FIELD=0); + LUCENE_STATIC_CONSTANT(uint8_t, REQUIRED_FIELD=1); + LUCENE_STATIC_CONSTANT(uint8_t, PROHIBITED_FIELD=2); + + /** + * Creates a MultiFieldQueryParser. + * + *

It will, when parse(String query) + * is called, construct a query like this (assuming the query consists of + * two terms and you specify the two fields title and body):

+ * + * + * (title:term1 body:term1) (title:term2 body:term2) + * + * + *

When setDefaultOperator(AND_OPERATOR) is set, the result will be:

+ * + * + * +(title:term1 body:term1) +(title:term2 body:term2) + * + * + *

In other words, all the query's terms must appear, but it doesn't matter in + * what fields they appear.

+ */ + MultiFieldQueryParser(const TCHAR** fields, CL_NS(analysis)::Analyzer* a, BoostMap* boosts = NULL); + virtual ~MultiFieldQueryParser(); + + /** + *

+ * Parses a query which searches on the fields specified. + *

+ * If x fields are specified, this effectively constructs: + *

+         * 
+         * (field1:query) (field2:query) (field3:query)...(fieldx:query)
+         * 
+         * 
+ * + * @param query Query string to parse + * @param fields Fields to search on + * @param analyzer Analyzer to use + * @throws ParserException if query parsing fails + * @throws TokenMgrError if query parsing fails + */ + static CL_NS(search)::Query* parse(const TCHAR* query, const TCHAR** fields, CL_NS(analysis)::Analyzer* analyzer); + + /** + *

+ * Parses a query, searching on the fields specified. + * Use this if you need to specify certain fields as required, + * and others as prohibited. + *

+         * Usage:
+         * 
+         * String[] fields = {"filename", "contents", "description"};
+         * int32_t[] flags = {MultiFieldQueryParser.NORMAL FIELD,
+         *                MultiFieldQueryParser.REQUIRED FIELD,
+         *                MultiFieldQueryParser.PROHIBITED FIELD,};
+         * parse(query, fields, flags, analyzer);
+         * 
+         * 
+ *

+ * The code above would construct a query: + *

+         * 
+         * (filename:query) +(contents:query) -(description:query)
+         * 
+         * 
+ * + * @param query Query string to parse + * @param fields Fields to search on + * @param flags Flags describing the fields + * @param analyzer Analyzer to use + * @throws ParserException if query parsing fails + * @throws TokenMgrError if query parsing fails + */ + static CL_NS(search)::Query* parse(const TCHAR* query, const TCHAR** fields, const uint8_t* flags, CL_NS(analysis)::Analyzer* analyzer); + + + + protected: + CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText); + CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop); + CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field, TCHAR* termStr); + CL_NS(search)::Query* GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive); + CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field, TCHAR* termStr); + CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr); + + /** + * A special virtual function for the MultiFieldQueryParser which can be used + * to clean up queries. Once the field name is known and the query has been + * created, its passed to this function. + * An example of this usage is to set boosts. + */ + virtual CL_NS(search)::Query* QueryAddedCallback(const TCHAR* field, CL_NS(search)::Query* query){ return query; } + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp new file mode 100644 index 000000000..b11eec0bb --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.cpp @@ -0,0 +1,509 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "QueryParser.h" + +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/util/Reader.h" +#include "CLucene/search/SearchHeader.h" +#include "CLucene/index/Term.h" + +#include "TokenList.h" +#include "QueryToken.h" +#include "QueryParserBase.h" +#include "Lexer.h" + +CL_NS_USE(util) +CL_NS_USE(index) +CL_NS_USE(analysis) +CL_NS_USE(search) + +CL_NS_DEF(queryParser) + + QueryParser::QueryParser(const TCHAR* _field, Analyzer* _analyzer) : QueryParserBase(_analyzer){ + //Func - Constructor. + // Instantiates a QueryParser for the named field _field + //Pre - _field != NULL + //Post - An instance has been created + + if ( _field ) + field = STRDUP_TtoT(_field); + else + field = NULL; + tokens = NULL; + lowercaseExpandedTerms = true; + } + + QueryParser::~QueryParser() { + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + _CLDELETE_CARRAY(field); + } + + //static + Query* QueryParser::parse(const TCHAR* query, const TCHAR* field, Analyzer* analyzer){ + //Func - Returns a new instance of the Query class with a specified query, field and + // analyzer values. + //Pre - query != NULL and holds the query to parse + // field != NULL and holds the default field for query terms + // analyzer holds a valid reference to an Analyzer and is used to + // find terms in the query text + //Post - query has been parsed and an instance of Query has been returned + + CND_PRECONDITION(query != NULL, "query is NULL"); + CND_PRECONDITION(field != NULL, "field is NULL"); + + QueryParser parser(field, analyzer); + return parser.parse(query); + } + + Query* QueryParser::parse(const TCHAR* query){ + //Func - Returns a parsed Query instance + //Pre - query != NULL and contains the query value to be parsed + //Post - Returns a parsed Query Instance + + CND_PRECONDITION(query != NULL, "query is NULL"); + + //Instantie a Stringer that can read the query string + Reader* r = _CLNEW StringReader(query); + + //Check to see if r has been created properly + CND_CONDITION(r != NULL, "Could not allocate memory for StringReader r"); + + //Pointer for the return value + Query* ret = NULL; + + try{ + //Parse the query managed by the StringReader R and return a parsed Query instance + //into ret + ret = parse(r); + }_CLFINALLY ( + _CLDELETE(r); + ); + + return ret; + } + + Query* QueryParser::parse(Reader* reader){ + //Func - Returns a parsed Query instance + //Pre - reader contains a valid reference to a Reader and manages the query string + //Post - A parsed Query instance has been returned or + + //instantiate the TokenList tokens + TokenList _tokens; + this->tokens = &_tokens; + + //Instantiate a lexer + Lexer lexer(this, reader); + + //tokens = lexer.Lex(); + //Lex the tokens + lexer.Lex(tokens); + + //Peek to the first token and check if is an EOF + if (tokens->peek()->Type == QueryToken::EOF_){ + // The query string failed to yield any tokens. We discard the + // TokenList tokens and raise an exceptioin. + QueryToken* token = this->tokens->extract(); + _CLDELETE(token); + _CLTHROWA(CL_ERR_Parse, "No query given."); + } + + //Return the parsed Query instance + Query* ret = MatchQuery(field); + this->tokens = NULL; + return ret; + } + + int32_t QueryParser::MatchConjunction(){ + //Func - matches for CONJUNCTION + // CONJUNCTION ::= | + //Pre - tokens != NULL + //Post - if the first token is an AND or an OR then + // the token is extracted and deleted and CONJ_AND or CONJ_OR is returned + // otherwise CONJ_NONE is returned + + CND_PRECONDITION(tokens != NULL, "tokens is NULL"); + + switch(tokens->peek()->Type){ + case QueryToken::AND_ : + //Delete the first token of tokenlist + ExtractAndDeleteToken(); + return CONJ_AND; + case QueryToken::OR : + //Delete the first token of tokenlist + ExtractAndDeleteToken(); + return CONJ_OR; + default : + return CONJ_NONE; + } + } + + int32_t QueryParser::MatchModifier(){ + //Func - matches for MODIFIER + // MODIFIER ::= | | + //Pre - tokens != NULL + //Post - if the first token is a PLUS the token is extracted and deleted and MOD_REQ is returned + // if the first token is a MINUS or NOT the token is extracted and deleted and MOD_NOT is returned + // otherwise MOD_NONE is returned + CND_PRECONDITION(tokens != NULL, "tokens is NULL"); + + switch(tokens->peek()->Type){ + case QueryToken::PLUS : + //Delete the first token of tokenlist + ExtractAndDeleteToken(); + return MOD_REQ; + case QueryToken::MINUS : + case QueryToken::NOT : + //Delete the first token of tokenlist + ExtractAndDeleteToken(); + return MOD_NOT; + default : + return MOD_NONE; + } + } + + Query* QueryParser::MatchQuery(const TCHAR* field){ + //Func - matches for QUERY + // QUERY ::= [MODIFIER] QueryParser::CLAUSE ( [MODIFIER] CLAUSE)* + //Pre - field != NULL + //Post - + + CND_PRECONDITION(tokens != NULL, "tokens is NULL"); + + CL_NS_STD(vector) clauses; + + Query* q = NULL; + + int32_t mods = MOD_NONE; + int32_t conj = CONJ_NONE; + + //match for MODIFIER + mods = MatchModifier(); + + //match for CLAUSE + q = MatchClause(field); + AddClause(clauses, CONJ_NONE, mods, q); + + // match for CLAUSE* + while(true){ + QueryToken* p = tokens->peek(); + if(p->Type == QueryToken::EOF_){ + QueryToken* qt = MatchQueryToken(QueryToken::EOF_); + _CLDELETE(qt); + break; + } + + if(p->Type == QueryToken::RPAREN){ + //MatchQueryToken(QueryToken::RPAREN); + break; + } + + //match for a conjuction (AND OR NOT) + conj = MatchConjunction(); + //match for a modifier + mods = MatchModifier(); + + q = MatchClause(field); + if ( q != NULL ) + AddClause(clauses, conj, mods, q); + } + + // finalize query + if(clauses.size() == 1){ //bvk: removed this && firstQuery != NULL + BooleanClause* c = clauses[0]; + Query* q = c->query; + + //Condition check to be sure clauses[0] is valid + CND_CONDITION(c != NULL, "c is NULL"); + + //Tell the boolean clause not to delete its query + c->deleteQuery=false; + //Clear the clauses list + clauses.clear(); + _CLDELETE(c); + + return q; + }else{ + return GetBooleanQuery(clauses); + } + } + + Query* QueryParser::MatchClause(const TCHAR* field){ + //Func - matches for CLAUSE + // CLAUSE ::= [TERM ] ( TERM | ( QUERY )) + //Pre - field != NULL + //Post - + + Query* q = NULL; + const TCHAR* sfield = field; + bool delField = false; + + QueryToken *DelToken = NULL; + + //match for [TERM ] + QueryToken* term = tokens->extract(); + if(term->Type == QueryToken::TERM && tokens->peek()->Type == QueryToken::COLON){ + DelToken = MatchQueryToken(QueryToken::COLON); + + CND_CONDITION(DelToken != NULL,"DelToken is NULL"); + _CLDELETE(DelToken); + + TCHAR* tmp = STRDUP_TtoT(term->Value); + discardEscapeChar(tmp); + delField = true; + sfield = tmp; + _CLDELETE(term); + }else{ + tokens->push(term); + term = NULL; + } + + // match for + // TERM | ( QUERY ) + if(tokens->peek()->Type == QueryToken::LPAREN){ + DelToken = MatchQueryToken(QueryToken::LPAREN); + + CND_CONDITION(DelToken != NULL,"DelToken is NULL"); + _CLDELETE(DelToken); + + q = MatchQuery(sfield); + //DSR:2004.11.01: + //If exception is thrown while trying to match trailing parenthesis, + //need to prevent q from leaking. + + try{ + DelToken = MatchQueryToken(QueryToken::RPAREN); + + CND_CONDITION(DelToken != NULL,"DelToken is NULL"); + _CLDELETE(DelToken); + + }catch(...) { + _CLDELETE(q); + throw; + } + }else{ + q = MatchTerm(sfield); + } + + if ( delField ) + _CLDELETE_CARRAY(sfield); + return q; + } + + + Query* QueryParser::MatchTerm(const TCHAR* field){ + //Func - matches for TERM + // TERM ::= TERM | PREFIXTERM | WILDTERM | NUMBER + // [ ] [ []] + // | ( | ) [ ] + // | [SLOP] [ ] + //Pre - field != NULL + //Post - + + QueryToken* term = NULL; + QueryToken* slop = NULL; + QueryToken* boost = NULL; + + bool prefix = false; + bool wildcard = false; + bool fuzzy = false; + bool rangein = false; + Query* q = NULL; + + term = tokens->extract(); + QueryToken* DelToken = NULL; //Token that is about to be deleted + + switch(term->Type){ + case QueryToken::TERM: + case QueryToken::NUMBER: + case QueryToken::PREFIXTERM: + case QueryToken::WILDTERM: + { //start case + //Check if type of QueryToken term is a prefix term + if(term->Type == QueryToken::PREFIXTERM){ + prefix = true; + } + //Check if type of QueryToken term is a wildcard term + if(term->Type == QueryToken::WILDTERM){ + wildcard = true; + } + //Peek to see if the type of the next token is fuzzy term + if(tokens->peek()->Type == QueryToken::FUZZY){ + DelToken = MatchQueryToken(QueryToken::FUZZY); + + CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); + _CLDELETE(DelToken); + + fuzzy = true; + } + if(tokens->peek()->Type == QueryToken::CARAT){ + DelToken = MatchQueryToken(QueryToken::CARAT); + + CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); + _CLDELETE(DelToken); + + boost = MatchQueryToken(QueryToken::NUMBER); + + if(tokens->peek()->Type == QueryToken::FUZZY){ + DelToken = MatchQueryToken(QueryToken::FUZZY); + + CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); + _CLDELETE(DelToken); + + fuzzy = true; + } + } //end if type==CARAT + + discardEscapeChar(term->Value); //clean up + if(wildcard){ + q = GetWildcardQuery(field,term->Value); + break; + }else if(prefix){ + //Create a PrefixQuery + term->Value[_tcslen(term->Value)-1] = 0; //discard the * + q = GetPrefixQuery(field,term->Value); + break; + }else if(fuzzy){ + //Create a FuzzyQuery + + //Check if the last char is a ~ + if(term->Value[_tcslen(term->Value)-1] == '~'){ + //remove the ~ + term->Value[_tcslen(term->Value)-1] = '\0'; + } + + q = GetFuzzyQuery(field,term->Value); + break; + }else{ + q = GetFieldQuery(field, term->Value); + break; + } + } + + + case QueryToken::RANGEIN: + case QueryToken::RANGEEX:{ + if(term->Type == QueryToken::RANGEIN){ + rangein = true; + } + + if(tokens->peek()->Type == QueryToken::CARAT){ + DelToken = MatchQueryToken(QueryToken::CARAT); + + CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); + _CLDELETE(DelToken); + + boost = MatchQueryToken(QueryToken::NUMBER); + } + + TCHAR* noBrackets = term->Value + 1; + noBrackets[_tcslen(noBrackets)-1] = 0; + q = ParseRangeQuery(field, noBrackets, rangein); + break; + } + + + case QueryToken::QUOTED:{ + if(tokens->peek()->Type == QueryToken::SLOP){ + slop = MatchQueryToken(QueryToken::SLOP); + } + + if(tokens->peek()->Type == QueryToken::CARAT){ + DelToken = MatchQueryToken(QueryToken::CARAT); + + CND_CONDITION(DelToken !=NULL, "DelToken is NULL"); + _CLDELETE(DelToken); + + boost = MatchQueryToken(QueryToken::NUMBER); + } + + //remove the quotes + TCHAR* quotedValue = term->Value+1; + quotedValue[_tcslen(quotedValue)-1] = '\0'; + + int32_t islop = phraseSlop; + if(slop != NULL ){ + try { + TCHAR* end; //todo: should parse using float... + islop = (int32_t)_tcstoi64(slop->Value+1, &end, 10); + }catch(...){ + //ignored + } + } + + q = GetFieldQuery(field, quotedValue, islop); + _CLDELETE(slop); + } + } // end of switch + + _CLDELETE(term); + + + if( q!=NULL && boost != NULL ){ + qreal f = 1.0F; + try { + TCHAR* tmp; + f = _tcstod(boost->Value, &tmp); + }catch(...){ + //ignored + } + _CLDELETE(boost); + + q->setBoost( f); + } + + return q; + } + + QueryToken* QueryParser::MatchQueryToken(QueryToken::Types expectedType){ + //Func - matches for QueryToken of the specified type and returns it + // otherwise Exception throws + //Pre - tokens != NULL + //Post - + + CND_PRECONDITION(tokens != NULL,"tokens is NULL"); + + if(tokens->count() == 0){ + throwParserException(_T("Error: Unexpected end of program"),' ',0,0); + } + + //Extract a token form the TokenList tokens + QueryToken* t = tokens->extract(); + //Check if the type of the token t matches the expectedType + if (expectedType != t->Type){ + TCHAR buf[200]; + _sntprintf(buf,200,_T("Error: Unexpected QueryToken: %d, expected: %d"),t->Type,expectedType); + _CLDELETE(t); + throwParserException(buf,' ',0,0); + } + + //Return the matched token + return t; + } + + void QueryParser::ExtractAndDeleteToken(void){ + //Func - Extracts the first token from the Tokenlist tokenlist + // and destroys it + //Pre - true + //Post - The first token has been extracted and destroyed + + CND_PRECONDITION(tokens != NULL, "tokens is NULL"); + + //Extract the token from the TokenList tokens + QueryToken* t = tokens->extract(); + //Condition Check Token may not be NULL + CND_CONDITION(t != NULL, "Token is NULL"); + //Delete Token + _CLDELETE(t); + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h new file mode 100644 index 000000000..a2fc85c89 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParser.h @@ -0,0 +1,165 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_queryParser_QueryParser_ +#define _lucene_queryParser_QueryParser_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/util/Reader.h" +#include "CLucene/search/SearchHeader.h" +#include "CLucene/index/Term.h" + +#include "TokenList.h" +#include "QueryToken.h" +#include "QueryParserBase.h" +#include "Lexer.h" + +CL_NS_DEF(queryParser) + +/** +* @brief CLucene's default query parser. +* +*

It's a query parser. +* The only method that clients should need to call is Parse(). +* The syntax for query const TCHAR*s is as follows: +* A Query is a series of clauses. A clause may be prefixed by:

+*
    +*
  • a plus (+) or a minus (-) sign, indicating that the +* clause is required or prohibited respectively; or
  • +*
  • a term followed by a colon, indicating the field to be searched. +* This enables one to construct queries which search multiple fields.
  • +*
+*

+* A clause may be either:

+*
    +*
  • a term, indicating all the documents that contain this term; or
  • +*
  • a nested query, enclosed in parentheses. Note that this may be +* used with a +/- prefix to require any of a set of terms.
  • +*
+*

+* Thus, in BNF, the query grammar is:

+* +* Query ::= ( Clause )* +* Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" ) +* +*

+* Examples of appropriately formatted queries can be found in the test cases. +*

+*/ +class QueryParser : public QueryParserBase +{ +private: + const TCHAR* field; + TokenList* tokens; +public: + /** + * Initializes a new instance of the QueryParser class with a specified field and + * analyzer values. + */ + QueryParser(const TCHAR* field, CL_NS(analysis)::Analyzer* analyzer); + ~QueryParser(); + + /** + * Returns a parsed Query instance. + * Note: this call is not threadsafe, either use a seperate QueryParser for each thread, or use a thread lock + * The query value to be parsed. + * A parsed Query instance. + */ + virtual CL_NS(search)::Query* parse(const TCHAR* query); + + /** + * Returns a parsed Query instance. + * Note: this call is not threadsafe, either use a seperate QueryParser for each thread, or use a thread lock + * The TextReader value to be parsed. + * A parsed Query instance. + */ + virtual CL_NS(search)::Query* parse(CL_NS(util)::Reader* reader); + + /** + * Returns a new instance of the Query class with a specified query, field and + * analyzer values. + */ + static CL_NS(search)::Query* parse(const TCHAR* query, const TCHAR* field, CL_NS(analysis)::Analyzer* analyzer); + + CL_NS(analysis)::Analyzer* getAnalyzer() { return analyzer; } + + /** + * @return Returns the field. + */ + const TCHAR* getField() { return field; } + + //deprecated functions + _CL_DEPRECATED( setLowercaseExpandedTerms ) void setLowercaseWildcardTerms(bool lowercaseWildcardTerms){ setLowercaseExpandedTerms(lowercaseWildcardTerms); } + _CL_DEPRECATED( getLowercaseExpandedTerms ) bool getLowercaseWildcardTerms() const { return getLowercaseExpandedTerms(); } +protected: + //these functions may be defined under certain compilation conditions. + //note that this functionality is deprecated, you should create your own queryparser + //if you want to remove this functionality...it will be removed... be warned! +#ifdef NO_PREFIX_QUERY + virtual CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field,const TCHAR* termStr){ return NULL; } +#endif +#ifdef NO_FUZZY_QUERY + virtual CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field,const TCHAR* termStr){ return NULL; } +#endif +#ifdef NO_RANGE_QUERY + virtual CL_NS(search)::Query* GetRangeQuery(const TCHAR* field, const TCHAR* part1, const TCHAR* part2, bool inclusive) { return NULL; } +#endif +#ifdef NO_WILDCARD_QUERY + virtual CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr) { return NULL; } +#endif +private: + /** + * matches for CONJUNCTION + * CONJUNCTION ::= | + */ + int32_t MatchConjunction(); + + /** + * matches for MODIFIER + * MODIFIER ::= | | + */ + int32_t MatchModifier(); + + /** + * matches for QUERY + * QUERY ::= [MODIFIER] CLAUSE ( [MODIFIER] CLAUSE)* + */ + CL_NS(search)::Query* MatchQuery(const TCHAR* field); + + /** + * matches for CLAUSE + * CLAUSE ::= [TERM ] ( TERM | ( QUERY )) + */ + CL_NS(search)::Query* MatchClause(const TCHAR* field); + + /** + * matches for TERM + * TERM ::= TERM | PREFIXTERM | WILDTERM | NUMBER + * [ ] [ []] + * + * | ( | ) [ ] + * | [SLOP] [ ] + */ + CL_NS(search)::Query* MatchTerm(const TCHAR* field); + + /** + * matches for QueryToken of the specified type and returns it + * otherwise Exception throws + */ + QueryToken* MatchQueryToken(QueryToken::Types expectedType); + + /** + * Extracts the first token from the Tokenlist tokenlist + * and destroys it + */ + void ExtractAndDeleteToken(void); +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp new file mode 100644 index 000000000..7b95b30f9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.cpp @@ -0,0 +1,369 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "QueryParserBase.h" + +#include "CLucene/search/TermQuery.h" +#include "CLucene/search/PhraseQuery.h" +#include "CLucene/search/RangeQuery.h" +#include "CLucene/search/FuzzyQuery.h" +#include "CLucene/search/WildcardQuery.h" +#include "CLucene/search/PrefixQuery.h" + + +CL_NS_USE(search) +CL_NS_USE(util) +CL_NS_USE(analysis) +CL_NS_USE(index) + +CL_NS_DEF(queryParser) + +QueryParserBase::QueryParserBase(Analyzer* analyzer){ +//Func - Constructor +//Pre - true +//Post - instance has been created with PhraseSlop = 0 + this->analyzer = analyzer; + this->defaultOperator = OR_OPERATOR; + this->phraseSlop = 0; + this->lowercaseExpandedTerms = true; +} + +QueryParserBase::~QueryParserBase(){ +//Func - Destructor +//Pre - true +//Post - The instance has been destroyed +} + + +void QueryParserBase::discardEscapeChar(TCHAR* source) const{ + int len = _tcslen(source); + int j = 0; + for (int i = 0; i < len; i++) { + if (source[i] == '\\' && source[i+1] != '\0' ) { + _tcscpy(source+i,source+i+1); + len--; + } + } +} + +void QueryParserBase::AddClause(CL_NS_STD(vector)& clauses, int32_t conj, int32_t mods, Query* q){ +//Func - Adds the next parsed clause. +//Pre - +//Post - + + bool required, prohibited; + + // If this term is introduced by AND, make the preceding term required, + // unless it's already prohibited. + const uint32_t nPreviousClauses = clauses.size(); + if (nPreviousClauses > 0 && conj == CONJ_AND) { + BooleanClause* c = clauses[nPreviousClauses-1]; + if (!c->prohibited) + c->required = true; + } + + if (nPreviousClauses > 0 && defaultOperator == AND_OPERATOR && conj == CONJ_OR) { + // If this term is introduced by OR, make the preceding term optional, + // unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b) + // notice if the input is a OR b, first term is parsed as required; without + // this modification a OR b would parse as +a OR b + BooleanClause* c = clauses[nPreviousClauses-1]; + if (!c->prohibited){ + c->required = false; + c->prohibited = false; + } + } + + // We might have been passed a NULL query; the term might have been + // filtered away by the analyzer. + if (q == NULL) + return; + + if (defaultOperator == OR_OPERATOR) { + // We set REQUIRED if we're introduced by AND or +; PROHIBITED if + // introduced by NOT or -; make sure not to set both. + prohibited = (mods == MOD_NOT); + required = (mods == MOD_REQ); + if (conj == CONJ_AND && !prohibited) { + required = true; + } + } else { + // We set PROHIBITED if we're introduced by NOT or -; We set REQUIRED + // if not PROHIBITED and not introduced by OR + prohibited = (mods == MOD_NOT); + required = (!prohibited && conj != CONJ_OR); + } + + if ( required && prohibited ) + throwParserException( _T("Clause cannot be both required and prohibited"), ' ',0,0); + clauses.push_back(_CLNEW BooleanClause(q,true, required, prohibited)); +} + +void QueryParserBase::throwParserException(const TCHAR* message, TCHAR ch, int32_t col, int32_t line ) +{ + TCHAR msg[1024]; + _sntprintf(msg,1024,message,ch,col,line); + _CLTHROWT (CL_ERR_Parse, msg ); +} + + +Query* QueryParserBase::GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop){ + Query* ret = GetFieldQuery(field,queryText); + if ( ret && ret->getQueryName() == PhraseQuery::getClassName() ) + ((PhraseQuery*)ret)->setSlop(slop); + + return ret; +} + +Query* QueryParserBase::GetFieldQuery(const TCHAR* field, TCHAR* queryText){ +//Func - Returns a query for the specified field. +// Use the analyzer to get all the tokens, and then build a TermQuery, +// PhraseQuery, or nothing based on the term count +//Pre - field != NULL +// analyzer contains a valid reference to an Analyzer +// queryText != NULL and contains the query +//Post - A query instance has been returned for the specified field + + CND_PRECONDITION(field != NULL, "field is NULL"); + CND_PRECONDITION(queryText != NULL, "queryText is NULL"); + + //Instantiate a stringReader for queryText + StringReader reader(queryText); + TokenStream* source = analyzer->tokenStream(field, &reader); + CND_CONDITION(source != NULL,"source is NULL"); + + StringArrayConstWithDeletor v; + + Token t; + int positionCount = 0; + bool severalTokensAtSamePosition = false; + + //Get the tokens from the source + try{ + while (source->next(&t)){ + v.push_back(STRDUP_TtoT(t.termText())); + + if (t.getPositionIncrement() != 0) + positionCount += t.getPositionIncrement(); + else + severalTokensAtSamePosition = true; + } + }catch(CLuceneError& err){ + if ( err.number() != CL_ERR_IO ) + throw err; + } + _CLDELETE(source); + + //Check if there are any tokens retrieved + if (v.size() == 0){ + return NULL; + }else{ + if (v.size() == 1){ + Term* t = _CLNEW Term(field, v[0]); + Query* ret = _CLNEW TermQuery( t ); + _CLDECDELETE(t); + return ret; + }else{ + if (severalTokensAtSamePosition) { + if (positionCount == 1) { + // no phrase query: + BooleanQuery* q = _CLNEW BooleanQuery; //todo: disableCoord=true here, but not implemented in BooleanQuery + StringArrayConst::iterator itr = v.begin(); + while ( itr != v.end() ){ + Term* t = _CLNEW Term(field, *itr); + q->add(_CLNEW TermQuery(t),true, false,false);//should occur... + _CLDECDELETE(t); + ++itr; + } + return q; + }else { + _CLTHROWA(CL_ERR_UnsupportedOperation, "MultiPhraseQuery NOT Implemented"); + } + }else{ + PhraseQuery* q = _CLNEW PhraseQuery; + q->setSlop(phraseSlop); + + StringArrayConst::iterator itr = v.begin(); + while ( itr != v.end() ){ + const TCHAR* data = *itr; + Term* t = _CLNEW Term(field, data); + q->add(t); + _CLDECDELETE(t); + ++itr; + } + return q; + } + } + } +} + +void QueryParserBase::setLowercaseExpandedTerms(bool lowercaseExpandedTerms){ + this->lowercaseExpandedTerms = lowercaseExpandedTerms; +} +bool QueryParserBase::getLowercaseExpandedTerms() const { + return lowercaseExpandedTerms; +} +void QueryParserBase::setDefaultOperator(int oper){ + this->defaultOperator=oper; +} +int QueryParserBase::getDefaultOperator() const{ + return defaultOperator; +} + + +Query* QueryParserBase::ParseRangeQuery(const TCHAR* field, TCHAR* queryText, bool inclusive) +{ + //todo: this must be fixed, [-1--5] (-1 to -5) should yield a result, but won't parse properly + //because it uses an analyser, should split it up differently... + + // Use the analyzer to get all the tokens. There should be 1 or 2. + StringReader reader(queryText); + TokenStream* source = analyzer->tokenStream(field, &reader); + + TCHAR* terms[2]; + terms[0]=NULL;terms[1]=NULL; + Token t; + bool tret=true; + bool from=true; + while(tret) + { + try{ + tret = source->next(&t); + }catch (CLuceneError& err){ + if ( err.number() == CL_ERR_IO ) + tret=false; + else + throw err; + } + if (tret) + { + if ( !from && _tcscmp(t.termText(),_T("TO"))==0 ) + continue; + + + TCHAR* tmp = STRDUP_TtoT(t.termText()); + discardEscapeChar(tmp); + terms[from? 0 : 1] = tmp; + + if (from) + from = false; + else + break; + } + } + Query* ret = GetRangeQuery(field, terms[0], terms[1],inclusive); + _CLDELETE_CARRAY(terms[0]); + _CLDELETE_CARRAY(terms[1]); + _CLDELETE(source); + + return ret; +} + +Query* QueryParserBase::GetPrefixQuery(const TCHAR* field, TCHAR* termStr){ +//Pre - field != NULL and field contains the name of the field that the query will use +// termStr != NULL and is the token to use for building term for the query +// (WITH or WITHOUT a trailing '*' character!) +//Post - A PrefixQuery instance has been returned + + CND_PRECONDITION(field != NULL,"field is NULL"); + CND_PRECONDITION(termStr != NULL,"termStr is NULL"); + + if ( lowercaseExpandedTerms ) + _tcslwr(termStr); + + Term* t = _CLNEW Term(field, termStr); + CND_CONDITION(t != NULL,"Could not allocate memory for term t"); + + Query *q = _CLNEW PrefixQuery(t); + CND_CONDITION(q != NULL,"Could not allocate memory for PrefixQuery q"); + + _CLDECDELETE(t); + return q; +} + +Query* QueryParserBase::GetFuzzyQuery(const TCHAR* field, TCHAR* termStr){ +//Func - Factory method for generating a query (similar to getPrefixQuery}). Called when parser parses +// an input term token that has the fuzzy suffix (~) appended. +//Pre - field != NULL and field contains the name of the field that the query will use +// termStr != NULL and is the token to use for building term for the query +// (WITH or WITHOUT a trailing '*' character!) +//Post - A FuzzyQuery instance has been returned + + CND_PRECONDITION(field != NULL,"field is NULL"); + CND_PRECONDITION(termStr != NULL,"termStr is NULL"); + + if ( lowercaseExpandedTerms ) + _tcslwr(termStr); + + Term* t = _CLNEW Term(field, termStr); + CND_CONDITION(t != NULL,"Could not allocate memory for term t"); + + Query *q = _CLNEW FuzzyQuery(t); + CND_CONDITION(q != NULL,"Could not allocate memory for FuzzyQuery q"); + + _CLDECDELETE(t); + return q; +} + + +Query* QueryParserBase::GetWildcardQuery(const TCHAR* field, TCHAR* termStr){ + CND_PRECONDITION(field != NULL,"field is NULL"); + CND_PRECONDITION(termStr != NULL,"termStr is NULL"); + + if ( lowercaseExpandedTerms ) + _tcslwr(termStr); + + Term* t = _CLNEW Term(field, termStr); + CND_CONDITION(t != NULL,"Could not allocate memory for term t"); + Query* q = _CLNEW WildcardQuery(t); + _CLDECDELETE(t); + + return q; +} + +Query* QueryParserBase::GetBooleanQuery(CL_NS_STD(vector)& clauses){ + if ( clauses.size() == 0 ) + return NULL; + + BooleanQuery* query = _CLNEW BooleanQuery(); + //Condition check to see if query has been allocated properly + CND_CONDITION(query != NULL, "No memory could be allocated for query"); + + //iterate through all the clauses + for( uint32_t i=0;iadd(clauses[i]); + } + return query; +} + + +CL_NS(search)::Query* QueryParserBase::GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive){ + //todo: does jlucene handle rangequeries differntly? if we are using + //a certain type of analyser, the terms may be filtered out, which + //is not necessarily what we want. + if (lowercaseExpandedTerms) { + _tcslwr(part1); + _tcslwr(part2); + } + //todo: should see if we can parse the strings as dates... currently we leave that up to the end-developer... + Term* t1 = _CLNEW Term(field,part1); + Term* t2 = _CLNEW Term(field,part2); + Query* ret = _CLNEW RangeQuery(t1, t2, inclusive); + _CLDECDELETE(t1); + _CLDECDELETE(t2); + + return ret; +} + + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h new file mode 100644 index 000000000..261e587b0 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryParserBase.h @@ -0,0 +1,204 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_queryParser_QueryParserBase_ +#define _lucene_queryParser_QueryParserBase_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/VoidList.h" +#include "CLucene/search/BooleanClause.h" +#include "CLucene/analysis/Analyzers.h" +#include "QueryToken.h" + +CL_NS_DEF(queryParser) + + /** + * Contains default implementations used by QueryParser. + * You can override any of these to provide a customised QueryParser. + */ + class QueryParserBase:LUCENE_BASE + { + protected: + /* The actual operator the parser uses to combine query terms */ + int defaultOperator; + int32_t phraseSlop; + + bool lowercaseExpandedTerms; + + LUCENE_STATIC_CONSTANT(int, CONJ_NONE=0); + LUCENE_STATIC_CONSTANT(int, CONJ_AND=1); + LUCENE_STATIC_CONSTANT(int, CONJ_OR=2); + + LUCENE_STATIC_CONSTANT(int, MOD_NONE=0); + LUCENE_STATIC_CONSTANT(int, MOD_NOT=10); + LUCENE_STATIC_CONSTANT(int, MOD_REQ=11); + + CL_NS(analysis)::Analyzer* analyzer; + + public: + QueryParserBase(CL_NS(analysis)::Analyzer* analyzer); + ~QueryParserBase(); + + /** + * Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically + * lower-cased or not. Default is true. + */ + void setLowercaseExpandedTerms(bool lowercaseExpandedTerms); + + /** + * @see #setLowercaseExpandedTerms(boolean) + */ + bool getLowercaseExpandedTerms() const; + + //values used for setOperator + LUCENE_STATIC_CONSTANT(int, OR_OPERATOR=0); + LUCENE_STATIC_CONSTANT(int, AND_OPERATOR=1); + + /** + * Sets the boolean operator of the QueryParser. + * In default mode (OR_OPERATOR) terms without any modifiers + * are considered optional: for example capital of Hungary is equal to + * capital OR of OR Hungary.
+ * In AND_OPERATOR mode terms are considered to be in conjuction: the + * above mentioned query is parsed as capital AND of AND Hungary + */ + void setDefaultOperator(int oper); + /** + * Gets implicit operator setting, which will be either AND_OPERATOR + * or OR_OPERATOR. + */ + int getDefaultOperator() const; + + //public so that the lexer can call this + virtual void throwParserException(const TCHAR* message, TCHAR ch, int32_t col, int32_t line ); + + /** + * Sets the default slop for phrases. If zero, then exact phrase matches + * are required. Default value is zero. + */ + void setPhraseSlop(int phraseSlop) { this->phraseSlop = phraseSlop; } + + /** + * Gets the default slop for phrases. + */ + int getPhraseSlop() { return phraseSlop; } + + protected: + + /** + * Removes the escaped characters + */ + void discardEscapeChar(TCHAR* token) const; + + //Analyzes the expanded term termStr with the StandardFilter and the LowerCaseFilter. + TCHAR* AnalyzeExpandedTerm(const TCHAR* field, TCHAR* termStr); + + // Adds the next parsed clause. + virtual void AddClause(std::vector& clauses, int32_t conj, int32_t mods, CL_NS(search)::Query* q); + + /** + * Returns a termquery, phrasequery for the specified field. + * Note: this is only a partial implementation, since MultiPhraseQuery is not implemented yet + * return NULL to disallow + */ + virtual CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText); + + /** + * Delegates to GetFieldQuery(string, string), and adds slop onto phrasequery. + * Can be used to remove slop functionality + */ + virtual CL_NS(search)::Query* GetFieldQuery(const TCHAR* field, TCHAR* queryText, int32_t slop); + + /** + * Factory method for generating a query (similar to + * {@link #GetWildcardQuery}). Called when parser parses an input term + * token that uses prefix notation; that is, contains a single '*' wildcard + * character as its last character. Since this is a special case + * of generic wildcard term, and such a query can be optimized easily, + * this usually results in a different query object. + *

+ * Depending on settings, a prefix term may be lower-cased + * automatically. It will not go through the default Analyzer, + * however, since normal Analyzers are unlikely to work properly + * with wildcard templates. + *

+ * Can be overridden by extending classes, to provide custom handling for + * wild card queries, which may be necessary due to missing analyzer calls. + * + * @param field Name of the field query will use. + * @param termStr Term token to use for building term for the query + * (without trailing '*' character!) + * + * @return Resulting {@link Query} built for the term + * return NULL to disallow + */ + virtual CL_NS(search)::Query* GetPrefixQuery(const TCHAR* field, TCHAR* termStr); + + /** + * Factory method for generating a query. Called when parser + * parses an input term token that contains one or more wildcard + * characters (? and *), but is not a prefix term token (one + * that has just a single * character at the end) + *

+ * Depending on settings, prefix term may be lower-cased + * automatically. It will not go through the default Analyzer, + * however, since normal Analyzers are unlikely to work properly + * with wildcard templates. + *

+ * Can be overridden by extending classes, to provide custom handling for + * wildcard queries, which may be necessary due to missing analyzer calls. + * + * @param field Name of the field query will use. + * @param termStr Term token that contains one or more wild card + * characters (? or *), but is not simple prefix term + * + * @return Resulting {@link Query} built for the term + * return NULL to disallow + */ + virtual CL_NS(search)::Query* GetWildcardQuery(const TCHAR* field, TCHAR* termStr); + + /** + * Factory method for generating a query (similar to + * {@link #GetWildcardQuery}). Called when parser parses + * an input term token that has the fuzzy suffix (~) appended. + * + * @param field Name of the field query will use. + * @param termStr Term token to use for building term for the query + * + * @return Resulting {@link Query} built for the term + * return NULL to disallow + */ + virtual CL_NS(search)::Query* GetFuzzyQuery(const TCHAR* field, TCHAR* termStr); + + /** + * Factory method for generating query, given a set of clauses. + * By default creates a boolean query composed of clauses passed in. + * + * Can be overridden by extending classes, to modify query being + * returned. + * + * @param clauses Vector that contains {@link BooleanClause} instances + * to join. + * + * @return Resulting {@link Query} object. + * return NULL to disallow + * + * Memory: clauses must all be cleaned up by this function. + */ + virtual CL_NS(search)::Query* GetBooleanQuery(std::vector& clauses); + + /** + * return NULL to disallow + */ + virtual CL_NS(search)::Query* GetRangeQuery(const TCHAR* field, TCHAR* part1, TCHAR* part2, bool inclusive); + virtual CL_NS(search)::Query* ParseRangeQuery(const TCHAR* field, TCHAR* str, bool inclusive); + + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp new file mode 100644 index 000000000..ee88a3cb6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.cpp @@ -0,0 +1,73 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "QueryToken.h" + +CL_NS_DEF(queryParser) + + +QueryToken::QueryToken(): + Value(NULL) +{ + set(UNKNOWN_); +} +QueryToken::QueryToken(TCHAR* value, const int32_t start, const int32_t end, const QueryToken::Types type): + Value(NULL) +{ + set(value,start,end,type); +} + +QueryToken::~QueryToken(){ +//Func - Destructor +//Pre - true +//Post - Instance has been destroyed + + #ifndef LUCENE_TOKEN_WORD_LENGTH + _CLDELETE_CARRAY( Value ); + #endif +} + +// Initializes a new instance of the Token class LUCENE_EXPORT. +// +QueryToken::QueryToken(TCHAR* value, const QueryToken::Types type): + Value(NULL) +{ + set(value,type); +} + +// Initializes a new instance of the Token class LUCENE_EXPORT. +// +QueryToken::QueryToken(QueryToken::Types type): + Value(NULL) +{ + set(type); +} + + +void QueryToken::set(TCHAR* value, const Types type){ + set(value,0,-1,type); +} +void QueryToken::set(TCHAR* value, const int32_t start, const int32_t end, const Types type){ + #ifndef LUCENE_TOKEN_WORD_LENGTH + _CLDELETE_CARRAY(Value); + Value = STRDUP_TtoT(value); + #else + _tcsncpy(Value,value,LUCENE_TOKEN_WORD_LENGTH); + Value[LUCENE_TOKEN_WORD_LENGTH]; + #endif + this->Start = start; + this->End = end; + this->Type = type; + + if ( this->End < 0 ) + this->End = _tcslen(Value); +} +void QueryToken::set(Types type){ + set(LUCENE_BLANK_STRING,0,0,type); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h new file mode 100644 index 000000000..739a667ba --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/QueryToken.h @@ -0,0 +1,76 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_queryParser_QueryToken_ +#define _lucene_queryParser_QueryToken_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "QueryParserBase.h" + +CL_NS_DEF(queryParser) + + // Token class that used by QueryParser. + class QueryToken:LUCENE_BASE + { + public: + enum Types + { + AND_, + OR, + NOT, + PLUS, + MINUS, + LPAREN, + RPAREN, + COLON, + CARAT, + QUOTED, + TERM, + SLOP, + FUZZY, + PREFIXTERM, + WILDTERM, + RANGEIN, + RANGEEX, + NUMBER, + EOF_, + UNKNOWN_ + }; + + + #ifdef LUCENE_TOKEN_WORD_LENGTH + TCHAR Value[LUCENE_TOKEN_WORD_LENGTH+1]; + #else + TCHAR* Value; + #endif + + int32_t Start; + int32_t End; + QueryToken::Types Type; + + // Initializes a new instance of the Token class. + QueryToken(TCHAR* value, const int32_t start, const int32_t end, const Types type); + + // Initializes a new instance of the Token class. + QueryToken(TCHAR* value, const Types type); + + // Initializes a new instance of the Token class. + QueryToken(Types type); + + // Initializes an empty instance of the Token class. + QueryToken(); + + ~QueryToken(); + + void set(TCHAR* value, const int32_t start, const int32_t end, const Types type); + void set(TCHAR* value, const Types type); + void set(Types type); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp new file mode 100644 index 000000000..7d30b931f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.cpp @@ -0,0 +1,79 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "TokenList.h" + +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/VoidList.h" +#include "QueryToken.h" + +CL_NS_DEF(queryParser) + + TokenList::TokenList(){ + //Func - Constructor + //Pre - true + //Post - Instance has been created + } + + TokenList::~TokenList(){ + //Func - Destructor + //Pre - true + //Post - The tokenlist has been destroyed + + tokens.clear(); + } + + void TokenList::add(QueryToken* token){ + //Func - Adds a QueryToken token to the TokenList + //Pre - token != NULL + //Post - token has been added to the token list + + CND_PRECONDITION(token != NULL, "token != NULL"); + + tokens.insert(tokens.begin(),token); + } + + void TokenList::push(QueryToken* token){ + //Func - + //Pre - token != NULL + //Post - + + CND_PRECONDITION(token != NULL, "token is NULL"); + + tokens.push_back(token); + } + + QueryToken* TokenList::peek() { + /* DSR:2004.11.01: Reverted my previous (circa April 2004) fix (which + ** raised an exception if Peek was called when there were no tokens) in + ** favor of returning the EOF token. This solution is much better + ** integrated with the rest of the code in the queryParser subsystem. */ + size_t nTokens = tokens.size(); + if (nTokens == 0) { + push(_CLNEW QueryToken(QueryToken::EOF_)); + nTokens++; + } + return tokens[nTokens-1]; + } + + QueryToken* TokenList::extract(){ + //Func - Extract token from the TokenList + //Pre - true + //Post - Retracted token has been returned + + QueryToken* token = peek(); + //Retract the current peeked token + tokens.delete_back(); + + return token; + } + + int32_t TokenList::count() const + { + return tokens.size(); + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.h b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.h new file mode 100644 index 000000000..3166bba78 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/queryParser/TokenList.h @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_queryParser_TokenList_ +#define _lucene_queryParser_TokenList_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/VoidList.h" +#include "QueryToken.h" +CL_NS_DEF(queryParser) + + // Represents a list of the tokens. + class TokenList:LUCENE_BASE + { + private: + CL_NS(util)::CLVector tokens; //todo:,CL_NS(util)::Deletor::Object + public: + TokenList(); + ~TokenList(); + + void add(QueryToken* token); + + void push(QueryToken* token); + + QueryToken* peek(); + + QueryToken* extract(); + + int32_t count() const; + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanClause.h b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanClause.h new file mode 100644 index 000000000..b89cb31d7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanClause.h @@ -0,0 +1,90 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_BooleanClause_ +#define _lucene_search_BooleanClause_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif +#include "SearchHeader.h" + +CL_NS_DEF(search) + // A clause in a BooleanQuery. + class BooleanClause:LUCENE_BASE { + public: + class Compare:public CL_NS_STD(binary_function) + { + public: + bool operator()( const BooleanClause* val1, const BooleanClause* val2 ) const{ + return val1->equals(val2); + } + }; + + // The query whose matching documents are combined by the boolean query. + Query* query; + + int32_t getClauseCount(); + + // If true, documents documents which do not + // match this sub-query will not match the boolean query. + bool required; + + // If true, documents documents which do + // match this sub-query will not match the boolean query. + bool prohibited; + + bool deleteQuery; + + // Constructs a BooleanClause with query q, required + // r and prohibited p. + BooleanClause(Query* q, const bool DeleteQuery,const bool req, const bool p): + query(q), + required(req), + prohibited(p), + deleteQuery(DeleteQuery) + { + } + + BooleanClause(const BooleanClause& clone): +#if defined(LUCENE_ENABLE_MEMLEAKTRACKING) +#elif defined(LUCENE_ENABLE_REFCOUNT) +#else + LuceneVoidBase(), +#endif + query(clone.query->clone()), + required(clone.required), + prohibited(clone.prohibited), + deleteQuery(true) + { + } + + BooleanClause* clone() const{ + BooleanClause* ret = _CLNEW BooleanClause(*this); + return ret; + } + + ~BooleanClause(){ + if ( deleteQuery ) + _CLDELETE( query ); + } + + /** Returns true iff o is equal to this. */ + bool equals(const BooleanClause* other) const { + return this->query->equals(other->query) + && (this->required == other->required) + && (this->prohibited == other->prohibited); + } + + size_t hashCode() const{ + return query->hashCode() ^ (this->required?1:0) ^ (this->prohibited?2:0); + } + }; + + +CL_NS_END +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp new file mode 100644 index 000000000..3fd36d847 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.cpp @@ -0,0 +1,363 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "BooleanQuery.h" + +#include "BooleanClause.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/StringBuffer.h" +#include "CLucene/util/Arrays.h" +#include "SearchHeader.h" +#include "BooleanScorer.h" +#include "Scorer.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + BooleanQuery::BooleanQuery(): + clauses(true) + { + } + + BooleanQuery::BooleanQuery(const BooleanQuery& clone): + Query(clone) + { + for ( uint32_t i=0;iclone(); + clause->deleteQuery=true; + add(clause); + } + } + + BooleanQuery::~BooleanQuery(){ + clauses.clear(); + } + + size_t BooleanQuery::hashCode() const { + //todo: do cachedHashCode, and invalidate on add/remove clause + size_t ret = 0; + for (uint32_t i = 0 ; i < clauses.size(); i++) { + BooleanClause* c = clauses[i]; + ret = 31 * ret + c->hashCode(); + } + ret = ret ^ Similarity::floatToByte(getBoost()); + return ret; + } + + const TCHAR* BooleanQuery::getQueryName() const{ + return getClassName(); + } + const TCHAR* BooleanQuery::getClassName(){ + return _T("BooleanQuery"); + } + + /** + * Default value is 1024. Use org.apache.lucene.maxClauseCount + * system property to override. + */ + size_t BooleanQuery::maxClauseCount = LUCENE_BOOLEANQUERY_MAXCLAUSECOUNT; + size_t BooleanQuery::getMaxClauseCount(){ + return maxClauseCount; + } + + void BooleanQuery::setMaxClauseCount(size_t maxClauseCount){ + BooleanQuery::maxClauseCount = maxClauseCount; + } + + void BooleanQuery::add(Query* query, const bool deleteQuery, const bool required, const bool prohibited) { + BooleanClause* bc = _CLNEW BooleanClause(query,deleteQuery,required, prohibited); + try{ + add(bc); + }catch(...){ + _CLDELETE(bc); + throw; + } + } + + void BooleanQuery::add(BooleanClause* clause) { + if (clauses.size() >= getMaxClauseCount()) + _CLTHROWA(CL_ERR_TooManyClauses,"Too Many Clauses"); + + clauses.push_back(clause); + } + + + size_t BooleanQuery::getClauseCount() const { + return (int32_t) clauses.size(); + } + + TCHAR* BooleanQuery::toString(const TCHAR* field) const{ + StringBuffer buffer; + if (getBoost() != 1.0) { + buffer.append(_T("(")); + } + + for (uint32_t i = 0 ; i < clauses.size(); i++) { + BooleanClause* c = clauses[i]; + if (c->prohibited) + buffer.append(_T("-")); + else if (c->required) + buffer.append(_T("+")); + + if ( c->query->instanceOf(BooleanQuery::getClassName()) ) { // wrap sub-bools in parens + buffer.append(_T("(")); + + TCHAR* buf = c->query->toString(field); + buffer.append(buf); + _CLDELETE_CARRAY( buf ); + + buffer.append(_T(")")); + } else { + TCHAR* buf = c->query->toString(field); + buffer.append(buf); + _CLDELETE_CARRAY( buf ); + } + if (i != clauses.size()-1) + buffer.append(_T(" ")); + + if (getBoost() != 1.0) { + buffer.append(_T(")^")); + buffer.appendFloat(getBoost(),1); + } + } + return buffer.toString(); + } + + + + + BooleanClause** BooleanQuery::getClauses() const + { + CND_MESSAGE(false, "Warning: BooleanQuery::getClauses() is deprecated") + BooleanClause** ret = _CL_NEWARRAY(BooleanClause*, clauses.size()+1); + getClauses(ret); + return ret; + } + + void BooleanQuery::getClauses(BooleanClause** ret) const + { + size_t size=clauses.size(); + for ( uint32_t i=0;iprohibited) { // just return clause + Query* query = c->query->rewrite(reader); // rewrite first + + //if the query doesn't actually get re-written, + //then return a clone (because the BooleanQuery + //will register different to the returned query. + if ( query == c->query ) + query = query->clone(); + + if (getBoost() != 1.0f) { // incorporate boost + query->setBoost(getBoost() * query->getBoost()); + } + + return query; + } + } + + BooleanQuery* clone = NULL; // recursively rewrite + for (uint32_t i = 0 ; i < clauses.size(); i++) { + BooleanClause* c = clauses[i]; + Query* query = c->query->rewrite(reader); + if (query != c->query) { // clause rewrote: must clone + if (clone == NULL) + clone = (BooleanQuery*)this->clone(); + //todo: check if delete query should be on... + //in fact we should try and get rid of these + //for compatibility sake + clone->clauses.set (i, _CLNEW BooleanClause(query, true, c->required, c->prohibited)); + } + } + if (clone != NULL) { + return clone; // some clauses rewrote + } else + return this; // no clauses rewrote + } + + + Query* BooleanQuery::clone() const{ + BooleanQuery* clone = _CLNEW BooleanQuery(*this); + return clone; + } + + /** Returns true iff o is equal to this. */ + bool BooleanQuery::equals(Query* o)const { + if (!(o->instanceOf(BooleanQuery::getClassName()))) + return false; + const BooleanQuery* other = (BooleanQuery*)o; + + bool ret = (this->getBoost() == other->getBoost()); + if ( ret ){ + CLListEquals comp; + ret = comp.equals(&this->clauses,&other->clauses); + } + return ret; + } + + qreal BooleanQuery::BooleanWeight::getValue() { return parentQuery->getBoost(); } + Query* BooleanQuery::BooleanWeight::getQuery() { return (Query*)parentQuery; } + + + + + + BooleanQuery::BooleanWeight::BooleanWeight(Searcher* searcher, + CLVector >* clauses, BooleanQuery* parentQuery) + { + this->searcher = searcher; + this->parentQuery = parentQuery; + this->clauses = clauses; + for (uint32_t i = 0 ; i < clauses->size(); i++) { + weights.push_back((*clauses)[i]->query->_createWeight(searcher)); + } + } + BooleanQuery::BooleanWeight::~BooleanWeight(){ + this->weights.clear(); + } + + qreal BooleanQuery::BooleanWeight::sumOfSquaredWeights() { + qreal sum = 0.0f; + for (uint32_t i = 0 ; i < weights.size(); i++) { + BooleanClause* c = (*clauses)[i]; + Weight* w = weights[i]; + if (!c->prohibited) + sum += w->sumOfSquaredWeights(); // sum sub weights + } + sum *= parentQuery->getBoost() * parentQuery->getBoost(); // boost each sub-weight + return sum ; + } + + void BooleanQuery::BooleanWeight::normalize(qreal norm) { + norm *= parentQuery->getBoost(); // incorporate boost + for (uint32_t i = 0 ; i < weights.size(); i++) { + BooleanClause* c = (*clauses)[i]; + Weight* w = weights[i]; + if (!c->prohibited) + w->normalize(norm); + } + } + + Scorer* BooleanQuery::BooleanWeight::scorer(IndexReader* reader){ + // First see if the (faster) ConjunctionScorer will work. This can be + // used when all clauses are required. Also, at this point a + // BooleanScorer cannot be embedded in a ConjunctionScorer, as the hits + // from a BooleanScorer are not always sorted by document number (sigh) + // and hence BooleanScorer cannot implement skipTo() correctly, which is + // required by ConjunctionScorer. + bool allRequired = true; + bool noneBoolean = true; + { //msvc6 scope fix + for (uint32_t i = 0 ; i < weights.size(); i++) { + BooleanClause* c = (*clauses)[i]; + if (!c->required) + allRequired = false; + if (c->query->instanceOf(BooleanQuery::getClassName())) + noneBoolean = false; + } + } + + if (allRequired && noneBoolean) { // ConjunctionScorer is okay + ConjunctionScorer* result = + _CLNEW ConjunctionScorer(parentQuery->getSimilarity(searcher)); + for (uint32_t i = 0 ; i < weights.size(); i++) { + Weight* w = weights[i]; + Scorer* subScorer = w->scorer(reader); + if (subScorer == NULL) + return NULL; + result->add(subScorer); + } + return result; + } + + // Use good-old BooleanScorer instead. + BooleanScorer* result = _CLNEW BooleanScorer(parentQuery->getSimilarity(searcher)); + + { //msvc6 scope fix + for (uint32_t i = 0 ; i < weights.size(); i++) { + BooleanClause* c = (*clauses)[i]; + Weight* w = weights[i]; + Scorer* subScorer = w->scorer(reader); + if (subScorer != NULL) + result->add(subScorer, c->required, c->prohibited); + else if (c->required) + return NULL; + } + } + + return result; + } + + void BooleanQuery::BooleanWeight::explain(IndexReader* reader, int32_t doc, Explanation* result){ + int32_t coord = 0; + int32_t maxCoord = 0; + qreal sum = 0.0f; + Explanation* sumExpl = _CLNEW Explanation; + for (uint32_t i = 0 ; i < weights.size(); i++) { + BooleanClause* c = (*clauses)[i]; + Weight* w = weights[i]; + Explanation* e = _CLNEW Explanation; + w->explain(reader, doc, e); + if (!c->prohibited) + maxCoord++; + if (e->getValue() > 0) { + if (!c->prohibited) { + sumExpl->addDetail(e); + sum += e->getValue(); + coord++; + e = NULL; //prevent e from being deleted + } else { + //we want to return something else... + _CLDELETE(sumExpl); + result->setValue(0.0f); + result->setDescription(_T("match prohibited")); + return; + } + } else if (c->required) { + _CLDELETE(sumExpl); + result->setValue(0.0f); + result->setDescription(_T("match prohibited")); + return; + } + + _CLDELETE(e); + } + sumExpl->setValue(sum); + + if (coord == 1){ // only one clause matched + Explanation* tmp = sumExpl; + sumExpl = sumExpl->getDetail(0)->clone(); // eliminate wrapper + _CLDELETE(tmp); + } + + sumExpl->setDescription(_T("sum of:")); + qreal coordFactor = parentQuery->getSimilarity(searcher)->coord(coord, maxCoord); + if (coordFactor == 1.0f){ // coord is no-op + result->set(*sumExpl); // eliminate wrapper + _CLDELETE(sumExpl); + } else { + result->setDescription( _T("product of:")); + result->addDetail(sumExpl); + + StringBuffer explbuf; + explbuf.append(_T("coord(")); + explbuf.appendInt(coord); + explbuf.append(_T("/")); + explbuf.appendInt(maxCoord); + explbuf.append(_T(")")); + result->addDetail(_CLNEW Explanation(coordFactor, explbuf.getBuffer())); + result->setValue(sum*coordFactor); + } + } + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.h new file mode 100644 index 000000000..27b67d1e5 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanQuery.h @@ -0,0 +1,126 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_BooleanQuery_ +#define _lucene_search_BooleanQuery_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "ConjunctionScorer.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/StringBuffer.h" +#include "SearchHeader.h" +#include "BooleanClause.h" +#include "BooleanScorer.h" +#include "Scorer.h" + +CL_NS_DEF(search) + + + // A Query that matches documents matching boolean combinations of other + // queries, typically {@link TermQuery}s or {@link PhraseQuery}s. + class BooleanQuery:public Query { + public: + typedef CL_NS(util)::CLVector > ClausesType; + private: + BooleanQuery::ClausesType clauses; + static size_t maxClauseCount; + + class BooleanWeight: public Weight { + private: + Searcher* searcher; + CL_NS(util)::CLVector > weights; + ClausesType* clauses; + BooleanQuery* parentQuery; + public: + BooleanWeight(Searcher* searcher, + CL_NS(util)::CLVector >* clauses, + BooleanQuery* parentQuery); + ~BooleanWeight(); + Query* getQuery(); + qreal getValue(); + qreal sumOfSquaredWeights(); + void normalize(qreal norm); + Scorer* scorer(CL_NS(index)::IndexReader* reader); + void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret); + };//booleanweight + + protected: + Weight* _createWeight(Searcher* searcher) { + return _CLNEW BooleanWeight(searcher,&clauses,this); + } + BooleanQuery(const BooleanQuery& clone); + public: + /** Constructs an empty boolean query. */ + BooleanQuery(); + + ~BooleanQuery(); + + const TCHAR* getQueryName() const; + static const TCHAR* getClassName(); + + /** Return the maximum number of clauses permitted, 1024 by default. + * Attempts to add more than the permitted number of clauses cause {@link + * TooManyClauses} to be thrown.*/ + static size_t getMaxClauseCount(); + + /** Set the maximum number of clauses permitted. */ + static void setMaxClauseCount(size_t maxClauseCount); + + /** Adds a clause to a boolean query. Clauses may be: + *

    + *
  • required which means that documents which do not + * match this sub-query will not match the boolean query; + *
  • prohibited which means that documents which do + * match this sub-query will not match the boolean query; or + *
  • neither, in which case matched documents are neither prohibited from + * nor required to match the sub-query. However, a document must match at + * least 1 sub-query to match the boolean query. + *
+ * It is an error to specify a clause as both required and + * prohibited. + * + * @see #getMaxClauseCount() + */ + void add(Query* query, const bool required, const bool prohibited){ + add(query,false,required,prohibited); + } + void add(Query* query, const bool deleteQuery, const bool required, const bool prohibited); + + /** Copies the clauses of this query into the array. + * The array must be at least as long as getClauseCount() + * If you want to use the clauses, make sure you null terminate it. + */ + void getClauses(BooleanClause** clauses) const; + + ///@deprecated + _CL_DEPRECATED( getClauses(clauses) ) BooleanClause** getClauses() const; + + /** + * Give client code access to clauses.size() so we know how + * large the array returned by getClauses is. + */ + size_t getClauseCount() const; + + /** Adds a clause to a boolean query. + * @see #getMaxClauseCount() + */ + void add(BooleanClause* clause); + + Query* rewrite(CL_NS(index)::IndexReader* reader); + Query* clone() const; + bool equals(Query* o) const; + + /** Prints a user-readable version of this query. */ + TCHAR* toString(const TCHAR* field) const; + /** Returns a hash code value for this object.*/ + size_t hashCode() const; + }; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp new file mode 100644 index 000000000..ae7ee40d6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.cpp @@ -0,0 +1,248 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "BooleanScorer.h" + +#include "Scorer.h" +#include "Similarity.h" + +CL_NS_USE(util) +CL_NS_DEF(search) + + BooleanScorer::BooleanScorer(Similarity* similarity): + Scorer(similarity), + scorers(NULL), + maxCoord (1), + nextMask (1), + end(0), + current(NULL), + requiredMask (0), + prohibitedMask (0), + coordFactors (NULL) + { + bucketTable = _CLNEW BucketTable(this); + } + + BooleanScorer::~BooleanScorer(){ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + _CLDELETE(bucketTable); + _CLDELETE_ARRAY(coordFactors); + _CLDELETE(scorers); + } + + + bool BooleanScorer::next() { + bool more; + do { + while (bucketTable->first != NULL) { // more queued + current = bucketTable->first; + bucketTable->first = current->next; // pop the queue + + // check prohibited & required + if ((current->bits & prohibitedMask) == 0 && + (current->bits & requiredMask) == requiredMask) { + return true; + } + } + + // refill the queue + more = false; + end += BooleanScorer::BucketTable_SIZE; + for (SubScorer* sub = scorers; sub != NULL; sub = sub->next) { + Scorer* scorer = sub->scorer; + int32_t doc; + while (!sub->done && (doc=scorer->doc()) < end) { + sub->collector->collect(doc, scorer->score()); + sub->done = !scorer->next(); + } + if (!sub->done) { + more = true; + } + } + } while (bucketTable->first != NULL || more); + + return false; + } + + qreal BooleanScorer::score(){ + if (coordFactors == NULL) + computeCoordFactors(); + return current->score * coordFactors[current->coord]; + } + + bool BooleanScorer::skipTo(int32_t target) { + _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: BooleanScorer::skipTo"); + } + + void BooleanScorer::explain(int32_t doc, Explanation* ret) { + _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: BooleanScorer::explain"); + } + + TCHAR* BooleanScorer::toString() { + CL_NS(util)::StringBuffer buffer; + buffer.append(_T("boolean(")); + for (SubScorer* sub = scorers; sub != NULL; sub = sub->next) { + buffer.append(sub->scorer->toString()); + buffer.append(_T(" ")); + } + buffer.appendChar(')'); + return buffer.toString(); + } + + void BooleanScorer::add(Scorer* scorer, const bool required, const bool prohibited) { + int32_t mask = 0; + if (required || prohibited) { + if (nextMask == 0) + _CLTHROWA(CL_ERR_IndexOutOfBounds, "More than 32 required/prohibited clauses in query."); + mask = nextMask; + nextMask = ( nextMask << 1 ); + } else + mask = 0; + + if (!prohibited) + maxCoord++; + + if (prohibited) + prohibitedMask |= mask; // update prohibited mask + else if (required) + requiredMask |= mask; // update required mask + + //scorer, HitCollector, and scorers is delete in the SubScorer + scorers = _CLNEW SubScorer(scorer, required, prohibited, + bucketTable->newCollector(mask), scorers); + } + + void BooleanScorer::computeCoordFactors(){ + coordFactors = _CL_NEWARRAY(qreal,maxCoord); + for (int32_t i = 0; i < maxCoord; i++) + coordFactors[i] = getSimilarity()->coord(i, maxCoord-1); + } + + /*void BooleanScorer::score(HitCollector* results, const int32_t maxDoc) { + if (coordFactors == NULL) + computeCoordFactors(); + + while (currentDoc < maxDoc) { + currentDoc = (currentDoc+BucketTable_SIZEnext) + t->scorer->score((t->collector), currentDoc); + bucketTable->collectHits(results); + } + }*/ + + + + + BooleanScorer::SubScorer::SubScorer(Scorer* scr, const bool r, const bool p, HitCollector* c, SubScorer* nxt): + scorer(scr), + required(r), + prohibited(p), + collector(c), + next(nxt) + { + //Func - Constructor + //Pre - scr != NULL, + // c != NULL + // nxt may or may not be NULL + //Post - The instance has been created + + CND_PRECONDITION(scr != NULL,"scr is NULL"); + CND_PRECONDITION(c != NULL,"c is NULL"); + + done = !scorer->next(); + } + + BooleanScorer::SubScorer::~SubScorer(){ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + for (SubScorer * ptr = next; ptr; ){ + SubScorer* next = ptr->next; + ptr->next = NULL; + _CLDELETE(ptr); + ptr = next; + } + _CLDELETE(scorer); + _CLDELETE(collector); + } + + BooleanScorer::Bucket::Bucket(): + doc(-1), + score(0.0), + bits(0), + coord(0), + next(NULL) + { + } + BooleanScorer::Bucket::~Bucket(){ + } + + + + + BooleanScorer::BucketTable::BucketTable(BooleanScorer* scr): + scorer(scr), + first(NULL) + { + buckets = _CL_NEWARRAY(Bucket,BucketTable_SIZE); + } + BooleanScorer::BucketTable::~BucketTable(){ + clear(); + _CLDELETE_ARRAY(buckets); + } + + void BooleanScorer::BucketTable::clear(){ + //delete first; + first = NULL; + } + int32_t BooleanScorer::BucketTable::size() const { return BooleanScorer::BucketTable_SIZE; } + + HitCollector* BooleanScorer::BucketTable::newCollector(const int32_t mask) { + return _CLNEW Collector(mask, this); + } + + + + + + + + + + BooleanScorer::Collector::Collector(const int32_t msk, BucketTable* bucketTbl): + bucketTable(bucketTbl), + mask(msk) + { + } + + void BooleanScorer::Collector::collect(const int32_t doc, const qreal score){ + BucketTable* table = bucketTable; + int32_t i = doc & (BooleanScorer::BucketTable_SIZE-1); + Bucket* bucket = &table->buckets[i]; + + if (bucket->doc != doc) { // invalid bucket + bucket->doc = doc; // set doc + bucket->score = score; // initialize score + bucket->bits = mask; // initialize mask + bucket->coord = 1; // initialize coord + + bucket->next = table->first; // push onto valid list + table->first = bucket; + } else { // valid bucket + bucket->score += score; // increment score + bucket->bits |= mask; // add bits in mask + bucket->coord++; // increment coord + } + } + + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.h new file mode 100644 index 000000000..2147bc516 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/BooleanScorer.h @@ -0,0 +1,99 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_BooleanScorer_ +#define _lucene_search_BooleanScorer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Scorer.h" + +CL_NS_DEF(search) + +class BooleanScorer : public Scorer { +public: + class Bucket : LUCENE_BASE { + public: + int32_t doc; // tells if bucket is valid + qreal score; // incremental score + int32_t bits; // used for bool constraints + int32_t coord; // count of terms in score + Bucket* next; // next valid bucket + + Bucket(); + ~Bucket(); + }; + + class SubScorer: LUCENE_BASE { + public: + bool done; + Scorer* scorer; + bool required; + bool prohibited; + HitCollector* collector; + SubScorer* next; + SubScorer(Scorer* scr, const bool r, const bool p, HitCollector* c, SubScorer* nxt); + ~SubScorer(); + }; + + class BucketTable:LUCENE_BASE { + private: + BooleanScorer* scorer; + public: + Bucket* buckets; + Bucket* first; // head of valid list + + BucketTable(BooleanScorer* scr); + int32_t size() const; + HitCollector* newCollector(const int32_t mask); + void clear(); + ~BucketTable(); + + }; + + class Collector: public HitCollector { + private: + BucketTable* bucketTable; + int32_t mask; + public: + Collector(const int32_t mask, BucketTable* bucketTable); + + void collect(const int32_t doc, const qreal score); + }; + + SubScorer* scorers; + BucketTable* bucketTable; + + int32_t maxCoord; + int32_t nextMask; + + int32_t end; + Bucket* current; + +public: + LUCENE_STATIC_CONSTANT(int32_t,BucketTable_SIZE=1024); + int32_t requiredMask; + int32_t prohibitedMask; + qreal* coordFactors; + + BooleanScorer(Similarity* similarity); + ~BooleanScorer(); + void add(Scorer* scorer, const bool required, const bool prohibited); + int32_t doc() const { return current->doc; } + bool next(); + qreal score(); + bool skipTo(int32_t target); + void explain(int32_t doc, Explanation* ret); + TCHAR* toString(); + void computeCoordFactors(); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp new file mode 100644 index 000000000..694556ca7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.cpp @@ -0,0 +1,86 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CachingWrapperFilter.h" + +CL_NS_DEF(search) +CL_NS_USE(index) +CL_NS_USE(util) + +AbstractCachingFilter::AbstractCachingFilter(): + cache(false,true) +{ +} +AbstractCachingFilter::AbstractCachingFilter(const AbstractCachingFilter& copy): + cache(false,true) +{ +} +AbstractCachingFilter::~AbstractCachingFilter(){ +} +AbstractCachingFilter::BitSetHolder::BitSetHolder(CL_NS(util)::BitSet* bits, bool deleteBs){ + this->bits = bits; + this->deleteBs = deleteBs; +} +AbstractCachingFilter::BitSetHolder::~BitSetHolder(){ + if ( deleteBs ) + _CLDELETE(bits); +} + + +BitSet* AbstractCachingFilter::bits(IndexReader* reader){ + SCOPED_LOCK_MUTEX(cache.THIS_LOCK) + BitSetHolder* cached = cache.get(reader); + if ( cached != NULL ) + return cached->bits; + BitSet* bs = doBits(reader); + BitSetHolder* bsh = _CLNEW BitSetHolder(bs, doShouldDeleteBitSet(bs)); + cache.put(reader,bsh); + return bs; +} +void AbstractCachingFilter::closeCallback(CL_NS(index)::IndexReader* reader, void*){ + SCOPED_LOCK_MUTEX(cache.THIS_LOCK) + cache.remove(reader); +} + + + + +CachingWrapperFilter::CachingWrapperFilter(Filter* filter, bool deleteFilter){ + this->filter = filter; + this->deleteFilter = deleteFilter; +} +CachingWrapperFilter::CachingWrapperFilter(const CachingWrapperFilter& copy): + AbstractCachingFilter(copy) +{ + this->filter = copy.filter->clone(); + this->deleteFilter = true; +} +Filter* CachingWrapperFilter::clone() const{ + return _CLNEW CachingWrapperFilter(*this); +} +TCHAR* CachingWrapperFilter::toString(){ + TCHAR* fs = filter->toString(); + int len = _tcslen(fs)+23; + TCHAR* ret = _CL_NEWARRAY(TCHAR,len); + _sntprintf(ret,len,_T("CachingWrapperFilter(%s)"),fs); + _CLDELETE_CARRAY(fs); + return ret; +} +BitSet* CachingWrapperFilter::doBits(IndexReader* reader){ + return filter->bits(reader); +} +bool CachingWrapperFilter::doShouldDeleteBitSet( CL_NS(util)::BitSet* bits ){ + return filter->shouldDeleteBitSet(bits); +} +CachingWrapperFilter::~CachingWrapperFilter(){ + if ( deleteFilter ){ + _CLDELETE(filter); + }else + filter=NULL; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h b/src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h new file mode 100644 index 000000000..e48a18292 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/CachingWrapperFilter.h @@ -0,0 +1,80 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_CachingWrapperFilter_ +#define _lucene_search_CachingWrapperFilter_ + +#include "CLucene/util/BitSet.h" +#include "CLucene/index/IndexReader.h" +#include "Filter.h" + +CL_NS_DEF(search) +/** + * Wraps another filter's result and caches it. The purpose is to allow + * filters to implement this and allow itself to be cached. Alternatively, + * use the CachingWrapperFilter to cache the filter. + */ +class AbstractCachingFilter: public Filter +{ + class BitSetHolder: LUCENE_BASE{ + bool deleteBs; + public: + BitSetHolder(CL_NS(util)::BitSet* bits, bool deleteBs); + ~BitSetHolder(); + CL_NS(util)::BitSet* bits; + }; + void closeCallback(CL_NS(index)::IndexReader* reader, void* param); + typedef CL_NS(util)::CLHashMap, + CL_NS(util)::Equals::Void, + CL_NS(util)::Deletor::Object, + CL_NS(util)::Deletor::Object > CacheType; + + CacheType cache; + +protected: + AbstractCachingFilter( const AbstractCachingFilter& copy ); + virtual CL_NS(util)::BitSet* doBits( CL_NS(index)::IndexReader* reader ) = 0; + virtual bool doShouldDeleteBitSet( CL_NS(util)::BitSet* bits ){ return false; } + AbstractCachingFilter(); +public: + virtual ~AbstractCachingFilter(); + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); + + virtual Filter *clone() const = 0; + virtual TCHAR *toString() = 0; + + bool shouldDeleteBitSet( const CL_NS(util)::BitSet* bits ) const{ return false; } +}; + +/** + * Wraps another filter's result and caches it. The purpose is to allow + * filters to simply filter, and then wrap with this class to add + * caching, keeping the two concerns decoupled yet composable. + */ +class CachingWrapperFilter: public AbstractCachingFilter +{ +private: + Filter* filter; + bool deleteFilter; +protected: + CachingWrapperFilter( const CachingWrapperFilter& copy ); + CL_NS(util)::BitSet* doBits( CL_NS(index)::IndexReader* reader ); + bool doShouldDeleteBitSet( CL_NS(util)::BitSet* bits ); +public: + CachingWrapperFilter( Filter* filter, bool deleteFilter=true ); + ~CachingWrapperFilter(); + + Filter *clone() const; + TCHAR *toString(); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp new file mode 100644 index 000000000..4b6389c0f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.cpp @@ -0,0 +1,213 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +#include +#include +#include "ChainedFilter.h" + +CL_NS_DEF(search) +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_USE(document) + + +ChainedFilter::ChainedFilter( Filter ** _filters, int _op ): + filters(_filters), + logicArray(NULL), + logic(_op) +{ +} +ChainedFilter::ChainedFilter( Filter** _filters, int* _array ): + filters(_filters), + logicArray(_array), + logic(-1) +{ +} +ChainedFilter::ChainedFilter( const ChainedFilter& copy ) : + logicArray( copy.logicArray ), + logic( copy.logic ) +{ + filters = copy.filters; +} +ChainedFilter::~ChainedFilter(void) +{ + +} + +Filter* ChainedFilter::clone() const { + return _CLNEW ChainedFilter(*this ); +} + +const TCHAR* ChainedFilter::getLogicString(int logic){ + if ( logic == ChainedFilter::OR ) + return _T("OR"); + else if ( logic == ChainedFilter::AND ) + return _T("AND"); + else if ( logic == ChainedFilter::ANDNOT ) + return _T("ANDNOT"); + else if ( logic == ChainedFilter::XOR ) + return _T("XOR"); + else if ( logic >= ChainedFilter::USER ){ + return _T("USER"); + } + return _T(""); +} + +TCHAR* ChainedFilter::toString() +{ + + Filter** filter = filters; + + StringBuffer buf(_T("ChainedFilter: [")); + int* la = logicArray; + while(*filter ) + { + if ( filter != filters ) + buf.appendChar(' '); + buf.append(getLogicString(logic==-1?*la:logic)); + buf.appendChar(' '); + + TCHAR* filterstr = (*filter)->toString(); + buf.append(filterstr); + _CLDELETE_ARRAY( filterstr ); + + filter++; + if ( logic == -1 ) + la++; + } + + buf.appendChar(']'); + + return buf.toString(); +} + + +/** Returns a BitSet with true for documents which should be permitted in +search results, and false for those that should not. */ +BitSet* ChainedFilter::bits( IndexReader* reader ) +{ + if( logic != -1 ) + return bits( reader, logic ); + else if( logicArray != NULL ) + return bits( reader, logicArray ); + else + return bits( reader, DEFAULT ); +} + + +BitSet* ChainedFilter::bits( IndexReader* reader, int logic ) +{ + BitSet* bts = NULL; + + Filter** filter = filters; + + // see discussion at top of file + if( *filter ) { + BitSet* tmp = (*filter)->bits( reader ); + if ( (*filter)->shouldDeleteBitSet(tmp) ) //if we are supposed to delete this BitSet, then + bts = tmp; //we can safely call it our own + else if ( tmp == NULL ){ + int32_t len = reader->maxDoc(); + bts = _CLNEW BitSet( len ); //bitset returned null, which means match _all_ + for (int32_t i=0;iset(i); + }else{ + bts = tmp->clone(); //else it is probably cached, so we need to copy it before using it. + } + filter++; + } + else + bts = _CLNEW BitSet( reader->maxDoc() ); + + while( *filter ) { + doChain( bts, reader, logic, *filter ); + filter++; + } + + return bts; +} + + +BitSet* ChainedFilter::bits( IndexReader* reader, int* _logicArray ) +{ + BitSet* bts = NULL; + + Filter** filter = filters; + int* logic = _logicArray; + + // see discussion at top of file + if( *filter ) { + BitSet* tmp = (*filter)->bits( reader ); + if ( (*filter)->shouldDeleteBitSet(tmp) ) //if we are supposed to delete this BitSet, then + bts = tmp; //we can safely call it our own + else if ( tmp == NULL ){ + int32_t len = reader->maxDoc(); + bts = _CLNEW BitSet( len ); //bitset returned null, which means match _all_ + for (int32_t i=0;iset(i); //todo: this could mean that we can skip certain types of filters + } + else + { + bts = tmp->clone(); //else it is probably cached, so we need to copy it before using it. + } + filter++; + logic++; + } + else + bts = _CLNEW BitSet( reader->maxDoc() ); + + while( *filter ) { + doChain( bts, reader, *logic, *filter ); + filter++; + logic++; + } + + return bts; +} + +void ChainedFilter::doUserChain( CL_NS(util)::BitSet* chain, CL_NS(util)::BitSet* filter, int logic ){ + _CLTHROWA(CL_ERR_Runtime,"User chain logic not implemented by superclass"); +} + +BitSet* ChainedFilter::doChain( BitSet* resultset, IndexReader* reader, int logic, Filter* filter ) +{ + BitSet* filterbits = filter->bits( reader ); + int32_t maxDoc = reader->maxDoc(); + int32_t i=0; + if ( logic >= ChainedFilter::USER ){ + doUserChain(resultset,filterbits,logic); + }else{ + switch( logic ) + { + case OR: + for( i=0; i < maxDoc; i++ ) + resultset->set( i, (resultset->get(i) || (filterbits==NULL || filterbits->get(i) ))?1:0 ); + break; + case AND: + for( i=0; i < maxDoc; i++ ) + resultset->set( i, (resultset->get(i) && (filterbits==NULL || filterbits->get(i) ))?1:0 ); + break; + case ANDNOT: + for( i=0; i < maxDoc; i++ ) + resultset->set( i, (resultset->get(i) && (filterbits==NULL || filterbits->get(i)))?0:1 ); + break; + case XOR: + for( i=0; i < maxDoc; i++ ) + resultset->set( i, resultset->get(i) ^ ((filterbits==NULL || filterbits->get(i) )?1:0) ); + break; + default: + doChain( resultset, reader, DEFAULT, filter ); + } + } + + if ( filter->shouldDeleteBitSet(filterbits) ) + _CLDELETE( filterbits ); + + return resultset; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.h b/src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.h new file mode 100644 index 000000000..f4d9d0049 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/ChainedFilter.h @@ -0,0 +1,86 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_ChainedFilter_ +#define _lucene_search_ChainedFilter_ + +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/BitSet.h" +#include "CLucene/search/Filter.h" + +CL_NS_DEF(search) + +/* +Discussion - brian@unixpoet.com + +From ChainedFilter.java: + +... + +// First AND operation takes place against a completely false +// bitset and will always return zero results. Thanks to +// Daniel Armbrust for pointing this out and suggesting workaround. + +if (logic[0] == AND) +{ + result = (BitSet) chain[i].bits(reader).clone(); + ++i; +} + +... + +The observation is correct and it was buggy. The problem is that the same +issue remains for the ANDNOT logic op but with the inverse result: all bits +set to 1. The result of the other ops, i.e. OR, AND, XOR for the first filter +ends up just copying the bitset of the first filter (explicitly in the case of the AND). + +Why not do the same for the NAND? This will have the side effect of rendering the first op +in the logic array superflous - not a big problem. + +The only "problem" is that we will return different results then the Java +Lucene code - though I prefer CLucene to be a correct implementation and only maintain +API compat rather than full 100% compat with Lucene. +*/ +class ChainedFilter: public Filter +{ +public: + LUCENE_STATIC_CONSTANT(int, OR = 0); //set current bit if the chain is set OR if the filter bit is set + LUCENE_STATIC_CONSTANT(int, AND = 1); //set current bit if the chain is set AND the filter bit is set + LUCENE_STATIC_CONSTANT(int, ANDNOT = 2); //set current bit if the chain is not set AND the filter bit is not set + LUCENE_STATIC_CONSTANT(int, XOR = 3); //set current bit if the chain is set OR the filter bit is set BUT not both is set + + LUCENE_STATIC_CONSTANT(int, USER = 5); //add this value to user defined value, then override doUserChain + + LUCENE_STATIC_CONSTANT(int, DEFAULT = OR); + +protected: + Filter **filters; + int *logicArray; + int logic; + + ChainedFilter( const ChainedFilter& copy ); + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader, int logic ); + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader, int* logicArray ); + CL_NS(util)::BitSet* doChain( CL_NS(util)::BitSet* result, CL_NS(index)::IndexReader* reader, int logic, Filter* filter ); + + virtual void doUserChain( CL_NS(util)::BitSet* chain, CL_NS(util)::BitSet* filter, int logic ); + virtual const TCHAR* getLogicString(int logic); +public: + ChainedFilter( Filter** filters, int op = DEFAULT ); + ChainedFilter( Filter** filters, int* _array ); + virtual ~ChainedFilter(); + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); + + virtual Filter* clone() const; + + TCHAR* toString(); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Compare.h b/src/assistant/3rdparty/clucene/src/CLucene/search/Compare.h new file mode 100644 index 000000000..ab38b17f1 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Compare.h @@ -0,0 +1,161 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_Compare_ +#define _lucene_search_Compare_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "FieldSortedHitQueue.h" + +CL_NS_DEF(search) + + +class ScoreDocComparators:LUCENE_BASE { +protected: + ScoreDocComparators(){} +public: + ~ScoreDocComparators(){ + } + + class Relevance:public ScoreDocComparator { + public: + int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { + if (i->score > j->score) return -1; + if (i->score < j->score) return 1; + return 0; + } + CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { + return _CLNEW CL_NS(util)::Compare::Float (i->score); + } + int32_t sortType() { + return SortField::DOCSCORE; + } + }; + + class IndexOrder:public ScoreDocComparator{ + public: + IndexOrder(): + ScoreDocComparator() + { + + } + int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { + if (i->doc < j->doc) return -1; + if (i->doc > j->doc) return 1; + return 0; + } + CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { + return _CLNEW CL_NS(util)::Compare::Int32(i->doc); + } + int32_t sortType() { + return SortField::DOC; + } + }; + + + class String: public ScoreDocComparator { + FieldCache::StringIndex* index; +#ifdef _CL__CND_DEBUG + int32_t length; +#endif + public: + String(FieldCache::StringIndex* index, int32_t len) + { +#ifdef _CL__CND_DEBUG + this->length = len; +#endif + this->index = index; + } + + int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { + CND_PRECONDITION(i->docdoc>=length") + CND_PRECONDITION(j->docdoc>=length") + if (index->order[i->doc] < index->order[j->doc]) return -1; + if (index->order[i->doc] > index->order[j->doc]) return 1; + return 0; + } + + CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { + return _CLNEW CL_NS(util)::Compare::TChar(index->lookup[index->order[i->doc]]); + } + + int32_t sortType() { + return SortField::STRING; + } + }; + + class Int32:public ScoreDocComparator{ + int32_t* fieldOrder; +#ifdef _CL__CND_DEBUG + int32_t length; +#endif + public: + Int32(int32_t* fieldOrder, int32_t len) + { + this->fieldOrder = fieldOrder; +#ifdef _CL__CND_DEBUG + this->length = len; +#endif + } + + + int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { + CND_PRECONDITION(i->docdoc>=length") + CND_PRECONDITION(j->docdoc>=length") + if (fieldOrder[i->doc] < fieldOrder[j->doc]) return -1; + if (fieldOrder[i->doc] > fieldOrder[j->doc]) return 1; + return 0; + } + + CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { + CND_PRECONDITION(i->docdoc>=length") + return _CLNEW CL_NS(util)::Compare::Int32(fieldOrder[i->doc]); + } + + int32_t sortType() { + return SortField::INT; + } + }; + + class Float:public ScoreDocComparator { + qreal* fieldOrder; +#ifdef _CL__CND_DEBUG + int32_t length; +#endif + public: + Float(qreal* fieldOrder, int32_t len) + { + this->fieldOrder = fieldOrder; +#ifdef _CL__CND_DEBUG + this->length = len; +#endif + } + + int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) { + CND_PRECONDITION(i->docdoc>=length") + CND_PRECONDITION(j->docdoc>=length") + if (fieldOrder[i->doc] < fieldOrder[j->doc]) return -1; + if (fieldOrder[i->doc] > fieldOrder[j->doc]) return 1; + return 0; + } + + CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) { + CND_PRECONDITION(i->docdoc>=length") + return _CLNEW CL_NS(util)::Compare::Float(fieldOrder[i->doc]); + } + + int32_t sortType() { + return SortField::FLOAT; + } + }; +}; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp new file mode 100644 index 000000000..9b7846f8e --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.cpp @@ -0,0 +1,144 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "ConjunctionScorer.h" +#include "CLucene/util/Arrays.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + Scorer* ConjunctionScorer::first() const{ + if ( scorers.end() == scorers.begin() ) + return NULL; + + return *scorers.begin(); + } //get First + Scorer* ConjunctionScorer::last() { + if ( scorers.end() == scorers.begin() ) + return NULL; + + CL_NS_STD(list)::iterator i = scorers.end(); + --i; + return *i; + } //get Last + + class _ScorerSorter:public CL_NS(util)::Arrays::_Arrays{ + public: + bool equals(Scorer* o1,Scorer* o2) const{ + return o1->doc() == o2->doc(); + } + int32_t compare(Scorer* o1,Scorer* o2) const{ + return o1->doc() - o2->doc(); + } + }; + _ScorerSorter __ScorerSorter; + + void ConjunctionScorer::sortScorers() { + // move scorers to an array + int32_t size = scorers.size(); + Scorer** array = _CL_NEWARRAY(Scorer*,size+1); + scorers.toArray(array); + scorers.clear(); // empty the list + + // note that this comparator is not consistent with equals! + __ScorerSorter.sort(array,size,0,size); + + for (int32_t i = 0; idoc() < last()->doc()) { // find doc w/ all clauses + more = first()->skipTo(last()->doc()); // skip first upto last + Scorer* scorer = *scorers.begin(); + scorers.delete_front(); + scorers.push_back(scorer); // move first to last + } + return more; // found a doc with all clauses + } + + + void ConjunctionScorer::init() { + more = scorers.size() > 0; + + // compute coord factor + coord = getSimilarity()->coord(scorers.size(), scorers.size()); + + // move each scorer to its first entry + CL_NS_STD(list)::iterator i = scorers.begin(); + while (more && i!=scorers.end()) { + more = ((Scorer*)*i)->next(); + ++i; + } + + if (more) + sortScorers(); // initial sort of list + + firstTime = false; + } + + ConjunctionScorer::ConjunctionScorer(Similarity* similarity): + Scorer(similarity), + scorers(false), + firstTime(true), + more(true), + coord(0.0) + { + } + ConjunctionScorer::~ConjunctionScorer(){ + scorers.setDoDelete(true); + } + + TCHAR *CL_NS(search)::Scorer::toString(void){ + return STRDUP_TtoT(_T("ConjunctionScorer")); + } + + + void ConjunctionScorer::add(Scorer* scorer){ + scorers.push_back(scorer); + } + + + int32_t ConjunctionScorer::doc() const{ return first()->doc(); } + + bool ConjunctionScorer::next() { + if (firstTime) { + init(); + } else if (more) { + more = last()->next(); // trigger further scanning + } + return doNext(); + } + + bool ConjunctionScorer::skipTo(int32_t target) { + CL_NS_STD(list)::iterator i = scorers.begin(); + while (more && i!=scorers.end()) { + more = ((Scorer*)*i)->skipTo(target); + ++i; + } + if (more) + sortScorers(); // re-sort scorers + return doNext(); + } + + qreal ConjunctionScorer::score(){ + qreal score = 0.0f; // sum scores + CL_NS_STD(list)::const_iterator i = scorers.begin(); + while (i!=scorers.end()){ + score += (*i)->score(); + ++i; + } + score *= coord; + return score; + } + + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h new file mode 100644 index 000000000..4b6807209 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/ConjunctionScorer.h @@ -0,0 +1,50 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_ConjunctionScorer_ +#define _lucene_search_ConjunctionScorer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif +#include "Scorer.h" +#include "Similarity.h" + +CL_NS_DEF(search) + +/** Scorer for conjunctions, sets of queries, all of which are required. */ +class ConjunctionScorer: public Scorer { +private: + CL_NS(util)::CLLinkedList > scorers; + bool firstTime; + bool more; + qreal coord; + + Scorer* first() const; + Scorer* last(); + void sortScorers(); + bool doNext(); + void init(); +public: + ConjunctionScorer(Similarity* similarity); + virtual ~ConjunctionScorer(); + TCHAR* toString(void){ + return STRDUP_TtoT(_T("ConjunctionScorer")); + } + void add(Scorer* scorer); + int32_t doc() const; + bool next(); + bool skipTo(int32_t target); + qreal score(); + virtual void explain(int32_t doc, Explanation* ret) { + _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: ConjunctionScorer::explain"); + } + + +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.cpp new file mode 100644 index 000000000..925858204 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.cpp @@ -0,0 +1,93 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "DateFilter.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_USE(document) +CL_NS_DEF(search) + + DateFilter::~DateFilter(){ + _CLDECDELETE( start ); + _CLDECDELETE( end ); + } + + DateFilter::DateFilter(const DateFilter& copy): + start( _CL_POINTER(copy.start) ), + end ( _CL_POINTER(copy.end) ) + { + } + + /** Constructs a filter for field f matching times between + from and to. */ + DateFilter::DateFilter(const TCHAR* f, int64_t from, int64_t to) + { + TCHAR* tmp = DateField::timeToString(from); + start = _CLNEW Term(f, tmp); + _CLDELETE_CARRAY(tmp); + + tmp = DateField::timeToString(to); + end = _CLNEW Term(start, tmp); + _CLDELETE_CARRAY(tmp); + } + + /** Constructs a filter for field f matching times before + time. */ + DateFilter* DateFilter::Before(const TCHAR* field, int64_t time) { + return _CLNEW DateFilter(field, 0,time); + } + + /** Constructs a filter for field f matching times after + time. */ + DateFilter* DateFilter::After(const TCHAR* field, int64_t time) { + return _CLNEW DateFilter(field,time, DATEFIELD_DATE_MAX ); + } + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + BitSet* DateFilter::bits(IndexReader* reader) { + BitSet* bts = _CLNEW BitSet(reader->maxDoc()); + + TermEnum* enumerator = reader->terms(start); + if (enumerator->term(false) == NULL){ + _CLDELETE(enumerator); + return bts; + } + TermDocs* termDocs = reader->termDocs(); + + try { + while (enumerator->term(false)->compareTo(end) <= 0) { + termDocs->seek(enumerator->term(false)); + while (termDocs->next()) { + bts->set(termDocs->doc()); + } + if (!enumerator->next()) { + break; + } + } + } _CLFINALLY ( + termDocs->close(); + _CLDELETE(termDocs); + enumerator->close(); + _CLDELETE(enumerator); + ); + return bts; + } + + Filter* DateFilter::clone() const{ + return _CLNEW DateFilter(*this); + } + + TCHAR* DateFilter::toString(){ + size_t len = _tcslen(start->field()) + start->textLength() + end->textLength() + 8; + TCHAR* ret = _CL_NEWARRAY(TCHAR,len); + ret[0]=0; + _sntprintf(ret,len,_T("%s: [%s-%s]"), start->field(),start->text(),end->text()); + return ret; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.h b/src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.h new file mode 100644 index 000000000..b37272b84 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/DateFilter.h @@ -0,0 +1,59 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_DateFilter_ +#define _lucene_search_DateFilter_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/document/DateField.h" +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/BitSet.h" +#include "Filter.h" + +CL_NS_DEF(search) + /** + * A Filter that restricts search results to a range of time. + * + *

For this to work, documents must have been indexed with a + * {@link DateField}. + */ + class DateFilter: public Filter { + private: + CL_NS(index)::Term* start; + CL_NS(index)::Term* end; + + protected: + DateFilter(const DateFilter& copy); + public: + ~DateFilter(); + + /** Constructs a filter for field f matching times between + from and to. */ + DateFilter(const TCHAR* f, int64_t from, int64_t to); + + /** Constructs a filter for field f matching times before + time. */ + static DateFilter* Before(const TCHAR* field, int64_t time) ; + + /** Constructs a filter for field f matching times after + time. */ + static DateFilter* After(const TCHAR* field, int64_t time) ; + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + CL_NS(util)::BitSet* bits(CL_NS(index)::IndexReader* reader) ; + + Filter* clone() const; + + TCHAR* toString(); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp new file mode 100644 index 000000000..1fbf2e99d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.cpp @@ -0,0 +1,85 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "ExactPhraseScorer.h" + +#include "PhraseScorer.h" +#include "CLucene/index/Terms.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + ExactPhraseScorer::ExactPhraseScorer(Weight* weight, TermPositions** tps, + int32_t* positions, Similarity* similarity, uint8_t* norms): + PhraseScorer(weight, tps, positions, similarity, norms){ + //Func - Constructor + //Pre - tps != NULL + // tpsLength >= 0 + // n != NULL + //Post - Instance has been created + + CND_PRECONDITION(tps != NULL,"tps is NULL"); + CND_PRECONDITION(tps[0] != NULL,"tps is NULL"); + //CND_PRECONDITION(n != NULL,"n is NULL") =this is checked already in PhraseScorer + + } + + qreal ExactPhraseScorer::phraseFreq(){ + //Func - Returns the freqency of the phrase + //Pre - first != NULL + // last != NULL + // pq != NULL + // size of the PhraseQueue pq is 0 + //Post - The frequency of the phrase has been returned + + CND_PRECONDITION(first != NULL,"first is NULL"); + CND_PRECONDITION(last != NULL,"last is NULL"); + CND_PRECONDITION(pq != NULL,"pq is NULL"); + CND_PRECONDITION(pq->size()==0,"pq is not empty"); + + //build pq from list + + //Add the nodes of the list of PhrasePositions and store them + //into the PhraseQueue pq so it can used to build + //a list of sorted nodes + for (PhrasePositions* pp = first; pp != NULL; pp = pp->_next) { + //Read the first TermPosition of the current PhrasePositions pp + pp->firstPosition(); + //Store the current PhrasePositions pp into the PhraseQueue pq + pq->put(pp); + } + //pqToList requires that first and last be NULL when it's called. + //This is done at the beginning of pqToList() + //In this case, the nodes of the linked list are referenced by pq (see + //above loop), so we can clear our pointers to the head and tail of the + //linked list without fear of leaking the nodes. + + //rebuild list from pq + pqToList(); + + //Initialize freq at 0 + int32_t freq = 0; + + //find position with all terms + do { + //scan forward in first + while (first->position < last->position){ + do{ + if (!first->nextPosition()){ + return (qreal)freq; + } + } while (first->position < last->position); + //Make the current first node the last node in the list + firstToLast(); + } + //all equal: a match has been found + freq++; + } while (last->nextPosition()); + + return (qreal)freq; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h new file mode 100644 index 000000000..d82aa9e9a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/ExactPhraseScorer.h @@ -0,0 +1,31 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_ExactPhraseScorer_ +#define _lucene_search_ExactPhraseScorer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "PhraseScorer.h" +#include "CLucene/index/Terms.h" + +CL_NS_DEF(search) + + class ExactPhraseScorer: public PhraseScorer { + public: + ExactPhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, int32_t* positions, + Similarity* similarity, uint8_t* norms ); + + ~ExactPhraseScorer(){ + } + protected: + //Returns the exact freqency of the phrase + qreal phraseFreq(); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.cpp new file mode 100644 index 000000000..87189b71b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.cpp @@ -0,0 +1,133 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Explanation.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_USE(util) +CL_NS_DEF(search) + + +Explanation::Explanation(qreal value, const TCHAR* description) { + this->value = value; + _tcsncpy(this->description,description,LUCENE_SEARCH_EXPLANATION_DESC_LEN); +} + +Explanation::Explanation() { + this->value = 0; + this->description[0]=0; +} + +Explanation::Explanation(const Explanation& copy){ + set(copy); +} +void Explanation::set(const Explanation& copy){ + this->value = copy.value; + STRCPY_TtoT(description,copy.description,LUCENE_SEARCH_EXPLANATION_DESC_LEN); + + details.clear(); + typedef CL_NS(util)::Deletor::Object Deletor; + CL_NS(util)::CLArrayList::const_iterator itr; + itr = copy.details.begin(); + while ( itr != copy.details.end() ){ + details.push_back( (*itr)->clone() ); + ++itr; + } +} + +Explanation::~Explanation(){ +} + +void Explanation::setDescription(const TCHAR* description) { + _tcsncpy(this->description,description,LUCENE_SEARCH_EXPLANATION_DESC_LEN); +} + + +Explanation* Explanation::clone() const{ + return _CLNEW Explanation(*this); +} + +qreal Explanation::getValue() const{ + return value; +} + +void Explanation::setValue(qreal value) { + this->value = value; +} + +const TCHAR* Explanation::getDescription() const { + return description; +} + +///todo: mem leaks +TCHAR* Explanation::toString(int32_t depth) { + StringBuffer buffer; + for (int32_t i = 0; i < depth; i++) { + buffer.append(_T(" ")); + } + buffer.appendFloat(getValue(),2); + buffer.append(_T(" = ")); + buffer.append(getDescription()); + buffer.append(_T("\n")); + + for ( uint32_t j=0;jtoString(depth+1); + buffer.append(tmp); + _CLDELETE_CARRAY(tmp); + } + return buffer.toString(); +} + +int Explanation::getDetailsLength(){ + return details.size(); +} +Explanation* Explanation::getDetail(int i){ + return details[i]; +} +/** The sub-nodes of this explanation node. */ +void Explanation::getDetails(Explanation** ret) { + uint32_t size = details.size(); + for ( uint32_t i=0;iclone(); + } + ret[size] = NULL; +} + +/** Adds a sub-node to this explanation node. */ +void Explanation::addDetail(Explanation* detail) { + details.push_back(detail); +} + +/** Render an explanation as text. */ +TCHAR* Explanation::toString() { + return toString(0); +} + +/** Render an explanation as HTML. */ +///todo: mem leaks +TCHAR* Explanation::toHtml() { + StringBuffer buffer; + TCHAR* tmp; + buffer.append(_T("

    \n")); + + buffer.append(_T("
  • ")); + buffer.appendFloat(getValue(),2); + buffer.append(_T(" = ")); + + buffer.append(getDescription()); + buffer.append(_T("
  • \n")); + + for ( uint32_t i=0;itoHtml(); + buffer.append(tmp); + _CLDELETE_CARRAY(tmp); + } + buffer.append(_T("
\n")); + + return buffer.toString(); +} +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.h b/src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.h new file mode 100644 index 000000000..7c95822b6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Explanation.h @@ -0,0 +1,66 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_Explanation +#define _lucene_search_Explanation + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(search) + + #define LUCENE_SEARCH_EXPLANATION_DESC_LEN 200 + class Explanation :LUCENE_BASE { + private: + qreal value; // the value of this node + TCHAR description[LUCENE_SEARCH_EXPLANATION_DESC_LEN]; // what it represents + CL_NS(util)::CLArrayList > details; // sub-explanations + + TCHAR* toString(int32_t depth); + protected: + Explanation(const Explanation& copy); + public: + Explanation(); + ~Explanation(); + + Explanation(qreal value, const TCHAR* description); + void set(const Explanation& other); + + Explanation* clone() const; + + /** The value assigned to this explanation node. */ + qreal getValue() const; + + /** Sets the value assigned to this explanation node. */ + void setValue(qreal value); + + /** A description of this explanation node. */ + const TCHAR* getDescription() const; ///count = count; + this->order = values; + this->lookup = lookup; + } + + ~StringIndex(){ + _CLDELETE_ARRAY(order); + + for ( int i=0;ifield as integers and returns an array + * of size reader.maxDoc() of the value each document + * has in the given field. + * @param reader Used to get field values. + * @param field Which field contains the integers. + * @return The values in the given field for each document. + * @throws IOException If any error occurs. + */ + virtual FieldCacheAuto* getInts (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; + + /** Checks the internal cache for an appropriate entry, and if + * none is found, reads the terms in field as floats and returns an array + * of size reader.maxDoc() of the value each document + * has in the given field. + * @param reader Used to get field values. + * @param field Which field contains the floats. + * @return The values in the given field for each document. + * @throws IOException If any error occurs. + */ + virtual FieldCacheAuto* getFloats (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; + + /** Checks the internal cache for an appropriate entry, and if none + * is found, reads the term values in field and returns an array + * of size reader.maxDoc() containing the value each document + * has in the given field. + * @param reader Used to get field values. + * @param field Which field contains the strings. + * @return The values in the given field for each document. + * @throws IOException If any error occurs. + */ + virtual FieldCacheAuto* getStrings (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; + + /** Checks the internal cache for an appropriate entry, and if none + * is found reads the term values in field and returns + * an array of them in natural order, along with an array telling + * which element in the term array each document uses. + * @param reader Used to get field values. + * @param field Which field contains the strings. + * @return Array of terms and index into the array for each document. + * @throws IOException If any error occurs. + */ + virtual FieldCacheAuto* getStringIndex (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; + + /** Checks the internal cache for an appropriate entry, and if + * none is found reads field to see if it contains integers, floats + * or strings, and then calls one of the other methods in this class to get the + * values. For string values, a FieldCache::StringIndex is returned. After + * calling this method, there is an entry in the cache for both + * type AUTO and the actual found type. + * @param reader Used to get field values. + * @param field Which field contains the values. + * @return int32_t[], qreal[] or FieldCache::StringIndex. + * @throws IOException If any error occurs. + */ + virtual FieldCacheAuto* getAuto (CL_NS(index)::IndexReader* reader, const TCHAR* field) = 0; + + /** Checks the internal cache for an appropriate entry, and if none + * is found reads the terms out of field and calls the given SortComparator + * to get the sort values. A hit in the cache will happen if reader, + * field, and comparator are the same (using equals()) + * as a previous call to this method. + * @param reader Used to get field values. + * @param field Which field contains the values. + * @param comparator Used to convert terms into something to sort by. + * @return Array of sort objects, one for each document. + * @throws IOException If any error occurs. + */ + virtual FieldCacheAuto* getCustom (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparator* comparator) = 0; +}; + +/** A class holding an AUTO field. In java lucene an Object + is used, but we use this. + contentType: + 1 - integer array + 2 - float array + 3 - FieldCache::StringIndex object + This class is also used when returning getInt, getFloat, etc + because we have no way of returning the size of the array and this + class can be used to determine the array size +*/ +class FieldCacheAuto:LUCENE_BASE{ +public: + enum{ + INT_ARRAY=1, + FLOAT_ARRAY=2, + STRING_INDEX=3, + STRING_ARRAY=4, + COMPARABLE_ARRAY=5, + SORT_COMPARATOR=6, + SCOREDOC_COMPARATOR=7 + }; + + FieldCacheAuto(int32_t len, int32_t type); + ~FieldCacheAuto(); + ///if contents should be deleted too, depending on type + bool ownContents; + int32_t contentLen; //number of items in the list + uint8_t contentType; + int32_t* intArray; //item 1 + qreal* floatArray; //item 2 + FieldCache::StringIndex* stringIndex; //item 3 + TCHAR** stringArray; //item 4 + CL_NS(util)::Comparable** comparableArray; //item 5 + SortComparator* sortComparator; //item 6 + ScoreDocComparator* scoreDocComparator; //item 7 + +}; + + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp new file mode 100644 index 000000000..62052097e --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.cpp @@ -0,0 +1,529 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "FieldCacheImpl.h" + +CL_NS_USE(util) +CL_NS_USE(index) +CL_NS_DEF(search) + +FieldCacheImpl::FieldCacheImpl(): + cache(false,true){ +} +FieldCacheImpl::~FieldCacheImpl(){ + cache.clear(); +} + +FieldCacheImpl::FileEntry::FileEntry (const TCHAR* field, int32_t type) { + this->field = CLStringIntern::intern(field CL_FILELINE); + this->type = type; + this->custom = NULL; + this->_hashCode = 0; + } + + /** Creates one of these objects for a custom comparator. */ + FieldCacheImpl::FileEntry::FileEntry (const TCHAR* field, SortComparatorSource* custom) { + this->field = CLStringIntern::intern(field CL_FILELINE); + this->type = SortField::CUSTOM; + this->custom = custom; + this->_hashCode = 0; + } + FieldCacheImpl::FileEntry::~FileEntry(){ + CLStringIntern::unintern(field); + } + + size_t FieldCacheImpl::FileEntry::hashCode(){ + if ( _hashCode == 0 ){ + //todo: cache hashcode? + size_t ret = Misc::thashCode(field); + if ( custom != NULL ) + ret = ret ^ custom->hashCode(); + ret = ret ^ (type*7); //type with a seed + _hashCode = ret; + } + return _hashCode; + } + int32_t FieldCacheImpl::FileEntry::compareTo(const FieldCacheImpl::FileEntry* other) const{ + if ( other->field == this->field ){ + if ( other->type == this->type ){ + if ( other->custom == NULL ){ + if ( this->custom == NULL ) + return 0; //both null + else + return 1; + }else if ( this->custom == NULL ) + return -1; + else if ( other->custom < this->custom ) + return -1; + else if ( other->custom > this->custom ) + return 1; + else + return 0; + }else if ( other->type > this->type ) + return 1; + else + return -1; + + }else + return _tcscmp(other->field,this->field); + } + + /** Two of these are equal iff they reference the same field and type. */ + /*bool FieldCacheImpl::FileEntry::equals (FileEntry* other) { + if (other->field == field && other->type == type) { + if (other->custom == NULL) { + if (custom == NULL) + return true; + } else if (other->custom->equals (custom)) { + return true; + } + } + }*/ + + /** Composes a hashcode based on the field and type. */ + /*size_t FieldCacheImpl::FileEntry::hashCode() { + return field->hashCode() ^ type ^ (custom==NULL ? 0 : custom->hashCode()); + }*/ + + + + + + /** See if an object is in the cache. */ + FieldCacheAuto* FieldCacheImpl::lookup (IndexReader* reader, const TCHAR* field, int32_t type) { + FieldCacheAuto* ret = NULL; + FileEntry* entry = _CLNEW FileEntry (field, type); + { + SCOPED_LOCK_MUTEX(THIS_LOCK) + fieldcacheCacheReaderType* readerCache = cache.get(reader); + if (readerCache != NULL) + ret = readerCache->get (entry); + _CLDELETE(entry); + } + return ret; + } + + + /** See if a custom object is in the cache. */ + FieldCacheAuto* FieldCacheImpl::lookup (IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer) { + FieldCacheAuto* ret = NULL; + FileEntry* entry = _CLNEW FileEntry (field, comparer); + { + SCOPED_LOCK_MUTEX(THIS_LOCK) + fieldcacheCacheReaderType* readerCache = cache.get(reader); + if (readerCache != NULL) + ret = readerCache->get (entry); + _CLDELETE(entry); +} + return ret; + } + + void FieldCacheImpl::closeCallback(CL_NS(index)::IndexReader* reader, void* fieldCacheImpl){ + FieldCacheImpl* fci = (FieldCacheImpl*)fieldCacheImpl; + SCOPED_LOCK_MUTEX(fci->THIS_LOCK) + fci->cache.remove(reader); + } + + /** Put an object into the cache. */ + void FieldCacheImpl::store (IndexReader* reader, const TCHAR* field, int32_t type, FieldCacheAuto* value) { + FileEntry* entry = _CLNEW FileEntry (field, type); + { + SCOPED_LOCK_MUTEX(THIS_LOCK) + fieldcacheCacheReaderType* readerCache = cache.get(reader); + if (readerCache == NULL) { + readerCache = _CLNEW fieldcacheCacheReaderType; + cache.put(reader,readerCache); + reader->addCloseCallback(closeCallback, this); + } + readerCache->put (entry, value); + //this is supposed to return the previous value, but it needs to be deleted!!! + } + } + + /** Put a custom object into the cache. */ + void FieldCacheImpl::store (IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer, FieldCacheAuto* value) { + FileEntry* entry = _CLNEW FileEntry (field, comparer); + { + SCOPED_LOCK_MUTEX(THIS_LOCK) + fieldcacheCacheReaderType* readerCache = cache.get(reader); + if (readerCache == NULL) { + readerCache = _CLNEW fieldcacheCacheReaderType; + cache.put(reader, readerCache); + reader->addCloseCallback(FieldCacheImpl::closeCallback, this); + } + readerCache->put(entry, value); + //this is supposed to return the previous value, but it needs to be deleted!!! + } + } + + + + + + // inherit javadocs + FieldCacheAuto* FieldCacheImpl::getInts (IndexReader* reader, const TCHAR* field) { + field = CLStringIntern::intern(field CL_FILELINE); + FieldCacheAuto* ret = lookup (reader, field, SortField::INT); + if (ret == NULL) { + int32_t retLen = reader->maxDoc(); + int32_t* retArray = _CL_NEWARRAY(int32_t,retLen); + memset(retArray,0,sizeof(int32_t)*retLen); + if (retLen > 0) { + TermDocs* termDocs = reader->termDocs(); + + Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); + TermEnum* termEnum = reader->terms (term); + _CLDECDELETE(term); + try { + if (termEnum->term(false) == NULL) { + _CLTHROWA(CL_ERR_Runtime,"no terms in field"); //todo: add detailed error: + field); + } + do { + Term* term = termEnum->term(false); + if (term->field() != field) + break; + + TCHAR* end; + int32_t termval = (int32_t)_tcstoi64(term->text(), &end, 10); + termDocs->seek (termEnum); + while (termDocs->next()) { + retArray[termDocs->doc()] = termval; + } + } while (termEnum->next()); + } _CLFINALLY( + termDocs->close(); + _CLDELETE(termDocs); + termEnum->close(); + _CLDELETE(termEnum); + ) + } + + FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::INT_ARRAY); + fa->intArray = retArray; + + store (reader, field, SortField::INT, fa); + CLStringIntern::unintern(field); + return fa; + } + CLStringIntern::unintern(field); + return ret; + } + + // inherit javadocs + FieldCacheAuto* FieldCacheImpl::getFloats (IndexReader* reader, const TCHAR* field){ + field = CLStringIntern::intern(field CL_FILELINE); + FieldCacheAuto* ret = lookup (reader, field, SortField::FLOAT); + if (ret == NULL) { + int32_t retLen = reader->maxDoc(); + qreal* retArray = _CL_NEWARRAY(qreal,retLen); + memset(retArray,0,sizeof(qreal)*retLen); + if (retLen > 0) { + TermDocs* termDocs = reader->termDocs(); + + Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); + TermEnum* termEnum = reader->terms (term); + _CLDECDELETE(term); + + try { + if (termEnum->term(false) == NULL) { + _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: make richer error + field); + } + do { + Term* term = termEnum->term(false); + if (term->field() != field) + break; + + TCHAR* tmp; + qreal termval = _tcstod(term->text(),&tmp); + termDocs->seek (termEnum); + while (termDocs->next()) { + retArray[termDocs->doc()] = termval; + } + } while (termEnum->next()); + } _CLFINALLY( + termDocs->close(); + _CLDELETE(termDocs); + termEnum->close(); + _CLDELETE(termEnum); + ) + } + + FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::FLOAT_ARRAY); + fa->floatArray = retArray; + + store (reader, field, SortField::FLOAT, fa); + CLStringIntern::unintern(field); + return fa; + } + CLStringIntern::unintern(field); + return ret; + } + + + // inherit javadocs + FieldCacheAuto* FieldCacheImpl::getStrings (IndexReader* reader, const TCHAR* field){ + //todo: this is not really used, i think? + field = CLStringIntern::intern(field CL_FILELINE); + FieldCacheAuto* ret = lookup (reader, field, SortField::STRING); + if (ret == NULL) { + int32_t retLen = reader->maxDoc(); + TCHAR** retArray = _CL_NEWARRAY(TCHAR*,retLen+1); + memset(retArray,0,sizeof(TCHAR*)*(retLen+1)); + if (retLen > 0) { + TermDocs* termDocs = reader->termDocs(); + + Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); + TermEnum* termEnum = reader->terms (term); + _CLDECDELETE(term); + + try { + if (termEnum->term(false) == NULL) { + _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: extend to + field); + } + do { + Term* term = termEnum->term(false); + if (term->field() != field) + break; + const TCHAR* termval = term->text(); + termDocs->seek (termEnum); + while (termDocs->next()) { + retArray[termDocs->doc()] = STRDUP_TtoT(termval); //todo: any better way of doing this??? + } + } while (termEnum->next()); + } _CLFINALLY( + retArray[retLen]=NULL; + termDocs->close(); + _CLDELETE(termDocs); + termEnum->close(); + _CLDELETE(termEnum); + ) + } + + + FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::STRING_ARRAY); + fa->stringArray = retArray; + fa->ownContents=true; + store (reader, field, SortField::STRING, fa); + CLStringIntern::unintern(field); + return fa; + } + CLStringIntern::unintern(field); + return ret; + } + + // inherit javadocs + FieldCacheAuto* FieldCacheImpl::getStringIndex (IndexReader* reader, const TCHAR* field){ + field = CLStringIntern::intern(field CL_FILELINE); + FieldCacheAuto* ret = lookup (reader, field, STRING_INDEX); + int32_t t = 0; // current term number + if (ret == NULL) { + int32_t retLen = reader->maxDoc(); + int32_t* retArray = _CL_NEWARRAY(int32_t,retLen); + memset(retArray,0,sizeof(int32_t)*retLen); + + TCHAR** mterms = _CL_NEWARRAY(TCHAR*,retLen+2); + mterms[0]=NULL; + if ( retLen > 0 ) { + TermDocs* termDocs = reader->termDocs(); + + Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); + TermEnum* termEnum = reader->terms (term); + _CLDECDELETE(term); + + + CND_PRECONDITION(t+1 <= retLen, "t out of bounds"); + + // an entry for documents that have no terms in this field + // should a document with no terms be at top or bottom? + // this puts them at the top - if it is changed, FieldDocSortedHitQueue + // needs to change as well. + mterms[t++] = NULL; + + try { + if (termEnum->term(false) == NULL) { + _CLTHROWA(CL_ERR_Runtime,"no terms in field"); //todo: make rich message " + field); + } + do { + Term* term = termEnum->term(false); + if (term->field() != field) + break; + + // store term text + // we expect that there is at most one term per document + if (t >= retLen+1) + _CLTHROWA(CL_ERR_Runtime,"there are more terms than documents in field"); //todo: rich error \"" + field + "\""); + mterms[t] = STRDUP_TtoT(term->text()); + + termDocs->seek (termEnum); + while (termDocs->next()) { + retArray[termDocs->doc()] = t; + } + + t++; + } while (termEnum->next()); + CND_PRECONDITION(tclose(); + _CLDELETE(termDocs); + termEnum->close(); + _CLDELETE(termEnum); + ); + + if (t == 0) { + // if there are no terms, make the term array + // have a single NULL entry + _CLDELETE_ARRAY(mterms); + mterms = _CL_NEWARRAY(TCHAR*,1); //todo: delete old mterms? + mterms[0]=NULL; + } else if (t < retLen) { //todo: check, was mterms.length + // if there are less terms than documents, + // trim off the dead array space + //const TCHAR** terms = _CL_NEWARRAY(TCHAR,t); + //System.arraycopy (mterms, 0, terms, 0, t); + //mterms = terms; + + //we simply shorten the length of the array... + + } + } + FieldCache::StringIndex* value = _CLNEW FieldCache::StringIndex (retArray, mterms,t); + + FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::STRING_INDEX); + fa->stringIndex = value; + fa->ownContents=true; + store (reader, field, STRING_INDEX, fa); + CLStringIntern::unintern(field); + return fa; + } + CLStringIntern::unintern(field); + return ret; + } + + // inherit javadocs + FieldCacheAuto* FieldCacheImpl::getAuto (IndexReader* reader, const TCHAR* field) { + field = CLStringIntern::intern(field CL_FILELINE); + FieldCacheAuto* ret = lookup (reader, field, SortField::AUTO); + if (ret == NULL) { + Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false); + TermEnum* enumerator = reader->terms (term); + _CLDECDELETE(term); + + try { + Term* term = enumerator->term(false); + if (term == NULL) { + _CLTHROWA(CL_ERR_Runtime,"no terms in field - cannot determine sort type"); //todo: make rich error: " + field + " + } + if (term->field() == field) { + const TCHAR* termtext = term->text(); + size_t termTextLen = term->textLength(); + + bool isint=true; + for ( size_t i=0;iclose(); _CLDELETE(enumerator) ); + + } + CLStringIntern::unintern(field); + return ret; + } + + + // inherit javadocs + FieldCacheAuto* FieldCacheImpl::getCustom (IndexReader* reader, const TCHAR* field, SortComparator* comparator){ + field = CLStringIntern::intern(field CL_FILELINE); + + FieldCacheAuto* ret = lookup (reader, field, comparator); + if (ret == NULL) { + int32_t retLen = reader->maxDoc(); + Comparable** retArray = _CL_NEWARRAY(Comparable*,retLen); + memset(retArray,0,sizeof(Comparable*)*retLen); + if (retLen > 0) { + TermDocs* termDocs = reader->termDocs(); + TermEnum* termEnum = reader->terms (); + + try { + if (termEnum->term(false) == NULL) { + _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: make rich error + field); + } + do { + Term* term = termEnum->term(false); + if (term->field() != field) + break; + Comparable* termval = comparator->getComparable (term->text()); + termDocs->seek (termEnum); + while (termDocs->next()) { + retArray[termDocs->doc()] = termval; + } + } while (termEnum->next()); + } _CLFINALLY ( + termDocs->close(); + _CLDELETE(termDocs); + termEnum->close(); + _CLDELETE(termEnum); + ); + } + + FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::COMPARABLE_ARRAY); + fa->comparableArray = retArray; + fa->ownContents=true; + store (reader, field, SortField::CUSTOM, fa); + CLStringIntern::unintern(field); + return fa; + } + CLStringIntern::unintern(field); + return ret; + } + + + FieldCacheImpl::fieldcacheCacheReaderType::fieldcacheCacheReaderType(){ + setDeleteKey(false); + setDeleteValue(false); + } + FieldCacheImpl::fieldcacheCacheReaderType::~fieldcacheCacheReaderType(){ + iterator itr = begin(); + while ( itr != end() ){ + FileEntry* f = itr->first; + if ( f->getType() != SortField::AUTO ) + _CLDELETE( itr->second ); + _CLDELETE( f ); + ++itr; + } + clear(); + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h new file mode 100644 index 000000000..ac3c4cabc --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldCacheImpl.h @@ -0,0 +1,144 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_FieldCacheImpl_ +#define _lucene_search_FieldCacheImpl_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "FieldCache.h" +#include "Sort.h" + + +CL_NS_DEF(search) + + +/** + * Expert: The default cache implementation, storing all values in memory. + * + */ +class FieldCacheImpl: public FieldCache { +public: + DEFINE_MUTEX(THIS_LOCK) + + /** Expert: Every key in the internal cache is of this type. */ + class FileEntry:LUCENE_BASE { + const TCHAR* field; // which Field + int32_t type; // which SortField type + SortComparatorSource* custom; // which custom comparator + size_t _hashCode; + public: + /** Creates one of these objects. */ + FileEntry (const TCHAR* field, int32_t type); + + /** Creates one of these objects for a custom comparator. */ + FileEntry (const TCHAR* field, SortComparatorSource* custom); + ~FileEntry(); + + int32_t getType() const{ return type; } + + /** Two of these are equal iff they reference the same field and type. */ + bool equals (FileEntry* other) const; + + /** Composes a hashcode based on the field and type. */ + size_t hashCode(); + + int32_t compareTo(const FileEntry* other) const; + + class Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base // + { + public: + bool operator()( FileEntry* f1, FileEntry* f2 ) const{ + return ( f1->compareTo(f2) < 0 ); + } + size_t operator()( FileEntry* t ) const{ + return t->hashCode(); + } + }; + class Equals:LUCENE_BASE, public CL_NS(util)::Compare::_base // + { + public: + bool operator()( FileEntry* f1, FileEntry* f2 ) const{ + return ( f1->compareTo(f2) == 0 ); + } + }; + }; + + FieldCacheImpl(); + ~FieldCacheImpl(); +private: + + ///the type that is stored in the field cache. can't use a typedef because + ///the decorated name would become too long + class fieldcacheCacheReaderType: public CL_NS(util)::CLHashMap, + CL_NS(util)::Deletor::Object >{ + public: + fieldcacheCacheReaderType(); + ~fieldcacheCacheReaderType(); + }; + + //note: typename gets too long if using cacheReaderType as a typename + typedef CL_NS(util)::CLHashMap, + CL_NS(util)::Equals::Void, + CL_NS(util)::Deletor::Object, + CL_NS(util)::Deletor::Object > fieldcacheCacheType; + + /** The internal cache. Maps FileEntry to array of interpreted term values. **/ + //todo: make indexreader remove itself from here when the reader is shut + fieldcacheCacheType cache; + + /** See if an object is in the cache. */ + FieldCacheAuto* lookup (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type) ; + + /** See if a custom object is in the cache. */ + FieldCacheAuto* lookup (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer); + + /** Put an object into the cache. */ + void store (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type, FieldCacheAuto* value); + + /** Put a custom object into the cache. */ + void store (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer, FieldCacheAuto* value); + +public: + + // inherit javadocs + FieldCacheAuto* getInts (CL_NS(index)::IndexReader* reader, const TCHAR* field); + + // inherit javadocs + FieldCacheAuto* getFloats (CL_NS(index)::IndexReader* reader, const TCHAR* field); + + // inherit javadocs + FieldCacheAuto* getStrings (CL_NS(index)::IndexReader* reader, const TCHAR* field); + + // inherit javadocs + FieldCacheAuto* getStringIndex (CL_NS(index)::IndexReader* reader, const TCHAR* field); + + // inherit javadocs + FieldCacheAuto* getAuto (CL_NS(index)::IndexReader* reader, const TCHAR* field); + + // inherit javadocs + FieldCacheAuto* getCustom (CL_NS(index)::IndexReader* reader, const TCHAR* field, SortComparator* comparator); + + + /** + * Callback for when IndexReader closes. This causes + * any cache to be removed for the specified reader. + */ + static void closeCallback(CL_NS(index)::IndexReader* reader, void* fieldCacheImpl); +}; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDoc.h b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDoc.h new file mode 100644 index 000000000..6ce915acf --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDoc.h @@ -0,0 +1,70 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_FieldDoc_ +#define _lucene_search_FieldDoc_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "ScoreDoc.h" + +CL_NS_DEF(search) + +/** + * Expert: A ScoreDoc which also contains information about + * how to sort the referenced document. In addition to the + * document number and score, this object contains an array + * of values for the document from the field(s) used to sort. + * For example, if the sort criteria was to sort by fields + * "a", "b" then "c", the fields object array + * will have three elements, corresponding respectively to + * the term values for the document in fields "a", "b" and "c". + * The class of each element in the array will be either + * Integer, Float or String depending on the type of values + * in the terms of each field. + * + * @see ScoreDoc + * @see TopFieldDocs + */ +class FieldDoc: public ScoreDoc { +public: + + /** Expert: The values which are used to sort the referenced document. + * The order of these will match the original sort criteria given by a + * Sort object. Each Object will be either an Integer, Float or String, + * depending on the type of values in the terms of the original field. + * @see Sort + * @see Searchable#search(Query,Filter,int32_t,Sort) + */ + CL_NS(util)::Comparable** fields; + + /** Expert: Creates one of these objects with empty sort information. */ + FieldDoc (int32_t doc, qreal score): + ScoreDoc(doc,score) { + fields=NULL; + } + + /** Expert: Creates one of these objects with the given sort information. */ + FieldDoc (int32_t doc, qreal score, CL_NS(util)::Comparable** fields): + ScoreDoc(doc,score) + { + this->fields = fields; + } + + ~FieldDoc(){ + if ( fields != NULL ){ + for ( int i=0;fields[i]!=NULL;i++ ) + _CLDELETE(fields[i]); + _CLDELETE_ARRAY(fields); + } + } +}; + +CL_NS_END +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp new file mode 100644 index 000000000..0a5210903 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.cpp @@ -0,0 +1,171 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "FieldDocSortedHitQueue.h" + + +CL_NS_USE(util) +CL_NS_DEF(search) + + +FieldDoc::FieldDoc (int32_t doc, qreal score) +{ + this->scoreDoc.doc = doc; + this->scoreDoc.score = score; + fields=NULL; +} + +FieldDoc::FieldDoc (int32_t doc, qreal score, CL_NS(util)::Comparable** fields) +{ + this->scoreDoc.doc = doc; + this->scoreDoc.score = score; + this->fields = fields; +} + +FieldDoc::~FieldDoc(){ + if ( fields != NULL ){ + for ( int i=0;fields[i]!=NULL;i++ ) + _CLDELETE(fields[i]); + _CLDELETE_ARRAY(fields); + } +} + + + +FieldDocSortedHitQueue::FieldDocSortedHitQueue (SortField** fields, int32_t size) { + this->fields = fields; + _countsize(); + //this->collators = hasCollators (fields); + initialize (size,true); +} + +bool FieldDocSortedHitQueue::lessThan (FieldDoc* docA, FieldDoc* docB) { + int32_t n = fieldsLen; + int32_t c = 0; + qreal f1,f2,r1,r2; + int32_t i1,i2; + const TCHAR *s1, *s2; + + for (int32_t i=0; igetType(); + if (fields[i]->getReverse()) { + switch (type) { + case SortField::DOCSCORE: + r1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); + r2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); + if (r1 < r2) c = -1; + if (r1 > r2) c = 1; + break; + case SortField::DOC: + case SortField::INT: + i1 = __REINTERPRET_CAST(Compare::Int32*, docA->fields[i])->getValue(); + i2 = __REINTERPRET_CAST(Compare::Int32*, docB->fields[i])->getValue(); + if (i1 > i2) c = -1; + if (i1 < i2) c = 1; + break; + case SortField::STRING: + s1 = __REINTERPRET_CAST(Compare::TChar*, docA->fields[i])->getValue(); + s2 = __REINTERPRET_CAST(Compare::TChar*, docB->fields[i])->getValue(); + if (s2 == NULL) c = -1; // could be NULL if there are + else if (s1 == NULL) c = 1; // no terms in the given field + else c = _tcscmp(s2,s1); //else if (fields[i].getLocale() == NULL) { + + /*todo: collators not impl + } else { + c = collators[i].compare (s2, s1); + }*/ + break; + case SortField::FLOAT: + f1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); + f2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); + if (f1 > f2) c = -1; + if (f1 < f2) c = 1; + break; + case SortField::CUSTOM: + c = docB->fields[i]->compareTo (docA->fields[i]); + break; + case SortField::AUTO: + // we cannot handle this - even if we determine the type of object (qreal or + // Integer), we don't necessarily know how to compare them (both SCORE and + // qreal both contain floats, but are sorted opposite of each other). Before + // we get here, each AUTO should have been replaced with its actual value. + _CLTHROWA (CL_ERR_Runtime,"FieldDocSortedHitQueue cannot use an AUTO SortField"); + default: + _CLTHROWA (CL_ERR_Runtime, "invalid SortField type"); //todo: rich error... : "+type); + } + } else { + switch (type) { + case SortField::DOCSCORE: + r1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); + r2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); + if (r1 > r2) c = -1; + if (r1 < r2) c = 1; + break; + case SortField::DOC: + case SortField::INT: + i1 = __REINTERPRET_CAST(Compare::Int32*, docA->fields[i])->getValue(); + i2 = __REINTERPRET_CAST(Compare::Int32*, docB->fields[i])->getValue(); + if (i1 < i2) c = -1; + if (i1 > i2) c = 1; + break; + case SortField::STRING: + s1 = __REINTERPRET_CAST(Compare::TChar*, docA->fields[i])->getValue(); + s2 = __REINTERPRET_CAST(Compare::TChar*, docB->fields[i])->getValue(); + // NULL values need to be sorted first, because of how FieldCache.getStringIndex() + // works - in that routine, any documents without a value in the given field are + // put first. + if (s1 == NULL) c = -1; // could be NULL if there are + else if (s2 == NULL) c = 1; // no terms in the given field + else c = _tcscmp(s1,s2); //else if (fields[i].getLocale() == NULL) { + + /* todo: collators not implemented } else { + c = collators[i].compare (s1, s2); + }*/ + break; + case SortField::FLOAT: + f1 = __REINTERPRET_CAST(Compare::Float*, docA->fields[i])->getValue(); + f2 = __REINTERPRET_CAST(Compare::Float*, docB->fields[i])->getValue(); + if (f1 < f2) c = -1; + if (f1 > f2) c = 1; + break; + case SortField::CUSTOM: + c = docA->fields[i]->compareTo (docB->fields[i]); + break; + case SortField::AUTO: + // we cannot handle this - even if we determine the type of object (qreal or + // Integer), we don't necessarily know how to compare them (both SCORE and + // qreal both contain floats, but are sorted opposite of each other). Before + // we get here, each AUTO should have been replaced with its actual value. + _CLTHROWA (CL_ERR_Runtime,"FieldDocSortedHitQueue cannot use an AUTO SortField"); + default: + _CLTHROWA (CL_ERR_Runtime,"invalid SortField type"); //todo: rich error... : "+type); + } + } + } + return c > 0; +} + +void FieldDocSortedHitQueue::setFields (SortField** fields) { + SCOPED_LOCK_MUTEX(THIS_LOCK) + if (this->fields == NULL) { + this->fields = fields; + _countsize(); + //this->collators = hasCollators (fields); + }else if ( fields == NULL ) + this->fields = NULL; +} + +FieldDocSortedHitQueue::~FieldDocSortedHitQueue(){ + if ( fields != NULL ){ + for ( int i=0;fields[i]!=NULL;i++ ) + _CLDELETE(fields[i]); + _CLDELETE_ARRAY(fields); + } +} + +CL_NS_END + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h new file mode 100644 index 000000000..5a46b3b65 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldDocSortedHitQueue.h @@ -0,0 +1,159 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_FieldDocSortedHitQueue_ +#define _lucene_search_FieldDocSortedHitQueue_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Sort.h" +#include "CLucene/util/PriorityQueue.h" + +CL_NS_DEF(search) + +/** + * Expert: A ScoreDoc which also contains information about + * how to sort the referenced document. In addition to the + * document number and score, this object contains an array + * of values for the document from the field(s) used to sort. + * For example, if the sort criteria was to sort by fields + * "a", "b" then "c", the fields object array + * will have three elements, corresponding respectively to + * the term values for the document in fields "a", "b" and "c". + * The class of each element in the array will be either + * Integer, Float or String depending on the type of values + * in the terms of each field. + * + * @see ScoreDoc + * @see TopFieldDocs + */ +class FieldDoc: LUCENE_BASE { +public: + //FieldDoc did inherit from ScoreDoc, but now we make the scoredoc a member + struct ScoreDoc scoreDoc; + + /** Expert: The values which are used to sort the referenced document. + * The order of these will match the original sort criteria given by a + * Sort object. Each Object will be either an Integer, Float or String, + * depending on the type of values in the terms of the original field. + * @see Sort + * @see Searchable#search(Query,Filter,int32_t,Sort) + */ + CL_NS(util)::Comparable** fields; + + /** Expert: Creates one of these objects with empty sort information. */ + FieldDoc (int32_t doc, qreal score); + /** Expert: Creates one of these objects with the given sort information. */ + FieldDoc (int32_t doc, qreal score, CL_NS(util)::Comparable** fields); + ~FieldDoc(); +}; + +/** + * Expert: Collects sorted results from Searchable's and collates them. + * The elements put into this queue must be of type FieldDoc. + */ +class FieldDocSortedHitQueue: + public CL_NS(util)::PriorityQueue > +{ +private: + DEFINE_MUTEX(THIS_LOCK) + + // this cannot contain AUTO fields - any AUTO fields should + // have been resolved by the time this class is used. + SortField** fields; + int32_t fieldsLen; + + void _countsize(){ + fieldsLen=0; + while(fields[fieldsLen]!=NULL) + fieldsLen++; + } + + // used in the case where the fields are sorted by locale + // based strings + //todo: not implemented in clucene because locales has not been implemented + //Collator[] collators; //volatile + +public: + /** + * Creates a hit queue sorted by the given list of fields. + * @param fields Field names, in priority order (highest priority first). + * @param size The number of hits to retain. Must be greater than zero. + */ + FieldDocSortedHitQueue (SortField** fields, int32_t size); + ~FieldDocSortedHitQueue(); + + + /** + * Allows redefinition of sort fields if they are NULL. + * This is to handle the case using ParallelMultiSearcher where the + * original list contains AUTO and we don't know the actual sort + * type until the values come back. The fields can only be set once. + * This method is thread safe. + * @param fields + */ + void setFields (SortField** fields); + + /** Returns the fields being used to sort. */ + SortField** getFields() { + return fields; + } + + /** Returns an array of collators, possibly NULL. The collators + * correspond to any SortFields which were given a specific locale. + * @param fields Array of sort fields. + * @return Array, possibly NULL. + + private Collator[] hasCollators (SortField[] fields) { + if (fields == NULL) return NULL; + Collator[] ret = new Collator[fields.length]; + for (int32_t i=0; ia is less relevant than b. + * @param a FieldDoc + * @param b FieldDoc + * @return true if document a should be sorted after document b. + */ + bool lessThan (FieldDoc* docA, FieldDoc* docB); +}; + + +/** +* Expert: Returned by low-level sorted search implementations. +* +* @see Searchable#search(Query,Filter,int32_t,Sort) +*/ +class TopFieldDocs: public TopDocs { +public: + /// The fields which were used to sort results by. + SortField** fields; + + FieldDoc** fieldDocs; + + /** Creates one of these objects. + * @param totalHits Total number of hits for the query. + * @param fieldDocs The top hits for the query. + * @param scoreDocs The top hits for the query. + * @param scoreDocsLen Length of fieldDocs and scoreDocs + * @param fields The sort criteria used to find the top hits. + */ + TopFieldDocs (int32_t totalHits, FieldDoc** fieldDocs, int32_t scoreDocsLen, SortField** fields); + ~TopFieldDocs(); +}; + +CL_NS_END +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp new file mode 100644 index 000000000..04f45e931 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.cpp @@ -0,0 +1,212 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "FieldSortedHitQueue.h" +#include "FieldDocSortedHitQueue.h" +#include "Compare.h" + +CL_NS_USE(util) +CL_NS_USE(index) +CL_NS_DEF(search) + +FieldSortedHitQueue::hitqueueCacheType FieldSortedHitQueue::Comparators(false,true); + +FieldSortedHitQueue::FieldSortedHitQueue (IndexReader* reader, SortField** _fields, int32_t size): + fieldsLen(0), + maxscore(1.0f) +{ + while ( _fields[fieldsLen] != 0 ) + fieldsLen++; + + comparators = _CL_NEWARRAY(ScoreDocComparator*,fieldsLen+1); + SortField** tmp = _CL_NEWARRAY(SortField*,fieldsLen+1); + for (int32_t i=0; igetField(); + //todo: fields[i].getLocale(), not implemented + comparators[i] = getCachedComparator (reader, fieldname, _fields[i]->getType(), _fields[i]->getFactory()); + tmp[i] = _CLNEW SortField (fieldname, comparators[i]->sortType(), _fields[i]->getReverse()); + } + comparatorsLen = fieldsLen; + comparators[fieldsLen]=NULL; + tmp[fieldsLen] = NULL; + this->fields = tmp; + + initialize(size,true); +} + + +bool FieldSortedHitQueue::lessThan (FieldDoc* docA, FieldDoc* docB) { + // keep track of maximum score + if (docA->scoreDoc.score > maxscore) maxscore = docA->scoreDoc.score; + if (docB->scoreDoc.score > maxscore) maxscore = docB->scoreDoc.score; + + // run comparators + int32_t c = 0; + for ( int32_t i=0; c==0 && igetReverse()) ? comparators[i]->compare (&docB->scoreDoc, &docA->scoreDoc) : + comparators[i]->compare (&docA->scoreDoc, &docB->scoreDoc); + } + // avoid random sort order that could lead to duplicates (bug #31241): + if (c == 0) + return docA->scoreDoc.doc > docB->scoreDoc.doc; + return c > 0; +} + + +//static +ScoreDocComparator* FieldSortedHitQueue::comparatorString (IndexReader* reader, const TCHAR* field) { + //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); + FieldCacheAuto* fa = FieldCache::DEFAULT->getStringIndex (reader, field); + //CLStringIntern::unintern(field); + + CND_PRECONDITION(fa->contentType==FieldCacheAuto::STRING_INDEX,"Content type is incorrect"); + fa->ownContents = false; + return _CLNEW ScoreDocComparators::String(fa->stringIndex, fa->contentLen); +} + +//static +ScoreDocComparator* FieldSortedHitQueue::comparatorInt (IndexReader* reader, const TCHAR* field){ + //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); + FieldCacheAuto* fa = FieldCache::DEFAULT->getInts (reader, field); + //CLStringIntern::unintern(field); + + CND_PRECONDITION(fa->contentType==FieldCacheAuto::INT_ARRAY,"Content type is incorrect"); + return _CLNEW ScoreDocComparators::Int32(fa->intArray, fa->contentLen); + } + +//static + ScoreDocComparator* FieldSortedHitQueue::comparatorFloat (IndexReader* reader, const TCHAR* field) { + //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); + FieldCacheAuto* fa = FieldCache::DEFAULT->getFloats (reader, field); + //CLStringIntern::unintern(field); + + CND_PRECONDITION(fa->contentType==FieldCacheAuto::FLOAT_ARRAY,"Content type is incorrect"); + return _CLNEW ScoreDocComparators::Float (fa->floatArray, fa->contentLen); + } +//static + ScoreDocComparator* FieldSortedHitQueue::comparatorAuto (IndexReader* reader, const TCHAR* field){ + //const TCHAR* field = CLStringIntern::intern(fieldname CL_FILELINE); + FieldCacheAuto* fa = FieldCache::DEFAULT->getAuto (reader, field); + //CLStringIntern::unintern(field); + + if (fa->contentType == FieldCacheAuto::STRING_INDEX ) { + return comparatorString (reader, field); + } else if (fa->contentType == FieldCacheAuto::INT_ARRAY) { + return comparatorInt (reader, field); + } else if (fa->contentType == FieldCacheAuto::FLOAT_ARRAY) { + return comparatorFloat (reader, field); + } else if (fa->contentType == FieldCacheAuto::STRING_ARRAY) { + return comparatorString (reader, field); + } else { + _CLTHROWA(CL_ERR_Runtime, "unknown data type in field"); //todo: rich error information: '"+field+"'"); + } + } + + + //todo: Locale locale, not implemented yet + ScoreDocComparator* FieldSortedHitQueue::getCachedComparator (IndexReader* reader, const TCHAR* fieldname, int32_t type, SortComparatorSource* factory){ + if (type == SortField::DOC) + return ScoreDocComparator::INDEXORDER; + if (type == SortField::DOCSCORE) + return ScoreDocComparator::RELEVANCE; + ScoreDocComparator* comparator = lookup (reader, fieldname, type, factory); + if (comparator == NULL) { + switch (type) { + case SortField::AUTO: + comparator = comparatorAuto (reader, fieldname); + break; + case SortField::INT: + comparator = comparatorInt (reader, fieldname); + break; + case SortField::FLOAT: + comparator = comparatorFloat (reader, fieldname); + break; + case SortField::STRING: + //if (locale != NULL) + // comparator = comparatorStringLocale (reader, fieldname, locale); + //else + comparator = comparatorString (reader, fieldname); + break; + case SortField::CUSTOM: + comparator = factory->newComparator (reader, fieldname); + break; + default: + _CLTHROWA(CL_ERR_Runtime,"unknown field type"); + //todo: extend error + //throw _CLNEW RuntimeException ("unknown field type: "+type); + } + store (reader, fieldname, type, factory, comparator); + } + return comparator; + } + + + FieldDoc* FieldSortedHitQueue::fillFields (FieldDoc* doc) const{ + int32_t n = comparatorsLen; + Comparable** fields = _CL_NEWARRAY(Comparable*,n+1); + for (int32_t i=0; isortValue(&doc->scoreDoc); + fields[n]=NULL; + doc->fields = fields; + if (maxscore > 1.0f) + doc->scoreDoc.score /= maxscore; // normalize scores + return doc; + } + + ScoreDocComparator* FieldSortedHitQueue::lookup (IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory) { + ScoreDocComparator* sdc = NULL; + FieldCacheImpl::FileEntry* entry = (factory != NULL) + ? _CLNEW FieldCacheImpl::FileEntry (field, factory) + : _CLNEW FieldCacheImpl::FileEntry (field, type); + + { + SCOPED_LOCK_MUTEX(Comparators.THIS_LOCK) + hitqueueCacheReaderType* readerCache = Comparators.get(reader); + if (readerCache == NULL){ + _CLDELETE(entry); + return NULL; + } + + sdc = readerCache->get (entry); + _CLDELETE(entry); + } + return sdc; + } + + void FieldSortedHitQueue::closeCallback(CL_NS(index)::IndexReader* reader, void*){ + SCOPED_LOCK_MUTEX(Comparators.THIS_LOCK) + Comparators.remove(reader); + } + + //static + void FieldSortedHitQueue::store (IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory, ScoreDocComparator* value) { + FieldCacheImpl::FileEntry* entry = (factory != NULL) + ? _CLNEW FieldCacheImpl::FileEntry (field, factory) + : _CLNEW FieldCacheImpl::FileEntry (field, type); + + { + SCOPED_LOCK_MUTEX(Comparators.THIS_LOCK) + hitqueueCacheReaderType* readerCache = Comparators.get(reader); + if (readerCache == NULL) { + readerCache = _CLNEW hitqueueCacheReaderType(true); + Comparators.put(reader,readerCache); + reader->addCloseCallback(FieldSortedHitQueue::closeCallback,NULL); + } + readerCache->put (entry, value); + //return NULL; //supposed to return previous value... + } + } + +FieldSortedHitQueue::~FieldSortedHitQueue(){ + _CLDELETE_ARRAY(comparators); + if ( fields != NULL ){ + for ( int i=0;fields[i]!=NULL;i++ ) + _CLDELETE(fields[i]); + _CLDELETE_ARRAY(fields); + } +} +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h new file mode 100644 index 000000000..d7b16ce9e --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FieldSortedHitQueue.h @@ -0,0 +1,216 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_FieldSortedHitQueue_ +#define _lucene_search_FieldSortedHitQueue_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "FieldCache.h" +#include "Sort.h" +#include "FieldDocSortedHitQueue.h" +#include "SearchHeader.h" +#include "FieldCacheImpl.h" +#include "CLucene/util/PriorityQueue.h" + +CL_NS_DEF(search) + + +/** + * Expert: A hit queue for sorting by hits by terms in more than one field. + * Uses FieldCache.DEFAULT for maintaining internal term lookup tables. + * + * @see Searchable#search(Query,Filter,int32_t,Sort) + * @see FieldCache + */ +class FieldSortedHitQueue: public CL_NS(util)::PriorityQueue > { + + ///the type that is stored in the field cache. can't use a typedef because + ///the decorated name would become too long + class hitqueueCacheReaderType: public CL_NS(util)::CLHashMap, + CL_NS(util)::Deletor::Object >{ + + public: + hitqueueCacheReaderType(bool deleteValue){ + setDeleteKey(true); + setDeleteValue(deleteValue); + } + ~hitqueueCacheReaderType(){ + clear(); + } + + }; + +public: //todo: remove this and below after close callback is implemented + //note: typename gets too long if using cacheReaderType as a typename + typedef CL_NS(util)::CLHashMap, + CL_NS(util)::Equals::Void, + CL_NS(util)::Deletor::Object, + CL_NS(util)::Deletor::Object > hitqueueCacheType; + + /** Internal cache of comparators. Similar to FieldCache, only + * caches comparators instead of term values. + */ + static hitqueueCacheType Comparators; +private: + + /** Returns a comparator if it is in the cache.*/ + static ScoreDocComparator* lookup (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory); + + /** Stores a comparator into the cache. + returns the valid ScoreDocComparator. + */ + static void store (CL_NS(index)::IndexReader* reader, const TCHAR* field, int32_t type, SortComparatorSource* factory, ScoreDocComparator* value); + + + //todo: Locale locale, not implemented yet + static ScoreDocComparator* getCachedComparator (CL_NS(index)::IndexReader* reader, + const TCHAR* fieldname, int32_t type, SortComparatorSource* factory); + + + /** + * Returns a comparator for sorting hits according to a field containing integers. + * @param reader Index to use. + * @param fieldname Field containg integer values. + * @return Comparator for sorting hits. + * @throws IOException If an error occurs reading the index. + */ + static ScoreDocComparator* comparatorInt (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); + + /** + * Returns a comparator for sorting hits according to a field containing floats. + * @param reader Index to use. + * @param fieldname Field containg float values. + * @return Comparator for sorting hits. + * @throws IOException If an error occurs reading the index. + */ + static ScoreDocComparator* comparatorFloat (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); + + /** + * Returns a comparator for sorting hits according to a field containing strings. + * @param reader Index to use. + * @param fieldname Field containg string values. + * @return Comparator for sorting hits. + * @throws IOException If an error occurs reading the index. + */ + static ScoreDocComparator* comparatorString (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); + + + //todo: + /** + * Returns a comparator for sorting hits according to a field containing strings. + * @param reader Index to use. + * @param fieldname Field containg string values. + * @return Comparator for sorting hits. + * @throws IOException If an error occurs reading the index. + + static ScoreDocComparator* comparatorStringLocale (IndexReader* reader, TCHAR* fieldname, Locale locale){ + Collator collator = Collator.getInstance (locale); + TCHAR* field = fieldname.intern(); + TCHAR** index = FieldCache.DEFAULT.getStrings (reader, field); + return _CLNEW ScoreDocComparator() { + + public int32_t compare (ScoreDoc i, ScoreDoc j) { + return collator.compare (index[i.doc], index[j.doc]); + } + + public Comparable sortValue (ScoreDoc i) { + return index[i.doc]; + } + + public int32_t sortType() { + return SortField.STRING; + } + }; + }*/ + + /** + * Returns a comparator for sorting hits according to values in the given field. + * The terms in the field are looked at to determine whether they contain integers, + * floats or strings. Once the type is determined, one of the other static methods + * in this class is called to get the comparator. + * @param reader Index to use. + * @param fieldname Field containg values. + * @return Comparator for sorting hits. + * @throws IOException If an error occurs reading the index. + */ + static ScoreDocComparator* comparatorAuto (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); + + +protected: + /** Stores a comparator corresponding to each field being sorted by */ + ScoreDocComparator** comparators; + int32_t comparatorsLen; + + /** Stores the sort criteria being used. */ + SortField** fields; + int32_t fieldsLen; + + /** Stores the maximum score value encountered, for normalizing. + * we only care about scores greater than 1.0 - if all the scores + * are less than 1.0, we don't have to normalize. */ + qreal maxscore; + + /** + * Returns whether a is less relevant than b. + * @param a ScoreDoc + * @param b ScoreDoc + * @return true if document a should be sorted after document b. + */ + bool lessThan (FieldDoc* docA, FieldDoc* docB); +public: + + /** + * Creates a hit queue sorted by the given list of fields. + * @param reader Index to use. + * @param fields Field names, in priority order (highest priority first). Cannot be null or empty. + * @param size The number of hits to retain. Must be greater than zero. + * @throws IOException + */ + FieldSortedHitQueue (CL_NS(index)::IndexReader* reader, SortField** fields, int32_t size); + + ~FieldSortedHitQueue(); + + /** + * Callback for when IndexReader closes. This causes + * any Comparators to be removed for the specified reader. + */ + static void closeCallback(CL_NS(index)::IndexReader* reader, void* param); + + /** + * Given a FieldDoc object, stores the values used + * to sort the given document. These values are not the raw + * values out of the index, but the internal representation + * of them. This is so the given search hit can be collated + * by a MultiSearcher with other search hits. + * @param doc The FieldDoc to store sort values into. + * @return The same FieldDoc passed in. + * @see Searchable#search(Query,Filter,int32_t,Sort) + */ + FieldDoc* fillFields (FieldDoc* doc) const; + + void setFields (SortField** fields){ + this->fields = fields; + } + + /** Returns the SortFields being used by this hit queue. */ + SortField** getFields() { + return fields; + } +}; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Filter.h b/src/assistant/3rdparty/clucene/src/CLucene/search/Filter.h new file mode 100644 index 000000000..309c5a9d6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Filter.h @@ -0,0 +1,46 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_Filter_ +#define _lucene_search_Filter_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/BitSet.h" + +CL_NS_DEF(search) + // Abstract base class providing a mechanism to restrict searches to a subset + // of an index. + class Filter: LUCENE_BASE { + public: + virtual ~Filter(){ + } + + virtual Filter* clone() const = 0; + + /** + * Returns a BitSet with true for documents which should be permitted in + * search results, and false for those that should not. + * MEMORY: read shouldDeleteBitSet + */ + virtual CL_NS(util)::BitSet* bits(CL_NS(index)::IndexReader* reader)=0; + + /** + * Because of the problem of cached bitsets with the CachingWrapperFilter, + * CLucene has no way of knowing whether to delete the bitset returned from bits(). + * To properly clean memory from bits(), pass the bitset to this function. The + * Filter should be deleted if this function returns true. + */ + virtual bool shouldDeleteBitSet(const CL_NS(util)::BitSet* bs) const{ return true; } + + //Creates a user-readable version of this query and returns it as as string + virtual TCHAR* toString()=0; + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp new file mode 100644 index 000000000..f90ceeaaf --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.cpp @@ -0,0 +1,136 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +#include "FilteredTermEnum.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + + FilteredTermEnum::FilteredTermEnum(){ + //Func - Constructor + //Pre - true + //Post - Instance has been created + + currentTerm = NULL; + actualEnum = NULL; + } + + FilteredTermEnum::~FilteredTermEnum() { + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + close(); + } + + int32_t FilteredTermEnum::docFreq() const { + //Func - Returns the docFreq of the current Term in the enumeration. + //Pre - next() must have been called at least once + //Post - if actualEnum is NULL result is -1 otherwise the frequencey is returned + + if (actualEnum == NULL){ + return -1; + } + return actualEnum->docFreq(); + } + + bool FilteredTermEnum::next() { + //Func - Increments the enumeration to the next element. + //Pre - true + //Post - Returns True if the enumeration has been moved to the next element otherwise false + + //The actual enumerator is not initialized! + if (actualEnum == NULL){ + return false; + } + + //Finalize the currentTerm and reset it to NULL + _CLDECDELETE( currentTerm ); + + //Iterate through the enumeration + while (currentTerm == NULL) { + if (endEnum()) + return false; + if (actualEnum->next()) { + //Order term not to return reference ownership here. */ + Term* term = actualEnum->term(false); + //Compare the retrieved term + if (termCompare(term)){ + //Matched so finalize the current + _CLDECDELETE(currentTerm); + //Get a reference to the matched term + currentTerm = _CL_POINTER(term); + return true; + } + }else + return false; + } + _CLDECDELETE(currentTerm); + currentTerm = NULL; + + return false; + } + + Term* FilteredTermEnum::term() { + //Func - Returns the current Term in the enumeration. + //Pre - next() must have been called at least once + // pointer is true or false + //Post - if pre(pointer) is true the reference counter of currentTerm is increased + // and current Term is returned otherwise currentTerm is only returned + + return _CL_POINTER(currentTerm); + } + Term* FilteredTermEnum::term(bool pointer) { + if ( pointer ) + return _CL_POINTER(currentTerm); + else + return currentTerm; + } + + void FilteredTermEnum::close(){ + //Func - Closes the enumeration to further activity, freeing resources. + //Pre - true + //Post - The Enumeration has been closed + + //Check if actualEnum is valid + if (actualEnum){ + //Close the enumeration + actualEnum->close(); + } + + //Destroy the enumeration + _CLDELETE(actualEnum); + + //Destroy currentTerm + _CLDECDELETE(currentTerm); + } + + void FilteredTermEnum::setEnum(TermEnum* actualEnum) { + //Func - Sets the actual Enumeration + //Pre - actualEnum != NULL + //Post - The instance has been created + + CND_PRECONDITION(actualEnum != NULL,"actualEnum is NULL"); + + _CLDELETE(this->actualEnum); + + this->actualEnum = actualEnum; + + // Find the first term that matches + //Ordered term not to return reference ownership here. + Term* term = actualEnum->term(false); + if (term != NULL && termCompare(term)){ + _CLDECDELETE(currentTerm); + currentTerm = _CL_POINTER(term); + }else{ + next(); + } + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h b/src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h new file mode 100644 index 000000000..035ae384e --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FilteredTermEnum.h @@ -0,0 +1,61 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_FilteredTermEnum_ +#define _lucene_search_FilteredTermEnum_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" + +CL_NS_DEF(search) + //FilteredTermEnum is an abstract class for enumerating a subset of all terms. + // + //Term enumerations are always ordered by term->compareTo(). Each term in + //the enumeration is greater than all that precede it. + + class FilteredTermEnum: public CL_NS(index)::TermEnum { + public: + //Constructor + FilteredTermEnum(); + //Destructor + virtual ~FilteredTermEnum(); + + //Equality measure on the term + virtual qreal difference() = 0; + + //Returns the docFreq of the current Term in the enumeration. + int32_t docFreq() const ; + + //Increments the enumeration to the next element + bool next() ; + + //Returns a pointer to the current Term in the enumeration. + CL_NS(index)::Term* term(); + CL_NS(index)::Term* term(bool pointer); + + //Closes the enumeration to further activity, freeing resources. + void close(); + + protected: + //Equality compare on the term */ + virtual bool termCompare(CL_NS(index)::Term* term) = 0; + + //Indiciates the end of the enumeration has been reached + virtual bool endEnum() = 0; + + void setEnum(CL_NS(index)::TermEnum* actualEnum) ; + + private: + CL_NS(index)::Term* currentTerm; + CL_NS(index)::TermEnum* actualEnum; + + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp new file mode 100644 index 000000000..e95d48da3 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.cpp @@ -0,0 +1,357 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "FuzzyQuery.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + /** + * Constructor for enumeration of all terms from specified reader which share a prefix of + * length prefixLength with term and which have a fuzzy similarity > + * minSimilarity. + * + * @param reader Delivers terms. + * @param term Pattern term. + * @param minSimilarity Minimum required similarity for terms from the reader. Default value is 0.5f. + * @param prefixLength Length of required common prefix. Default value is 0. + * @throws IOException + */ + FuzzyTermEnum::FuzzyTermEnum(const IndexReader* reader, Term* term, qreal minSimilarity, size_t prefixLength): + distance(0), + _endEnum(false), + prefix(LUCENE_BLANK_STRING), + prefixLength(0), + minimumSimilarity(minSimilarity) + { + //Func - Constructor + //Pre - reader contains a valid reference to an IndexReader + // term != NULL + //Post - The instance has been created + + CND_PRECONDITION(term != NULL,"term is NULL"); + + scale_factor = 1.0f / (1.0f - minimumSimilarity); + searchTerm = _CL_POINTER(term); + + text = STRDUP_TtoT(term->text()); + textLen = term->textLength(); + + + //Initialize e to NULL + e = NULL; + eWidth = 0; + eHeight = 0; + + if(prefixLength > 0 && prefixLength < textLen){ + this->prefixLength = prefixLength; + + prefix = _CL_NEWARRAY(TCHAR,prefixLength+1); + _tcsncpy(prefix,text,prefixLength); + prefix[prefixLength]='\0'; + + textLen = prefixLength; + text[textLen]='\0'; + } + + + //Set the enumeration + Term* trm = _CLNEW Term(term, prefix); + setEnum(reader->terms(trm)); + _CLDECDELETE(trm); + } + + FuzzyTermEnum::~FuzzyTermEnum(){ + //Func - Destructor + //Pre - true + //Post - FuzzyTermEnum has been destroyed + + //Close the enumeration + close(); + } + + bool FuzzyTermEnum::endEnum() { + //Func - Returns the fact if the current term in the enumeration has reached the end + //Pre - true + //Post - The boolean value of endEnum has been returned + + return _endEnum; + } + + void FuzzyTermEnum::close(){ + //Func - Close the enumeration + //Pre - true + //Post - The enumeration has been closed + + FilteredTermEnum::close(); + + //Finalize the searchTerm + _CLDECDELETE(searchTerm); + //Destroy e + _CLDELETE_ARRAY(e); + + _CLDELETE_CARRAY(text); + + if ( prefix != LUCENE_BLANK_STRING ) + _CLDELETE_CARRAY(prefix); + } + + bool FuzzyTermEnum::termCompare(Term* term) { + //Func - Compares term with the searchTerm using the Levenshtein distance. + //Pre - term is NULL or term points to a Term + //Post - if pre(term) is NULL then false is returned otherwise + // if the distance of the current term in the enumeration is bigger than the FUZZY_THRESHOLD + // then true is returned + + if (term == NULL){ + return false; //Note that endEnum is not set to true! + } + + const TCHAR* termText = term->text(); + size_t termTextLen = term->textLength(); + + //Check if the field name of searchTerm of term match + //(we can use == because fields are interned) + if ( searchTerm->field() == term->field() && + (prefixLength==0 || _tcsncmp(termText,prefix,prefixLength)==0 )) { + + const TCHAR* target = termText+prefixLength; + size_t targetLen = termTextLen-prefixLength; + + //Calculate the Levenshtein distance + int32_t dist = editDistance(text, target, textLen, targetLen); + distance = 1 - ((qreal)dist / (qreal)min(textLen, targetLen)); + return (distance > minimumSimilarity); + } + _endEnum = true; + return false; + } + + qreal FuzzyTermEnum::difference() { + //Func - Returns the difference between the distance and the fuzzy threshold + // multiplied by the scale factor + //Pre - true + //Post - The difference is returned + + return (qreal)((distance - minimumSimilarity) * scale_factor ); + } + + + /** Finds and returns the smallest of three integers + precondition: Must define int32_t __t for temporary storage and result + */ + #define min3(a, b, c) __t = (a < b) ? a : b; __t = (__t < c) ? __t : c; + + int32_t FuzzyTermEnum::editDistance(const TCHAR* s, const TCHAR* t, const int32_t n, const int32_t m) { + //Func - Calculates the Levenshtein distance also known as edit distance is a measure of similiarity + // between two strings where the distance is measured as the number of character + // deletions, insertions or substitutions required to transform one string to + // the other string. + //Pre - s != NULL and contains the source string + // t != NULL and contains the target string + // n >= 0 and contains the length of the source string + // m >= 0 and containts the length of th target string + //Post - The distance has been returned + + CND_PRECONDITION(s != NULL, "s is NULL"); + CND_PRECONDITION(t != NULL, "t is NULL"); + CND_PRECONDITION(n >= 0," n is a negative number"); + CND_PRECONDITION(n >= 0," n is a negative number"); + + int32_t i; // iterates through s + int32_t j; // iterates through t + TCHAR s_i; // ith character of s + + if (n == 0) + return m; + if (m == 0) + return n; + + //Check if the array must be reallocated because it is too small or does not exist + if (e == NULL || eWidth <= n || eHeight <= m) { + //Delete e if possible + _CLDELETE_ARRAY(e); + //resize e + eWidth = max(eWidth, n+1); + eHeight = max(eHeight, m+1); + e = _CL_NEWARRAY(int32_t,eWidth*eHeight); + } + + CND_CONDITION(e != NULL,"e is NULL"); + + // init matrix e + for (i = 0; i <= n; i++){ + e[i + (0*eWidth)] = i; + } + for (j = 0; j <= m; j++){ + e[0 + (j*eWidth)] = j; + } + + int32_t __t; //temporary variable for min3 + + // start computing edit distance + for (i = 1; i <= n; i++) { + s_i = s[i - 1]; + for (j = 1; j <= m; j++) { + if (s_i != t[j-1]){ + min3(e[i + (j*eWidth) - 1], e[i + ((j-1)*eWidth)], e[i + ((j-1)*eWidth)-1]); + e[i + (j*eWidth)] = __t+1; + }else{ + min3(e[i + (j*eWidth) -1]+1, e[i + ((j-1)*eWidth)]+1, e[i + ((j-1)*eWidth)-1]); + e[i + (j*eWidth)] = __t; + } + } + } + + // we got the result! + return e[n + ((m)*eWidth)]; + } + + + /** + * Create a new FuzzyQuery that will match terms with a similarity + * of at least minimumSimilarity to term. + * If a prefixLength > 0 is specified, a common prefix + * of that length is also required. + * + * @param term the term to search for + * @param minimumSimilarity a value between 0 and 1 to set the required similarity + * between the query term and the matching terms. For example, for a + * minimumSimilarity of 0.5 a term of the same length + * as the query term is considered similar to the query term if the edit distance + * between both terms is less than length(term)*0.5 + * @param prefixLength length of common (non-fuzzy) prefix + * @throws IllegalArgumentException if minimumSimilarity is > 1 or < 0 + * or if prefixLength < 0 or > term.text().length(). + */ + FuzzyQuery::FuzzyQuery(Term* term, qreal minimumSimilarity, size_t prefixLength): + MultiTermQuery(term) + { + //Func - Constructor + //Pre - term != NULL + //Post - The instance has been created + + CND_PRECONDITION(term != NULL,"term is NULL"); + + if (minimumSimilarity > 1.0f) + _CLTHROWA(CL_ERR_IllegalArgument,"minimumSimilarity > 1"); + else if (minimumSimilarity < 0.0f) + _CLTHROWA(CL_ERR_IllegalArgument,"minimumSimilarity < 0"); + + this->minimumSimilarity = minimumSimilarity; + + if(prefixLength >= term->textLength()) + _CLTHROWA(CL_ERR_IllegalArgument,"prefixLength >= term.textLength()"); + this->prefixLength = prefixLength; + + } + + + qreal FuzzyQuery::defaultMinSimilarity = 0.5f; + + FuzzyQuery::~FuzzyQuery(){ + //Func - Destructor + //Pre - true + //Post - Instance has been destroyed + } + + TCHAR* FuzzyQuery::toString(const TCHAR* field) const{ + //Func - Returns the query string + //Pre - field != NULL + //Post - The query string has been returned + + CND_PRECONDITION(field != NULL,"field is NULL"); + + StringBuffer buffer; + const TCHAR* b = MultiTermQuery::toString(field); + + buffer.append ( b ); + _CLDELETE_CARRAY(b); + buffer.append( _T("~") ); + + buffer.appendFloat(minimumSimilarity,1); + + return buffer.toString(); + } + + const TCHAR* FuzzyQuery::getQueryName() const{ + //Func - Returns the name of the query + //Pre - true + //post - The string FuzzyQuery has been returned + + return getClassName(); + } + const TCHAR* FuzzyQuery::getClassName(){ + //Func - Returns the name of the query + //Pre - true + //post - The string FuzzyQuery has been returned + + return _T("FuzzyQuery"); + } + + + /** + * Returns the minimum similarity that is required for this query to match. + * @return float value between 0.0 and 1.0 + */ + qreal FuzzyQuery::getMinSimilarity() const { + return minimumSimilarity; + } + + FuzzyQuery::FuzzyQuery(const FuzzyQuery& clone): + MultiTermQuery(clone) + { + this->minimumSimilarity = clone.getMinSimilarity(); + this->prefixLength = clone.getPrefixLength(); + + //if(prefixLength < 0) + // _CLTHROWA(CL_ERR_IllegalArgument,"prefixLength < 0"); + //else + if(prefixLength >= clone.getTerm()->textLength()) + _CLTHROWA(CL_ERR_IllegalArgument,"prefixLength >= term.textLength()"); + + } + + Query* FuzzyQuery::clone() const{ + return _CLNEW FuzzyQuery(*this); + } + size_t FuzzyQuery::hashCode() const{ + //todo: we should give the query a seeding value... but + //need to do it for all hascode functions + size_t val = Similarity::floatToByte(getBoost()) ^ getTerm()->hashCode(); + val ^= Similarity::floatToByte(this->getMinSimilarity()); + val ^= this->getPrefixLength(); + return val; + } + bool FuzzyQuery::equals(Query* other) const{ + if (!(other->instanceOf(FuzzyQuery::getClassName()))) + return false; + + FuzzyQuery* fq = (FuzzyQuery*)other; + return (this->getBoost() == fq->getBoost()) + && this->getMinSimilarity() == fq->getMinSimilarity() + && this->getPrefixLength() == fq->getPrefixLength() + && getTerm()->equals(fq->getTerm()); + } + + /** + * Returns the prefix length, i.e. the number of characters at the start + * of a term that must be identical (not fuzzy) to the query term if the query + * is to match that term. + */ + size_t FuzzyQuery::getPrefixLength() const { + return prefixLength; + } + + FilteredTermEnum* FuzzyQuery::getEnum(IndexReader* reader){ + Term* term = getTerm(false); + FuzzyTermEnum* ret = _CLNEW FuzzyTermEnum(reader, term, minimumSimilarity, prefixLength); + return ret; + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h new file mode 100644 index 000000000..e58637bb9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/FuzzyQuery.h @@ -0,0 +1,156 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_FuzzyQuery_ +#define _lucene_search_FuzzyQuery_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "MultiTermQuery.h" + + +CL_NS_DEF(search) + + // class FuzzyQuery implements the fuzzy search query + class FuzzyQuery: public MultiTermQuery { + private: + qreal minimumSimilarity; + size_t prefixLength; + protected: + FuzzyQuery(const FuzzyQuery& clone); + public: + static qreal defaultMinSimilarity; + + /** + * Create a new FuzzyQuery that will match terms with a similarity + * of at least minimumSimilarity to term. + * If a prefixLength > 0 is specified, a common prefix + * of that length is also required. + * + * @param term the term to search for + * @param minimumSimilarity a value between 0 and 1 to set the required similarity + * between the query term and the matching terms. For example, for a + * minimumSimilarity of 0.5 a term of the same length + * as the query term is considered similar to the query term if the edit distance + * between both terms is less than length(term)*0.5 + * @param prefixLength length of common (non-fuzzy) prefix + * @throws IllegalArgumentException if minimumSimilarity is > 1 or < 0 + * or if prefixLength < 0 or > term.text().length(). + */ + FuzzyQuery(CL_NS(index)::Term* term, qreal minimumSimilarity=defaultMinSimilarity, size_t prefixLength=0); + //Destructor + ~FuzzyQuery(); + + TCHAR* toString(const TCHAR* field) const; + + //Returns the name "FuzzyQuery" + static const TCHAR* getClassName(); + const TCHAR* getQueryName() const; + + Query* clone() const; + bool equals(Query * other) const; + size_t hashCode() const; + + /** + * Returns the minimum similarity that is required for this query to match. + * @return float value between 0.0 and 1.0 + */ + qreal getMinSimilarity() const; + + /** + * Returns the prefix length, i.e. the number of characters at the start + * of a term that must be identical (not fuzzy) to the query term if the query + * is to match that term. + */ + size_t getPrefixLength() const; + + protected: + FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader); + }; + + /** FuzzyTermEnum is a subclass of FilteredTermEnum for enumerating all + * terms that are similiar to the specified filter term. + * + * Term enumerations are always ordered by Term.compareTo(). Each term in + * the enumeration is greater than all that precede it. + */ + class FuzzyTermEnum: public FilteredTermEnum { + private: + qreal distance; + bool _endEnum; + + CL_NS(index)::Term* searchTerm; + TCHAR* text; + size_t textLen; + TCHAR* prefix; + size_t prefixLength; + qreal minimumSimilarity; + double scale_factor; + + + /** + * This static array saves us from the time required to create a new array + * everytime editDistance is called. + */ + int32_t* e; + int32_t eWidth; + int32_t eHeight; + + /****************************** + * Compute Levenshtein distance + ******************************/ + + /** + Levenshtein distance also known as edit distance is a measure of similiarity + between two strings where the distance is measured as the number of character + deletions, insertions or substitutions required to transform one string to + the other string. +

This method takes in four parameters; two strings and their respective + lengths to compute the Levenshtein distance between the two strings. + The result is returned as an integer. + */ + int32_t editDistance(const TCHAR* s, const TCHAR* t, const int32_t n, const int32_t m) ; + + protected: + /** + The termCompare method in FuzzyTermEnum uses Levenshtein distance to + calculate the distance between the given term and the comparing term. + */ + bool termCompare(CL_NS(index)::Term* term) ; + + ///Returns the fact if the current term in the enumeration has reached the end + bool endEnum(); + public: + + /** + * Empty prefix and minSimilarity of 0.5f are used. + * + * @param reader + * @param term + * @throws IOException + * @see #FuzzyTermEnum(IndexReader, Term, qreal, int32_t) + */ + FuzzyTermEnum(const CL_NS(index)::IndexReader* reader, CL_NS(index)::Term* term, qreal minSimilarity=FuzzyQuery::defaultMinSimilarity, size_t prefixLength=0); + /** Destructor */ + ~FuzzyTermEnum(); + /** Close the enumeration */ + void close(); + + /** Returns the difference between the distance and the fuzzy threshold + * multiplied by the scale factor + */ + qreal difference(); + + + const char* getObjectName(){ return FuzzyTermEnum::getClassName(); } + static const char* getClassName(){ return "FuzzyTermEnum"; } + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.cpp new file mode 100644 index 000000000..c9aecc6b4 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.cpp @@ -0,0 +1,107 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "HitQueue.h" + +CL_NS_DEF(search) + +void HitQueue::upHeap(){ + size_t i = _size; + ScoreDoc node = heap[i]; // save bottom node (WAS object) + int32_t j = ((uint32_t)i) >> 1; + while (j > 0 && lessThan(node,heap[j])) { + heap[i] = heap[j]; // shift parents down + i = j; + j = ((uint32_t)j) >> 1; + } + heap[i] = node; // install saved node +} +void HitQueue::downHeap(){ + size_t i = 1; + ScoreDoc node = heap[i]; // save top node + size_t j = i << 1; // find smaller child + size_t k = j + 1; + if (k <= _size && lessThan(heap[k], heap[j])) { + j = k; + } + while (j <= _size && lessThan(heap[j],node)) { + heap[i] = heap[j]; // shift up child + i = j; + j = i << 1; + k = j + 1; + if (k <= _size && lessThan(heap[k], heap[j])) { + j = k; + } + } + heap[i] = node; // install saved node +} + +void HitQueue::adjustTop(){ + downHeap(); +} +size_t HitQueue::size(){ + return _size; +} + +struct ScoreDoc& HitQueue::top(){ + if ( _size == 0 ) + _CLTHROWA(CL_ERR_IndexOutOfBounds, "Attempted to access empty hitqueue::top"); + return heap[1]; +} + +void HitQueue::put(struct ScoreDoc& element){ + if ( _size>=maxSize ) + _CLTHROWA(CL_ERR_IndexOutOfBounds,"add is out of bounds"); + + _size++; + heap[_size] = element; + upHeap(); +} + +ScoreDoc HitQueue::pop(){ + if (_size > 0) { + ScoreDoc result = heap[1]; // save first value + heap[1] = heap[_size]; // move last to first + + _size--; + downHeap(); // adjust heap + return result; + } else + _CLTHROWA(CL_ERR_IndexOutOfBounds, "Attempted to access empty hitqueue::top"); +} + +bool HitQueue::insert(struct ScoreDoc& element){ + if(_size < maxSize){ + put(element); + return true; + }else if(_size > 0 && !lessThan(element, heap[1])){ + heap[1] = element; + adjustTop(); + return true; + }else + return false; +} + +HitQueue::HitQueue(const int32_t maxSize){ + _size = 0; + this->maxSize = maxSize; + int32_t heapSize = maxSize + 1; + heap = _CL_NEWARRAY(ScoreDoc,heapSize); +} +HitQueue::~HitQueue(){ + _CLDELETE_ARRAY(heap); +} + +bool HitQueue::lessThan(struct ScoreDoc& hitA, struct ScoreDoc& hitB){ + if (hitA.score == hitB.score) + return hitA.doc > hitB.doc; + else + return hitA.score < hitB.score; +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.h b/src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.h new file mode 100644 index 000000000..0bd196a7f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/HitQueue.h @@ -0,0 +1,55 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_HitQueue_ +#define _lucene_search_HitQueue_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SearchHeader.h" + +CL_NS_DEF(search) + +/** +* An optimised PriorityQueue which takes ScoreDoc structs. Some by-ref passing +* and memory related optimisations have been done. +*/ +class HitQueue: LUCENE_BASE { +private: + ScoreDoc* heap; + size_t _size; + size_t maxSize; + + void upHeap(); + void downHeap(); + +protected: + bool lessThan(struct ScoreDoc& hitA, struct ScoreDoc& hitB); + +public: + void adjustTop(); + struct ScoreDoc& top(); + void put(struct ScoreDoc& element); + ScoreDoc pop(); + /** + * Adds element to the PriorityQueue in log(size) time if either + * the PriorityQueue is not full, or not lessThan(element, top()). + * @param element + * @return true if element is added, false otherwise. + */ + bool insert(struct ScoreDoc& element); + /** + * Returns the number of elements currently stored in the PriorityQueue. + */ + size_t size(); + HitQueue(const int32_t maxSize); + ~HitQueue(); + +}; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Hits.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/Hits.cpp new file mode 100644 index 000000000..38c489f44 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Hits.cpp @@ -0,0 +1,174 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +#include "SearchHeader.h" +#include "CLucene/document/Document.h" +#include "CLucene/index/IndexReader.h" +#include "Filter.h" +#include "CLucene/search/SearchHeader.h" + +CL_NS_USE(document) +CL_NS_USE(util) +CL_NS_USE(index) + +CL_NS_DEF(search) + + HitDoc::HitDoc(const qreal s, const int32_t i) + { + //Func - Constructor + //Pre - true + //Post - The instance has been created + + next = NULL; + prev = NULL; + doc = NULL; + score = s; + id = i; + } + + HitDoc::~HitDoc(){ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + _CLDELETE(doc); + } + + + Hits::Hits(Searcher* s, Query* q, Filter* f, const Sort* _sort): + query(q), searcher(s), filter(f), sort(_sort) + { + //Func - Constructor + //Pre - s contains a valid reference to a searcher s + // q contains a valid reference to a Query + // f is NULL or contains a pointer to a filter + //Post - The instance has been created + + _length = 0; + first = NULL; + last = NULL; + numDocs = 0; + maxDocs = 200; + + //retrieve 100 initially + getMoreDocs(50); + } + + Hits::~Hits(){ + + } + int32_t Hits::length() const { + return _length; + } + + Document& Hits::doc(const int32_t n){ + HitDoc* hitDoc = getHitDoc(n); + + // Update LRU cache of documents + remove(hitDoc); // remove from list, if there + addToFront(hitDoc); // add to front of list + if (numDocs > maxDocs) { // if cache is full + HitDoc* oldLast = last; + remove(last); // flush last + + _CLDELETE( oldLast->doc ); + oldLast->doc = NULL; + } + + if (hitDoc->doc == NULL){ + hitDoc->doc = _CLNEW Document; + searcher->doc(hitDoc->id, hitDoc->doc); // cache miss: read document + } + + return *hitDoc->doc; + } + + int32_t Hits::id (const int32_t n){ + return getHitDoc(n)->id; + } + + qreal Hits::score(const int32_t n){ + return getHitDoc(n)->score; + } + + void Hits::getMoreDocs(const size_t m){ + size_t _min = m; + { + size_t nHits = hitDocs.size(); + if ( nHits > _min) + _min = nHits; + } + + size_t n = _min * 2; // double # retrieved + TopDocs* topDocs = NULL; + if ( sort==NULL ) + topDocs = (TopDocs*)((Searchable*)searcher)->_search(query, filter, n); + else + topDocs = (TopDocs*)((Searchable*)searcher)->_search(query, filter, n, sort); + _length = topDocs->totalHits; + ScoreDoc* scoreDocs = topDocs->scoreDocs; + int32_t scoreDocsLength = topDocs->scoreDocsLength; + + qreal scoreNorm = 1.0f; + //Check that scoreDocs is a valid pointer before using it + if (scoreDocs != NULL){ + if (_length > 0 && scoreDocs[0].score > 1.0f){ + scoreNorm = 1.0f / scoreDocs[0].score; + } + + int32_t end = scoreDocsLength < _length ? scoreDocsLength : _length; + for (int32_t i = hitDocs.size(); i < end; i++) { + hitDocs.push_back(_CLNEW HitDoc(scoreDocs[i].score*scoreNorm, scoreDocs[i].doc)); + } + } + + _CLDELETE(topDocs); + } + + HitDoc* Hits::getHitDoc(const size_t n){ + if (n >= _length){ + TCHAR buf[100]; + _sntprintf(buf, 100,_T("Not a valid hit number: %d"),n); + _CLTHROWT(CL_ERR_IndexOutOfBounds, buf ); + } + if (n >= hitDocs.size()) + getMoreDocs(n); + + return hitDocs[n]; + } + + void Hits::addToFront(HitDoc* hitDoc) { // insert at front of cache + if (first == NULL) + last = hitDoc; + else + first->prev = hitDoc; + + hitDoc->next = first; + first = hitDoc; + hitDoc->prev = NULL; + + numDocs++; + } + + void Hits::remove(const HitDoc* hitDoc) { // remove from cache + if (hitDoc->doc == NULL) // it's not in the list + return; // abort + + if (hitDoc->next == NULL) + last = hitDoc->prev; + else + hitDoc->next->prev = hitDoc->prev; + + if (hitDoc->prev == NULL) + first = hitDoc->next; + else + hitDoc->prev->next = hitDoc->next; + + numDocs--; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp new file mode 100644 index 000000000..c948cfa4b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.cpp @@ -0,0 +1,362 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "IndexSearcher.h" + +#include "SearchHeader.h" +#include "Scorer.h" +#include "FieldDocSortedHitQueue.h" +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "CLucene/util/BitSet.h" +#include "FieldSortedHitQueue.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_USE(document) + +CL_NS_DEF(search) + +class SimpleTopDocsCollector : public HitCollector +{ +private: + qreal minScore; + const CL_NS(util)::BitSet* bits; + HitQueue* hq; + size_t nDocs; + int32_t* totalHits; + +public: + SimpleTopDocsCollector(const CL_NS(util)::BitSet* bs, HitQueue* hitQueue, + int32_t* totalhits, size_t ndocs, const qreal ms=-1.0f) + : minScore(ms), + bits(bs), + hq(hitQueue), + nDocs(ndocs), + totalHits(totalhits) {} + ~SimpleTopDocsCollector() {} + + void collect(const int32_t doc, const qreal score) + { + if (score > 0.0f // ignore zeroed buckets + && (bits == NULL || bits->get(doc))) { // skip docs not in bits + ++totalHits[0]; + if (hq->size() < nDocs || (minScore==-1.0f || score >= minScore)) { + ScoreDoc sd = {doc, score}; + hq->insert(sd); // update hit queue + if ( minScore != -1.0f ) + minScore = hq->top().score; // maintain minScore + } + } + } +}; + +class SortedTopDocsCollector : public HitCollector +{ +private: + const CL_NS(util)::BitSet* bits; + FieldSortedHitQueue* hq; + size_t nDocs; + int32_t* totalHits; +public: + SortedTopDocsCollector(const CL_NS(util)::BitSet* bs, + FieldSortedHitQueue* hitQueue, int32_t* totalhits, size_t _nDocs) + : bits(bs), + hq(hitQueue), + nDocs(_nDocs), + totalHits(totalhits) + { + } + ~SortedTopDocsCollector() {} + + void collect(const int32_t doc, const qreal score) + { + if (score > 0.0f && // ignore zeroed buckets + (bits==NULL || bits->get(doc))) { // skip docs not in bits + ++totalHits[0]; + // TODO: see jlucene way... with fields def??? + FieldDoc* fd = _CLNEW FieldDoc(doc, score); + if ( !hq->insert(fd) ) // update hit queue + _CLDELETE(fd); + } + } +}; + +class SimpleFilteredCollector : public HitCollector +{ +private: + CL_NS(util)::BitSet* bits; + HitCollector* results; +public: + SimpleFilteredCollector(CL_NS(util)::BitSet* bs, HitCollector* collector) + : bits(bs), + results(collector) {} + ~SimpleFilteredCollector() {} + +protected: + void collect(const int32_t doc, const qreal score) + { + // skip docs not in bits + if (bits->get(doc)) + results->collect(doc, score); + } +}; + + +IndexSearcher::IndexSearcher(const QString& path) +{ + //Func - Constructor + // Creates a searcher searching the index in the named directory. + //Pre - path != NULL + //Post - The instance has been created + + CND_PRECONDITION(!path.isEmpty(), "path is NULL"); + + reader = IndexReader::open(path); + readerOwner = true; +} + +IndexSearcher::IndexSearcher(CL_NS(store)::Directory* directory) +{ + //Func - Constructor + // Creates a searcher searching the index in the specified directory. + //Pre - path != NULL + //Post - The instance has been created + + CND_PRECONDITION(directory != NULL, "directory is NULL"); + + reader = IndexReader::open(directory); + readerOwner = true; +} + +IndexSearcher::IndexSearcher(IndexReader* r) +{ + //Func - Constructor + // Creates a searcher searching the index with the provide IndexReader + //Pre - path != NULL + //Post - The instance has been created + + reader = r; + readerOwner = false; +} + +IndexSearcher::~IndexSearcher() +{ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + close(); +} + +void IndexSearcher::close() +{ + //Func - Frees resources associated with this Searcher. + //Pre - true + //Post - The resources associated have been freed + if (readerOwner && reader){ + reader->close(); + _CLDELETE(reader); + } +} + +// inherit javadoc +int32_t IndexSearcher::docFreq(const Term* term) const +{ + //Func - + //Pre - reader != NULL + //Post - + + CND_PRECONDITION(reader != NULL, "reader is NULL"); + return reader->docFreq(term); +} + +// inherit javadoc +bool IndexSearcher::doc(int32_t i, CL_NS(document)::Document* d) +{ + //Func - Retrieves i-th document found + // For use by HitCollector implementations. + //Pre - reader != NULL + //Post - The i-th document has been returned + + CND_PRECONDITION(reader != NULL, "reader is NULL"); + return reader->document(i,d); +} + +// inherit javadoc +int32_t IndexSearcher::maxDoc() const +{ + //Func - Return total number of documents including the ones marked deleted + //Pre - reader != NULL + //Post - The total number of documents including the ones marked deleted + // has been returned + + CND_PRECONDITION(reader != NULL, "reader is NULL"); + return reader->maxDoc(); +} + +TopDocs* IndexSearcher::_search(Query* query, Filter* filter, const int32_t nDocs) +{ + //Func - + //Pre - reader != NULL + //Post - + + CND_PRECONDITION(reader != NULL, "reader is NULL"); + CND_PRECONDITION(query != NULL, "query is NULL"); + + Weight* weight = query->weight(this); + Scorer* scorer = weight->scorer(reader); + if (scorer == NULL){ + return _CLNEW TopDocs(0, NULL, 0); + } + + BitSet* bits = filter != NULL ? filter->bits(reader) : NULL; + HitQueue* hq = _CLNEW HitQueue(nDocs); + + //Check hq has been allocated properly + CND_CONDITION(hq != NULL, "Could not allocate memory for HitQueue hq"); + + int32_t* totalHits = _CL_NEWARRAY(int32_t,1); + totalHits[0] = 0; + + SimpleTopDocsCollector hitCol(bits,hq,totalHits,nDocs,0.0f); + scorer->score( &hitCol ); + _CLDELETE(scorer); + + int32_t scoreDocsLength = hq->size(); + + ScoreDoc* scoreDocs = _CL_NEWARRAY(ScoreDoc,scoreDocsLength); + + for (int32_t i = scoreDocsLength-1; i >= 0; --i) // put docs in array + scoreDocs[i] = hq->pop(); + + int32_t totalHitsInt = totalHits[0]; + + _CLDELETE(hq); + if ( bits != NULL && filter->shouldDeleteBitSet(bits) ) + _CLDELETE(bits); + _CLDELETE_ARRAY(totalHits); + Query* wq = weight->getQuery(); + if ( query != wq ) //query was re-written + _CLLDELETE(wq); + _CLDELETE(weight); + + return _CLNEW TopDocs(totalHitsInt, scoreDocs, scoreDocsLength); +} + +// inherit javadoc +TopFieldDocs* IndexSearcher::_search(Query* query, Filter* filter, + const int32_t nDocs, const Sort* sort) +{ + CND_PRECONDITION(reader != NULL, "reader is NULL"); + CND_PRECONDITION(query != NULL, "query is NULL"); + + Weight* weight = query->weight(this); + Scorer* scorer = weight->scorer(reader); + if (scorer == NULL) { + return _CLNEW TopFieldDocs(0, NULL, 0, NULL ); + } + + BitSet* bits = filter != NULL ? filter->bits(reader) : NULL; + FieldSortedHitQueue hq(reader, sort->getSort(), nDocs); + int32_t* totalHits = _CL_NEWARRAY(int32_t,1); + totalHits[0]=0; + + SortedTopDocsCollector hitCol(bits,&hq,totalHits,nDocs); + scorer->score(&hitCol); + _CLDELETE(scorer); + + int32_t hqLen = hq.size(); + FieldDoc** fieldDocs = _CL_NEWARRAY(FieldDoc*,hqLen); + for (int32_t i = hqLen-1; i >= 0; --i){ // put docs in array + fieldDocs[i] = hq.fillFields (hq.pop()); + } + + Query* wq = weight->getQuery(); + if ( query != wq ) //query was re-written + _CLLDELETE(wq); + _CLDELETE(weight); + + SortField** hqFields = hq.getFields(); + hq.setFields(NULL); //move ownership of memory over to TopFieldDocs + int32_t totalHits0 = totalHits[0]; + if ( bits != NULL && filter->shouldDeleteBitSet(bits) ) + _CLDELETE(bits); + _CLDELETE_ARRAY(totalHits); + return _CLNEW TopFieldDocs(totalHits0, fieldDocs, hqLen, hqFields ); +} + +void IndexSearcher::_search(Query* query, Filter* filter, HitCollector* results) +{ + //Func - _search an index and fetch the results + // Applications should only use this if they need all of the + // matching documents. The high-level search API (search(Query)) + // is usually more efficient, as it skips non-high-scoring hits. + //Pre - query is a valid reference to a query filter may or may not be NULL + // results is a valid reference to a HitCollector and used to store the results + //Post - filter if non-NULL, a bitset used to eliminate some documents + + CND_PRECONDITION(reader != NULL, "reader is NULL"); + CND_PRECONDITION(query != NULL, "query is NULL"); + + BitSet* bits = NULL; + SimpleFilteredCollector* fc = NULL; + + if (filter != NULL){ + bits = filter->bits(reader); + fc = _CLNEW SimpleFilteredCollector(bits, results); + } + + Weight* weight = query->weight(this); + Scorer* scorer = weight->scorer(reader); + if (scorer != NULL) { + if (fc == NULL){ + scorer->score(results); + }else{ + scorer->score((HitCollector*)fc); + } + _CLDELETE(scorer); + } + + _CLDELETE(fc); + _CLDELETE(weight); + if ( bits != NULL && filter->shouldDeleteBitSet(bits) ) + _CLDELETE(bits); +} + +Query* IndexSearcher::rewrite(Query* original) +{ + Query* query = original; + Query* last = original; + for (Query* rewrittenQuery = query->rewrite(reader); + rewrittenQuery != query; + rewrittenQuery = query->rewrite(reader)) { + query = rewrittenQuery; + if ( query != last && last != original) { + _CLDELETE(last); + } + last = query; + } + return query; +} + +void IndexSearcher::explain(Query* query, int32_t doc, Explanation* ret) +{ + Weight* weight = query->weight(this); + weight->explain(reader, doc, ret); + + Query* wq = weight->getQuery(); + if ( query != wq ) //query was re-written + _CLLDELETE(wq); + _CLDELETE(weight); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.h b/src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.h new file mode 100644 index 000000000..307e0266d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/IndexSearcher.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_search_IndexSearcher_ +#define _lucene_search_IndexSearcher_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "SearchHeader.h" +#include "CLucene/store/Directory.h" +#include "CLucene/document/Document.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "CLucene/util/BitSet.h" +#include "HitQueue.h" +#include "FieldSortedHitQueue.h" + +CL_NS_DEF(search) +/** Implements search over a single IndexReader. +* +*

Applications usually need only call the inherited {@link search(Query*)} +* or {@link search(Query*,Filter*)} methods. +*/ +class IndexSearcher:public Searcher{ + CL_NS(index)::IndexReader* reader; + bool readerOwner; + +public: + /// Creates a searcher searching the index in the named directory. + IndexSearcher(const QString& path); + + /// Creates a searcher searching the index in the specified directory. + IndexSearcher(CL_NS(store)::Directory* directory); + + /// Creates a searcher searching the provided index. + IndexSearcher(CL_NS(index)::IndexReader* r); + + ~IndexSearcher(); + + /// Frees resources associated with this Searcher. + void close(); + + int32_t docFreq(const CL_NS(index)::Term* term) const; + + bool doc(int32_t i, CL_NS(document)::Document* document); + + int32_t maxDoc() const; + + TopDocs* _search(Query* query, Filter* filter, const int32_t nDocs); + TopFieldDocs* _search(Query* query, Filter* filter, const int32_t nDocs, + const Sort* sort); + + void _search(Query* query, Filter* filter, HitCollector* results); + + CL_NS(index)::IndexReader* getReader() { + return reader; } + + Query* rewrite(Query* original); + void explain(Query* query, int32_t doc, Explanation* ret); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp new file mode 100644 index 000000000..bed7f0d61 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.cpp @@ -0,0 +1,227 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "MultiSearcher.h" + +#include "SearchHeader.h" +#include "HitQueue.h" +#include "CLucene/document/Document.h" +#include "CLucene/index/Term.h" +#include "FieldDocSortedHitQueue.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_USE(document) + +CL_NS_DEF(search) + + /** Creates a searcher which searches searchers. */ + MultiSearcher::MultiSearcher(Searchable** _searchables): + _maxDoc(0) { + searchablesLen = 0; + while ( _searchables[searchablesLen] != NULL ) + ++searchablesLen; + + searchables=_CL_NEWARRAY(Searchable*,searchablesLen+1); + starts = _CL_NEWARRAY(int32_t,searchablesLen + 1); // build starts array + for (int32_t i = 0; i < searchablesLen; ++i) { + searchables[i]=_searchables[i]; + starts[i] = _maxDoc; + _maxDoc += searchables[i]->maxDoc(); // compute maxDocs + } + starts[searchablesLen] = _maxDoc; + } + + MultiSearcher::~MultiSearcher() { + _CLDELETE_ARRAY(searchables); + _CLDELETE_ARRAY(starts); + } + + + // inherit javadoc + void MultiSearcher::close() { + for (int32_t i = 0; i < searchablesLen; ++i){ + searchables[i]->close(); + searchables[i]=NULL; + } + } + + int32_t MultiSearcher::docFreq(const Term* term) const { + int32_t docFreq = 0; + for (int32_t i = 0; i < searchablesLen; ++i) + docFreq += searchables[i]->docFreq(term); + return docFreq; + } + + /** For use by {@link HitCollector} implementations. */ + bool MultiSearcher::doc(int32_t n, Document* d) { + int32_t i = subSearcher(n); // find searcher index + return searchables[i]->doc(n - starts[i], d); // dispatch to searcher + } + + int32_t MultiSearcher::searcherIndex(int32_t n) const{ + return subSearcher(n); + } + + /** Returns index of the searcher for document n in the array + * used to construct this searcher. */ + int32_t MultiSearcher::subSearcher(int32_t n) const{ + // replace w/ call to Arrays.binarySearch in Java 1.2 + int32_t lo = 0; // search starts array + int32_t hi = searchablesLen - 1; // for first element less + // than n, return its index + int32_t mid,midValue; + while (hi >= lo) { + mid = (lo + hi) >> 1; + midValue = starts[mid]; + if (n < midValue) + hi = mid - 1; + else if (n > midValue) + lo = mid + 1; + else{ // found a match + while (mid+1 < searchablesLen && starts[mid+1] == midValue) { + ++mid; // scan to last match + } + return mid; + } + } + return hi; + } + + /** Returns the document number of document n within its + * sub-index. */ + int32_t MultiSearcher::subDoc(int32_t n) const{ + return n - starts[subSearcher(n)]; + } + + int32_t MultiSearcher::maxDoc() const{ + return _maxDoc; + } + + TopDocs* MultiSearcher::_search(Query* query, Filter* filter, const int32_t nDocs) { + HitQueue* hq = _CLNEW HitQueue(nDocs); + int32_t totalHits = 0; + TopDocs* docs; + int32_t j; + ScoreDoc* scoreDocs; + for (int32_t i = 0; i < searchablesLen; i++) { // search each searcher + docs = searchables[i]->_search(query, filter, nDocs); + totalHits += docs->totalHits; // update totalHits + scoreDocs = docs->scoreDocs; + for ( j = 0; j scoreDocsLength; ++j) { // merge scoreDocs int_to hq + scoreDocs[j].doc += starts[i]; // convert doc + if ( !hq->insert(scoreDocs[j])) + break; // no more scores > minScore + } + + _CLDELETE(docs); + } + + int32_t scoreDocsLen = hq->size(); + scoreDocs = _CL_NEWARRAY(ScoreDoc, scoreDocsLen); + {//MSVC 6 scope fix + for (int32_t i = scoreDocsLen-1; i >= 0; --i) // put docs in array + scoreDocs[i] = hq->pop(); + } + + //cleanup + _CLDELETE(hq); + + return _CLNEW TopDocs(totalHits, scoreDocs, scoreDocsLen); + } + + /** Lower-level search API. + * + *

{@link HitCollector#collect(int32_t,qreal)} is called for every non-zero + * scoring document. + * + *

Applications should only use this if they need all of the + * matching documents. The high-level search API ({@link + * Searcher#search(Query)}) is usually more efficient, as it skips + * non-high-scoring hits. + * + * @param query to match documents + * @param filter if non-null, a bitset used to eliminate some documents + * @param results to receive hits + */ + void MultiSearcher::_search(Query* query, Filter* filter, HitCollector* results){ + for (int32_t i = 0; i < searchablesLen; ++i) { + /* DSR:CL_BUG: Old implementation leaked and was misconceived. We need + ** to have the original HitCollector ($results) collect *all* hits; + ** the MultiHitCollector instantiated below serves only to adjust + ** (forward by starts[i]) the docNo passed to $results. + ** Old implementation instead created a sort of linked list of + ** MultiHitCollectors that applied the adjustments in $starts + ** cumulatively (and was never deleted). */ + HitCollector *docNoAdjuster = _CLNEW MultiHitCollector(results, starts[i]); + searchables[i]->_search(query, filter, docNoAdjuster); + _CLDELETE(docNoAdjuster); + } + } + + TopFieldDocs* MultiSearcher::_search (Query* query, Filter* filter, const int32_t n, const Sort* sort){ + FieldDocSortedHitQueue* hq = NULL; + int32_t totalHits = 0; + TopFieldDocs* docs; + int32_t j; + FieldDoc** fieldDocs; + + for (int32_t i = 0; i < searchablesLen; ++i) { // search each searcher + docs = searchables[i]->_search (query, filter, n, sort); + if (hq == NULL){ + hq = _CLNEW FieldDocSortedHitQueue (docs->fields, n); + docs->fields = NULL; //hit queue takes fields memory + } + + totalHits += docs->totalHits; // update totalHits + fieldDocs = docs->fieldDocs; + for(j = 0;jscoreDocsLength;++j){ // merge scoreDocs into hq + fieldDocs[j]->scoreDoc.doc += starts[i]; // convert doc + if (!hq->insert (fieldDocs[j]) ) + break; // no more scores > minScore + } + for ( int32_t x=0;xsize(); + fieldDocs = _CL_NEWARRAY(FieldDoc*,hqlen); + for (j = hqlen - 1; j >= 0; j--) // put docs in array + fieldDocs[j] = hq->pop(); + + SortField** hqFields = hq->getFields(); + hq->setFields(NULL); //move ownership of memory over to TopFieldDocs + _CLDELETE(hq); + + return _CLNEW TopFieldDocs (totalHits, fieldDocs, hqlen, hqFields); + } + + Query* MultiSearcher::rewrite(Query* original) { + Query** queries = _CL_NEWARRAY(Query*,searchablesLen+1); + for (int32_t i = 0; i < searchablesLen; ++i) + queries[i] = searchables[i]->rewrite(original); + queries[searchablesLen]=NULL; + return original->combine(queries); + } + + void MultiSearcher::explain(Query* query, int32_t doc, Explanation* ret) { + int32_t i = subSearcher(doc); // find searcher index + searchables[i]->explain(query,doc-starts[i], ret); // dispatch to searcher + } + + MultiHitCollector::MultiHitCollector(HitCollector* _results, int32_t _start): + results(_results), + start(_start) { + } + + void MultiHitCollector::collect(const int32_t doc, const qreal score) { + results->collect(doc + start, score); + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.h b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.h new file mode 100644 index 000000000..1021fbbec --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiSearcher.h @@ -0,0 +1,95 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_multisearcher +#define _lucene_search_multisearcher + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SearchHeader.h" +#include "CLucene/document/Document.h" +#include "CLucene/index/Term.h" + +CL_NS_DEF(search) + + class MultiHitCollector: public HitCollector{ + private: + HitCollector* results; + int32_t start; + public: + MultiHitCollector(HitCollector* _results, int32_t _start); + void collect(const int32_t doc, const qreal score) ; + }; + + + /** Implements search over a set of Searchables. + * + *

Applications usually need only call the inherited {@link #search(Query)} + * or {@link #search(Query,Filter)} methods. + */ + class MultiSearcher: public Searcher { + private: + Searchable** searchables; + int32_t searchablesLen; + int32_t* starts; + int32_t _maxDoc; + protected: + int32_t* getStarts() { + return starts; + } + + public: + /** Creates a searcher which searches Searchables. */ + MultiSearcher(Searchable** searchables); + + ~MultiSearcher(); + + /** Frees resources associated with this Searcher. */ + void close() ; + + int32_t docFreq(const CL_NS(index)::Term* term) const ; + + /** For use by {@link HitCollector} implementations. */ + bool doc(int32_t n, CL_NS(document)::Document* document); + + /** For use by {@link HitCollector} implementations to identify the + * index of the sub-searcher that a particular hit came from. */ + int32_t searcherIndex(int32_t n) const; + + int32_t subSearcher(int32_t n) const; + + int32_t subDoc(int32_t n) const; + + int32_t maxDoc() const; + + TopDocs* _search(Query* query, Filter* filter, const int32_t nDocs) ; + + TopFieldDocs* _search (Query* query, Filter* filter, const int32_t n, const Sort* sort); + + /** Lower-level search API. + * + *

{@link HitCollector#collect(int32_t,qreal)} is called for every non-zero + * scoring document. + * + *

Applications should only use this if they need all of the + * matching documents. The high-level search API ({@link + * Searcher#search(Query)}) is usually more efficient, as it skips + * non-high-scoring hits. + * + * @param query to match documents + * @param filter if non-null, a bitset used to eliminate some documents + * @param results to receive hits + */ + void _search(Query* query, Filter* filter, HitCollector* results); + + Query* rewrite(Query* original); + void explain(Query* query, int32_t doc, Explanation* ret); + }; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp new file mode 100644 index 000000000..3bf8d7a26 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.cpp @@ -0,0 +1,98 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "MultiTermQuery.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + +/** Constructs a query for terms matching term. */ + + MultiTermQuery::MultiTermQuery(Term* t){ + //Func - Constructor + //Pre - t != NULL + //Post - The instance has been created + + CND_PRECONDITION(t != NULL, "t is NULL"); + + term = _CL_POINTER(t); + + } + MultiTermQuery::MultiTermQuery(const MultiTermQuery& clone): + Query(clone) + { + term = _CLNEW Term(clone.getTerm(false),clone.getTerm(false)->text()); + } + + MultiTermQuery::~MultiTermQuery(){ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + _CLDECDELETE(term); + } + + Term* MultiTermQuery::getTerm(bool pointer) const{ + if ( pointer ) + return _CL_POINTER(term); + else + return term; + } + + Query* MultiTermQuery::rewrite(IndexReader* reader) { + FilteredTermEnum* enumerator = getEnum(reader); + BooleanQuery* query = _CLNEW BooleanQuery(); + try { + do { + Term* t = enumerator->term(false); + if (t != NULL) { + TermQuery* tq = _CLNEW TermQuery(t); // found a match + tq->setBoost(getBoost() * enumerator->difference()); // set the boost + query->add(tq,true, false, false); // add to q + } + } while (enumerator->next()); + } _CLFINALLY ( enumerator->close(); _CLDELETE(enumerator) ); + + //if we only added one clause and the clause is not prohibited then + //we can just return the query + if (query->getClauseCount() == 1) { // optimize 1-clause queries + BooleanClause* c=0; + query->getClauses(&c); + + if (!c->prohibited) { // just return clause + c->deleteQuery=false; + Query* ret = c->query; + + _CLDELETE(query); + return ret; + } + } + return query; + } + + Query* MultiTermQuery::combine(Query** queries) { + return Query::mergeBooleanQueries(queries); + } + + /** Prints a user-readable version of this query. */ + TCHAR* MultiTermQuery::toString(const TCHAR* field) const{ + StringBuffer buffer; + + if ( field==NULL || _tcscmp(term->field(),field)!=0 ) { + buffer.append(term->field()); + buffer.append( _T(":")); + } + buffer.append(term->text()); + if (getBoost() != 1.0f) { + buffer.appendChar ( '^' ); + buffer.appendFloat( getBoost(),1); + } + return buffer.toString(); + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h new file mode 100644 index 000000000..d37645359 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/MultiTermQuery.h @@ -0,0 +1,62 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_MultiTermQuery_ +#define _lucene_search_MultiTermQuery_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/StringBuffer.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "FilteredTermEnum.h" +#include "SearchHeader.h" +#include "BooleanQuery.h" +#include "TermQuery.h" + +CL_NS_DEF(search) + /** + * A {@link Query} that matches documents containing a subset of terms provided + * by a {@link FilteredTermEnum} enumeration. + *

+ * MultiTermQuery is not designed to be used by itself. + *
+ * The reason being that it is not intialized with a {@link FilteredTermEnum} + * enumeration. A {@link FilteredTermEnum} enumeration needs to be provided. + *

+ * For example, {@link WildcardQuery} and {@link FuzzyQuery} extend + * MultiTermQuery to provide {@link WildcardTermEnum} and + * {@link FuzzyTermEnum}, respectively. + */ + class MultiTermQuery: public Query { + private: + CL_NS(index)::Term* term; + protected: + MultiTermQuery(const MultiTermQuery& clone); + + /** Construct the enumeration to be used, expanding the pattern term. */ + virtual FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader) = 0; + public: + /** Constructs a query for terms matching term. */ + MultiTermQuery(CL_NS(index)::Term* t); + + virtual ~MultiTermQuery(); + + /** Returns the pattern term. */ + CL_NS(index)::Term* getTerm(bool pointer=true) const; + + Query* combine(Query** queries); + + /** Prints a user-readable version of this query. */ + TCHAR* toString(const TCHAR* field) const; + + Query* rewrite(CL_NS(index)::IndexReader* reader); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp new file mode 100644 index 000000000..7611056e7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.cpp @@ -0,0 +1,116 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "PhrasePositions.h" + +#include "CLucene/index/Terms.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + PhrasePositions::PhrasePositions(TermPositions* Tp, const int32_t OffSet){ + //Func - Constructor + //Pre - t != NULL + // OffSet != NULL + //Post - The instance has been created + + CND_PRECONDITION(Tp != NULL,"Tp is NULL"); + CND_PRECONDITION(OffSet >= 0 ,"OffSet is a negative number"); + + tp = Tp; + offset = OffSet; + position = 0; + count = 0; + doc = 0; + + _next = NULL; + } + + PhrasePositions::~PhrasePositions(){ + //Func - Destructor + //Pre - true + //Post - The instance has been deleted + + //delete next Phrase position and by doing that + //all PhrasePositions in the list + _CLDELETE(_next); + + //Check if tp is valid + if ( tp != NULL ){ + //Close TermPositions tp + tp->close(); + _CLDELETE(tp); + } + } + + bool PhrasePositions::next(){ + //Func - Increments to next doc + //Pre - tp != NULL + //Post - if there was no next then doc = INT_MAX otherwise + // doc contains the current document number + + CND_PRECONDITION(tp != NULL,"tp is NULL"); + + //Move to the next in TermPositions tp + if (!tp->next()) { + //There is no next so close the stream + tp->close(); + //delete tp and reset tp to NULL + _CLVDELETE(tp); //todo: not a clucene object... should be + //Assign Doc sentinel value + doc = INT_MAX; + return false; + }else{ + doc = tp->doc(); + position = 0; + return true; + } + } + bool PhrasePositions::skipTo(int32_t target){ + if (!tp->skipTo(target)) { + tp->close(); // close stream + doc = LUCENE_INT32_MAX_SHOULDBE; // sentinel value + return false; + } + doc = tp->doc(); + position = 0; + return true; + } + void PhrasePositions::firstPosition(){ + //Func - Read the first TermPosition + //Pre - tp != NULL + //Post - + + CND_PRECONDITION(tp != NULL,"tp is NULL"); + + //read first pos + count = tp->freq(); + //Move to the next TermPosition + nextPosition(); + } + + bool PhrasePositions::nextPosition(){ + //Func - Move to the next position + //Pre - tp != NULL + //Post - + + CND_PRECONDITION(tp != NULL,"tp is NULL"); + + if (count-- > 0) { + //read subsequent pos's + position = tp->nextPosition() - offset; + + //Check position always bigger than or equal to 0 + //bvk: todo, bug??? position < 0 occurs, cant figure out why, + //old version does it too and will fail the "SearchTest" test + //CND_CONDITION(position >= 0, "position has become a negative number"); + return true; + }else{ + return false; + } + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.h b/src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.h new file mode 100644 index 000000000..b6c8437b9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhrasePositions.h @@ -0,0 +1,41 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_PhrasePositions_ +#define _lucene_search_PhrasePositions_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/Terms.h" + +CL_NS_DEF(search) + + class PhrasePositions:LUCENE_BASE { + public: + int32_t doc; // current doc + int32_t position; // position in doc + int32_t count; // remaining pos in this doc + int32_t offset; // position in phrase + CL_NS(index)::TermPositions* tp; // stream of positions + PhrasePositions* _next; // used to make lists + + + //Constructor + PhrasePositions(CL_NS(index)::TermPositions* Tp, const int32_t o); + //Destructor + ~PhrasePositions(); + + bool next(); + bool skipTo(int32_t target); + + void firstPosition(); + + bool nextPosition(); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp new file mode 100644 index 000000000..899cb3cfe --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.cpp @@ -0,0 +1,463 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "PhraseQuery.h" + +#include "SearchHeader.h" +#include "Scorer.h" +#include "BooleanQuery.h" +#include "TermQuery.h" + +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "CLucene/index/IndexReader.h" + +#include "CLucene/util/StringBuffer.h" +#include "CLucene/util/VoidList.h" +#include "CLucene/util/Arrays.h" + +#include "ExactPhraseScorer.h" +#include "SloppyPhraseScorer.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + PhraseQuery::PhraseQuery(): + terms(false) + { + //Func - Constructor + //Pre - true + //Post - An empty PhraseQuery has been created + + slop = 0; + + field = NULL; + } + PhraseQuery::PhraseQuery(const PhraseQuery& clone): + Query(clone), terms(false) + { + slop = clone.slop; + field = clone.field; + int32_t size=clone.positions.size(); + { //msvc6 scope fix + for ( int32_t i=0;ipositions.push_back( n ); + } + } + size=clone.terms.size(); + { //msvc6 scope fix + for ( int32_t i=0;iterms.push_back( _CL_POINTER(clone.terms[i])); + } + } + } + Query* PhraseQuery::clone() const{ + return _CLNEW PhraseQuery(*this); + } + bool PhraseQuery::equals(CL_NS(search)::Query *other) const{ + if (!(other->instanceOf(PhraseQuery::getClassName()))) + return false; + + PhraseQuery* pq = (PhraseQuery*)other; + bool ret = (this->getBoost() == pq->getBoost()) + && (this->slop == pq->slop); + + if ( ret ){ + CLListEquals, + const CL_NS(util)::CLVector > comp; + ret = comp.equals(&this->terms,&pq->terms); + } + + if ( ret ){ + CLListEquals, + const CL_NS(util)::CLVector > comp; + ret = comp.equals(&this->positions,&pq->positions); + } + return ret; + } + + + PhraseQuery::~PhraseQuery(){ + //Func - Destructor + //Pre - true + //Post 0 The instance has been destroyed + + //Iterate through all the terms + for (uint32_t i = 0; i < terms.size(); i++){ + _CLLDECDELETE(terms[i]); + } + positions.clear(); + } + + size_t PhraseQuery::hashCode() const { + //todo: do cachedHashCode, and invalidate on add/remove clause + size_t ret = Similarity::floatToByte(getBoost()) ^ Similarity::floatToByte(slop); + + { //msvc6 scope fix + for ( int32_t i=0;terms.size();i++ ) + ret = 31 * ret + terms[i]->hashCode(); + } + { //msvc6 scope fix + for ( int32_t i=0;positions.size();i++ ) + ret = 31 * ret + positions[i]; + } + return ret; + } + + const TCHAR* PhraseQuery::getClassName(){ + return _T("PhraseQuery"); + } + const TCHAR* PhraseQuery::getQueryName() const{ + //Func - Returns the string "PhraseQuery" + //Pre - true + //Post - The string "PhraseQuery" has been returned + return getClassName(); + } + + + /** + * Adds a term to the end of the query phrase. + * The relative position of the term is the one immediately after the last term added. + */ + void PhraseQuery::add(Term* term) { + CND_PRECONDITION(term != NULL,"term is NULL"); + + int32_t position = 0; + + if(positions.size() > 0) + position = (positions[positions.size()-1]) + 1; + + add(term, position); + } + + void PhraseQuery::add(Term* term, int32_t position) { + //Func - Adds a term to the end of the query phrase. + //Pre - term != NULL + //Post - The term has been added if its field matches the field of the PhraseQuery + // and true is returned otherwise false is returned + CND_PRECONDITION(term != NULL,"term is NULL"); + + if (terms.size() == 0) + field = term->field(); + else{ + //Check if the field of the _CLNEW term matches the field of the PhraseQuery + //can use != because fields are interned + if ( term->field() != field){ + //return false; + TCHAR buf[200]; + _sntprintf(buf,200,_T("All phrase terms must be in the same field: %s"),term->field()); + _CLTHROWT(CL_ERR_IllegalArgument,buf); + } + } + //Store the _CLNEW term + terms.push_back(_CL_POINTER(term)); + + positions.push_back(position); + } + + void PhraseQuery::getPositions(Array& result) const{ + result.length = positions.size(); + result.values = _CL_NEWARRAY(int32_t,result.length); + for(int32_t i = 0; i < result.length; i++){ + result.values[i] = positions[i]; + } + } + int32_t* PhraseQuery::getPositions() const{ + CND_WARNING(false,"getPositions() is deprecated") + + Array arr; + getPositions(arr); + return arr.values; + } + + Weight* PhraseQuery::_createWeight(Searcher* searcher) { + if (terms.size() == 1) { // optimize one-term case + Term* term = terms[0]; + Query* termQuery = _CLNEW TermQuery(term); + termQuery->setBoost(getBoost()); + Weight* ret = termQuery->_createWeight(searcher); + _CLDELETE(termQuery); + return ret; + } + return _CLNEW PhraseWeight(searcher,this); + } + + + Term** PhraseQuery::getTerms() const{ + //Func - added by search highlighter + //Pre - + //Post - + + //Let size contain the number of terms + int32_t size = terms.size(); + Term** ret = _CL_NEWARRAY(Term*,size+1); + + CND_CONDITION(ret != NULL,"Could not allocated memory for ret"); + + //Iterate through terms and copy each pointer to ret + for ( int32_t i=0;itext() ); + //Check if i is at the end of terms + if (i != terms.size()-1){ + buffer.append(_T(" ")); + } + } + + buffer.append( _T("\"") ); + + if (slop != 0) { + buffer.append(_T("~")); + buffer.appendFloat(slop,0); + } + + //Check if there is an other boost factor than 1.0 + if (getBoost() != 1.0f) { + buffer.append(_T("^")); + buffer.appendFloat( getBoost(),1 ); + } + + //return the query string + return buffer.toString(); + } + + + + + + + + + PhraseQuery::PhraseWeight::PhraseWeight(Searcher* searcher, PhraseQuery* _this) { + this->_this=_this; + this->value = 0; + this->idf = 0; + this->queryNorm = 0; + this->queryWeight = 0; + this->searcher = searcher; + } + + TCHAR* PhraseQuery::PhraseWeight::toString() { + return STRDUP_TtoT(_T("weight(PhraseQuery)")); + } + PhraseQuery::PhraseWeight::~PhraseWeight(){ + } + + + Query* PhraseQuery::PhraseWeight::getQuery() { return _this; } + qreal PhraseQuery::PhraseWeight::getValue() { return value; } + + qreal PhraseQuery::PhraseWeight::sumOfSquaredWeights(){ + idf = _this->getSimilarity(searcher)->idf(&_this->terms, searcher); + queryWeight = idf * _this->getBoost(); // compute query weight + return queryWeight * queryWeight; // square it + } + + void PhraseQuery::PhraseWeight::normalize(qreal queryNorm) { + this->queryNorm = queryNorm; + queryWeight *= queryNorm; // normalize query weight + value = queryWeight * idf; // idf for document + } + + Scorer* PhraseQuery::PhraseWeight::scorer(IndexReader* reader) { + //Func - + //Pre - + //Post - + + //Get the length of terms + int32_t tpsLength = _this->terms.size(); + + //optimize zero-term case + if (tpsLength == 0) + return NULL; + + TermPositions** tps = _CL_NEWARRAY(TermPositions*,tpsLength+1); + + //Check if tps has been allocated properly + CND_CONDITION(tps != NULL,"Could not allocate memory for tps"); + + TermPositions* p = NULL; + + //Iterate through all terms + int32_t size = _this->terms.size(); + for (int32_t i = 0; i < size; i++) { + //Get the termPostitions for the i-th term + p = reader->termPositions(_this->terms[i]); + + //Check if p is valid + if (p == NULL) { + //Delete previous retrieved termPositions + while (--i >= 0){ + _CLVDELETE(tps[i]); //todo: not a clucene object... should be + } + _CLDELETE_ARRAY(tps); + return NULL; + } + + //Store p at i in tps + tps[i] = p; + } + tps[tpsLength] = NULL; + + Scorer* ret = NULL; + + Array positions; + _this->getPositions(positions); + int32_t slop = _this->getSlop(); + if ( slop != 0) + // optimize exact case + //todo: need to pass these: this, tps, + ret = _CLNEW SloppyPhraseScorer(this,tps,positions.values, + _this->getSimilarity(searcher), + slop, reader->norms(_this->field)); + else + ret = _CLNEW ExactPhraseScorer(this, tps, positions.values, + _this->getSimilarity(searcher), + reader->norms(_this->field)); + positions.deleteArray(); + + CND_CONDITION(ret != NULL,"Could not allocate memory for ret"); + + //tps can be deleted safely. SloppyPhraseScorer or ExactPhraseScorer will take care + //of its values + + _CLDELETE_ARRAY(tps); + return ret; + } + + void PhraseQuery::PhraseWeight::explain(IndexReader* reader, int32_t doc, Explanation* result){ + TCHAR descbuf[LUCENE_SEARCH_EXPLANATION_DESC_LEN+1]; + TCHAR* tmp; + + tmp = getQuery()->toString(); + _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN,_T("weight(%s in %d), product of:"), + tmp,doc); + _CLDELETE_CARRAY(tmp); + result->setDescription(descbuf); + + StringBuffer docFreqs; + StringBuffer query; + query.appendChar('\"'); + for (uint32_t i = 0; i < _this->terms.size(); i++) { + if (i != 0) { + docFreqs.appendChar(' '); + query.appendChar(' '); + } + + Term* term = _this->terms[i]; + + docFreqs.append(term->text()); + docFreqs.appendChar('='); + docFreqs.appendInt(searcher->docFreq(term)); + + query.append(term->text()); + } + query.appendChar('\"'); + + _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("idf(%s: %s)"),_this->field,docFreqs.getBuffer()); + Explanation* idfExpl = _CLNEW Explanation(idf, descbuf); + + // explain query weight + Explanation* queryExpl = _CLNEW Explanation; + tmp = getQuery()->toString(); + _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("queryWeight(%s), product of:"),tmp); + _CLDELETE_CARRAY(tmp); + queryExpl->setDescription(descbuf); + + Explanation* boostExpl = _CLNEW Explanation(_this->getBoost(), _T("boost")); + if (_this->getBoost() != 1.0f) + queryExpl->addDetail(boostExpl); + queryExpl->addDetail(idfExpl); + + Explanation* queryNormExpl = _CLNEW Explanation(queryNorm,_T("queryNorm")); + queryExpl->addDetail(queryNormExpl); + + queryExpl->setValue(boostExpl->getValue() * + idfExpl->getValue() * + queryNormExpl->getValue()); + + result->addDetail(queryExpl); + + // explain field weight + Explanation* fieldExpl = _CLNEW Explanation; + _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("fieldWeight(%s:%s in %d), product of:"), + _this->field,query.getBuffer(),doc); + fieldExpl->setDescription(descbuf); + + + Explanation* tfExpl = _CLNEW Explanation; + scorer(reader)->explain(doc, tfExpl); + fieldExpl->addDetail(tfExpl); + fieldExpl->addDetail(idfExpl); + + Explanation* fieldNormExpl = _CLNEW Explanation(); + uint8_t* fieldNorms = reader->norms(_this->field); + qreal fieldNorm = + fieldNorms!=NULL ? Similarity::decodeNorm(fieldNorms[doc]) : 0.0f; + fieldNormExpl->setValue(fieldNorm); + + + _sntprintf(descbuf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("fieldNorm(field=%s, doc=%d)"),_this->field,doc); + fieldNormExpl->setDescription(descbuf); + fieldExpl->addDetail(fieldNormExpl); + + fieldExpl->setValue(tfExpl->getValue() * + idfExpl->getValue() * + fieldNormExpl->getValue()); + + result->addDetail(fieldExpl); + + // combine them + result->setValue(queryExpl->getValue() * fieldExpl->getValue()); + + if (queryExpl->getValue() == 1.0f){ + result->set(*fieldExpl); + _CLDELETE(fieldExpl); + } + } + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.h new file mode 100644 index 000000000..6b3255822 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQuery.h @@ -0,0 +1,127 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_PhraseQuery_ +#define _lucene_search_PhraseQuery_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SearchHeader.h" +#include "Scorer.h" +#include "BooleanQuery.h" +#include "TermQuery.h" + +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "CLucene/index/IndexReader.h" + +#include "CLucene/util/StringBuffer.h" +#include "CLucene/util/VoidList.h" + +#include "ExactPhraseScorer.h" +#include "SloppyPhraseScorer.h" + +CL_NS_DEF(search) + // A Query that matches documents containing a particular sequence of terms. + // This may be combined with other terms with a {@link BooleanQuery}. + class PhraseQuery: public Query { + private: + CL_NS(util)::CLVector positions; + int32_t slop; + + const TCHAR* field; + CL_NS(util)::CLVector terms; + + + class PhraseWeight: public Weight { + private: + Searcher* searcher; + qreal value; + qreal idf; + qreal queryNorm; + qreal queryWeight; + PhraseQuery* _this; + public: + PhraseWeight(Searcher* searcher, PhraseQuery* _this); + ~PhraseWeight(); + TCHAR* toString(); + + Query* getQuery(); + qreal getValue(); + + qreal sumOfSquaredWeights(); + void normalize(qreal queryNorm); + Scorer* scorer(CL_NS(index)::IndexReader* reader); + void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret); + TCHAR* toString(TCHAR* f); + bool equals(PhraseWeight* o); + }; + friend class PhraseWeight; + protected: + Weight* _createWeight(Searcher* searcher); + PhraseQuery(const PhraseQuery& clone); + public: + //Constructor + PhraseQuery(); + + //Destructor + ~PhraseQuery(); + + //Returns the string "PhraseQuery" + const TCHAR* getQueryName() const; + static const TCHAR* getClassName(); + + //Sets the number of other words permitted between words in query phrase. + //If zero, then this is an exact phrase search. For larger values this works + //like a WITHIN or NEAR operator. + // + //The slop is in fact an edit-distance, where the units correspond to + //moves of terms in the query phrase out of position. For example, to switch + //the order of two words requires two moves (the first move places the words + //atop one another), so to permit re-orderings of phrases, the slop must be + //at least two. + // + //More exact matches are scored higher than sloppier matches, thus search + //results are sorted by exactness. + // + //The slop is zero by default, requiring exact matches. + void setSlop(const int32_t s) { slop = s; } + + //Returns the slop. See setSlop(). + int32_t getSlop() const { return slop; } + + //Adds a term to the end of the query phrase. + void add(CL_NS(index)::Term* term); + void add(CL_NS(index)::Term* term, int32_t position); + + + + //Returns the sum of squared weights + qreal sumOfSquaredWeights(Searcher* searcher); + + //Normalizes the Weight + void normalize(const qreal norm); + + Scorer* scorer(CL_NS(index)::IndexReader* reader); + + //added by search highlighter + CL_NS(index)::Term** getTerms() const; + _CL_DEPRECATED( deleteDocuments ) int32_t* getPositions() const; ///@deprecated. use getPositions(Array& result) + void getPositions(Array& result) const; + const TCHAR* getFieldName() const{ return field; } + + //Prints a user-readable version of this query. + TCHAR* toString(const TCHAR* f) const; + + Query* clone() const; + bool equals(CL_NS(search)::Query *) const; + + size_t hashCode() const; + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQueue.h b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQueue.h new file mode 100644 index 000000000..c0682fcaf --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseQueue.h @@ -0,0 +1,36 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_PriorityQueue_ +#define _lucene_search_PriorityQueue_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/PriorityQueue.h" +#include "PhrasePositions.h" + +CL_NS_DEF(search) + class PhraseQueue: public CL_NS(util)::PriorityQueue > { + public: + PhraseQueue(const int32_t size) { + initialize(size,false); + } + ~PhraseQueue(){ + } + + protected: + bool lessThan(PhrasePositions* pp1, PhrasePositions* pp2) { + if (pp1->doc == pp2->doc) + return pp1->position < pp2->position; + else + return pp1->doc < pp2->doc; + } + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp new file mode 100644 index 000000000..b2da2316a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.cpp @@ -0,0 +1,225 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "PhraseScorer.h" + +#include "PhraseQueue.h" +#include "PhrasePositions.h" +#include "Scorer.h" +#include "Similarity.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + + PhraseScorer::PhraseScorer(Weight* weight, TermPositions** tps, + int32_t* positions, Similarity* similarity, uint8_t* norms): + Scorer(similarity) + { + //Func - Constructor + //Pre - tps != NULL and is an array of TermPositions + // tpsLength >= 0 + // n != NULL + //Post - The instance has been created + + CND_PRECONDITION(tps != NULL,"tps is NULL"); + + //norms are only used if phraseFreq returns more than 0.0 + //phraseFreq should only return more than 0.0 if norms != NULL + //CND_PRECONDITION(n != NULL,"n is NULL"); + + firstTime = true; + more = true; + this->norms = norms; + this->weight = weight; + this->value = weight->getValue(); + + //reset internal pointers + first = NULL; + last = NULL; + + //use pq to build a sorted list of PhrasePositions + int32_t i = 0; + while(tps[i] != NULL){ + PhrasePositions *pp = _CLNEW PhrasePositions(tps[i], positions[i]); + CND_CONDITION(pp != NULL,"Could not allocate memory for pp"); + + //Store PhrasePos into the PhrasePos pq + if (last != NULL) { // add next to end of list + last->_next = pp; + } else + first = pp; + last = pp; + + i++; + } + + pq = _CLNEW PhraseQueue(i); //i==tps.length + CND_CONDITION(pq != NULL,"Could not allocate memory for pq"); + } + + PhraseScorer::~PhraseScorer() { + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + //The PhraseQueue pq (which is a PriorityQueue) pq is actually empty at present, the elements + //having been transferred by pqToList() to the linked list starting with + //first. The nodes of that linked list are deleted by the destructor of + //first, rather than the destructor of pq. + _CLDELETE(first); + _CLDELETE(pq); + } + + bool PhraseScorer::next(){ + if (firstTime) { + init(); + firstTime = false; + } else if (more) { + more = last->next(); // trigger further scanning + } + return doNext(); + } + + // next without initial increment + bool PhraseScorer::doNext() { + while (more) { + while (more && first->doc < last->doc) { // find doc w/ all the terms + more = first->skipTo(last->doc); // skip first upto last + firstToLast(); // and move it to the end + } + + if (more) { + // found a doc with all of the terms + freq = phraseFreq(); // check for phrase + if (freq == 0.0f) // no match + more = last->next(); // trigger further scanning + else + return true; // found a match + } + } + return false; // no more matches + } + + qreal PhraseScorer::score(){ + //System.out.println("scoring " + first.doc); + qreal raw = getSimilarity()->tf(freq) * value; // raw score + return raw * Similarity::decodeNorm(norms[first->doc]); // normalize + } + + bool PhraseScorer::skipTo(int32_t target) { + for (PhrasePositions* pp = first; more && pp != NULL; pp = pp->_next) { + more = pp->skipTo(target); + } + if (more) + sort(); // re-sort + return doNext(); + } + + void PhraseScorer::init() { + for (PhrasePositions* pp = first; more && pp != NULL; pp = pp->_next) + more = pp->next(); + if(more) + sort(); + } + + void PhraseScorer::sort() { + pq->clear(); + for (PhrasePositions* pp = first; pp != NULL; pp = pp->_next) + pq->put(pp); + pqToList(); + } + + + + void PhraseScorer::pqToList(){ + //Func - Transfers the PhrasePositions from the PhraseQueue pq to + // the PhrasePositions list with first as its first element + //Pre - pq != NULL + // first = NULL + // last = NULL + //Post - All PhrasePositions have been transfered to the list + // of PhrasePositions of which the first element is pointed to by first + // and the last element is pointed to by last + + CND_PRECONDITION(pq != NULL,"pq is NULL"); + + last = first = NULL; + + PhrasePositions* PhrasePos = NULL; + + //As long pq is not empty + while (pq->top() != NULL){ + //Pop a PhrasePositions instance + PhrasePos = pq->pop(); + + // add next to end of list + if (last != NULL) { + last->_next = PhrasePos; + } else { + first = PhrasePos; + } + + //Let last point to the new last PhrasePositions instance just added + last = PhrasePos; + //Reset the next of last to NULL + last->_next = NULL; + } + + //Check to see that pq is empty now + CND_CONDITION(pq->size()==0, "pq is not empty while it should be"); + } + + void PhraseScorer::firstToLast(){ + //Func - Moves first to the end of the list + //Pre - first is NULL or points to an PhrasePositions Instance + // last is NULL or points to an PhrasePositions Instance + // first and last both are NULL or both are not NULL + //Post - The first element has become the last element in the list + + CND_PRECONDITION(((first==NULL && last==NULL) ||(first !=NULL && last != NULL)), + "Either first or last is NULL but not both"); + + //Check if first and last are valid pointers + if(first && last){ + last->_next = first; + last = first; + first = first->_next; + last->_next = NULL; + } + } + + + void PhraseScorer::explain(int32_t _doc, Explanation* tfExplanation) { + while (next() && doc() < _doc){ + } + + qreal phraseFreq = (doc() == _doc) ? freq : 0.0f; + tfExplanation->setValue(getSimilarity()->tf(phraseFreq)); + + StringBuffer buf; + buf.append(_T("tf(phraseFreq=")); + buf.appendFloat(phraseFreq,2); + buf.append(_T(")")); + tfExplanation->setDescription(buf.getBuffer()); + } + + TCHAR* PhraseScorer::toString() { + StringBuffer buf; + buf.append(_T("scorer(")); + + TCHAR* tmp = weight->toString(); + buf.append(tmp); + _CLDELETE_CARRAY(tmp); + + buf.append(_T(")")); + + return buf.toString(); + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.h new file mode 100644 index 000000000..89f7a1fbb --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PhraseScorer.h @@ -0,0 +1,65 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_PhraseScorer_ +#define _lucene_search_PhraseScorer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "PhraseQueue.h" +#include "PhrasePositions.h" +#include "Scorer.h" +#include "Similarity.h" + +CL_NS_DEF(search) + + class PhraseScorer: public Scorer { + private: + Weight* weight; + qreal freq; + bool firstTime; + bool more; + + protected: + uint8_t* norms; + qreal value; + + PhraseQueue* pq; //is used to order the list point to by first and last + PhrasePositions* first; //Points to the first in the list of PhrasePositions + PhrasePositions* last; //Points to the last in the list of PhrasePositions + + public: + //Constructor + PhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, + int32_t* positions, Similarity* similarity, uint8_t* norms); + virtual ~PhraseScorer(); + + int32_t doc() const { return first->doc; } + bool next(); + qreal score(); + bool skipTo(int32_t target); + + + void explain(int32_t doc, Explanation* ret); + TCHAR* toString(); + protected: + virtual qreal phraseFreq() =0; + + //Transfers the PhrasePositions from the PhraseQueue pq to + //the PhrasePositions list with first as its first element + void pqToList(); + + //Moves first to the end of the list + void firstToLast(); + private: + bool doNext(); + void init(); + void sort(); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp new file mode 100644 index 000000000..6bb27d1ca --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.cpp @@ -0,0 +1,273 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "PrefixQuery.h" +#include "CLucene/util/BitSet.h" + +CL_NS_USE(util) +CL_NS_USE(index) +CL_NS_DEF(search) + + PrefixQuery::PrefixQuery(Term* Prefix){ + //Func - Constructor. + // Constructs a query for terms starting with prefix + //Pre - Prefix != NULL + //Post - The instance has been created + + //Get a pointer to Prefix + prefix = _CL_POINTER(Prefix); + } + + PrefixQuery::PrefixQuery(const PrefixQuery& clone):Query(clone){ + prefix = _CL_POINTER(clone.prefix); + } + Query* PrefixQuery::clone() const{ + return _CLNEW PrefixQuery(*this); + } + + Term* PrefixQuery::getPrefix(bool pointer){ + if ( pointer ) + return _CL_POINTER(prefix); + else + return prefix; + } + + PrefixQuery::~PrefixQuery(){ + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed. + + //Delete prefix by finalizing it + _CLDECDELETE(prefix); + } + + + /** Returns a hash code value for this object.*/ + size_t PrefixQuery::hashCode() const { + return Similarity::floatToByte(getBoost()) ^ prefix->hashCode(); + } + + const TCHAR* PrefixQuery::getQueryName()const{ + //Func - Returns the name "PrefixQuery" + //Pre - true + //Post - The string "PrefixQuery" has been returned + + return getClassName(); + } + const TCHAR* PrefixQuery::getClassName(){ + //Func - Returns the name "PrefixQuery" + //Pre - true + //Post - The string "PrefixQuery" has been returned + + return _T("PrefixQuery"); + } + + bool PrefixQuery::equals(Query * other) const{ + if (!(other->instanceOf(PrefixQuery::getClassName()))) + return false; + + PrefixQuery* rq = (PrefixQuery*)other; + bool ret = (this->getBoost() == rq->getBoost()) + && (this->prefix->equals(rq->prefix)); + + return ret; + } + + Query* PrefixQuery::rewrite(IndexReader* reader){ + BooleanQuery* query = _CLNEW BooleanQuery(); + TermEnum* enumerator = reader->terms(prefix); + Term* lastTerm = NULL; + try { + const TCHAR* prefixText = prefix->text(); + const TCHAR* prefixField = prefix->field(); + const TCHAR* tmp; + size_t i; + int32_t prefixLen = prefix->textLength(); + do { + lastTerm = enumerator->term(); + if (lastTerm != NULL && lastTerm->field() == prefixField ){ + + //now see if term->text() starts with prefixText + int32_t termLen = lastTerm->textLength(); + if ( prefixLen>termLen ) + break; //the prefix is longer than the term, can't be matched + + tmp = lastTerm->text(); + + //check for prefix match in reverse, since most change will be at the end + for ( i=prefixLen-1;i!=-1;--i ){ + if ( tmp[i] != prefixText[i] ){ + tmp=NULL;//signals inequality + break; + } + } + if ( tmp == NULL ) + break; + + TermQuery* tq = _CLNEW TermQuery(lastTerm); // found a match + tq->setBoost(getBoost()); // set the boost + query->add(tq,true,false, false); // add to query + } else + break; + _CLDECDELETE(lastTerm); + } while (enumerator->next()); + }_CLFINALLY( + enumerator->close(); + _CLDELETE(enumerator); + _CLDECDELETE(lastTerm); + ); + _CLDECDELETE(lastTerm); + + + //if we only added one clause and the clause is not prohibited then + //we can just return the query + if (query->getClauseCount() == 1) { // optimize 1-clause queries + BooleanClause* c=0; + query->getClauses(&c); + + if (!c->prohibited) { // just return clause + c->deleteQuery=false; + Query* ret = c->query; + + _CLDELETE(query); + return ret; + } + } + + return query; + } + + Query* PrefixQuery::combine(Query** queries) { + return Query::mergeBooleanQueries(queries); + } + + TCHAR* PrefixQuery::toString(const TCHAR* field) const{ + //Func - Creates a user-readable version of this query and returns it as as string + //Pre - field != NULL + //Post - a user-readable version of this query has been returned as as string + + //Instantiate a stringbuffer buffer to store the readable version temporarily + CL_NS(util)::StringBuffer buffer; + //check if field equal to the field of prefix + if( field==NULL || _tcscmp(prefix->field(),field) != 0 ) { + //Append the field of prefix to the buffer + buffer.append(prefix->field()); + //Append a colon + buffer.append(_T(":") ); + } + //Append the text of the prefix + buffer.append(prefix->text()); + //Append a wildchar character + buffer.append(_T("*")); + //if the boost factor is not eaqual to 1 + if (getBoost() != 1.0f) { + //Append ^ + buffer.append(_T("^")); + //Append the boost factor + buffer.appendFloat( getBoost(),1); + } + //Convert StringBuffer buffer to TCHAR block and return it + return buffer.toString(); + } + + + + + + + + +PrefixFilter::PrefixFilter( Term* prefix ) +{ + this->prefix = _CL_POINTER(prefix); +} + +PrefixFilter::~PrefixFilter() +{ + _CLDECDELETE(prefix); +} + +PrefixFilter::PrefixFilter( const PrefixFilter& copy ) : + prefix( _CL_POINTER(copy.prefix) ) +{ +} + +Filter* PrefixFilter::clone() const { + return _CLNEW PrefixFilter(*this ); +} + +TCHAR* PrefixFilter::toString() +{ + //Instantiate a stringbuffer buffer to store the readable version temporarily + CL_NS(util)::StringBuffer buffer; + //check if field equal to the field of prefix + if( prefix->field() != NULL ) { + //Append the field of prefix to the buffer + buffer.append(prefix->field()); + //Append a colon + buffer.append(_T(":") ); + } + //Append the text of the prefix + buffer.append(prefix->text()); + buffer.append(_T("*")); + + //Convert StringBuffer buffer to TCHAR block and return it + return buffer.toString(); +} + +/** Returns a BitSet with true for documents which should be permitted in +search results, and false for those that should not. */ +BitSet* PrefixFilter::bits( IndexReader* reader ) +{ + BitSet* bts = _CLNEW BitSet( reader->maxDoc() ); + TermEnum* enumerator = reader->terms(prefix); + TermDocs* docs = reader->termDocs(); + const TCHAR* prefixText = prefix->text(); + const TCHAR* prefixField = prefix->field(); + const TCHAR* tmp; + size_t i; + int32_t prefixLen = prefix->textLength(); + Term* lastTerm = NULL; + + try{ + do{ + lastTerm = enumerator->term(false); + if (lastTerm != NULL && lastTerm->field() == prefixField ){ + //now see if term->text() starts with prefixText + int32_t termLen = lastTerm->textLength(); + if ( prefixLen>termLen ) + break; //the prefix is longer than the term, can't be matched + + tmp = lastTerm->text(); + + //check for prefix match in reverse, since most change will be at the end + for ( i=prefixLen-1;i!=-1;--i ){ + if ( tmp[i] != prefixText[i] ){ + tmp=NULL;//signals inequality + break; + } + } + if ( tmp == NULL ) + break; + + docs->seek(enumerator); + while (docs->next()) { + bts->set(docs->doc()); + } + } + }while(enumerator->next()); + } _CLFINALLY( + docs->close(); + _CLDELETE(docs); + enumerator->close(); + _CLDELETE(enumerator); + ) + + return bts; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.h new file mode 100644 index 000000000..8e3f41352 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/PrefixQuery.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_PrefixQuery +#define _lucene_search_PrefixQuery +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "CLucene/index/IndexReader.h" +#include "SearchHeader.h" +#include "BooleanQuery.h" +#include "TermQuery.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_DEF(search) + //PrefixQuery is a Query that matches documents containing terms with a specified prefix. + + class PrefixQuery: public Query { + private: + CL_NS(index)::Term* prefix; + protected: + PrefixQuery(const PrefixQuery& clone); + public: + + //Constructor. Constructs a query for terms starting with prefix + PrefixQuery(CL_NS(index)::Term* Prefix); + + //Destructor + ~PrefixQuery(); + + //Returns the name "PrefixQuery" + const TCHAR* getQueryName() const; + static const TCHAR* getClassName(); + + /** Returns the prefix of this query. */ + CL_NS(index)::Term* getPrefix(bool pointer=true); + + Query* combine(Query** queries); + Query* rewrite(CL_NS(index)::IndexReader* reader); + Query* clone() const; + bool equals(Query * other) const; + + //Creates a user-readable version of this query and returns it as as string + TCHAR* toString(const TCHAR* field) const; + + size_t hashCode() const; + }; + + + class PrefixFilter: public Filter + { + private: + CL_NS(index)::Term* prefix; + protected: + PrefixFilter( const PrefixFilter& copy ); + + public: + PrefixFilter(CL_NS(index)::Term* prefix); + ~PrefixFilter(); + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); + + Filter* clone() const; + TCHAR* toString(); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp new file mode 100644 index 000000000..2dbe2d7cd --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.cpp @@ -0,0 +1,73 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "QueryFilter.h" +#include "IndexSearcher.h" + +CL_NS_DEF(search) +CL_NS_USE(util) +CL_NS_USE(index) + + +QueryFilter::QueryFilter( const Query* query ) +{ + this->query = query->clone(); +} + + +QueryFilter::~QueryFilter() +{ + _CLDELETE( query ); +} + + +QueryFilter::QueryFilter( const QueryFilter& copy ) +{ + this->query = copy.query->clone(); +} + + +Filter* QueryFilter::clone() const { + return _CLNEW QueryFilter(*this ); +} + + +TCHAR* QueryFilter::toString() +{ + TCHAR* qt = query->toString(); + size_t len = _tcslen(qt) + 14; + TCHAR* ret = _CL_NEWARRAY( TCHAR, len ); + ret[0] = 0; + _sntprintf( ret, len, _T("QueryFilter(%s)"), qt ); + _CLDELETE_CARRAY(qt); + return ret; +} + + +/** Returns a BitSet with true for documents which should be permitted in +search results, and false for those that should not. */ +BitSet* QueryFilter::bits( IndexReader* reader ) +{ + BitSet* bits = _CLNEW BitSet(reader->maxDoc()); + + IndexSearcher s(reader); + QFHitCollector hc(bits); + s._search(query, NULL, &hc); + return bits; +} + + +QueryFilter::QFHitCollector::QFHitCollector(CL_NS(util)::BitSet* bits){ + this->bits = bits; +} + +void QueryFilter::QFHitCollector::collect(const int32_t doc, const qreal score) { + bits->set(doc); // set bit for hit +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.h b/src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.h new file mode 100644 index 000000000..8d423b2f7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/QueryFilter.h @@ -0,0 +1,44 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_QueryFilter_ +#define _lucene_search_QueryFilter_ + +#include "CLucene/util/BitSet.h" +#include "CLucene/index/IndexReader.h" +#include "SearchHeader.h" +#include "CachingWrapperFilter.h" + +CL_NS_DEF(search) + +class QueryFilter: public Filter +{ +private: + Query* query; + + class QFHitCollector: public HitCollector{ + CL_NS(util)::BitSet* bits; + public: + QFHitCollector(CL_NS(util)::BitSet* bits); + void collect(const int32_t doc, const qreal score); + }; + +protected: + QueryFilter( const QueryFilter& copy ); +public: + QueryFilter( const Query* query ); + + ~QueryFilter(); + + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); + + Filter *clone() const; + + TCHAR *toString(); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp new file mode 100644 index 000000000..66ee5ce55 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp @@ -0,0 +1,150 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "RangeFilter.h" + +CL_NS_DEF(search) +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_USE(document) + + +RangeFilter::RangeFilter( const TCHAR* fieldName, const TCHAR* lowerTerm, const TCHAR* upperTerm, bool includeLower, bool includeUpper ) +{ + this->field = STRDUP_TtoT(fieldName); + if ( lowerTerm != NULL ) + this->lowerValue = STRDUP_TtoT(lowerTerm); + else + this->lowerValue = NULL; + if ( upperTerm != NULL ) + this->upperValue = STRDUP_TtoT(upperTerm); + else + this->upperValue = NULL; + this->includeLower = includeLower; + this->includeUpper = includeUpper; +} + + +/** + * Constructs a filter for field fieldName matching + * less than or equal to upperTerm. + */ +RangeFilter* RangeFilter::Less( TCHAR* fieldName, TCHAR* upperTerm ) { + return new RangeFilter( fieldName, NULL, upperTerm, false, true ); +} + + +/** +* Constructs a filter for field fieldName matching +* more than or equal to lowerTerm. +*/ +RangeFilter* RangeFilter::More( TCHAR* fieldName, TCHAR* lowerTerm ) { + return new RangeFilter( fieldName, lowerTerm, NULL, true, false ); +} + + +RangeFilter::~RangeFilter() +{ + _CLDELETE_CARRAY( lowerValue ); + _CLDELETE_CARRAY( field ); + _CLDELETE_CARRAY( upperValue ); +} + + +RangeFilter::RangeFilter( const RangeFilter& copy ) : + field( STRDUP_TtoT(copy.field) ), + lowerValue( STRDUP_TtoT(copy.lowerValue) ), + upperValue( STRDUP_TtoT(copy.upperValue) ), + includeLower( copy.includeLower ), + includeUpper( copy.includeUpper ) +{ +} + + +Filter* RangeFilter::clone() const { + return _CLNEW RangeFilter(*this ); +} + + +TCHAR* RangeFilter::toString() +{ + size_t len = (field ? _tcslen(field) : 0) + (lowerValue ? _tcslen(lowerValue) : 0) + (upperValue ? _tcslen(upperValue) : 0) + 8; + TCHAR* ret = _CL_NEWARRAY( TCHAR, len ); + ret[0] = 0; + _sntprintf( ret, len, _T("%s: [%s-%s]"), field, (lowerValue?lowerValue:_T("")), (upperValue?upperValue:_T("")) ); + + return ret; +} + + +/** Returns a BitSet with true for documents which should be permitted in +search results, and false for those that should not. */ +BitSet* RangeFilter::bits( IndexReader* reader ) +{ + BitSet* bts = _CLNEW BitSet( reader->maxDoc() ); + Term* term = NULL; + + Term* t = _CLNEW Term( field, (lowerValue ? lowerValue : _T("")), false ); + TermEnum* enumerator = reader->terms( t ); // get enumeration of all terms after lowerValue + _CLDECDELETE( t ); + + if( enumerator->term(false) == NULL ) { + _CLDELETE( enumerator ); + return bts; + } + + bool checkLower = false; + if( !includeLower ) // make adjustments to set to exclusive + checkLower = true; + + TermDocs* termDocs = reader->termDocs(); + + try + { + do + { + term = enumerator->term(); + + if( term == NULL || _tcscmp(term->field(), field) ) + break; + + if( !checkLower || lowerValue == NULL || _tcscmp(term->text(), lowerValue) > 0 ) + { + checkLower = false; + if( upperValue != NULL ) + { + int compare = _tcscmp( upperValue, term->text() ); + + /* if beyond the upper term, or is exclusive and + * this is equal to the upper term, break out */ + if( (compare < 0) || (!includeUpper && compare == 0) ) + break; + } + + termDocs->seek( enumerator->term(false) ); + while( termDocs->next() ) { + bts->set( termDocs->doc() ); + } + } + + _CLDECDELETE( term ); + } + while( enumerator->next() ); + } + _CLFINALLY + ( + _CLDECDELETE( term ); + termDocs->close(); + _CLVDELETE( termDocs ); + enumerator->close(); + _CLDELETE( enumerator ); + ); + + return bts; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.h b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.h new file mode 100644 index 000000000..0865e356f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeFilter.h @@ -0,0 +1,51 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +#ifndef _lucene_search_RangeFilter_ +#define _lucene_search_RangeFilter_ + +#include "CLucene/document/DateField.h" +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/BitSet.h" +#include "CLucene/search/Filter.h" + +CL_NS_DEF(search) + +class RangeFilter: public Filter +{ +private: + const TCHAR* field; + TCHAR* lowerValue; + TCHAR* upperValue; + bool includeLower; + bool includeUpper; + +protected: + RangeFilter( const RangeFilter& copy ); + +public: + RangeFilter( const TCHAR* fieldName, const TCHAR* lowerValue, const TCHAR* upperValue, bool includeLower, bool includeUpper ); + + static RangeFilter* Less( TCHAR* fieldName, TCHAR* upperTerm ); + + static RangeFilter* More( TCHAR* fieldName, TCHAR* lowerTerm ); + + ~RangeFilter(); + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); + + Filter* clone() const; + + TCHAR* toString(); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp new file mode 100644 index 000000000..4fc242089 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.cpp @@ -0,0 +1,204 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "RangeQuery.h" + +#include "SearchHeader.h" +#include "Scorer.h" +#include "BooleanQuery.h" +#include "TermQuery.h" + +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/StringBuffer.h" + + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + RangeQuery::RangeQuery(Term* lowerTerm, Term* upperTerm, const bool Inclusive){ + //Func - Constructor + //Pre - (LowerTerm != NULL OR UpperTerm != NULL) AND + // if LowerTerm and UpperTerm are valid pointer then the fieldnames must be the same + //Post - The instance has been created + + if (lowerTerm == NULL && upperTerm == NULL) + { + _CLTHROWA(CL_ERR_IllegalArgument,"At least one term must be non-null"); + } + if (lowerTerm != NULL && upperTerm != NULL && lowerTerm->field() != upperTerm->field()) + { + _CLTHROWA(CL_ERR_IllegalArgument,"Both terms must be for the same field"); + } + + // if we have a lowerTerm, start there. otherwise, start at beginning + if (lowerTerm != NULL) { + this->lowerTerm = _CL_POINTER(lowerTerm); + } + else { + this->lowerTerm = _CLNEW Term(upperTerm, LUCENE_BLANK_STRING); + } + this->upperTerm = (upperTerm != NULL ? _CL_POINTER(upperTerm) : NULL); + this->inclusive = Inclusive; + } + RangeQuery::RangeQuery(const RangeQuery& clone): + Query(clone){ + this->inclusive = clone.inclusive; + this->upperTerm = (clone.upperTerm != NULL ? _CL_POINTER(clone.upperTerm) : NULL ); + this->lowerTerm = (clone.lowerTerm != NULL ? _CL_POINTER(clone.lowerTerm) : NULL ); + } + Query* RangeQuery::clone() const{ + return _CLNEW RangeQuery(*this); + } + + RangeQuery::~RangeQuery() { + //Func - Destructor + //Pre - true + //Post - The instance has been destroyed + + _CLDECDELETE(lowerTerm); + _CLDECDELETE(upperTerm); + } + + /** Returns a hash code value for this object.*/ + size_t RangeQuery::hashCode() const { + return Similarity::floatToByte(getBoost()) ^ + (lowerTerm != NULL ? lowerTerm->hashCode() : 0) ^ + (upperTerm != NULL ? upperTerm->hashCode() : 0) ^ + (this->inclusive ? 1 : 0); + } + + const TCHAR* RangeQuery::getQueryName() const{ + return getClassName(); + } + const TCHAR* RangeQuery::getClassName(){ + return _T("RangeQuery"); + } + + Query* RangeQuery::combine(Query** queries) { + return Query::mergeBooleanQueries(queries); + } + + bool RangeQuery::equals(Query * other) const{ + if (!(other->instanceOf(RangeQuery::getClassName()))) + return false; + + RangeQuery* rq = (RangeQuery*)other; + bool ret = (this->getBoost() == rq->getBoost()) + && (this->isInclusive() == rq->isInclusive()) + && (this->getLowerTerm()->equals(rq->getLowerTerm())) + && (this->getUpperTerm()->equals(rq->getUpperTerm())); + + return ret; + } + + + /** + * FIXME: Describe rewrite method here. + * + * @param reader an IndexReader value + * @return a Query value + * @exception IOException if an error occurs + */ + Query* RangeQuery::rewrite(IndexReader* reader){ + + BooleanQuery* query = _CLNEW BooleanQuery; + TermEnum* enumerator = reader->terms(lowerTerm); + Term* lastTerm = NULL; + try { + bool checkLower = false; + if (!inclusive) // make adjustments to set to exclusive + checkLower = true; + + const TCHAR* testField = getField(); + do { + lastTerm = enumerator->term(); + if (lastTerm != NULL && lastTerm->field() == testField ) { + if (!checkLower || _tcscmp(lastTerm->text(),lowerTerm->text()) > 0) { + checkLower = false; + if (upperTerm != NULL) { + int compare = _tcscmp(upperTerm->text(),lastTerm->text()); + /* if beyond the upper term, or is exclusive and + * this is equal to the upper term, break out */ + if ((compare < 0) || (!inclusive && compare == 0)) + break; + } + TermQuery* tq = _CLNEW TermQuery(lastTerm); // found a match + tq->setBoost(getBoost()); // set the boost + query->add(tq, true, false, false); // add to query + } + }else { + break; + } + _CLDECDELETE(lastTerm); + } + while (enumerator->next()); + }catch(...){ + _CLDECDELETE(lastTerm); //always need to delete this + _CLDELETE(query); //in case of error, delete the query + enumerator->close(); + _CLDELETE(enumerator); + throw; //rethrow + } + _CLDECDELETE(lastTerm); //always need to delete this + enumerator->close(); + _CLDELETE(enumerator); + + return query; + } + + /** Prints a user-readable version of this query. */ + TCHAR* RangeQuery::toString(const TCHAR* field) const + { + StringBuffer buffer; + if ( field==NULL || _tcscmp(getField(),field)!=0 ) + { + buffer.append( getField() ); + buffer.append( _T(":")); + } + buffer.append(inclusive ? _T("[") : _T("{")); + buffer.append(lowerTerm != NULL ? lowerTerm->text() : _T("NULL")); + buffer.append(_T(" TO ")); + buffer.append(upperTerm != NULL ? upperTerm->text() : _T("NULL")); + buffer.append(inclusive ? _T("]") : _T("}")); + if (getBoost() != 1.0f) + { + buffer.append( _T("^")); + buffer.appendFloat( getBoost(),1 ); + } + return buffer.toString(); + } + + + const TCHAR* RangeQuery::getField() const + { + return (lowerTerm != NULL ? lowerTerm->field() : upperTerm->field()); + } + + /** Returns the lower term of this range query */ + Term* RangeQuery::getLowerTerm(bool pointer) const { + if ( pointer ) + return _CL_POINTER(lowerTerm); + else + return lowerTerm; + } + + /** Returns the upper term of this range query */ + Term* RangeQuery::getUpperTerm(bool pointer) const { + if ( pointer ) + return _CL_POINTER(upperTerm); + else + return upperTerm; + } + + /** Returns true if the range query is inclusive */ + bool RangeQuery::isInclusive() const { return inclusive; } + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.h new file mode 100644 index 000000000..9a7733c33 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/RangeQuery.h @@ -0,0 +1,71 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_RangeQuery_ +#define _lucene_search_RangeQuery_ +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SearchHeader.h" +#include "Scorer.h" +#include "TermQuery.h" + +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" + +#include "CLucene/util/StringBuffer.h" + + +CL_NS_DEF(search) + /** Constructs a query selecting all terms greater than + * lowerTerm but less than upperTerm. + * There must be at least one term and either term may be null, + * in which case there is no bound on that side, but if there are + * two terms, both terms must be for the same field. + */ + class RangeQuery: public Query + { + private: + CL_NS(index)::Term* lowerTerm; + CL_NS(index)::Term* upperTerm; + bool inclusive; + protected: + RangeQuery(const RangeQuery& clone); + + public: + // Constructs a query selecting all terms greater than + // lowerTerm but less than upperTerm. + // There must be at least one term and either term may be NULL-- + // in which case there is no bound on that side, but if there are + // two term, both terms must be for the same field. + RangeQuery(CL_NS(index)::Term* LowerTerm, CL_NS(index)::Term* UpperTerm, const bool Inclusive); + ~RangeQuery(); + + const TCHAR* getQueryName() const; + static const TCHAR* getClassName(); + + Query* rewrite(CL_NS(index)::IndexReader* reader); + + Query* combine(Query** queries); + + // Prints a user-readable version of this query. + TCHAR* toString(const TCHAR* field) const; + + Query* clone() const; + + bool equals(Query * other) const; + + CL_NS(index)::Term* getLowerTerm(bool pointer=true) const; + CL_NS(index)::Term* getUpperTerm(bool pointer=true) const; + bool isInclusive() const; + const TCHAR* getField() const; + + size_t hashCode() const; + }; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Scorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/Scorer.h new file mode 100644 index 000000000..0d1d4355a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Scorer.h @@ -0,0 +1,80 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_Scorer_ +#define _lucene_search_Scorer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Similarity.h" +#include "SearchHeader.h" +#include "Explanation.h" + +CL_NS_DEF(search) + /** Expert: Implements scoring for a class of queries. */ +class Scorer: LUCENE_BASE { + private: + Similarity* similarity; + protected: + /** Constructs a Scorer. */ + Scorer(Similarity* similarity) { + this->similarity = similarity; + } + public: + virtual ~Scorer(){ + } + + /** Returns the Similarity implementation used by this scorer. */ + Similarity* getSimilarity() const{ + return this->similarity; + } + + /** Scores all documents and passes them to a collector. */ + void score(HitCollector* hc) { + while (next()) { + hc->collect(doc(), score()); + } + } + + /** Advance to the next document matching the query. Returns true iff there + * is another match. */ + virtual bool next() = 0; + + /** Returns the current document number. Initially invalid, until {@link + * #next()} is called the first time. */ + virtual int32_t doc() const = 0; + + /** Returns the score of the current document. Initially invalid, until + * {@link #next()} is called the first time. */ + virtual qreal score() = 0; + + /** Skips to the first match beyond the current whose document number is + * greater than or equal to target.

Returns true iff there is such + * a match.

Behaves as if written:

+         *   boolean skipTo(int32_t target) {
+         *     do {
+         *       if (!next())
+         * 	     return false;
+         *     } while (target > doc());
+         *     return true;
+         *   }
+         * 
+ * Most implementations are considerably more efficient than that. + */ + virtual bool skipTo(int32_t target) = 0; + + /** Returns an explanation of the score for doc. */ + virtual void explain(int32_t doc, Explanation* ret) = 0; + + + /** Returns an string which explains the object */ + virtual TCHAR* toString() = 0; + + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp new file mode 100644 index 000000000..56e4ad585 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.cpp @@ -0,0 +1,141 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SearchHeader.h" +#include "BooleanQuery.h" +#include "FieldDocSortedHitQueue.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + +CL_NS(document)::Document* Searchable::doc(const int32_t i){ + CL_NS(document)::Document* ret = _CLNEW CL_NS(document)::Document; + if (!doc(i,ret) ) + _CLDELETE(ret); + return ret; +} + +//static +Query* Query::mergeBooleanQueries(Query** queries) { + CL_NS(util)::CLVector allClauses; + int32_t i = 0; + while ( queries[i] != NULL ){ + BooleanQuery* bq = (BooleanQuery*)queries[i]; + + int32_t size = bq->getClauseCount(); + BooleanClause** clauses = _CL_NEWARRAY(BooleanClause*, size); + bq->getClauses(clauses); + + for (int32_t j = 0;j::iterator itr = allClauses.begin(); + while (itr != allClauses.end() ) { + result->add(*itr); + } + return result; +} + +Query::Query(const Query& clone):boost(clone.boost){ + //constructor +} +Weight* Query::_createWeight(Searcher* searcher){ + _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: Query::_createWeight"); +} + +Query::Query(): + boost(1.0f) +{ + //constructor +} +Query::~Query(){ +} + +/** Expert: called to re-write queries into primitive queries. */ +Query* Query::rewrite(CL_NS(index)::IndexReader* reader){ + return this; +} + +Query* Query::combine(Query** queries){ + _CLTHROWA(CL_ERR_UnsupportedOperation,"UnsupportedOperationException: Query::combine"); +} +Similarity* Query::getSimilarity(Searcher* searcher) { + return searcher->getSimilarity(); +} +bool Query::instanceOf(const TCHAR* other) const{ + const TCHAR* t = getQueryName(); + if ( t==other || _tcscmp( t, other )==0 ) + return true; + else + return false; +} +TCHAR* Query::toString() const{ + return toString(LUCENE_BLANK_STRING); +} + +void Query::setBoost(qreal b) { boost = b; } + +qreal Query::getBoost() const { return boost; } + +Weight* Query::weight(Searcher* searcher){ + Query* query = searcher->rewrite(this); + Weight* weight = query->_createWeight(searcher); + qreal sum = weight->sumOfSquaredWeights(); + qreal norm = getSimilarity(searcher)->queryNorm(sum); + weight->normalize(norm); + return weight; +} + +TopFieldDocs::TopFieldDocs (int32_t totalHits, FieldDoc** fieldDocs, int32_t scoreDocsLen, SortField** fields): + TopDocs (totalHits, NULL, scoreDocsLen) +{ + this->fields = fields; + this->fieldDocs = fieldDocs; + this->scoreDocs = _CL_NEWARRAY(ScoreDoc,scoreDocsLen); + for (int32_t i=0;iscoreDocs[i] = this->fieldDocs[i]->scoreDoc; +} +TopFieldDocs::~TopFieldDocs(){ + if ( fieldDocs ){ + for (int32_t i=0;i= 0 +//Post - The instance has been created + +} + +TopDocs::~TopDocs(){ +//Func - Destructor +//Pre - true +//Post - The instance has been destroyed + + _CLDELETE_ARRAY(scoreDocs); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.h b/src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.h new file mode 100644 index 000000000..4a896a5c5 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/SearchHeader.h @@ -0,0 +1,456 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_SearchHeader_ +#define _lucene_search_SearchHeader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "Filter.h" +#include "CLucene/document/Document.h" +#include "Sort.h" +#include "CLucene/util/VoidList.h" +#include "Explanation.h" +#include "Similarity.h" + +CL_NS_DEF(search) + + //predefine classes + class Scorer; + class Query; + class Hits; + class Sort; + class FieldDoc; + class TopFieldDocs; + + /** Expert: Returned by low-level search implementations. + * @see TopDocs */ + struct ScoreDoc { + /** Expert: A hit document's number. + * @see Searcher#doc(int32_t) + */ + int32_t doc; + + /** Expert: The score of this document for the query. */ + qreal score; + }; + + /** Expert: Returned by low-level search implementations. + * @see Searcher#search(Query,Filter,int32_t) */ + class TopDocs:LUCENE_BASE { + public: + /** Expert: The total number of hits for the query. + * @see Hits#length() + */ + int32_t totalHits; + + /** Expert: The top hits for the query. */ + ScoreDoc* scoreDocs; + int32_t scoreDocsLength; + + /** Expert: Constructs a TopDocs. TopDocs takes ownership of the ScoreDoc array*/ + TopDocs(const int32_t th, ScoreDoc* sds, int32_t scoreDocsLength); + ~TopDocs(); + }; + + // Lower-level search API. + // @see Searcher#search(Query,HitCollector) + class HitCollector: LUCENE_BASE { + public: + /** Called once for every non-zero scoring document, with the document number + * and its score. + * + *

If, for example, an application wished to collect all of the hits for a + * query in a BitSet, then it might:

+      *   Searcher searcher = new IndexSearcher(indexReader);
+      *   final BitSet bits = new BitSet(indexReader.maxDoc());
+      *   searcher.search(query, new HitCollector() {
+      *       public void collect(int32_t doc, float score) {
+      *         bits.set(doc);
+      *       }
+      *     });
+      * 
+ * + *

Note: This is called in an inner search loop. For good search + * performance, implementations of this method should not call + * {@link Searcher#doc(int32_t)} or + * {@link IndexReader#document(int32_t)} on every + * document number encountered. Doing so can slow searches by an order + * of magnitude or more. + *

Note: The score passed to this method is a raw score. + * In other words, the score will not necessarily be a float whose value is + * between 0 and 1. + */ + virtual void collect(const int32_t doc, const qreal score) = 0; + virtual ~HitCollector(){} + }; + + /** Expert: Calculate query weights and build query scorers. + * + *

A Weight is constructed by a query, given a Searcher ({@link + * Query#_createWeight(Searcher)}). The {@link #sumOfSquaredWeights()} method + * is then called on the top-level query to compute the query normalization + * factor (@link Similarity#queryNorm(qreal)}). This factor is then passed to + * {@link #normalize(qreal)}. At this point the weighting is complete and a + * scorer may be constructed by calling {@link #scorer(IndexReader)}. + */ + class Weight: LUCENE_BASE { + public: + virtual ~Weight(){ + }; + + /** The query that this concerns. */ + virtual Query* getQuery() = 0; + + /** The weight for this query. */ + virtual qreal getValue() = 0; + + /** The sum of squared weights of contained query clauses. */ + virtual qreal sumOfSquaredWeights() = 0; + + /** Assigns the query normalization factor to this. */ + virtual void normalize(qreal norm) = 0; + + /** Constructs a scorer for this. */ + virtual Scorer* scorer(CL_NS(index)::IndexReader* reader) = 0; + + /** An explanation of the score computation for the named document. */ + virtual void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret) = 0; + + virtual TCHAR* toString(){ + return STRDUP_TtoT(_T("Weight")); + } + }; + + class HitDoc:LUCENE_BASE { + public: + qreal score; + int32_t id; + CL_NS(document)::Document* doc; + + HitDoc* next; // in doubly-linked cache + HitDoc* prev; // in doubly-linked cache + + HitDoc(const qreal s, const int32_t i); + ~HitDoc(); + }; + + + + // A ranked list of documents, used to hold search results. + class Hits:LUCENE_BASE { + private: + Query* query; + Searcher* searcher; + Filter* filter; + const Sort* sort; + + size_t _length; // the total number of hits + CL_NS(util)::CLVector > hitDocs; // cache of hits retrieved + + HitDoc* first; // head of LRU cache + HitDoc* last; // tail of LRU cache + int32_t numDocs; // number cached + int32_t maxDocs; // max to cache + + public: + Hits(Searcher* s, Query* q, Filter* f, const Sort* sort=NULL); + ~Hits(); + + /** Returns the total number of hits available in this set. */ + int32_t length() const; + + /** Returns the stored fields of the nth document in this set. +

Documents are cached, so that repeated requests for the same element may + return the same Document object. + * + * @memory Memory belongs to the hits object. Don't delete the return value. + */ + CL_NS(document)::Document& doc(const int32_t n); + + /** Returns the id for the nth document in this set. */ + int32_t id (const int32_t n); + + /** Returns the score for the nth document in this set. */ + qreal score(const int32_t n); + + private: + // Tries to add new documents to hitDocs. + // Ensures that the hit numbered _min has been retrieved. + void getMoreDocs(const size_t _min); + + HitDoc* getHitDoc(const size_t n); + + void addToFront(HitDoc* hitDoc); + + void remove(const HitDoc* hitDoc); + + }; + + /** The interface for search implementations. + * + *

Implementations provide search over a single index, over multiple + * indices, and over indices on remote servers. + */ + class Searchable: LUCENE_BASE { + public: + virtual ~Searchable(){ + } + + /** Lower-level search API. + * + *

{@link HitCollector#collect(int32_t,qreal)} is called for every non-zero + * scoring document. + * + *

Applications should only use this if they need all of the + * matching documents. The high-level search API ({@link + * Searcher#search(Query*)}) is usually more efficient, as it skips + * non-high-scoring hits. + * + * @param query to match documents + * @param filter if non-null, a bitset used to eliminate some documents + * @param results to receive hits + */ + virtual void _search(Query* query, Filter* filter, HitCollector* results) = 0; + + /** Frees resources associated with this Searcher. + * Be careful not to call this method while you are still using objects + * like {@link Hits}. + */ + virtual void close() = 0; + + /** Expert: Returns the number of documents containing term. + * Called by search code to compute term weights. + * @see IndexReader#docFreq(Term). + */ + virtual int32_t docFreq(const CL_NS(index)::Term* term) const = 0; + + /** Expert: Returns one greater than the largest possible document number. + * Called by search code to compute term weights. + * @see IndexReader#maxDoc(). + */ + virtual int32_t maxDoc() const = 0; + + /** Expert: Low-level search implementation. Finds the top n + * hits for query, applying filter if non-null. + * + *

Called by {@link Hits}. + * + *

Applications should usually call {@link Searcher#search(Query*)} or + * {@link Searcher#search(Query*,Filter*)} instead. + */ + virtual TopDocs* _search(Query* query, Filter* filter, const int32_t n) = 0; + + /** Expert: Returns the stored fields of document i. + * Called by {@link HitCollector} implementations. + * @see IndexReader#document(int32_t). + */ + virtual bool doc(int32_t i, CL_NS(document)::Document* d) = 0; + _CL_DEPRECATED( doc(i, document) ) CL_NS(document)::Document* doc(const int32_t i); + + /** Expert: called to re-write queries into primitive queries. */ + virtual Query* rewrite(Query* query) = 0; + + /** Returns an Explanation that describes how doc scored against + * query. + * + *

This is intended to be used in developing Similarity implementations, + * and, for good performance, should not be displayed with every hit. + * Computing an explanation is as expensive as executing the query over the + * entire index. + */ + virtual void explain(Query* query, int32_t doc, Explanation* ret) = 0; + + /** Expert: Low-level search implementation with arbitrary sorting. Finds + * the top n hits for query, applying + * filter if non-null, and sorting the hits by the criteria in + * sort. + * + *

Applications should usually call {@link + * Searcher#search(Query,Filter,Sort)} instead. + */ + virtual TopFieldDocs* _search(Query* query, Filter* filter, const int32_t n, const Sort* sort) = 0; + }; + + + + /** An abstract base class for search implementations. + * Implements some common utility methods. + */ + class Searcher:public Searchable { + private: + /** The Similarity implementation used by this searcher. */ + Similarity* similarity; + + public: + Searcher(){ + similarity = Similarity::getDefault(); + } + virtual ~Searcher(){ + } + + // Returns the documents matching query. + Hits* search(Query* query) { + return search(query, (Filter*)NULL ); + } + + // Returns the documents matching query and + // filter. + Hits* search(Query* query, Filter* filter) { + return _CLNEW Hits(this, query, filter); + } + + /** Returns documents matching query sorted by + * sort. + */ + Hits* search(Query* query, const Sort* sort){ + return _CLNEW Hits(this, query, NULL, sort); + } + + /** Returns documents matching query and filter, + * sorted by sort. + */ + Hits* search(Query* query, Filter* filter, const Sort* sort){ + return _CLNEW Hits(this, query, filter, sort); + } + + /** Lower-level search API. + * + *

{@link HitCollector#collect(int32_t ,qreal)} is called for every non-zero + * scoring document. + * + *

Applications should only use this if they need all of the + * matching documents. The high-level search API ({@link + * Searcher#search(Query*)}) is usually more efficient, as it skips + * non-high-scoring hits. + *

Note: The score passed to this method is a raw score. + * In other words, the score will not necessarily be a float whose value is + * between 0 and 1. + */ + void _search(Query* query, HitCollector* results) { + Searchable::_search(query, NULL, results); + } + + /** Expert: Set the Similarity implementation used by this Searcher. + * + * @see Similarity#setDefault(Similarity) + */ + void setSimilarity(Similarity* similarity) { + this->similarity = similarity; + } + + /** Expert: Return the Similarity implementation used by this Searcher. + * + *

This defaults to the current value of {@link Similarity#getDefault()}. + */ + Similarity* getSimilarity(){ + return this->similarity; + } + }; + + /** The abstract base class for queries. +

Instantiable subclasses are: +

    +
  • {@link TermQuery} +
  • {@link MultiTermQuery} +
  • {@link BooleanQuery} +
  • {@link WildcardQuery} +
  • {@link PhraseQuery} +
  • {@link PrefixQuery} +
  • {@link PhrasePrefixQuery} +
  • {@link FuzzyQuery} +
  • {@link RangeQuery} +
  • {@link spans.SpanQuery} +
+

A parser for queries is contained in: +

    +
  • {@link queryParser.QueryParser QueryParser} +
+ */ + class Query :LUCENE_BASE { + private: + // query boost factor + qreal boost; + protected: + Query(const Query& clone); + public: + Query(); + virtual ~Query(); + + /** Sets the boost for this query clause to b. Documents + * matching this clause will (in addition to the normal weightings) have + * their score multiplied by b. + */ + void setBoost(qreal b); + + /** Gets the boost for this clause. Documents matching + * this clause will (in addition to the normal weightings) have their score + * multiplied by b. The boost is 1.0 by default. + */ + qreal getBoost() const; + + /** Expert: Constructs an initializes a Weight for a top-level query. */ + Weight* weight(Searcher* searcher); + + /** Expert: called to re-write queries into primitive queries. */ + virtual Query* rewrite(CL_NS(index)::IndexReader* reader); + + /** Expert: called when re-writing queries under MultiSearcher. + * + *

Only implemented by derived queries, with no + * {@link #_createWeight(Searcher)} implementatation. + */ + virtual Query* combine(Query** queries); + + /** Expert: merges the clauses of a set of BooleanQuery's into a single + * BooleanQuery. + * + *

A utility for use by {@link #combine(Query[])} implementations. + */ + static Query* mergeBooleanQueries(Query** queries); + + /** Expert: Returns the Similarity implementation to be used for this query. + * Subclasses may override this method to specify their own Similarity + * implementation, perhaps one that delegates through that of the Searcher. + * By default the Searcher's Similarity implementation is returned.*/ + Similarity* getSimilarity(Searcher* searcher); + + /** Returns a clone of this query. */ + virtual Query* clone() const = 0; + virtual const TCHAR* getQueryName() const = 0; + bool instanceOf(const TCHAR* other) const; + + /** Prints a query to a string, with field as the default field + * for terms.

The representation used is one that is readable by + * {@link queryParser.QueryParser QueryParser} + * (although, if the query was created by the parser, the printed + * representation may not be exactly what was parsed). + */ + virtual TCHAR* toString(const TCHAR* field) const = 0; + + virtual bool equals(Query* other) const = 0; + virtual size_t hashCode() const = 0; + + /** Prints a query to a string. */ + TCHAR* toString() const; + + + /** Expert: Constructs an appropriate Weight implementation for this query. + * + *

Only implemented by primitive queries, which re-write to themselves. + * This is an Internal function + */ + virtual Weight* _createWeight(Searcher* searcher); + + }; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.cpp new file mode 100644 index 000000000..d33a036e4 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.cpp @@ -0,0 +1,233 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Similarity.h" + +#include "CLucene/index/Term.h" +#include "SearchHeader.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + +#ifdef _CL_HAVE_NO_FLOAT_BYTE + #if defined(_LUCENE_PRAGMA_WARNINGS) + #pragma message ("==================Using fallback float<->byte encodings!!!==================") + #else + #warning "==================Using fallback float<->byte encodings!!!==================" + #endif + + //if the autoconf figured out that we can't do the conversions properly, then + //we fall back on the old, inaccurate way of doing things. + qreal NORM_TABLE[] = { + 0.0,5.820766E-10,6.9849193E-10,8.1490725E-10,9.313226E-10,1.1641532E-9,1.3969839E-9, + 1.6298145E-9,1.8626451E-9,2.3283064E-9,2.7939677E-9,3.259629E-9,3.7252903E-9, + 4.656613E-9,5.5879354E-9,6.519258E-9,7.4505806E-9,9.313226E-9,1.1175871E-8,1.3038516E-8, + 1.4901161E-8,1.8626451E-8,2.2351742E-8,2.6077032E-8,2.9802322E-8,3.7252903E-8,4.4703484E-8, + 5.2154064E-8,5.9604645E-8,7.4505806E-8,8.940697E-8,1.0430813E-7,1.1920929E-7,1.4901161E-7, + 1.7881393E-7,2.0861626E-7,2.3841858E-7,2.9802322E-7,3.5762787E-7,4.172325E-7,4.7683716E-7, + 5.9604645E-7,7.1525574E-7,8.34465E-7,9.536743E-7,1.1920929E-6,1.4305115E-6,1.66893E-6, + 1.9073486E-6,2.3841858E-6,2.861023E-6,3.33786E-6,3.8146973E-6,4.7683716E-6,5.722046E-6, + 6.67572E-6,7.6293945E-6,9.536743E-6,1.1444092E-5,1.335144E-5,1.5258789E-5,1.9073486E-5, + 2.2888184E-5,2.670288E-5,3.0517578E-5,3.8146973E-5,4.5776367E-5,5.340576E-5,6.1035156E-5, + 7.6293945E-5,9.1552734E-5,1.0681152E-4,1.2207031E-4,1.5258789E-4,1.8310547E-4,2.1362305E-4, + 2.4414062E-4,3.0517578E-4,3.6621094E-4,4.272461E-4,4.8828125E-4,6.1035156E-4,7.324219E-4, + 8.544922E-4,9.765625E-4,0.0012207031,0.0014648438,0.0017089844,0.001953125,0.0024414062, + 0.0029296875,0.0034179688,0.00390625,0.0048828125,0.005859375,0.0068359375, + 0.0078125,0.009765625,0.01171875,0.013671875,0.015625,0.01953125,0.0234375, + 0.02734375,0.03125,0.0390625,0.046875,0.0546875,0.0625,0.078125,0.09375,0.109375, + 0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.625,0.75, + 0.875,1.0,1.25,1.5,1.75,2,2.5,3,3.5,4.0,5.0,6.0,7.0,8.0,10.0,12.0,14.0,16.0,20.0,24.0,28.0,32.0,40.0,48.0,56.0, + 64.0,80.0,96.0,112.0,128.0,160.0,192.0,224.0,256.0,320.0,384.0,448.0,512.0,640.0,768.0,896.0,1024.0,1280.0,1536.0,1792.0, + 2048.0,2560.0,3072.0,3584.0,4096.0,5120.0,6144.0,7168.0,8192.0,10240.0,12288.0,14336.0,16384.0,20480.0,24576.0, + 28672.0,32768.0,40960.0,49152.0,57344.0,65536.0,81920.0,98304.0,114688.0,131072.0,163840.0,196608.0, + 229376.0,262144.0,327680.0,393216.0,458752.0,524288.0,655360.0,786432.0,917504.0,1048576.0,1310720.0, + 1572864.0,1835008.0,2097152.0,2621440.0,3145728.0,3670016.0,4194304.0,5242880.0,6291456.0,7340032.0, + 8388608.0,10485760.0,12582912.0,14680064.0,16777216.0,20971520.0,25165824.0,29360128.0,33554432.0, + 41943040.0,50331648.0,58720256.0,67108864.0,83886080.0,100663296.0,117440512.0,134217728.0, + 167772160.0,201326592.0,234881024.0,268435456.0,335544320.0,402653184.0,469762048.0,536870912.0, + 671088640.0,805306368.0,939524096.0,1073741824.0,1342177280.0,1610612736.0,1879048192.0, + 2147483648.0,2684354560.0,3221225472.0,3758096384.0,4294967296.0,5368709120.0,6442450944.0,7516192768.0 + }; + + qreal Similarity::byteToFloat(uint8_t b) { + return NORM_TABLE[b]; + } + + uint8_t Similarity::floatToByte(qreal f) { + return Similarity::encodeNorm(f); + } + +#else + + /** Cache of decoded bytes. */ + qreal NORM_TABLE[256]; + bool NORM_TABLE_initd=false; + + //float to bits conversion utilities... + union clvalue { + int32_t i; + float f; //must use a float type, else types dont match up + }; + + int32_t floatToIntBits(qreal value) + { + clvalue u; + int32_t e, f; + u.f = (float)value; + e = u.i & 0x7f800000; + f = u.i & 0x007fffff; + + if (e == 0x7f800000 && f != 0) + u.i = 0x7fc00000; + + return u.i; + } + + qreal intBitsToFloat(int32_t bits) + { + clvalue u; + u.i = bits; + return u.f; + } + + + qreal Similarity::byteToFloat(uint8_t b) { + if (b == 0) // zero is a special case + return 0.0f; + int32_t mantissa = b & 7; + int32_t exponent = (b >> 3) & 31; + int32_t bits = ((exponent+(63-15)) << 24) | (mantissa << 21); + return intBitsToFloat(bits); + } + + uint8_t Similarity::floatToByte(qreal f) { + if (f < 0.0f) // round negatives up to zero + f = 0.0f; + + if (f == 0.0f) // zero is a special case + return 0; + + int32_t bits = floatToIntBits(f); // parse qreal into parts + int32_t mantissa = (bits & 0xffffff) >> 21; + int32_t exponent = (((bits >> 24) & 0x7f) - 63) + 15; + + if (exponent > 31) { // overflow: use max value + exponent = 31; + mantissa = 7; + } + + if (exponent < 0) { // underflow: use min value + exponent = 0; + mantissa = 1; + } + + return (uint8_t)((exponent << 3) | mantissa); // pack into a uint8_t + } +#endif + + /** The Similarity implementation used by default. */ + Similarity* _defaultImpl=NULL; + + void Similarity::setDefault(Similarity* similarity) { + _defaultImpl = similarity; + } + + Similarity* Similarity::getDefault() { + if ( _defaultImpl == NULL ){ + _defaultImpl = _CLNEW DefaultSimilarity(); + } + return _defaultImpl; + } + + qreal Similarity::decodeNorm(uint8_t b) { +#ifndef _CL_HAVE_NO_FLOAT_BYTE + if ( !NORM_TABLE_initd ){ + for (int i = 0; i < 256; i++) + NORM_TABLE[i] = byteToFloat(i); + NORM_TABLE_initd=true; + } +#endif + return NORM_TABLE[b]; + } + + uint8_t Similarity::encodeNorm(qreal f) { +#ifdef _CL_HAVE_NO_FLOAT_BYTE + int32_t i=0; + if ( f <= 0 ) + return 0; + + while ( i<256 && f > NORM_TABLE[i] ){ + i++; + } + if ( i == 0 ) + return 0; + else if ( i == 255 && f>NORM_TABLE[255] ) + return 255; + else + return i; +#else + return floatToByte(f); +#endif + } + + + qreal Similarity::idf(Term* term, Searcher* searcher) { + return idf(searcher->docFreq(term), searcher->maxDoc()); + } + + + qreal Similarity::idf(CL_NS(util)::CLVector* terms, Searcher* searcher) { + qreal _idf = 0.0f; + for (CL_NS(util)::CLVector::iterator i = terms->begin(); i != terms->end(); i++ ) { + _idf += idf((Term*)*i, searcher); + } + return _idf; + } + + Similarity::~Similarity(){ + } + + + + + DefaultSimilarity::DefaultSimilarity(){ + } + DefaultSimilarity::~DefaultSimilarity(){ + } + + qreal DefaultSimilarity::lengthNorm(const TCHAR* fieldName, int32_t numTerms) { + if ( numTerms == 0 ) //prevent div by zero + return 0; + qreal ret = (qreal)(1.0 / sqrt((qreal)numTerms)); + return ret; + } + + qreal DefaultSimilarity::queryNorm(qreal sumOfSquaredWeights) { + if ( sumOfSquaredWeights == 0 ) //prevent div by zero + return 0.0f; + qreal ret = (qreal)(1.0 / sqrt(sumOfSquaredWeights)); + return ret; + } + + qreal DefaultSimilarity::tf(qreal freq) { + return sqrt(freq); + } + + qreal DefaultSimilarity::sloppyFreq(int32_t distance) { + return 1.0f / (distance + 1); + } + + qreal DefaultSimilarity::idf(int32_t docFreq, int32_t numDocs) { + return (qreal)(log(numDocs/(qreal)(docFreq+1)) + 1.0); + } + + qreal DefaultSimilarity::coord(int32_t overlap, int32_t maxOverlap) { + if ( maxOverlap == 0 ) + return 0.0f; + return overlap / (qreal)maxOverlap; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.h b/src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.h new file mode 100644 index 000000000..426af6952 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Similarity.h @@ -0,0 +1,268 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_Similarity_ +#define _lucene_search_Similarity_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/Term.h" + +CL_NS_DEF(search) + +class Searcher;//save including the searchheader.h +class DefaultSimilarity; + +/** Expert: Scoring API. +*

Subclasses implement search scoring. +* +*

The score of query q for document d is defined +* in terms of these methods as follows: +* +* +* +* +* +* +* +* +* +* +* +*
score(q,d) =
+* Σ +* {@link #tf(int32_t) tf}(t in d) * +* {@link #idf(Term,Searcher) idf}(t) * +* {@link Field#getBoost getBoost}(t.field in d) * +* {@link #lengthNorm(TCHAR*,int32_t) lengthNorm}(t.field in d) +*  * +* {@link #coord(int32_t,int32_t) coord}(q,d) * +* {@link #queryNorm(qreal) queryNorm}(q) +*
+* t in q +*
+* +* @see #setDefault(Similarity) +* @see IndexWriter#setSimilarity(Similarity) +* @see Searcher#setSimilarity(Similarity) +*/ +class Similarity:LUCENE_BASE { +public: + virtual ~Similarity(); + + /** Set the default Similarity implementation used by indexing and search + * code. + * + * @see Searcher#setSimilarity(Similarity) + * @see IndexWriter#setSimilarity(Similarity) + */ + static void setDefault(Similarity* similarity); + + /** Return the default Similarity implementation used by indexing and search + * code. + * + *

This is initially an instance of {@link DefaultSimilarity}. + * + * @see Searcher#setSimilarity(Similarity) + * @see IndexWriter#setSimilarity(Similarity) + */ + static Similarity* getDefault(); + + /** Encodes a normalization factor for storage in an index. + * + *

The encoding uses a five-bit exponent and three-bit mantissa, thus + * representing values from around 7x10^9 to 2x10^-9 with about one + * significant decimal digit of accuracy. Zero is also represented. + * Negative numbers are rounded up to zero. Values too large to represent + * are rounded down to the largest representable value. Positive values too + * small to represent are rounded up to the smallest positive representable + * value. + * + * @see Field#setBoost(qreal) + */ + static uint8_t encodeNorm(qreal f); + + /** Decodes a normalization factor stored in an index. + * @see #encodeNorm(qreal) + */ + static qreal decodeNorm(uint8_t b); + + static uint8_t floatToByte(qreal f); + static qreal byteToFloat(uint8_t b); + + /** Computes a score factor for a phrase. + * + *

The default implementation sums the {@link #idf(Term,Searcher)} factor + * for each term in the phrase. + * + * @param terms the terms in the phrase + * @param searcher the document collection being searched + * @return a score factor for the phrase + */ + qreal idf(CL_NS(util)::CLVector* terms, Searcher* searcher); + //qreal idf(Term** terms, Searcher* searcher); + + + /** Computes a score factor for a simple term. + * + *

The default implementation is:

+   *   return idf(searcher.docFreq(term), searcher.maxDoc());
+   * 
+ * + * Note that {@link Searcher#maxDoc()} is used instead of + * {@link IndexReader#numDocs()} because it is proportional to + * {@link Searcher#docFreq(Term)} , i.e., when one is inaccurate, + * so is the other, and in the same direction. + * + * @param term the term in question + * @param searcher the document collection being searched + * @return a score factor for the term + */ + qreal idf(CL_NS(index)::Term* term, Searcher* searcher); + + + /** Computes a score factor based on a term or phrase's frequency in a + * document. This value is multiplied by the {@link #idf(Term, Searcher)} + * factor for each term in the query and these products are then summed to + * form the initial score for a document. + * + *

Terms and phrases repeated in a document indicate the topic of the + * document, so implementations of this method usually return larger values + * when freq is large, and smaller values when freq + * is small. + * + *

The default implementation calls {@link #tf(qreal)}. + * + * @param freq the frequency of a term within a document + * @return a score factor based on a term's within-document frequency + */ + inline qreal tf(int32_t freq){ return tf((qreal)freq); } + + /** Computes the normalization value for a field given the total number of + * terms contained in a field. These values, together with field boosts, are + * stored in an index and multipled into scores for hits on each field by the + * search code. + * + *

Matches in longer fields are less precise, so implemenations of this + * method usually return smaller values when numTokens is large, + * and larger values when numTokens is small. + * + *

That these values are computed under {@link + * IndexWriter#addDocument(Document)} and stored then using + * {#encodeNorm(qreal)}. Thus they have limited precision, and documents + * must be re-indexed if this method is altered. + * + * @param fieldName the name of the field + * @param numTokens the total number of tokens contained in fields named + * fieldName of doc. + * @return a normalization factor for hits on this field of this document + * + * @see Field#setBoost(qreal) + */ + virtual qreal lengthNorm(const TCHAR* fieldName, int32_t numTokens) = 0; + + /** Computes the normalization value for a query given the sum of the squared + * weights of each of the query terms. This value is then multipled into the + * weight of each query term. + * + *

This does not affect ranking, but rather just attempts to make scores + * from different queries comparable. + * + * @param sumOfSquaredWeights the sum of the squares of query term weights + * @return a normalization factor for query weights + */ + virtual qreal queryNorm(qreal sumOfSquaredWeights) = 0; + + /** Computes the amount of a sloppy phrase match, based on an edit distance. + * This value is summed for each sloppy phrase match in a document to form + * the frequency that is passed to {@link #tf(qreal)}. + * + *

A phrase match with a small edit distance to a document passage more + * closely matches the document, so implementations of this method usually + * return larger values when the edit distance is small and smaller values + * when it is large. + * + * @see PhraseQuery#setSlop(int32_t) + * @param distance the edit distance of this sloppy phrase match + * @return the frequency increment for this match + */ + virtual qreal sloppyFreq(int32_t distance) = 0; + + /** Computes a score factor based on a term or phrase's frequency in a + * document. This value is multiplied by the {@link #idf(Term, Searcher)} + * factor for each term in the query and these products are then summed to + * form the initial score for a document. + * + *

Terms and phrases repeated in a document indicate the topic of the + * document, so implemenations of this method usually return larger values + * when freq is large, and smaller values when freq + * is small. + * + * @param freq the frequency of a term within a document + * @return a score factor based on a term's within-document frequency + */ + virtual qreal tf(qreal freq) = 0; + + /** Computes a score factor based on a term's document frequency (the number + * of documents which contain the term). This value is multiplied by the + * {@link #tf(int32_t)} factor for each term in the query and these products are + * then summed to form the initial score for a document. + * + *

Terms that occur in fewer documents are better indicators of topic, so + * implemenations of this method usually return larger values for rare terms, + * and smaller values for common terms. + * + * @param docFreq the number of documents which contain the term + * @param numDocs the total number of documents in the collection + * @return a score factor based on the term's document frequency + */ + virtual qreal idf(int32_t docFreq, int32_t numDocs) = 0; + + /** Computes a score factor based on the fraction of all query terms that a + * document contains. This value is multiplied into scores. + * + *

The presence of a large portion of the query terms indicates a better + * match with the query, so implemenations of this method usually return + * larger values when the ratio between these parameters is large and smaller + * values when the ratio between them is small. + * + * @param overlap the number of query terms matched in the document + * @param maxOverlap the total number of terms in the query + * @return a score factor based on term overlap with the query + */ + virtual qreal coord(int32_t overlap, int32_t maxOverlap) = 0; +}; + + +/** Expert: Default scoring implementation. */ +class DefaultSimilarity: public Similarity { +public: + DefaultSimilarity(); + ~DefaultSimilarity(); + + /** Implemented as 1/sqrt(numTerms). */ + qreal lengthNorm(const TCHAR* fieldName, int32_t numTerms); + + /** Implemented as 1/sqrt(sumOfSquaredWeights). */ + qreal queryNorm(qreal sumOfSquaredWeights); + + /** Implemented as sqrt(freq). */ + inline qreal tf(qreal freq); + + /** Implemented as 1 / (distance + 1). */ + qreal sloppyFreq(int32_t distance); + + /** Implemented as log(numDocs/(docFreq+1)) + 1. */ + qreal idf(int32_t docFreq, int32_t numDocs); + + /** Implemented as overlap / maxOverlap. */ + qreal coord(int32_t overlap, int32_t maxOverlap); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp new file mode 100644 index 000000000..b7683b018 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.cpp @@ -0,0 +1,106 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "SloppyPhraseScorer.h" + +#include "PhraseScorer.h" +#include "CLucene/index/Terms.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + SloppyPhraseScorer::SloppyPhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, + int32_t* positions, Similarity* similarity, + int32_t slop, uint8_t* norms): + PhraseScorer(weight,tps,positions,similarity,norms){ + //Func - Constructor + //Pre - tps != NULL + // tpsLength >= 0 + // n != NULL + //Post - Instance has been created + + CND_PRECONDITION(tps != NULL, "tps is NULL"); + //CND_PRECONDITION(n != NULL, _T("n is NULL")) = checked in PhraseScorer; + + this->slop = slop; + } + + qreal SloppyPhraseScorer::phraseFreq() { + //Func - Returns the freqency of the phrase + //Pre - first != NULL + // last != NULL + // pq != NULL + //Post - The frequency of the phrase has been returned + + CND_PRECONDITION(first != NULL,"first is NULL"); + CND_PRECONDITION(last != NULL,"last is NULL"); + CND_PRECONDITION(pq != NULL,"pq is NULL"); + + //Clear the PhraseQueue pq; + pq->clear(); + + int32_t end = 0; + + //declare iterator + PhrasePositions* pp = NULL; + + // build pq from list + + //Sort the list of PhrasePositions using pq + for (pp = first; pp != NULL; pp = pp->_next) { + //Read the first TermPosition of the current PhrasePositions pp + pp->firstPosition(); + //Check if the position of the pp is bigger than end + if (pp->position > end){ + end = pp->position; + } + //Store the current PhrasePositions pp into the PhraseQueue pp + pq->put(pp); + } + + qreal freq = 0.0f; + + bool done = false; + + do { + //Pop a PhrasePositions pp from the PhraseQueue pp + pp = pq->pop(); + //Get start position + int32_t start = pp->position; + //Get next position + int32_t next = pq->top()->position; + + for (int32_t pos = start; pos <= next; pos = pp->position) { + //advance pp to min window + start = pos; + + if (!pp->nextPosition()) { + //ran out of a term -- done + done = true; + break; + } + } + + //Calculate matchLength + int32_t matchLength = end - start; + //Check if matchLength is smaller than slop + if (matchLength <= slop){ + // penalize longer matches + freq += 1.0 / (matchLength + 1); + } + + if (pp->position > end){ + end = pp->position; + } + + //restore pq + pq->put(pp); + }while (!done); + + return freq; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h new file mode 100644 index 000000000..31516e393 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/SloppyPhraseScorer.h @@ -0,0 +1,34 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_SloppyPhraseScorer_ +#define _lucene_search_SloppyPhraseScorer_ +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "PhraseScorer.h" +#include "CLucene/index/Terms.h" + + +CL_NS_DEF(search) + class SloppyPhraseScorer: public PhraseScorer { + private: + int32_t slop; + + public: + SloppyPhraseScorer(Weight* weight, CL_NS(index)::TermPositions** tps, + int32_t* positions, Similarity* similarity, + int32_t slop, uint8_t* norms); + ~SloppyPhraseScorer(){ + } + + protected: + qreal phraseFreq(); + }; +CL_NS_END +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Sort.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/Sort.cpp new file mode 100644 index 000000000..5a17a784d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Sort.cpp @@ -0,0 +1,345 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Sort.h" +#include "Compare.h" + +CL_NS_USE(util) +CL_NS_DEF(search) + + + + /** Represents sorting by document score (relevancy). */ + SortField* SortField::FIELD_SCORE = _CLNEW SortField (NULL, DOCSCORE,false); + + /** Represents sorting by document number (index order). */ + SortField* SortField::FIELD_DOC = _CLNEW SortField (NULL, DOC,false); + + + /** Represents sorting by computed relevance. Using this sort criteria + * returns the same results as calling {@link Searcher#search(Query) Searcher#search()} + * without a sort criteria, only with slightly more overhead. */ + Sort* Sort::RELEVANCE = _CLNEW Sort(); + + /** Represents sorting by index order. */ + Sort* Sort::INDEXORDER = _CLNEW Sort (SortField::FIELD_DOC); + + + + + /** Creates a sort by terms in the given field where the type of term value + * is determined dynamically ({@link #AUTO AUTO}). + * @param field Name of field to sort by, cannot be null. + */ + SortField::SortField (const TCHAR* field) { + this->type = AUTO; + this->reverse = false; + this->field = CLStringIntern::intern(field CL_FILELINE); + this->factory = NULL; + } + + /** Creates a sort, possibly in reverse, by terms in the given field where + * the type of term value is determined dynamically ({@link #AUTO AUTO}). + * @param field Name of field to sort by, cannot be null. + * @param reverse True if natural order should be reversed. + + SortField::SortField (const TCHAR* field, bool reverse) { + this->field = CLStringIntern::intern(field CL_FILELINE); + this->reverse = reverse; + this->type = AUTO; + this->factory = NULL; + }*/ + + + /** Creates a sort, possibly in reverse, by terms in the given field with the + * type of term values explicitly given. + * @param field Name of field to sort by. Can be null if + * type is SCORE or DOC. + * @param type Type of values in the terms. + * @param reverse True if natural order should be reversed (default=false). + */ + SortField::SortField (const TCHAR* field, int32_t type, bool reverse) { + this->field = (field != NULL) ? CLStringIntern::intern(field CL_FILELINE) : field; + this->type = type; + this->reverse = reverse; + this->factory = NULL; + } + + SortField::SortField(const SortField& clone){ + this->field = (clone.field != NULL) ? CLStringIntern::intern(clone.field CL_FILELINE) : clone.field; + this->type = clone.type; + this->reverse = clone.reverse; + this->factory = clone.factory; + } + SortField* SortField::clone() const{ + return _CLNEW SortField(*this); + } + + /** Creates a sort by terms in the given field sorted + * according to the given locale. + * @param field Name of field to sort by, cannot be null. + * @param locale Locale of values in the field. + */ + /*SortField::SortField (TCHAR* field, Locale* locale) { + this->field = (field != NULL) ? CLStringIntern::intern(field): field; + this->type = STRING; + this->locale = locale; + }*/ + + /** Creates a sort, possibly in reverse, by terms in the given field sorted + * according to the given locale. + * @param field Name of field to sort by, cannot be null. + * @param locale Locale of values in the field. + */ + /*SortField::SortField (TCHAR* field, Locale* locale, bool reverse) { + this->field = (field != NULL) ? CLStringIntern::intern(field): field; + this->type = STRING; + this->locale = locale; + this->reverse = reverse; + }*/ + + + /** Creates a sort, possibly in reverse, with a custom comparison function. + * @param field Name of field to sort by; cannot be null. + * @param comparator Returns a comparator for sorting hits. + * @param reverse True if natural order should be reversed (default=false). + */ + SortField::SortField (const TCHAR* field, SortComparatorSource* comparator, bool reverse) { + this->field = (field != NULL) ? CLStringIntern::intern(field CL_FILELINE): field; + this->type = CUSTOM; + this->reverse = reverse; + this->factory = comparator; + } + + SortField::~SortField(){ + CLStringIntern::unintern(field); + } + + TCHAR* SortField::toString() const { + CL_NS(util)::StringBuffer buffer; + switch (type) { + case DOCSCORE: buffer.append(_T("")); + break; + + case DOC: buffer.append(_T("")); + break; + + case CUSTOM: buffer.append (_T("getName()); + buffer.append(_T(">")); + break; + + default: buffer.append( _T("\"")); + buffer.append( field ); + buffer.append( _T("\"") ); + break; + } + + //if (locale != null) buffer.append ("("+locale+")"); todo: + if (reverse) buffer.appendChar('!'); + + return buffer.toString(); + } + + + + + + + + + + + + + + /** Sorts by computed relevance. This is the same sort criteria as + * calling {@link Searcher#search(Query) Searcher#search()} without a sort criteria, only with + * slightly more overhead. */ + Sort::Sort() { + fields=NULL; + SortField** fields=_CL_NEWARRAY(SortField*,3); + fields[0]=SortField::FIELD_SCORE; + fields[1]=SortField::FIELD_DOC; + fields[2]=NULL; + setSort (fields); + _CLDELETE_ARRAY(fields); + } + + Sort::~Sort(){ + clear(); + } + void Sort::clear(){ + if ( fields != NULL ){ + int32_t i=0; + while ( fields[i] != NULL ){ + if ( fields[i] != SortField::FIELD_SCORE && + fields[i] != SortField::FIELD_DOC ){ + _CLDELETE(fields[i]); + } + i++; + } + _CLDELETE_ARRAY(fields); + } + } + + /** Sorts possibly in reverse by the terms in field then by + * index order (document number). The type of value in field is determined + * automatically. + * @see SortField#AUTO + */ + Sort::Sort (const TCHAR* field, bool reverse) { + this->fields=NULL; + setSort (field, reverse); + } + + + /** Sorts in succession by the terms in each field. + * The type of value in field is determined + * automatically. + * @see SortField#AUTO + */ + Sort::Sort (const TCHAR** fields) { + this->fields=NULL; + setSort (fields); + } + + + /** Sorts by the criteria in the given SortField. */ + Sort::Sort (SortField* field) { + this->fields=NULL; + setSort (field); + } + + + /** Sorts in succession by the criteria in each SortField. */ + Sort::Sort (SortField** fields) { + this->fields=NULL; + setSort (fields); + } + + + /** Sets the sort to the terms in field possibly in reverse, + * then by index order (document number). */ + void Sort::setSort (const TCHAR* field, bool reverse) { + clear(); + fields = _CL_NEWARRAY(SortField*,3); + fields[0] = _CLNEW SortField (field, SortField::AUTO, reverse); + fields[1] = SortField::FIELD_DOC; + fields[2] = NULL; + } + + + /** Sets the sort to the terms in each field in succession. */ + void Sort::setSort (const TCHAR** fieldnames) { + clear(); + + int32_t n = 0; + while ( fieldnames[n] != NULL ) + n++; + + fields = _CL_NEWARRAY(SortField*,n+1); + for (int32_t i = 0; i < n; ++i) { + fields[i] = _CLNEW SortField (fieldnames[i], SortField::AUTO,false); + } + fields[n]=NULL; + } + + + /** Sets the sort to the given criteria. */ + void Sort::setSort (SortField* field) { + clear(); + + this->fields = _CL_NEWARRAY(SortField*,2); + this->fields[0] = field; + this->fields[1] = NULL; + } + + + /** Sets the sort to the given criteria in succession. */ + void Sort::setSort (SortField** fields) { + clear(); + + int n=0; + while ( fields[n] != NULL ) + n++; + this->fields = _CL_NEWARRAY(SortField*,n+1); + for (int i=0;ifields[i]=fields[i]; + } + + TCHAR* Sort::toString() const { + CL_NS(util)::StringBuffer buffer; + + int32_t i = 0; + while ( fields[i] != NULL ){ + if (i>0) + buffer.appendChar(','); + + const TCHAR* p = fields[i]->toString(); + buffer.append(p); + _CLDELETE_CARRAY(p); + + i++; + } + + return buffer.toString(); + } + + + + + + ScoreDocComparator* ScoreDocComparator::INDEXORDER = _CLNEW ScoreDocComparators::IndexOrder; + ScoreDocComparator* ScoreDocComparator::RELEVANCE = _CLNEW ScoreDocComparators::Relevance; + + ScoreDocComparator::~ScoreDocComparator(){ + } + + +class ScoreDocComparatorImpl: public ScoreDocComparator{ + Comparable** cachedValues; + FieldCacheAuto* fca; + int32_t cachedValuesLen; +public: + ScoreDocComparatorImpl(FieldCacheAuto* fca){ + this->fca = fca; + if ( fca->contentType != FieldCacheAuto::COMPARABLE_ARRAY ) + _CLTHROWA(CL_ERR_InvalidCast,"Invalid field cache auto type"); + this->cachedValues = fca->comparableArray; + this->cachedValuesLen = fca->contentLen; + } + ~ScoreDocComparatorImpl(){ + } + int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j){ + CND_PRECONDITION(i->doc >= 0 && i->doc < cachedValuesLen, "i->doc out of range") + CND_PRECONDITION(j->doc >= 0 && j->doc < cachedValuesLen, "j->doc out of range") + return cachedValues[i->doc]->compareTo (cachedValues[j->doc]); + } + + CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i){ + CND_PRECONDITION(i->doc >= 0 && i->doc < cachedValuesLen, "i->doc out of range") + return cachedValues[i->doc]; + } + + int32_t sortType(){ + return SortField::CUSTOM; + } +}; + +ScoreDocComparator* SortComparator::newComparator (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname){ + return _CLNEW ScoreDocComparatorImpl(FieldCache::DEFAULT->getCustom (reader, fieldname, this)); +} +SortComparator::SortComparator(){ +} +SortComparator::~SortComparator(){ +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/Sort.h b/src/assistant/3rdparty/clucene/src/CLucene/search/Sort.h new file mode 100644 index 000000000..cfe96d56c --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/Sort.h @@ -0,0 +1,356 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_Sort_ +#define _lucene_search_Sort_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "SearchHeader.h" + +CL_NS_DEF(search) + + class SortField; //predefine + class Sort; + +/** + * Expert: Compares two ScoreDoc objects for sorting. + * + */ + class ScoreDocComparator:LUCENE_BASE { + protected: + ScoreDocComparator(){} + public: + virtual ~ScoreDocComparator(); +// CL_NS(util)::Comparable** cachedValues; +// ScoreDocComparator(CL_NS(util)::Comparable** cachedValues); + + /** + * Compares two ScoreDoc objects and returns a result indicating their + * sort order. + * @param i First ScoreDoc + * @param j Second ScoreDoc + * @return -1 if i should come before j
1 if i should come after j
0 if they are equal + * @see java.util.Comparator + */ + virtual int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j) = 0; + + /** + * Returns the value used to sort the given document. The + * object returned must implement the java.io.Serializable + * interface. This is used by multisearchers to determine how to collate results from their searchers. + * @see FieldDoc + * @param i Document + * @return Serializable object + */ + virtual CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i) = 0; + + + /** + * Returns the type of sort. Should return SortField.SCORE, SortField.DOC, SortField.STRING, SortField.INTEGER, + * SortField::FLOAT or SortField.CUSTOM. It is not valid to return SortField.AUTO. + * This is used by multisearchers to determine how to collate results from their searchers. + * @return One of the constants in SortField. + * @see SortField + */ + virtual int32_t sortType() = 0; + + /** Special comparator for sorting hits according to computed relevance (document score). */ + static ScoreDocComparator* RELEVANCE; + + /** Special comparator for sorting hits according to index order (document number). */ + static ScoreDocComparator* INDEXORDER; + }; + +/** + * Expert: returns a comparator for sorting ScoreDocs. + * + */ +class SortComparatorSource:LUCENE_BASE { +public: + virtual ~SortComparatorSource(){ + } + + /** + * return a reference to a string describing the name of the comparator + * this is used in the explanation + */ + virtual TCHAR* getName() = 0; + + virtual size_t hashCode() = 0; + + /** + * Creates a comparator for the field in the given index. + * @param reader Index to create comparator for. + * @param fieldname Field to create comparator for. + * @return Comparator of ScoreDoc objects. + * @throws IOException If an error occurs reading the index. + */ + virtual ScoreDocComparator* newComparator (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname) = 0; +}; + + +/** + * Abstract base class for sorting hits returned by a Query. + * + *

This class should only be used if the other SortField + * types (SCORE, DOC, STRING, INT, FLOAT) do not provide an + * adequate sorting. It maintains an internal cache of values which + * could be quite large. The cache is an array of Comparable, + * one for each document in the index. There is a distinct + * Comparable for each unique term in the field - if + * some documents have the same term in the field, the cache + * array will have entries which reference the same Comparable. + * + */ +class SortComparator: public SortComparatorSource { +public: + virtual ScoreDocComparator* newComparator (CL_NS(index)::IndexReader* reader, const TCHAR* fieldname); + + SortComparator(); + virtual ~SortComparator(); + + /** + * Returns an object which, when sorted according to natural order, + * will order the Term values in the correct order. + *

For example, if the Terms contained integer values, this method + * would return new Integer(termtext). Note that this + * might not always be the most efficient implementation - for this + * particular example, a better implementation might be to make a + * ScoreDocLookupComparator that uses an internal lookup table of int. + * @param termtext The textual value of the term. + * @return An object representing termtext that sorts + * according to the natural order of termtext. + * @see Comparable + * @see ScoreDocComparator + */ + virtual CL_NS(util)::Comparable* getComparable (const TCHAR* termtext) = 0; + +}; + + +/** + * Stores information about how to sort documents by terms in an individual + * field. Fields must be indexed in order to sort by them. + * + */ +class SortField:LUCENE_BASE { +private: + const TCHAR* field; + int32_t type; // defaults to determining type dynamically + //Locale* locale; // defaults to "natural order" (no Locale) + bool reverse; // defaults to natural order + SortComparatorSource* factory; + +protected: + SortField (const SortField& clone); +public: + virtual ~SortField(); + + /** Sort by document score (relevancy). Sort values are Float and higher + * values are at the front. + * PORTING: this is the same as SCORE in java, it had to be renamed because + * SCORE is a system macro on some platforms (AIX). + */ + LUCENE_STATIC_CONSTANT(int32_t, DOCSCORE=0); + + /** Sort by document number (index order). Sort values are Integer and lower + * values are at the front. */ + LUCENE_STATIC_CONSTANT(int32_t, DOC=1); + + /** Guess type of sort based on field contents. A regular expression is used + * to look at the first term indexed for the field and determine if it + * represents an integer number, a floating point number, or just arbitrary + * string characters. */ + LUCENE_STATIC_CONSTANT(int32_t, AUTO=2); + + /** Sort using term values as Strings. Sort values are String and lower + * values are at the front. */ + LUCENE_STATIC_CONSTANT(int32_t, STRING=3); + + /** Sort using term values as encoded Integers. Sort values are Integer and + * lower values are at the front. */ + LUCENE_STATIC_CONSTANT(int32_t, INT=4); + + /** Sort using term values as encoded Floats. Sort values are Float and + * lower values are at the front. */ + LUCENE_STATIC_CONSTANT(int32_t, FLOAT=5); + + /** Sort using a custom Comparator. Sort values are any Comparable and + * sorting is done according to natural order. */ + LUCENE_STATIC_CONSTANT(int32_t, CUSTOM=9); + + // IMPLEMENTATION NOTE: the FieldCache.STRING_INDEX is in the same "namespace" + // as the above static int values. Any new values must not have the same value + // as FieldCache.STRING_INDEX. + + /** Represents sorting by document score (relevancy). */ + static SortField* FIELD_SCORE; + + /** Represents sorting by document number (index order). */ + static SortField* FIELD_DOC; + + SortField (const TCHAR* field); + //SortField (const TCHAR* field, bool reverse); + //todo: we cannot make reverse use default field of =false. + //because bool and int are the same type in c, overloading is not possible + SortField (const TCHAR* field, int32_t type, bool reverse); + + /* + SortField (TCHAR* field, Locale* locale) { + SortField (TCHAR* field, Locale* locale, bool reverse);*/ + + SortField (const TCHAR* field, SortComparatorSource* comparator, bool reverse=false); + + /** Returns the name of the field. Could return null + * if the sort is by SCORE or DOC. + * @return Name of field, possibly null. + */ + const TCHAR* getField() const { return field; } + + SortField* clone() const; + + /** Returns the type of contents in the field. + * @return One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. + */ + int32_t getType() const { return type; } + + /** Returns the Locale by which term values are interpreted. + * May return null if no Locale was specified. + * @return Locale, or null. + */ + /*Locale getLocale() { + return locale; + }*/ + + /** Returns whether the sort should be reversed. + * @return True if natural order should be reversed. + */ + bool getReverse() const { return reverse; } + + SortComparatorSource* getFactory() const { return factory; } + + TCHAR* toString() const; +}; + + + +/** + * Encapsulates sort criteria for returned hits. + * + *

The fields used to determine sort order must be carefully chosen. + * Documents must contain a single term in such a field, + * and the value of the term should indicate the document's relative position in + * a given sort order. The field must be indexed, but should not be tokenized, + * and does not need to be stored (unless you happen to want it back with the + * rest of your document data). In other words: + * + *

document.add (new Field ("byNumber", Integer.toString(x), false, true, false)); + *
+ * + *

Valid Types of Values

+ * + *

There are three possible kinds of term values which may be put into + * sorting fields: Integers, Floats, or Strings. Unless + * {@link SortField SortField} objects are specified, the type of value + * in the field is determined by parsing the first term in the field. + * + *

Integer term values should contain only digits and an optional + * preceeding negative sign. Values must be base 10 and in the range + * Integer.MIN_VALUE and Integer.MAX_VALUE inclusive. + * Documents which should appear first in the sort + * should have low value integers, later documents high values + * (i.e. the documents should be numbered 1..n where + * 1 is the first and n the last). + * + *

Float term values should conform to values accepted by + * {@link Float Float.valueOf(String)} (except that NaN + * and Infinity are not supported). + * Documents which should appear first in the sort + * should have low values, later documents high values. + * + *

String term values can contain any valid String, but should + * not be tokenized. The values are sorted according to their + * {@link Comparable natural order}. Note that using this type + * of term value has higher memory requirements than the other + * two types. + * + *

Object Reuse

+ * + *

One of these objects can be + * used multiple times and the sort order changed between usages. + * + *

This class is thread safe. + * + *

Memory Usage

+ * + *

Sorting uses of caches of term values maintained by the + * internal HitQueue(s). The cache is static and contains an integer + * or float array of length IndexReader.maxDoc() for each field + * name for which a sort is performed. In other words, the size of the + * cache in bytes is: + * + *

4 * IndexReader.maxDoc() * (# of different fields actually used to sort) + * + *

For String fields, the cache is larger: in addition to the + * above array, the value of every term in the field is kept in memory. + * If there are many unique terms in the field, this could + * be quite large. + * + *

Note that the size of the cache is not affected by how many + * fields are in the index and might be used to sort - only by + * the ones actually used to sort a result set. + * + *

The cache is cleared each time a new IndexReader is + * passed in, or if the value returned by maxDoc() + * changes for the current IndexReader. This class is not set up to + * be able to efficiently sort hits from more than one index + * simultaneously. + * + */ +class Sort:LUCENE_BASE { + // internal representation of the sort criteria + SortField** fields; + void clear(); +public: + ~Sort(); + + /** Represents sorting by computed relevance. Using this sort criteria + * returns the same results as calling {@link Searcher#search(Query) Searcher#search()} + * without a sort criteria, only with slightly more overhead. */ + static Sort* RELEVANCE; + + /** Represents sorting by index order. */ + static Sort* INDEXORDER; + + Sort(); + Sort (const TCHAR* field, bool reverse=false); + Sort (const TCHAR** fields); + Sort (SortField* field); + Sort (SortField** fields); + void setSort (const TCHAR* field, bool reverse=false); + void setSort (const TCHAR** fieldnames); + void setSort (SortField* field); + void setSort (SortField** fields); + + TCHAR* toString() const; + + /** + * Representation of the sort criteria. + * @return a pointer to the of SortField array used in this sort criteria + */ + SortField** getSort() const{ return fields; } +}; + + + + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.cpp new file mode 100644 index 000000000..a04c20fec --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.cpp @@ -0,0 +1,213 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "TermQuery.h" + +#include "SearchHeader.h" +#include "Scorer.h" +#include "CLucene/index/Term.h" +#include "TermScorer.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/StringBuffer.h" +#include "CLucene/index/Terms.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + + /** Constructs a query for the term t. */ + TermQuery::TermQuery(Term* t): + term( _CL_POINTER(t) ) + { + } + TermQuery::TermQuery(const TermQuery& clone): + Query(clone){ + this->term=_CL_POINTER(clone.term); + } + TermQuery::~TermQuery(){ + _CLDECDELETE(term); + } + + Query* TermQuery::clone() const{ + return _CLNEW TermQuery(*this); + } + + const TCHAR* TermQuery::getClassName(){ + return _T("TermQuery"); + } + const TCHAR* TermQuery::getQueryName() const{ + return getClassName(); + } + size_t TermQuery::hashCode() const { + return Similarity::floatToByte(getBoost()) ^ term->hashCode(); + } + + + //added by search highlighter + Term* TermQuery::getTerm(bool pointer) const + { + if ( pointer ) + return _CL_POINTER(term); + else + return term; + } + + + /** Prints a user-readable version of this query. */ + TCHAR* TermQuery::toString(const TCHAR* field) const{ + CL_NS(util)::StringBuffer buffer; + if ( field==NULL || _tcscmp(term->field(),field)!= 0 ) { + buffer.append(term->field()); + buffer.append(_T(":")); + } + buffer.append(term->text()); + if (getBoost() != 1.0f) { + buffer.append(_T("^")); + buffer.appendFloat( getBoost(),1 ); + } + return buffer.toString(); + } + + /** Returns true iff o is equal to this. */ + bool TermQuery::equals(Query* other) const { + if (!(other->instanceOf(TermQuery::getClassName()))) + return false; + + TermQuery* tq = (TermQuery*)other; + return (this->getBoost() == tq->getBoost()) + && this->term->equals(tq->term); + } + + + TermQuery::TermWeight::TermWeight(Searcher* searcher, TermQuery* _this, Term* _term) { + this->_this = _this; + this->_term = _term; + this->searcher = searcher; + value=0; + idf=0; + queryNorm=0; + queryWeight=0; + } + TermQuery::TermWeight::~TermWeight(){ + } + + //return a *new* string describing this object + TCHAR* TermQuery::TermWeight::toString() { + int32_t size=_tcslen(_this->getQueryName()) + 10; + TCHAR* tmp = _CL_NEWARRAY(TCHAR, size);//_tcslen(weight()) + _sntprintf(tmp,size,_T("weight(%s)"),_this->getQueryName()); + return tmp; + } + + qreal TermQuery::TermWeight::sumOfSquaredWeights() { + idf = _this->getSimilarity(searcher)->idf(_term, searcher); // compute idf + queryWeight = idf * _this->getBoost(); // compute query weight + return queryWeight * queryWeight; // square it + } + + void TermQuery::TermWeight::normalize(qreal queryNorm) { + this->queryNorm = queryNorm; + queryWeight *= queryNorm; // normalize query weight + value = queryWeight * idf; // idf for document + } + + Scorer* TermQuery::TermWeight::scorer(IndexReader* reader) { + TermDocs* termDocs = reader->termDocs(_term); + + if (termDocs == NULL) + return NULL; + + return _CLNEW TermScorer(this, termDocs, _this->getSimilarity(searcher), + reader->norms(_term->field())); + } + + void TermQuery::TermWeight::explain(IndexReader* reader, int32_t doc, Explanation* result){ + TCHAR buf[LUCENE_SEARCH_EXPLANATION_DESC_LEN]; + TCHAR* tmp; + + tmp = getQuery()->toString(); + _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("weight(%s in %d), product of:"),tmp,doc); + _CLDELETE_CARRAY(tmp); + result->setDescription(buf); + + _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("idf(docFreq=%d)"), searcher->docFreq(_term) ); + Explanation* idfExpl = _CLNEW Explanation(idf, buf); + + // explain query weight + Explanation* queryExpl = _CLNEW Explanation(); + tmp = getQuery()->toString(); + _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("queryWeight(%s), product of:"), tmp); + _CLDELETE_CARRAY(tmp); + queryExpl->setDescription(buf); + + Explanation* boostExpl = _CLNEW Explanation(_this->getBoost(), _T("boost")); + if (_this->getBoost() != 1.0f) + queryExpl->addDetail(boostExpl); + else + _CLDELETE(boostExpl); + + queryExpl->addDetail(idfExpl->clone()); + + Explanation* queryNormExpl = _CLNEW Explanation(queryNorm,_T("queryNorm")); + queryExpl->addDetail(queryNormExpl); + + queryExpl->setValue(_this->getBoost()* // always 1.0 + idfExpl->getValue() * + queryNormExpl->getValue()); + + // explain field weight + const TCHAR* field = _term->field(); + Explanation* fieldExpl = _CLNEW Explanation(); + + tmp = _term->toString(); + _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("fieldWeight(%s in %d), product of:"),tmp,doc); + _CLDELETE_CARRAY(tmp); + fieldExpl->setDescription(buf); + + Scorer* sc = scorer(reader); + Explanation* tfExpl = _CLNEW Explanation; + sc->explain(doc, tfExpl); + _CLDELETE(sc); + fieldExpl->addDetail(tfExpl); + fieldExpl->addDetail(idfExpl); + + Explanation* fieldNormExpl = _CLNEW Explanation(); + uint8_t* fieldNorms = reader->norms(field); + qreal fieldNorm = + fieldNorms!=NULL ? Similarity::decodeNorm(fieldNorms[doc]) : 0.0f; + fieldNormExpl->setValue(fieldNorm); + + _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN, + _T("fieldNorm(field=%s, doc=%d)"),field,doc); + fieldNormExpl->setDescription(buf); + fieldExpl->addDetail(fieldNormExpl); + + fieldExpl->setValue(tfExpl->getValue() * + idfExpl->getValue() * + fieldNormExpl->getValue()); + + /*if (queryExpl->getValue() == 1.0f){ + _CLDELETE(result); + return fieldExpl; + }else{*/ + result->addDetail(queryExpl); + result->addDetail(fieldExpl); + + // combine them + result->setValue(queryExpl->getValue() * fieldExpl->getValue()); + //} + } + + Weight* TermQuery::_createWeight(Searcher* searcher) { + return _CLNEW TermWeight(searcher,this,term); + } +CL_NS_END + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.h new file mode 100644 index 000000000..a7dd8039b --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/TermQuery.h @@ -0,0 +1,81 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_TermQuery_ +#define _lucene_search_TermQuery_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "SearchHeader.h" +#include "Scorer.h" +#include "CLucene/index/Term.h" +#include "TermScorer.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/StringBuffer.h" +#include "CLucene/index/Terms.h" + +CL_NS_DEF(search) + + + /** A Query that matches documents containing a term. + This may be combined with other terms with a {@link BooleanQuery}. + */ + class TermQuery: public Query { + private: + CL_NS(index)::Term* term; + + + class TermWeight: public Weight { + private: + Searcher* searcher; + qreal value; + qreal idf; + qreal queryNorm; + qreal queryWeight; + TermQuery* _this; + CL_NS(index)::Term* _term; + + public: + TermWeight(Searcher* searcher, TermQuery* _this, CL_NS(index)::Term* _term); + ~TermWeight(); + TCHAR* toString(); + Query* getQuery() { return (Query*)_this; } + qreal getValue() { return value; } + + qreal sumOfSquaredWeights(); + void normalize(qreal queryNorm); + Scorer* scorer(CL_NS(index)::IndexReader* reader); + void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret); + }; + + protected: + Weight* _createWeight(Searcher* searcher); + TermQuery(const TermQuery& clone); + public: + // Constructs a query for the term t. + TermQuery(CL_NS(index)::Term* t); + ~TermQuery(); + + static const TCHAR* getClassName(); + const TCHAR* getQueryName() const; + + //added by search highlighter + CL_NS(index)::Term* getTerm(bool pointer=true) const; + + // Prints a user-readable version of this query. + TCHAR* toString(const TCHAR* field) const; + + bool equals(Query* other) const; + Query* clone() const; + + /** Returns a hash code value for this object.*/ + size_t hashCode() const; + }; +CL_NS_END +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.cpp new file mode 100644 index 000000000..ddd7f74ed --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.cpp @@ -0,0 +1,120 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "TermScorer.h" + +#include "CLucene/index/Terms.h" +#include "TermQuery.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + //TermScorer takes TermDocs and delets it when TermScorer is cleaned up + TermScorer::TermScorer(Weight* w, CL_NS(index)::TermDocs* td, + Similarity* similarity,uint8_t* _norms): + Scorer(similarity), + termDocs(td), + norms(_norms), + weight(w), + weightValue(w->getValue()), + _doc(0), + pointer(0), + pointerMax(0) + { + memset(docs,0,32*sizeof(int32_t)); + memset(freqs,0,32*sizeof(int32_t)); + + for (int32_t i = 0; i < LUCENE_SCORE_CACHE_SIZE; i++) + scoreCache[i] = getSimilarity()->tf(i) * weightValue; + } + + TermScorer::~TermScorer(){ + _CLDELETE(termDocs); + } + bool TermScorer::next(){ + pointer++; + if (pointer >= pointerMax) { + pointerMax = termDocs->read(docs, freqs, 32); // refill buffer + if (pointerMax != 0) { + pointer = 0; + } else { + termDocs->close(); // close stream + _doc = LUCENE_INT32_MAX_SHOULDBE; // set to sentinel value + return false; + } + } + _doc = docs[pointer]; + return true; + } + + bool TermScorer::skipTo(int32_t target) { + // first scan in cache + for (pointer++; pointer < pointerMax; pointer++) { + if (docs[pointer] >= target) { + _doc = docs[pointer]; + return true; + } + } + + // not found in cache, seek underlying stream + bool result = termDocs->skipTo(target); + if (result) { + pointerMax = 1; + pointer = 0; + docs[pointer] = _doc = termDocs->doc(); + freqs[pointer] = termDocs->freq(); + } else { + _doc = LUCENE_INT32_MAX_SHOULDBE; + } + return result; + } + + void TermScorer::explain(int32_t doc, Explanation* tfExplanation) { + TermQuery* query = (TermQuery*)weight->getQuery(); + int32_t tf = 0; + while (pointer < pointerMax) { + if (docs[pointer] == doc) + tf = freqs[pointer]; + pointer++; + } + if (tf == 0) { + while (termDocs->next()) { + if (termDocs->doc() == doc) { + tf = termDocs->freq(); + } + } + } + termDocs->close(); + tfExplanation->setValue(getSimilarity()->tf(tf)); + + TCHAR buf[LUCENE_SEARCH_EXPLANATION_DESC_LEN+1]; + TCHAR* termToString = query->getTerm(false)->toString(); + _sntprintf(buf,LUCENE_SEARCH_EXPLANATION_DESC_LEN,_T("tf(termFreq(%s)=%d)"), termToString, tf); + _CLDELETE_CARRAY(termToString); + tfExplanation->setDescription(buf); + } + + TCHAR* TermScorer::toString() { + TCHAR* wb = weight->toString(); + int32_t rl = _tcslen(wb) + 9; //9=_tcslen("scorer(" ")") + 1 + TCHAR* ret = _CL_NEWARRAY(TCHAR,rl); + _sntprintf(ret,rl,_T("scorer(%s)"), wb); + _CLDELETE_ARRAY(wb); + return ret; + } + + qreal TermScorer::score(){ + int32_t f = freqs[pointer]; + qreal raw = // compute tf(f)*weight + f < LUCENE_SCORE_CACHE_SIZE // check cache + ? scoreCache[f] // cache hit + : getSimilarity()->tf(f) * weightValue; // cache miss + + return raw * Similarity::decodeNorm(norms[_doc]); // normalize for field + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.h b/src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.h new file mode 100644 index 000000000..ccbf5f7ec --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/TermScorer.h @@ -0,0 +1,53 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_TermScorer_ +#define _lucene_search_TermScorer_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Scorer.h" +#include "CLucene/index/Terms.h" +#include "CLucene/search/Similarity.h" +#include "SearchHeader.h" + +CL_NS_DEF(search) + + class TermScorer: public Scorer { + private: + CL_NS(index)::TermDocs* termDocs; + uint8_t* norms; + Weight* weight; + const qreal weightValue; + int32_t _doc; + + int32_t docs[32]; // buffered doc numbers + int32_t freqs[32]; // buffered term freqs + int32_t pointer; + int32_t pointerMax; + + qreal scoreCache[LUCENE_SCORE_CACHE_SIZE]; + public: + + //TermScorer takes TermDocs and delets it when TermScorer is cleaned up + TermScorer(Weight* weight, CL_NS(index)::TermDocs* td, + Similarity* similarity, uint8_t* _norms); + + ~TermScorer(); + + int32_t doc() const { return _doc; } + + bool next(); + bool skipTo(int32_t target); + void explain(int32_t doc, Explanation* ret); + TCHAR* toString(); + + qreal score(); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp new file mode 100644 index 000000000..9373cef0a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.cpp @@ -0,0 +1,147 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "WildcardQuery.h" +#include "CLucene/util/BitSet.h" + +CL_NS_USE(index) +CL_NS_USE(util) +CL_NS_DEF(search) + + + WildcardQuery::WildcardQuery(Term* term): + MultiTermQuery( term ){ + //Func - Constructor + //Pre - term != NULL + //Post - Instance has been created + + } + + WildcardQuery::~WildcardQuery(){ + //Func - Destructor + //Pre - true + //Post - true + + } + + const TCHAR* WildcardQuery::getQueryName() const{ + //Func - Returns the string "WildcardQuery" + //Pre - true + //Post - The string "WildcardQuery" has been returned + return getClassName(); + } + + const TCHAR* WildcardQuery::getClassName(){ + return _T("WildcardQuery"); + } + + + FilteredTermEnum* WildcardQuery::getEnum(IndexReader* reader) { + return _CLNEW WildcardTermEnum(reader, getTerm(false)); + } + + WildcardQuery::WildcardQuery(const WildcardQuery& clone): + MultiTermQuery(clone) + { + } + + Query* WildcardQuery::clone() const{ + return _CLNEW WildcardQuery(*this); + } + size_t WildcardQuery::hashCode() const{ + //todo: we should give the query a seeding value... but + //need to do it for all hascode functions + return Similarity::floatToByte(getBoost()) ^ getTerm()->hashCode(); + } + bool WildcardQuery::equals(Query* other) const{ + if (!(other->instanceOf(WildcardQuery::getClassName()))) + return false; + + WildcardQuery* tq = (WildcardQuery*)other; + return (this->getBoost() == tq->getBoost()) + && getTerm()->equals(tq->getTerm()); + } + + + + + + + + + + + + +WildcardFilter::WildcardFilter( Term* term ) +{ + this->term = _CL_POINTER(term); +} + +WildcardFilter::~WildcardFilter() +{ + _CLDECDELETE(term); +} + +WildcardFilter::WildcardFilter( const WildcardFilter& copy ) : + term( _CL_POINTER(copy.term) ) +{ +} + +Filter* WildcardFilter::clone() const { + return _CLNEW WildcardFilter(*this ); +} + + +TCHAR* WildcardFilter::toString() +{ + //Instantiate a stringbuffer buffer to store the readable version temporarily + CL_NS(util)::StringBuffer buffer; + //check if field equal to the field of prefix + if( term->field() != NULL ) { + //Append the field of prefix to the buffer + buffer.append(term->field()); + //Append a colon + buffer.append(_T(":") ); + } + //Append the text of the prefix + buffer.append(term->text()); + + //Convert StringBuffer buffer to TCHAR block and return it + return buffer.toString(); +} + + +/** Returns a BitSet with true for documents which should be permitted in +search results, and false for those that should not. */ +BitSet* WildcardFilter::bits( IndexReader* reader ) +{ + BitSet* bts = _CLNEW BitSet( reader->maxDoc() ); + + WildcardTermEnum termEnum (reader, term); + if (termEnum.term(false) == NULL) + return bts; + + TermDocs* termDocs = reader->termDocs(); + try{ + do{ + termDocs->seek(&termEnum); + + while (termDocs->next()) { + bts->set(termDocs->doc()); + } + }while(termEnum.next()); + } _CLFINALLY( + termDocs->close(); + _CLDELETE(termDocs); + termEnum.close(); + ) + + return bts; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.h b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.h new file mode 100644 index 000000000..cfc38f648 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardQuery.h @@ -0,0 +1,69 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_WildcardQuery_ +#define _lucene_search_WildcardQuery_ +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "MultiTermQuery.h" +#include "WildcardTermEnum.h" + +CL_NS_DEF(search) + + /** Implements the wildcard search query. Supported wildcards are *, which + * matches any character sequence (including the empty one), and ?, + * which matches any single character. Note this query can be slow, as it + * needs to iterate over all terms. In order to prevent extremely slow WildcardQueries, + * a Wildcard term must not start with one of the wildcards * or + * ?. + * + * @see WildcardTermEnum + */ + class WildcardQuery: public MultiTermQuery { + protected: + FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader); + WildcardQuery(const WildcardQuery& clone); + public: + WildcardQuery(CL_NS(index)::Term* term); + ~WildcardQuery(); + + //Returns the string "WildcardQuery" + const TCHAR* getQueryName() const; + static const TCHAR* getClassName(); + + size_t hashCode() const; + bool equals(Query* other) const; + Query* clone() const; + }; + + + +class WildcardFilter: public Filter +{ +private: + CL_NS(index)::Term* term; +protected: + WildcardFilter( const WildcardFilter& copy ); + +public: + WildcardFilter(CL_NS(index)::Term* term); + ~WildcardFilter(); + + /** Returns a BitSet with true for documents which should be permitted in + search results, and false for those that should not. */ + CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader ); + + Filter* clone() const; + TCHAR* toString(); +}; + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp new file mode 100644 index 000000000..bed9e6e0c --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.cpp @@ -0,0 +1,150 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "WildcardTermEnum.h" + +CL_NS_USE(index) +CL_NS_DEF(search) + + bool WildcardTermEnum::termCompare(Term* term) { + if ( term!=NULL && __term->field() == term->field() ) { + const TCHAR* searchText = term->text(); + const TCHAR* patternText = __term->text(); + if ( _tcsncmp( searchText, pre, preLen ) == 0 ){ + return wildcardEquals(patternText+preLen, __term->textLength()-preLen, 0, searchText, term->textLength(), preLen); + } + } + _endEnum = true; + return false; + } + + /** Creates new WildcardTermEnum */ + WildcardTermEnum::WildcardTermEnum(IndexReader* reader, Term* term): + FilteredTermEnum(), + __term(_CL_POINTER(term)), + fieldMatch(false), + _endEnum(false) + { + + pre = stringDuplicate(term->text()); + + const TCHAR* sidx = _tcschr( pre, LUCENE_WILDCARDTERMENUM_WILDCARD_STRING ); + const TCHAR* cidx = _tcschr( pre, LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR ); + const TCHAR* tidx = sidx; + if (tidx == NULL) + tidx = cidx; + else if ( cidx && cidx > pre) + tidx = min(sidx, cidx); + CND_PRECONDITION(tidx != NULL, "tidx==NULL"); + int32_t idx = (int32_t)(tidx - pre); + preLen = idx; + CND_PRECONDITION(preLentextLength(), "preLen >= term->textLength()"); + pre[preLen]=0; //trim end + + Term* t = _CLNEW Term(__term, pre); + setEnum( reader->terms(t) ); + _CLDECDELETE(t); + } + + void WildcardTermEnum::close() + { + if ( __term != NULL ){ + FilteredTermEnum::close(); + + _CLDECDELETE(__term); + __term = NULL; + + _CLDELETE_CARRAY( pre ); + } + } + WildcardTermEnum::~WildcardTermEnum() { + close(); + } + + qreal WildcardTermEnum::difference() { + return 1.0f; + } + + bool WildcardTermEnum::endEnum() { + return _endEnum; + } + + bool WildcardTermEnum::wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx) + { + for (int32_t p = patternIdx; ; ++p) + { + for (int32_t s = stringIdx; ; ++p, ++s) + { + // End of str yet? + bool sEnd = (s >= strLen); + // End of pattern yet? + bool pEnd = (p >= patternLen); + + // If we're looking at the end of the str... + if (sEnd) + { + // Assume the only thing left on the pattern is/are wildcards + bool justWildcardsLeft = true; + + // Current wildcard position + int32_t wildcardSearchPos = p; + // While we haven't found the end of the pattern, + // and haven't encountered any non-wildcard characters + while (wildcardSearchPos < patternLen && justWildcardsLeft) + { + // Check the character at the current position + TCHAR wildchar = pattern[wildcardSearchPos]; + // If it's not a wildcard character, then there is more + // pattern information after this/these wildcards. + + if (wildchar != LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR && + wildchar != LUCENE_WILDCARDTERMENUM_WILDCARD_STRING){ + justWildcardsLeft = false; + }else{ + // to prevent "cat" matches "ca??" + if (wildchar == LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR) + return false; + + wildcardSearchPos++; // Look at the next character + } + } + + // This was a prefix wildcard search, and we've matched, so + // return true. + if (justWildcardsLeft) + return true; + } + + // If we've gone past the end of the str, or the pattern, + // return false. + if (sEnd || pEnd) + break; + + // Match a single character, so continue. + if (pattern[p] == LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR) + continue; + + if (pattern[p] == LUCENE_WILDCARDTERMENUM_WILDCARD_STRING) + { + // Look at the character beyond the '*'. + ++p; + // Examine the str, starting at the last character. + for (int32_t i = strLen; i >= s; --i) + { + if (wildcardEquals(pattern, patternLen, p, str, strLen, i)) + return true; + } + break; + } + if (pattern[p] != str[s]) + break; + } + return false; + } + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h new file mode 100644 index 000000000..2a0373540 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/search/WildcardTermEnum.h @@ -0,0 +1,67 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_search_WildcardTermEnum_ +#define _lucene_search_WildcardTermEnum_ +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/index/IndexReader.h" +#include "CLucene/index/Term.h" +#include "CLucene/index/Terms.h" +#include "FilteredTermEnum.h" + +CL_NS_DEF(search) + /** + * Subclass of FilteredTermEnum for enumerating all terms that match the + * specified wildcard filter term-> + *

+ * Term enumerations are always ordered by term->compareTo(). Each term in + * the enumeration is greater than all that precede it. + */ + class WildcardTermEnum: public FilteredTermEnum { + private: + CL_NS(index)::Term* __term; + TCHAR* pre; + int32_t preLen; + bool fieldMatch; + bool _endEnum; + + /******************************************** + * const TCHAR* equality with support for wildcards + ********************************************/ + + protected: + bool termCompare(CL_NS(index)::Term* term) ; + + public: + + /** + * Creates a new WildcardTermEnum. Passing in a + * {@link Term Term} that does not contain a + * LUCENE_WILDCARDTERMENUM_WILDCARD_STRING or + * LUCENE_WILDCARDTERMENUM_WILDCARD_CHAR will cause an exception to be thrown. + */ + WildcardTermEnum(CL_NS(index)::IndexReader* reader, CL_NS(index)::Term* term); + ~WildcardTermEnum(); + + qreal difference() ; + + bool endEnum() ; + + /** + * Determines if a word matches a wildcard pattern. + */ + static bool wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx); + + void close(); + + const char* getObjectName(){ return WildcardTermEnum::getClassName(); } + static const char* getClassName(){ return "WildcardTermEnum"; } + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/Directory.h b/src/assistant/3rdparty/clucene/src/CLucene/store/Directory.h new file mode 100644 index 000000000..818bc7af9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/Directory.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#ifndef _lucene_store_Directory +#define _lucene_store_Directory + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Lock.h" +#include "CLucene/util/VoidList.h" +#include "CLucene/util/Misc.h" + +#include "IndexInput.h" +#include "IndexOutput.h" + +CL_NS_DEF(store) + +/** A Directory is a flat list of files. Files may be written once, when they +* are created. Once a file is created it may only be opened for read, or +* deleted. Random access is permitted both when reading and writing. +* +*

Direct i/o is not used directly, but rather all i/o is +* through this API. This permits things such as:

    +*
  • implementation of RAM-based indices; +*
  • implementation indices stored in a database, via a database; +*
  • implementation of an index as a single file; +*
+* +*/ +class Directory : LUCENE_REFBASE +{ +protected: + Directory() {} + // Removes an existing file in the directory. + virtual bool doDeleteFile(const QString& name) = 0; + +public: + DEFINE_MUTEX(THIS_LOCK) + + virtual ~Directory() {}; + + // Returns an array of strings, one for each file in the directory. + virtual QStringList list() const = 0; + + // Returns true iff a file with the given name exists. + virtual bool fileExists(const QString& name) const = 0; + + // Returns the time the named file was last modified. + virtual int64_t fileModified(const QString& name) const = 0; + + // Returns the length of a file in the directory. + virtual int64_t fileLength(const QString& name) const = 0; + + // Returns a stream reading an existing file. + virtual IndexInput* openInput(const QString& name) = 0; + virtual IndexInput* openInput(const QString& name, int32_t bufferSize) + { + // didnt overload bufferSize + return openInput(name); + } + + // Set the modified time of an existing file to now. + virtual void touchFile(const QString& name) = 0; + + // Removes an existing file in the directory. + virtual bool deleteFile(const QString& name, const bool throwError = true) { + bool ret = doDeleteFile(name); + if (!ret && throwError) { + char buffer[200]; + _snprintf(buffer, 200, "couldn't delete file %s", + name.toLocal8Bit().constData()); + _CLTHROWA(CL_ERR_IO, buffer); + } + return ret; + } + + // Renames an existing file in the directory. + // If a file already exists with the new name, then it is replaced. + virtual void renameFile(const QString& from, const QString& to) = 0; + + // Creates a new, empty file in the directory with the given name. + // Returns a stream writing this file. + virtual IndexOutput* createOutput(const QString& name) = 0; + + // Construct a {@link Lock}. + // @param name the name of the lock file + virtual LuceneLock* makeLock(const QString& name) = 0; + + // Closes the store. + virtual void close() = 0; + + virtual QString toString() const = 0; + + virtual QString getDirectoryType() const = 0; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp new file mode 100644 index 000000000..5f96e91cd --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp @@ -0,0 +1,662 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#include +#include +#include +#include +#include + +#include "CLucene/StdHeader.h" +#include "FSDirectory.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/Misc.h" +#include "CLucene/debug/condition.h" + +CL_NS_DEF(store) +CL_NS_USE(util) + +bool FSDirectory::disableLocks = false; + +// This cache of directories ensures that there is a unique Directory instance +// per path, so that synchronization on the Directory can be used to synchronize +// access between readers and writers. +static CL_NS(util)::CLHashMap DIRECTORIES(false, false); + +// # pragma mark -- FSDirectory::FSLock + +FSDirectory::FSLock::FSLock(const QString& _lockDir, const QString& name) + : lockDir(_lockDir) + , lockFile(_lockDir + QDir::separator() + name) +{ +} + +FSDirectory::FSLock::~FSLock() +{ +} + +bool FSDirectory::FSLock::obtain() +{ + if (disableLocks) + return true; + + if (QFile::exists(lockFile)) + return false; + + QDir dir(lockDir); + if (!dir.exists()) { + if (!dir.mkpath(lockDir)) { + // 34: len of "Couldn't create lock directory: " + char* err = _CL_NEWARRAY( + char, 34 + strlen(lockDir.toLocal8Bit().constData()) + 1); + strcpy(err, "Couldn't create lock directory: "); + strcat(err, lockDir.toLocal8Bit().constData()); + _CLTHROWA_DEL(CL_ERR_IO, err); + } + } + + QFile file(lockFile); + return file.open(QIODevice::ReadWrite); +} + +void FSDirectory::FSLock::release() +{ + if (disableLocks) + return; + + QFile file(lockFile); + file.remove(); +} + +bool FSDirectory::FSLock::isLocked() +{ + if (disableLocks) + return false; + return QFile::exists(lockFile); +} + +QString FSDirectory::FSLock::toString() const +{ + QString ret(QLatin1String("Lock@")); + return ret.append(lockFile); +} + +// # pragma mark -- FSDirectory::FSIndexInput + +FSDirectory::FSIndexInput::FSIndexInput(const QString& path, int32_t bufferSize) + : BufferedIndexInput(bufferSize) +{ + CND_PRECONDITION(!path.isEmpty(), "path is NULL"); + + handle = _CLNEW SharedHandle(); + handle->fhandle.setFileName(path); + handle->fhandle.open(QIODevice::ReadOnly); + + if (handle->fhandle.error() != QFile::NoError) { + switch(handle->fhandle.error()) { + case 1: + _CLTHROWA(CL_ERR_IO, "An error occurred when reading from the file"); + break; + case 2: + _CLTHROWA(CL_ERR_IO, "An error occurred when writing to the file."); + break; + case 5: + _CLTHROWA(CL_ERR_IO, "The file could not be opened."); + break; + case 6: + _CLTHROWA(CL_ERR_IO, "The operation was aborted."); + break; + case 7: + _CLTHROWA(CL_ERR_IO, "A timeout occurred."); + break; + case 8: + _CLTHROWA(CL_ERR_IO, "An unspecified error occurred."); + break; + case 9: + _CLTHROWA(CL_ERR_IO, "The file could not be removed."); + break; + case 10: + _CLTHROWA(CL_ERR_IO, "The file could not be renamed."); + break; + case 11: + _CLTHROWA(CL_ERR_IO, "The position in the file could not be changed."); + break; + case 12: + _CLTHROWA(CL_ERR_IO, "The file could not be resized.e"); + break; + case 13: + _CLTHROWA(CL_ERR_IO, "The file could not be accessed."); + break; + case 14: + _CLTHROWA(CL_ERR_IO, "The file could not be copied."); + break; + case 4: + default: + _CLTHROWA(CL_ERR_IO, "A fatal error occurred."); + } + } + + //Store the file length + handle->_length = handle->fhandle.size(); + handle->_fpos = 0; + this->_pos = 0; +} + +FSDirectory::FSIndexInput::FSIndexInput(const FSIndexInput& other) + : BufferedIndexInput(other) +{ + if (other.handle == NULL) + _CLTHROWA(CL_ERR_NullPointer, "other handle is null"); + + SCOPED_LOCK_MUTEX(*other.handle->THIS_LOCK) + + _pos = other.handle->_fpos; + handle = _CL_POINTER(other.handle); +} + +FSDirectory::FSIndexInput::~FSIndexInput() +{ + FSIndexInput::close(); +} + +void FSDirectory::FSIndexInput::close() +{ + BufferedIndexInput::close(); +#ifdef _LUCENE_THREADMUTEX + if (handle != NULL) { + // Here we have a bit of a problem... We need to lock the handle to + // ensure that we can safely delete the handle... But if we delete the + // handle, then the scoped unlock, won't be able to unlock the mutex... + + // take a reference of the lock object... + _LUCENE_THREADMUTEX* mutex = handle->THIS_LOCK; + //lock the mutex + mutex->lock(); + + // determine if we are about to delete the handle... + bool doUnlock = (handle->__cl_refcount > 1); + // decdelete (deletes if refcount is down to 0) + _CLDECDELETE(handle); + + if (doUnlock) + mutex->unlock(); + else + delete mutex; + } +#else + _CLDECDELETE(handle); +#endif +} + +IndexInput* FSDirectory::FSIndexInput::clone() const +{ + return _CLNEW FSDirectory::FSIndexInput(*this); +} + +void FSDirectory::FSIndexInput::seekInternal(const int64_t position) +{ + CND_PRECONDITION(position >= 0 && position < handle->_length, + "Seeking out of range") + _pos = position; +} + +void FSDirectory::FSIndexInput::readInternal(uint8_t* b, const int32_t len) +{ + SCOPED_LOCK_MUTEX(*handle->THIS_LOCK) + + CND_PRECONDITION(handle != NULL, "shared file handle has closed"); + CND_PRECONDITION(handle->fhandle.isOpen(), "file is not open"); + + if (handle->_fpos != _pos) { + handle->fhandle.seek(_pos); + if (handle->fhandle.pos() != _pos) + _CLTHROWA( CL_ERR_IO, "File IO Seek error"); + handle->_fpos = _pos; + } + + bufferLength = (int32_t)handle->fhandle.read((char*)b, len); + if (bufferLength == 0) + _CLTHROWA(CL_ERR_IO, "read past EOF"); + + if (bufferLength == -1) + _CLTHROWA(CL_ERR_IO, "read error"); + + _pos += bufferLength; + handle->_fpos =_pos; +} + +// # pragma mark -- FSDirectory::FSIndexInput::SharedHandle + +FSDirectory::FSIndexInput::SharedHandle::SharedHandle() + : _fpos(0) + , _length(0) +{ +#ifdef _LUCENE_THREADMUTEX + THIS_LOCK = new _LUCENE_THREADMUTEX; +#endif +} + +FSDirectory::FSIndexInput::SharedHandle::~SharedHandle() +{ + if (fhandle.isOpen()) + fhandle.close(); +} + +// # pragma mark -- FSDirectory::FSIndexOutput + +FSDirectory::FSIndexOutput::FSIndexOutput(const QString& path) +{ + //O_BINARY - Opens file in binary (untranslated) mode + //O_CREAT - Creates and opens new file for writing. Has no effect if file specified by filename exists + //O_RANDOM - Specifies that caching is optimized for, but not restricted to, random access from disk. + //O_WRONLY - Opens file for writing only; + fhandle.setFileName(path); + fhandle.open(QIODevice::ReadWrite | QIODevice::Truncate); + + if (fhandle.error() != QFile::NoError) { + switch(fhandle.error()) { + case 1: + _CLTHROWA(CL_ERR_IO, "An error occurred when reading from the file"); + break; + case 2: + _CLTHROWA(CL_ERR_IO, "An error occurred when writing to the file."); + break; + case 5: + _CLTHROWA(CL_ERR_IO, "The file could not be opened."); + break; + case 6: + _CLTHROWA(CL_ERR_IO, "The operation was aborted."); + break; + case 7: + _CLTHROWA(CL_ERR_IO, "A timeout occurred."); + break; + case 8: + _CLTHROWA(CL_ERR_IO, "An unspecified error occurred."); + break; + case 9: + _CLTHROWA(CL_ERR_IO, "The file could not be removed."); + break; + case 10: + _CLTHROWA(CL_ERR_IO, "The file could not be renamed."); + break; + case 11: + _CLTHROWA(CL_ERR_IO, "The position in the file could not be changed."); + break; + case 12: + _CLTHROWA(CL_ERR_IO, "The file could not be resized.e"); + break; + case 13: + _CLTHROWA(CL_ERR_IO, "The file could not be accessed."); + break; + case 14: + _CLTHROWA(CL_ERR_IO, "The file could not be copied."); + break; + case 4: + default: + _CLTHROWA(CL_ERR_IO, "A fatal error occurred."); + } + } +} + +FSDirectory::FSIndexOutput::~FSIndexOutput() +{ + if (fhandle.isOpen()) { + try { + FSIndexOutput::close(); + } catch (CLuceneError& err) { + //ignore IO errors... + if (err.number() != CL_ERR_IO) + throw; + } + } +} + +void FSDirectory::FSIndexOutput::close() +{ + try { + BufferedIndexOutput::close(); + } catch (CLuceneError& err) { + //ignore IO errors... + if (err.number() != CL_ERR_IO) + throw; + } + fhandle.close(); +} + +int64_t FSDirectory::FSIndexOutput::length() +{ + CND_PRECONDITION(fhandle.isOpen(), "file is not open"); + return fhandle.size(); +} + +void FSDirectory::FSIndexOutput::seek(const int64_t pos) +{ + CND_PRECONDITION(fhandle.isOpen(), "file is not open"); + + BufferedIndexOutput::seek(pos); + fhandle.seek(pos); + if (fhandle.pos() != pos) + _CLTHROWA(CL_ERR_IO, "File IO Seek error"); +} + +void FSDirectory::FSIndexOutput::flushBuffer(const uint8_t* b, const int32_t size) +{ + CND_PRECONDITION(fhandle.isOpen(), "file is not open"); + + if (size > 0 && fhandle.write((const char*)b, size) != size) + _CLTHROWA(CL_ERR_IO, "File IO Write error"); +} + +// # pragma mark -- FSDirectory + +FSDirectory::FSDirectory(const QString& path, const bool createDir) + : Directory() + , refCount(0) + , useMMap(false) +{ + //set a realpath so that if we change directory, we can still function + directory = QFileInfo(path).absoluteFilePath(); + lockDir = directory; + + QDir dir(lockDir); + if (!dir.exists()) { + if (!dir.mkpath(lockDir)) + _CLTHROWA_DEL(CL_ERR_IO, "Cannot create temp directory"); + } + + QFileInfo info(lockDir); + if (info.isFile() || info.isSymLink()) + _CLTHROWA(CL_ERR_IO, "Found regular file where directory expected"); + + if (createDir) + create(); + + dir.setPath(directory); + if (!dir.exists()) { + //19: len of " is not a directory" + char* err = + _CL_NEWARRAY(char, 19 + strlen(path.toLocal8Bit().constData()) + 1); + strcpy(err, path.toLocal8Bit().constData()); + strcat(err, " is not a directory"); + _CLTHROWA_DEL(CL_ERR_IO, err); + } +} + +void FSDirectory::create() +{ + SCOPED_LOCK_MUTEX(THIS_LOCK) + + bool clear = false; + QDir dir(directory); + if (!dir.exists()) { + if (!dir.mkpath(directory)) { + char* err = _CL_NEWARRAY( // 27 len of "Couldn't create directory:" + char, 27 + strlen(directory.toLocal8Bit().constData()) + 1); + strcpy(err, "Couldn't create directory: "); + strcat(err, directory.toLocal8Bit().constData()); + _CLTHROWA_DEL(CL_ERR_IO, err); + } + } else { + clear = true; + } + + QFileInfo info(directory); + if (info.isFile() || info.isSymLink()) { + char tmp[1024]; + _snprintf(tmp, 1024, "%s not a directory", + directory.toLocal8Bit().constData()); + _CLTHROWA(CL_ERR_IO, tmp); + } + + if (clear) { + dir.setPath(directory); + // clear probably existing lucene index files + QStringList fileList = dir.entryList(QDir::Files | QDir::Hidden + | QDir::NoSymLinks); + foreach(const QString file, fileList) { + if (CL_NS(index)::IndexReader::isLuceneFile(file)) { + if (!dir.remove(file)) + _CLTHROWA(CL_ERR_IO, "Couldn't delete file "); + } + } + + // clear probably existing file locks + QFileInfo dirInfo(lockDir); + if (dirInfo.exists() && dirInfo.isReadable() && dirInfo.isWritable() + && !dirInfo.isFile() && !dirInfo.isSymLink()) { + QDir lockDirectory(lockDir); + fileList = dir.entryList(QStringList() << getLockPrefix() + + QLatin1Char('*'), QDir::Files | QDir::Hidden | QDir::NoSymLinks); + + foreach(const QString file, fileList) { + if (!lockDirectory.remove(file)) + _CLTHROWA(CL_ERR_IO, "Couldn't delete file "); + } + } + else { + //todo: richer error: + lockDir.getAbsolutePath()); + _CLTHROWA(CL_ERR_IO, "Cannot read lock directory"); + } + } +} + +void FSDirectory::priv_getFN(QString& buffer, const QString& name) const +{ + buffer.clear(); + buffer.append(directory); + buffer.append(QDir::separator()); + buffer.append(name); +} + +FSDirectory::~FSDirectory() +{ +} + +QStringList FSDirectory::list() const +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QDir dir(directory); + return dir.entryList(QDir::Files | QDir::Hidden); +} + +bool FSDirectory::fileExists(const QString& name) const +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QDir dir(directory); + return dir.entryList().contains(name); +} + +QString FSDirectory::getDirName() const +{ + return directory; +} + +//static +FSDirectory* FSDirectory::getDirectory(const QString& file, const bool _create) +{ + FSDirectory* dir = NULL; + { + if (file.isEmpty()) + _CLTHROWA(CL_ERR_IO, "Invalid directory"); + + SCOPED_LOCK_MUTEX(DIRECTORIES.THIS_LOCK) + dir = DIRECTORIES.get(file); + if ( dir == NULL ){ + dir = _CLNEW FSDirectory(file, _create); + DIRECTORIES.put(dir->directory, dir); + } else if (_create) { + dir->create(); + } + + { + SCOPED_LOCK_MUTEX(dir->THIS_LOCK) + dir->refCount++; + } + } + + return _CL_POINTER(dir); +} + +int64_t FSDirectory::fileModified(const QString& name) const +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QFileInfo fInfo(directory + QDir::separator() + name); + return fInfo.lastModified().toTime_t(); +} + +//static +int64_t FSDirectory::fileModified(const QString& dir, const QString& name) +{ + QFileInfo fInfo(dir + QDir::separator() + name); + return fInfo.lastModified().toTime_t(); +} + +void FSDirectory::touchFile(const QString& name) +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QFile file(directory + QDir::separator() + name); + if (!file.open(QIODevice::ReadWrite)) + _CLTHROWA(CL_ERR_IO, "IO Error while touching file"); +} + +int64_t FSDirectory::fileLength(const QString& name) const +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QFileInfo fInfo(directory + QDir::separator() + name); + return fInfo.size(); +} + +IndexInput* FSDirectory::openInput(const QString& name) +{ + return openInput(name, CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); +} + +IndexInput* FSDirectory::openInput(const QString& name, int32_t bufferSize ) +{ + CND_PRECONDITION(directory[0]!=0,"directory is not open") + + return _CLNEW FSIndexInput(directory + QDir::separator() + name, bufferSize); +} + +void FSDirectory::close() +{ + SCOPED_LOCK_MUTEX(DIRECTORIES.THIS_LOCK) + { + SCOPED_LOCK_MUTEX(THIS_LOCK) + + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + //refcount starts at 1 + if (--refCount <= 0) { + Directory* dir = DIRECTORIES.get(getDirName()); + if (dir) { + //this will be removed in ~FSDirectory + DIRECTORIES.remove(getDirName()); + _CLDECDELETE(dir); + } + } + } +} + +QString FSDirectory::getLockPrefix() const +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QString dirName(QFileInfo(directory).absoluteFilePath()); + if (dirName.isEmpty()) + _CLTHROWA(CL_ERR_Runtime, "Invalid directory path"); + + // to be compatible with jlucene, + // we need to make some changes ... + if (dirName.at(1) == QLatin1Char(':')) + dirName[0] = dirName.at(0).toUpper(); + + TCHAR tBuffer[2048] = { 0 }; + dirName.toWCharArray(tBuffer); + + char aBuffer[4096] = { 0 }; + STRCPY_TtoA(aBuffer, tBuffer, 4096); + + QString string(QLatin1String("lucene-")); + QByteArray hash(QCryptographicHash::hash(aBuffer, QCryptographicHash::Md5)); + + // TODO: verify this !!! + return string.append(QLatin1String(hash.toHex().constData())); +} + +bool FSDirectory::doDeleteFile(const QString& name) +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QDir dir(directory); + return dir.remove(name); +} + +void FSDirectory::renameFile(const QString& from, const QString& to) +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + SCOPED_LOCK_MUTEX(THIS_LOCK) + + if (fileExists(to)) + deleteFile(to, false); + + QFile file(directory + QDir::separator() + from); + QString newFile(directory + QDir::separator() + to); + if (!file.rename(newFile)) { + // try a second time if we fail + if (fileExists(to)) + deleteFile(to, false); + + if (!file.rename(newFile)) { + QString error(QLatin1String("Could not rename: %1 to %2!!!!")); + error.arg(from).arg(newFile); + QByteArray bArray(error.toLocal8Bit()); + _CLTHROWA(CL_ERR_IO, bArray.constData()); + } + } +} + +IndexOutput* FSDirectory::createOutput(const QString& name) +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + QString file = directory + QDir::separator() + name; + if (QFileInfo(file).exists()) { + if (!QFile::remove(file)) { + QByteArray bArray("Cannot overwrite: "); + bArray.append(name.toLocal8Bit()); + _CLTHROWA(CL_ERR_IO, bArray.constData()); + } + } + return _CLNEW FSIndexOutput(file); +} + +LuceneLock* FSDirectory::makeLock(const QString& name) +{ + CND_PRECONDITION(!directory.isEmpty(), "directory is not open"); + + + QString lockFile(getLockPrefix()); + lockFile.append(QLatin1Char('-')).append(name); + + return _CLNEW FSLock(lockDir, lockFile); +} + +QString FSDirectory::toString() const +{ + return QString::fromLatin1("FSDirectory@").append(directory); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.h b/src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.h new file mode 100644 index 000000000..e967380e0 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/FSDirectory.h @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#ifndef _lucene_store_FSDirectory_ +#define _lucene_store_FSDirectory_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include +#include + +#include "Directory.h" +#include "Lock.h" +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/StringBuffer.h" + +CL_NS_DEF(store) + +/** +* Straightforward implementation of {@link Directory} as a directory of files. +*

If the system property 'disableLuceneLocks' has the String value of +* "true", lock creation will be disabled. +* +* @see Directory +*/ +class FSDirectory : public Directory +{ +public: + // Destructor - only call this if you are sure the directory + // is not being used anymore. Otherwise use the ref-counting + // facilities of _CLDECDELETE + ~FSDirectory(); + + // Get a list of strings, one for each file in the directory. + QStringList list() const; + + // Returns true iff a file with the given name exists. + bool fileExists(const QString& name) const; + + // Returns the text name of the directory + QString getDirName() const; ///Directories are cached, so that, for a given canonical path, the same + FSDirectory instance will always be returned. This permits + synchronization on directories. + + @param file the path to the directory. + @param create if true, create, or erase any existing contents. + @return the FSDirectory for the named file. + */ + static FSDirectory* getDirectory(const QString& file, const bool create); + + // Returns the time the named file was last modified. + int64_t fileModified(const QString& name) const; + + //static + // Returns the time the named file was last modified. + static int64_t fileModified(const QString& dir, const QString& name); + + // static + // Returns the length in bytes of a file in the directory. + int64_t fileLength(const QString& name) const; + + // Returns a stream reading an existing file. + IndexInput* openInput(const QString& name); + IndexInput* openInput(const QString& name, int32_t bufferSize); + + // Renames an existing file in the directory. + void renameFile(const QString& from, const QString& to); + + // Set the modified time of an existing file to now. + void touchFile(const QString& name); + + // Creates a new, empty file in the directory with the given name. + // Returns a stream writing this file. + IndexOutput* createOutput(const QString& name); + + // Construct a {@link Lock}. + // @param name the name of the lock file + LuceneLock* makeLock(const QString& name); + + // Decrease the ref-count to the directory by one. If the object is no + // longer needed, then the object is removed from the directory pool. + void close(); + + // If MMap is available, this can disable use of mmap reading. + void setUseMMap(bool value) { useMMap = value; } + + // Gets whether the directory is using MMap for inputstreams. + bool getUseMMap() const { return useMMap; } + + QString toString() const; + + static QString DirectoryType() { return QLatin1String("FS"); } + QString getDirectoryType() const { return QLatin1String("FS"); } + + // Set whether Lucene's use of lock files is disabled. By default, + // lock files are enabled. They should only be disabled if the index + // is on a read-only medium like a CD-ROM. + static void setDisableLocks(bool doDisableLocks) + { disableLocks = doDisableLocks; } + + // Returns whether Lucene's use of lock files is disabled. + // @return true if locks are disabled, false if locks are enabled. + static bool getDisableLocks() { return disableLocks; } + +protected: + FSDirectory(const QString& path, const bool createDir); + // Removes an existing file in the directory. + bool doDeleteFile(const QString& name); + +private: + class FSLock : public LuceneLock { + public: + FSLock (const QString& lockDir, const QString& name); + ~FSLock(); + + bool obtain(); + void release(); + bool isLocked(); + QString toString() const; + + QString lockDir; + QString lockFile; + }; + friend class FSDirectory::FSLock; + + class FSIndexInput : public BufferedIndexInput { + public: + FSIndexInput(const QString& path, int32_t bufferSize = + CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); + ~FSIndexInput(); + + void close(); + IndexInput* clone() const; + + int64_t length() + { return handle->_length; } + + QString getDirectoryType() const + { return FSDirectory::DirectoryType(); } + + protected: + FSIndexInput(const FSIndexInput& clone); + // Random-access methods + void seekInternal(const int64_t position); + // IndexInput methods + void readInternal(uint8_t* b, const int32_t len); + + private: + // We used a shared handle between all the fsindexinput clones. + // This reduces number of file handles we need, and it means + // we dont have to use file tell (which is slow) before doing a read. + class SharedHandle : LUCENE_REFBASE { + public: + SharedHandle(); + ~SharedHandle(); + + int64_t _fpos; + int64_t _length; + + QFile fhandle; + DEFINE_MUTEX(*THIS_LOCK) + }; + SharedHandle* handle; + int64_t _pos; + }; + friend class FSDirectory::FSIndexInput; + + class FSIndexOutput : public BufferedIndexOutput { + public: + FSIndexOutput(const QString& path); + ~FSIndexOutput(); + + void close(); + int64_t length(); + void seek(const int64_t pos); + + protected: + void flushBuffer(const uint8_t* b, const int32_t size); + + private: + QFile fhandle; + }; + friend class FSDirectory::FSIndexOutput; + +private: + QString directory; + int refCount; + void create(); + + QString lockDir; + QString getLockPrefix() const; + static bool disableLocks; + + void priv_getFN(QString& buffer, const QString& name) const; + bool useMMap; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.cpp new file mode 100644 index 000000000..cf7bd16b7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.cpp @@ -0,0 +1,233 @@ + /*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "IndexInput.h" + +CL_NS_USE(util) +CL_NS_DEF(store) + + IndexInput::IndexInput() + { + } + IndexInput::IndexInput(const IndexInput& other) + { + } + + int32_t IndexInput::readInt() { + int32_t b = (readByte() << 24); + b |= (readByte() << 16); + b |= (readByte() << 8); + return (b | readByte()); + } + + int32_t IndexInput::readVInt() { + uint8_t b = readByte(); + int32_t i = b & 0x7F; + for (int32_t shift = 7; (b & 0x80) != 0; shift += 7) { + b = readByte(); + i |= (b & 0x7F) << shift; + } + return i; + } + + int64_t IndexInput::readLong() { + int64_t i = ((int64_t)readInt() << 32); + return (i | ((int64_t)readInt() & 0xFFFFFFFFL)); + } + + int64_t IndexInput::readVLong() { + uint8_t b = readByte(); + int64_t i = b & 0x7F; + for (int32_t shift = 7; (b & 0x80) != 0; shift += 7) { + b = readByte(); + i |= (((int64_t)b) & 0x7FL) << shift; + } + return i; + } + + void IndexInput::skipChars( const int32_t count) { + for (int32_t i = 0; i < count; i++) { + TCHAR b = readByte(); + if ((b & 0x80) == 0) { + // Do Nothing. + } else if ((b & 0xE0) != 0xE0) { + readByte(); + } else { + readByte(); + readByte(); + } + } + } + + int32_t IndexInput::readString(TCHAR* buffer, const int32_t maxLength){ + int32_t len = readVInt(); + int32_t ml=maxLength-1; + if ( len >= ml ){ + readChars(buffer, 0, ml); + buffer[ml] = 0; + //we have to finish reading all the data for this string! + if ( len-ml > 0 ){ + //seek(getFilePointer()+(len-ml)); <- that was the wrong way to "finish reading" + skipChars(len-ml); + } + return ml; + }else{ + readChars(buffer, 0, len); + buffer[len] = 0; + return len; + } + } + + TCHAR* IndexInput::readString(const bool _unique){ + int32_t len = readVInt(); + + if ( len == 0){ + if ( _unique ) //todo: does non unique ever occur? + return stringDuplicate(LUCENE_BLANK_STRING); + else + return LUCENE_BLANK_STRING; + } + + TCHAR* ret = _CL_NEWARRAY(TCHAR,len+1); + readChars(ret, 0, len); + ret[len] = 0; + + return ret; + } + + void IndexInput::readChars( TCHAR* buffer, const int32_t start, const int32_t len) { + const int32_t end = start + len; + TCHAR b; + for (int32_t i = start; i < end; ++i) { + b = readByte(); + if ((b & 0x80) == 0) { + b = (b & 0x7F); + } else if ((b & 0xE0) != 0xE0) { + b = (((b & 0x1F) << 6) + | (readByte() & 0x3F)); + } else { + b = ((b & 0x0F) << 12) | ((readByte() & 0x3F) << 6); + b |= (readByte() & 0x3F); + } + buffer[i] = b; + } + } + + + + + + +BufferedIndexInput::BufferedIndexInput(int32_t _bufferSize): + buffer(NULL), + bufferSize(_bufferSize), + bufferStart(0), + bufferLength(0), + bufferPosition(0) + { + } + + BufferedIndexInput::BufferedIndexInput(const BufferedIndexInput& other): + IndexInput(other), + buffer(NULL), + bufferSize(other.bufferSize), + bufferStart(other.bufferStart), + bufferLength(other.bufferLength), + bufferPosition(other.bufferPosition) + { + /* DSR: Does the fact that sometime clone.buffer is not NULL even when + ** clone.bufferLength is zero indicate memory corruption/leakage? + ** if ( clone.buffer != NULL) { */ + if (other.bufferLength != 0 && other.buffer != NULL) { + buffer = _CL_NEWARRAY(uint8_t,bufferLength); + memcpy(buffer,other.buffer,bufferLength * sizeof(uint8_t)); + } + } + + void BufferedIndexInput::readBytes(uint8_t* b, const int32_t len){ + if (len < bufferSize) { + for (int32_t i = 0; i < len; ++i) // read byte-by-byte + b[i] = readByte(); + } else { // read all-at-once + int64_t start = getFilePointer(); + seekInternal(start); + readInternal(b, len); + + bufferStart = start + len; // adjust stream variables + bufferPosition = 0; + bufferLength = 0; // trigger refill() on read + } + } + + int64_t BufferedIndexInput::getFilePointer() const{ + return bufferStart + bufferPosition; + } + + void BufferedIndexInput::seek(const int64_t pos) { + if ( pos < 0 ) + _CLTHROWA(CL_ERR_IO, "IO Argument Error. Value must be a positive value."); + if (pos >= bufferStart && pos < (bufferStart + bufferLength)) + bufferPosition = (int32_t)(pos - bufferStart); // seek within buffer + else { + bufferStart = pos; + bufferPosition = 0; + bufferLength = 0; // trigger refill() on read() + seekInternal(pos); + } + } + void BufferedIndexInput::close(){ + _CLDELETE_ARRAY(buffer); + bufferLength = 0; + bufferPosition = 0; + bufferStart = 0; + } + + + BufferedIndexInput::~BufferedIndexInput(){ + BufferedIndexInput::close(); + } + + void BufferedIndexInput::refill() { + int64_t start = bufferStart + bufferPosition; + int64_t end = start + bufferSize; + if (end > length()) // don't read past EOF + end = length(); + bufferLength = (int32_t)(end - start); + if (bufferLength == 0) + _CLTHROWA(CL_ERR_IO, "IndexInput read past EOF"); + + if (buffer == NULL){ + buffer = _CL_NEWARRAY(uint8_t,bufferSize); // allocate buffer lazily + } + readInternal(buffer, bufferLength); + + + bufferStart = start; + bufferPosition = 0; + } + + +IndexInputStream::IndexInputStream(IndexInput* input){ + this->input = input; + this->size = input->length(); + this->position = input->getFilePointer(); +} +IndexInputStream::~IndexInputStream(){ +} +int32_t IndexInputStream::fillBuffer(char* start, int32_t space){ + int64_t avail = input->length()-input->getFilePointer(); + if ( avail == 0 ) + return -1; + else if ( availreadBytes((uint8_t*)start,space); + return space; +} + +CL_NS_END + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.h b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.h new file mode 100644 index 000000000..9453b5cf1 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexInput.h @@ -0,0 +1,190 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_store_IndexInput_ +#define _lucene_store_IndexInput_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/util/bufferedstream.h" +#include "IndexOutput.h" + +CL_NS_DEF(store) + + /** Abstract base class for input from a file in a {@link Directory}. A + * random-access input stream. Used for all Lucene index input operations. + * @see Directory + * @see IndexOutput + */ + class IndexInput: LUCENE_BASE { + private: + void skipChars( const int32_t count); + protected: + IndexInput(); + IndexInput(const IndexInput& clone); + public: + virtual ~IndexInput(){} + virtual IndexInput* clone() const =0; + + DEFINE_MUTEX(THIS_LOCK) + + /** Reads and returns a single byte. + * @see IndexOutput#writeByte(byte) + */ + virtual uint8_t readByte() =0; + + /** Reads a specified number of bytes into an array at the specified offset. + * @param b the array to read bytes into + * @param offset the offset in the array to start storing bytes + * @param len the number of bytes to read + * @see IndexOutput#writeBytes(byte[],int32_t) + */ + virtual void readBytes(uint8_t* b, const int32_t len) =0; + + /** Reads four bytes and returns an int. + * @see IndexOutput#writeInt(int32_t) + */ + int32_t readInt(); + + /** Reads an int stored in variable-length format. Reads between one and + * five bytes. Smaller values take fewer bytes. Negative numbers are not + * supported. + * @see IndexOutput#writeVInt(int32_t) + */ + virtual int32_t readVInt(); + + /** Reads eight bytes and returns a long. + * @see IndexOutput#writeLong(long) + */ + int64_t readLong(); + + /** Reads a long stored in variable-length format. Reads between one and + * nine bytes. Smaller values take fewer bytes. Negative numbers are not + * supported. */ + int64_t readVLong(); + + /** Reads a string. + * @see IndexOutput#writeString(String) + * maxLength is the amount read into the buffer, the whole string is still read from the stream + * returns the amount read + */ + int32_t readString(TCHAR* buffer, const int32_t maxlength); + + /** Reads a string. + * @see IndexOutput#writeString(String) + * If unique is true (default) the string will be duplicated. + * If false and the length is zero, LUCENE_BLANK_STRING is returned + */ + TCHAR* readString(const bool unique=true); + + + /** Reads UTF-8 encoded characters into an array. + * @param buffer the array to read characters into + * @param start the offset in the array to start storing characters + * @param length the number of characters to read + * @see IndexOutput#writeChars(String,int32_t,int32_t) + */ + void readChars( TCHAR* buffer, const int32_t start, const int32_t len); + + /** Closes the stream to futher operations. */ + virtual void close() =0; + + /** Returns the current position in this file, where the next read will + * occur. + * @see #seek(long) + */ + virtual int64_t getFilePointer() const =0; + + /** Sets current position in this file, where the next read will occur. + * @see #getFilePointer() + */ + virtual void seek(const int64_t pos) =0; + + /** The number of bytes in the file. */ + virtual int64_t length() = 0; + + virtual QString getDirectoryType() const = 0; + }; + + /** Abstract base class for input from a file in a {@link Directory}. A + * random-access input stream. Used for all Lucene index input operations. + * @see Directory + * @see IndexOutput + */ + class BufferedIndexInput: public IndexInput{ + private: + uint8_t* buffer; //array of bytes + void refill(); + protected: + int32_t bufferSize; //size of the buffer + int64_t bufferStart; // position in file of buffer + int32_t bufferLength; // end of valid l_byte_ts + int32_t bufferPosition; // next uint8_t to read + + /** Returns a clone of this stream. + * + *

Clones of a stream access the same data, and are positioned at the same + * point as the stream they were cloned from. + * + *

Expert: Subclasses must ensure that clones may be positioned at + * different points in the input from each other and from the stream they + * were cloned from. + */ + BufferedIndexInput(const BufferedIndexInput& clone); + BufferedIndexInput(int32_t bufferSize = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); + public: + + virtual ~BufferedIndexInput(); + virtual IndexInput* clone() const = 0; + void close(); + inline uint8_t readByte(){ + if (bufferPosition >= bufferLength) + refill(); + + return buffer[bufferPosition++]; + } + void readBytes(uint8_t* b, const int32_t len); + int64_t getFilePointer() const; + void seek(const int64_t pos); + + protected: + /** Expert: implements buffer refill. Reads bytes from the current position + * in the input. + * @param b the array to read bytes into + * @param offset the offset in the array to start storing bytes + * @param length the number of bytes to read + */ + virtual void readInternal(uint8_t* b, const int32_t len) = 0; + + /** Expert: implements seek. Sets current position in this file, where the + * next {@link #readInternal(byte[],int32_t,int32_t)} will occur. + * @see #readInternal(byte[],int32_t,int32_t) + */ + virtual void seekInternal(const int64_t pos) = 0; + }; + + /** + * JStream InputStream which reads from an IndexInput. This class is + * used by the FieldReader to create binary fields. You can then use + * a GZipInputStream to read compressed data or any of the other + * JStream stream types. + * + */ + class IndexInputStream: public jstreams::BufferedInputStream{ + IndexInput* input; + public: + IndexInputStream(IndexInput* input); + ~IndexInputStream(); + int32_t fillBuffer(char* start, int32_t space); + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp new file mode 100644 index 000000000..04f78c348 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.cpp @@ -0,0 +1,163 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "IndexOutput.h" + +CL_NS_USE(util) +CL_NS_DEF(store) + + + IndexOutput::IndexOutput() + { + } + + IndexOutput::~IndexOutput(){ + } + + BufferedIndexOutput::BufferedIndexOutput() + { + buffer = _CL_NEWARRAY(uint8_t, BUFFER_SIZE ); + bufferStart = 0; + bufferPosition = 0; + } + + BufferedIndexOutput::~BufferedIndexOutput(){ + if ( buffer != NULL ) + close(); + } + + void BufferedIndexOutput::close(){ + flush(); + _CLDELETE_ARRAY( buffer ); + + bufferStart = 0; + bufferPosition = 0; + } + + void BufferedIndexOutput::writeByte(const uint8_t b) { + CND_PRECONDITION(buffer!=NULL,"IndexOutput is closed") + if (bufferPosition >= BUFFER_SIZE) + flush(); + buffer[bufferPosition++] = b; + } + + void BufferedIndexOutput::writeBytes(const uint8_t* b, const int32_t length) { + if ( length < 0 ) + _CLTHROWA(CL_ERR_IllegalArgument, "IO Argument Error. Value must be a positive value."); + int32_t bytesLeft = BUFFER_SIZE - bufferPosition; + // is there enough space in the buffer? + if (bytesLeft >= length) { + // we add the data to the end of the buffer + memcpy(buffer + bufferPosition, b, length); + bufferPosition += length; + // if the buffer is full, flush it + if (BUFFER_SIZE - bufferPosition == 0) + flush(); + } else { + // is data larger then buffer? + if (length > BUFFER_SIZE) { + // we flush the buffer + if (bufferPosition > 0) + flush(); + // and write data at once + flushBuffer(b, length); + bufferStart += length; + } else { + // we fill/flush the buffer (until the input is written) + int64_t pos = 0; // position in the input data + int32_t pieceLength; + while (pos < length) { + if ( length - pos < bytesLeft ) + pieceLength = length - pos; + else + pieceLength = bytesLeft; + memcpy(buffer + bufferPosition, b + pos, pieceLength); + pos += pieceLength; + bufferPosition += pieceLength; + // if the buffer is full, flush it + bytesLeft = BUFFER_SIZE - bufferPosition; + if (bytesLeft == 0) { + flush(); + bytesLeft = BUFFER_SIZE; + } + } + } + } + } + + void IndexOutput::writeInt(const int32_t i) { + writeByte((uint8_t)(i >> 24)); + writeByte((uint8_t)(i >> 16)); + writeByte((uint8_t)(i >> 8)); + writeByte((uint8_t) i); + } + + void IndexOutput::writeVInt(const int32_t vi) { + uint32_t i = vi; + while ((i & ~0x7F) != 0) { + writeByte((uint8_t)((i & 0x7f) | 0x80)); + i >>= 7; //doing unsigned shift + } + writeByte( (uint8_t)i ); + } + + void IndexOutput::writeLong(const int64_t i) { + writeInt((int32_t) (i >> 32)); + writeInt((int32_t) i); + } + + void IndexOutput::writeVLong(const int64_t vi) { + uint64_t i = vi; + while ((i & ~0x7F) != 0) { + writeByte((uint8_t)((i & 0x7f) | 0x80)); + i >>= 7; //doing unsigned shift + } + writeByte((uint8_t)i); + } + + void IndexOutput::writeString(const TCHAR* s, const int32_t length ) { + writeVInt(length); + writeChars(s, 0, length); + } + + void IndexOutput::writeChars(const TCHAR* s, const int32_t start, const int32_t length){ + if ( length < 0 || start < 0 ) + _CLTHROWA(CL_ERR_IllegalArgument, "IO Argument Error. Value must be a positive value."); + + const int32_t end = start + length; + for (int32_t i = start; i < end; ++i) { + const int32_t code = (int32_t)s[i]; + if (code >= 0x01 && code <= 0x7F) + writeByte((uint8_t)code); + else if (((code >= 0x80) && (code <= 0x7FF)) || code == 0) { + writeByte((uint8_t)(0xC0 | (code >> 6))); + writeByte((uint8_t)(0x80 | (code & 0x3F))); + } else { + writeByte((uint8_t)(0xE0 | (((uint32_t)code) >> 12))); //unsigned shift + writeByte((uint8_t)(0x80 | ((code >> 6) & 0x3F))); + writeByte((uint8_t)(0x80 | (code & 0x3F))); + } + } + } + + + int64_t BufferedIndexOutput::getFilePointer() const{ + return bufferStart + bufferPosition; + } + + void BufferedIndexOutput::seek(const int64_t pos) { + flush(); + bufferStart = pos; + } + + void BufferedIndexOutput::flush() { + flushBuffer(buffer, bufferPosition); + bufferStart += bufferPosition; + bufferPosition = 0; + } + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.h b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.h new file mode 100644 index 000000000..c47ee73a7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/IndexOutput.h @@ -0,0 +1,152 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_store_IndexOutput_ +#define _lucene_store_IndexOutput_ +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(store) + + +/** Abstract class for output to a file in a Directory. A random-access output +* stream. Used for all Lucene index output operations. +* @see Directory +* @see IndexInput +*/ +class IndexOutput:LUCENE_BASE{ + bool isclosed; +public: + IndexOutput(); + virtual ~IndexOutput(); + + /** Writes a single byte. + * @see IndexInput#readByte() + */ + virtual void writeByte(const uint8_t b) = 0; + + /** Writes an array of bytes. + * @param b the bytes to write + * @param length the number of bytes to write + * @see IndexInput#readBytes(byte[],int32_t,int32_t) + */ + virtual void writeBytes(const uint8_t* b, const int32_t length) = 0; + + /** Writes an int as four bytes. + * @see IndexInput#readInt() + */ + void writeInt(const int32_t i); + + /** Writes an int in a variable-length format. Writes between one and + * five bytes. Smaller values take fewer bytes. Negative numbers are not + * supported. + * @see IndexInput#readVInt() + */ + void writeVInt(const int32_t vi); + + /** Writes a long as eight bytes. + * @see IndexInput#readLong() + */ + void writeLong(const int64_t i); + + /** Writes an long in a variable-length format. Writes between one and five + * bytes. Smaller values take fewer bytes. Negative numbers are not + * supported. + * @see IndexInput#readVLong() + */ + void writeVLong(const int64_t vi); + + /** Writes a string. + * @see IndexInput#readString() + */ + void writeString(const TCHAR* s, const int32_t length); + + /** Writes a sequence of UTF-8 encoded characters from a string. + * @param s the source of the characters + * @param start the first character in the sequence + * @param length the number of characters in the sequence + * @see IndexInput#readChars(char[],int32_t,int32_t) + */ + void writeChars(const TCHAR* s, const int32_t start, const int32_t length); + + /** Closes this stream to further operations. */ + virtual void close() = 0; + + /** Returns the current position in this file, where the next write will + * occur. + * @see #seek(long) + */ + virtual int64_t getFilePointer() const = 0; + + /** Sets current position in this file, where the next write will occur. + * @see #getFilePointer() + */ + virtual void seek(const int64_t pos) = 0; + + /** The number of bytes in the file. */ + virtual int64_t length() = 0; + + /** Forces any buffered output to be written. */ + virtual void flush() = 0; +}; + +/** Base implementation class for buffered {@link IndexOutput}. */ +class BufferedIndexOutput : public IndexOutput{ +public: + LUCENE_STATIC_CONSTANT(int32_t, BUFFER_SIZE=LUCENE_STREAM_BUFFER_SIZE); +private: + uint8_t* buffer; + int64_t bufferStart; // position in file of buffer + int32_t bufferPosition; // position in buffer + +public: + BufferedIndexOutput(); + virtual ~BufferedIndexOutput(); + + /** Writes a single byte. + * @see IndexInput#readByte() + */ + virtual void writeByte(const uint8_t b); + + /** Writes an array of bytes. + * @param b the bytes to write + * @param length the number of bytes to write + * @see IndexInput#readBytes(byte[],int32_t,int32_t) + */ + virtual void writeBytes(const uint8_t* b, const int32_t length); + + /** Closes this stream to further operations. */ + virtual void close(); + + /** Returns the current position in this file, where the next write will + * occur. + * @see #seek(long) + */ + int64_t getFilePointer() const; + + /** Sets current position in this file, where the next write will occur. + * @see #getFilePointer() + */ + virtual void seek(const int64_t pos); + + /** The number of bytes in the file. */ + virtual int64_t length() = 0; + + /** Forces any buffered output to be written. */ + void flush(); + +protected: + /** Expert: implements buffer write. Writes bytes at the current position in + * the output. + * @param b the bytes to write + * @param len the number of bytes to write + */ + virtual void flushBuffer(const uint8_t* b, const int32_t len) = 0; +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/InputStream.h b/src/assistant/3rdparty/clucene/src/CLucene/store/InputStream.h new file mode 100644 index 000000000..f56819eeb --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/InputStream.h @@ -0,0 +1,21 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_store_InputStream_ +#define _lucene_store_InputStream_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(store) + +deprecated... please use IndexInput.h header +and change InputStream to IndexInput + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/Lock.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/Lock.cpp new file mode 100644 index 000000000..a66e784b0 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/Lock.cpp @@ -0,0 +1,27 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Lock.h" + +CL_NS_DEF(store) + + bool LuceneLock::obtain(int64_t lockWaitTimeout) { + bool locked = obtain(); + int maxSleepCount = (int)(lockWaitTimeout / LOCK_POLL_INTERVAL); + int sleepCount = 0; + while (!locked) { + if (sleepCount++ == maxSleepCount) { + _CLTHROWA(CL_ERR_IO,"Lock obtain timed out"); + } + _LUCENE_SLEEP(LOCK_POLL_INTERVAL); + locked = obtain(); + } + return locked; + } + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/Lock.h b/src/assistant/3rdparty/clucene/src/CLucene/store/Lock.h new file mode 100644 index 000000000..b5dda3b06 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/Lock.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_store_Lock_ +#define _lucene_store_Lock_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(store) + +class LuceneLock : LUCENE_BASE +{ +public: + LUCENE_STATIC_CONSTANT(int64_t, LOCK_POLL_INTERVAL = 1000); + + virtual ~LuceneLock() {} + + // Attempts to obtain exclusive access and immediately return upon success + // or failure. Return true if exclusive access is obtained. + virtual bool obtain() = 0; + + // Attempts to obtain an exclusive lock within amount of time given. + // Currently polls once per second until lockWaitTimeout is passed. + // @param lockWaitTimeout length of time to wait in ms + // @return true if lock was obtained + // @throws IOException if lock wait times out or obtain() throws an IOException + bool obtain(int64_t lockWaitTimeout); + + // Release exclusive access. + virtual void release() = 0; + + // Returns true if the resource is currently locked. Note that one must + // still call {@link #obtain()} before using the resource. + virtual bool isLocked() = 0; + + virtual QString toString() const = 0; +}; + + +// Utility class for executing code with exclusive access. +template +class LuceneLockWith +{ +public: + // Constructs an executor that will grab the named lock. Defaults + // lockWaitTimeout to LUCENE_COMMIT_LOCK_TIMEOUT. + // @deprecated Kept only to avoid breaking existing code. + LuceneLockWith(LuceneLock* lock, int64_t lockWaitTimeout) + { + this->lock = lock; + this->lockWaitTimeout = lockWaitTimeout; + } + + virtual ~LuceneLockWith() {} + + // Calls {@link #doBody} while lock is obtained. Blocks if lock + // cannot be obtained immediately. Retries to obtain lock once per second + // until it is obtained, or until it has tried ten times. Lock is released + // when {@link #doBody} exits. + T runAndReturn() + { + bool locked = false; + T ret = NULL; + try { + locked = lock->obtain(lockWaitTimeout); + ret = doBody(); + } _CLFINALLY ( + if (locked) + lock->release(); + ); + return ret; + } + + // @see runAndReturn + // Same as runAndReturn, except doesn't return any value. The only + // difference is that no void values are used + void run() + { + bool locked = false; + try { + locked = lock->obtain(lockWaitTimeout); + doBody(); + } _CLFINALLY ( + if (locked) + lock->release(); + ); + } + +protected: + virtual T doBody() = 0; + +private: + LuceneLock* lock; + int64_t lockWaitTimeout; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/MMapInput.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/MMapInput.cpp new file mode 100644 index 000000000..d660032c6 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/MMapInput.cpp @@ -0,0 +1,203 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#if defined(LUCENE_FS_MMAP) + +#include "FSDirectory.h" +#include "CLucene/util/Misc.h" +#include "CLucene/debug/condition.h" + +#ifndef _CLCOMPILER_MSVC + #include +#endif + +CL_NS_DEF(store) +CL_NS_USE(util) + + FSDirectory::MMapIndexInput::MMapIndexInput(const char* path): + pos(0), + data(NULL), + _length(0), + isClone(false) + { + //Func - Constructor. + // Opens the file named path + //Pre - path != NULL + //Post - if the file could not be opened an exception is thrown. + + CND_PRECONDITION(path != NULL, "path is NULL"); + +#ifdef _CLCOMPILER_MSVC + mmaphandle = NULL; + fhandle = CreateFileA(path,GENERIC_READ,FILE_SHARE_READ, 0,OPEN_EXISTING,0,0); + + //Check if a valid fhandle was retrieved + if (fhandle < 0){ + DWORD err = GetLastError(); + if ( err == ERROR_FILE_NOT_FOUND ) + _CLTHROWA(CL_ERR_IO, "File does not exist"); + else if ( err == EACCES ) + _CLTHROWA(ERROR_ACCESS_DENIED, "File Access denied"); + else if ( err == ERROR_TOO_MANY_OPEN_FILES ) + _CLTHROWA(CL_ERR_IO, "Too many open files"); + else + _CLTHROWA(CL_ERR_IO, "File IO Error"); + } + + DWORD dummy=0; + _length = GetFileSize(fhandle,&dummy); + + if ( _length > 0 ){ + mmaphandle = CreateFileMappingA(fhandle,NULL,PAGE_READONLY,0,0,NULL); + if ( mmaphandle != NULL ){ + void* address = MapViewOfFile(mmaphandle,FILE_MAP_READ,0,0,0); + if ( address != NULL ){ + data = (uint8_t*)address; + return; //SUCCESS! + } + } + CloseHandle(mmaphandle); + + char* lpMsgBuf=0; + DWORD dw = GetLastError(); + + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + lpMsgBuf, + 0, NULL ); + + char* errstr = _CL_NEWARRAY(char, strlen(lpMsgBuf)+40); + sprintf(errstr, "MMapIndexInput::MMapIndexInput failed with error %d: %s", dw, lpMsgBuf); + LocalFree(lpMsgBuf); + + _CLTHROWA_DEL(CL_ERR_IO,errstr); + } + +#else //_CLCOMPILER_MSVC + fhandle = ::open (path, O_RDONLY); + if (fhandle < 0){ + _CLTHROWA(CL_ERR_IO,strerror(errno)); + }else{ + // stat it + struct stat sb; + if (::fstat (fhandle, &sb)){ + _CLTHROWA(CL_ERR_IO,strerror(errno)); + }else{ + // get length from stat + _length = sb.st_size; + + // mmap the file + void* address = ::mmap(0, _length, PROT_READ, MAP_SHARED, fhandle, 0); + if (address == MAP_FAILED){ + _CLTHROWA(CL_ERR_IO,strerror(errno)); + }else{ + data = (uint8_t*)address; + } + } + } +#endif + } + + FSDirectory::MMapIndexInput::MMapIndexInput(const MMapIndexInput& clone): IndexInput(clone){ + //Func - Constructor + // Uses clone for its initialization + //Pre - clone is a valide instance of FSIndexInput + //Post - The instance has been created and initialized by clone + +#ifdef _CLCOMPILER_MSVC + mmaphandle = NULL; + fhandle = NULL; +#endif + + data = clone.data; + pos = clone.pos; + + //clone the file length + _length = clone._length; + //Keep in mind that this instance is a clone + isClone = true; + } + + uint8_t FSDirectory::MMapIndexInput::readByte(){ + return *(data+(pos++)); + } + + void FSDirectory::MMapIndexInput::readBytes(uint8_t* b, const int32_t len){ + memcpy(b, data+pos, len); + pos+=len; + } + int32_t FSDirectory::MMapIndexInput::readVInt(){ + uint8_t b = *(data+(pos++)); + int32_t i = b & 0x7F; + for (int shift = 7; (b & 0x80) != 0; shift += 7) { + b = *(data+(pos++)); + i |= (b & 0x7F) << shift; + } + return i; + } + int64_t FSDirectory::MMapIndexInput::getFilePointer() const{ + return pos; + } + void FSDirectory::MMapIndexInput::seek(const int64_t pos){ + this->pos=pos; + } + + FSDirectory::MMapIndexInput::~MMapIndexInput(){ + //Func - Destructor + //Pre - True + //Post - The file for which this instance is responsible has been closed. + // The instance has been destroyed + + close(); + } + + IndexInput* FSDirectory::MMapIndexInput::clone() const + { + return _CLNEW FSDirectory::MMapIndexInput(*this); + } + void FSDirectory::MMapIndexInput::close() { + //IndexInput::close(); + + if ( !isClone ){ +#ifdef _CLCOMPILER_MSVC + if ( data != NULL ){ + if ( ! UnmapViewOfFile(data) ){ + CND_PRECONDITION( false, "UnmapViewOfFile(data) failed"); //todo: change to rich error + } + } + + if ( mmaphandle != NULL ){ + if ( ! CloseHandle(mmaphandle) ){ + CND_PRECONDITION( false, "CloseHandle(mmaphandle) failed"); + } + } + if ( fhandle != NULL ){ + if ( !CloseHandle(fhandle) ){ + CND_PRECONDITION( false, "CloseHandle(fhandle) failed"); + } + } + mmaphandle = NULL; + fhandle = NULL; +#else + if ( data != NULL ) + ::munmap(data, _length); + if ( fhandle > 0 ) + ::close(fhandle); + fhandle = 0; +#endif + } + data = NULL; + pos = 0; + } + + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/OutputStream.h b/src/assistant/3rdparty/clucene/src/CLucene/store/OutputStream.h new file mode 100644 index 000000000..a82d6718a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/OutputStream.h @@ -0,0 +1,23 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_store_IndexOutput_ +#define _lucene_store_IndexOutput_ +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +CL_NS_DEF(store) + + +deprecated... please use IndexOutput.h header +and change OutputStream to OutdexInput + + + +CL_NS_END + +#endif // _lucene_store_IndexOutput_ diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp new file mode 100644 index 000000000..b0a7c4d64 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.cpp @@ -0,0 +1,446 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#include "CLucene/StdHeader.h" +#include "RAMDirectory.h" + +#include "Lock.h" +#include "Directory.h" +#include "FSDirectory.h" +#include "CLucene/index/IndexReader.h" +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Misc.h" +#include "CLucene/debug/condition.h" + +CL_NS_USE(util) +CL_NS_DEF(store) + +RAMFile::RAMFile() +{ + length = 0; + lastModified = Misc::currentTimeMillis(); +} + +RAMFile::~RAMFile() +{ +} + + +RAMDirectory::RAMLock::RAMLock(const QString& name, RAMDirectory* dir) + : directory(dir) +{ + fname = name; +} + +RAMDirectory::RAMLock::~RAMLock() +{ + directory = NULL; +} + +QString RAMDirectory::RAMLock::toString() const +{ + return QLatin1String("LockFile@RAM"); +} + +bool RAMDirectory::RAMLock::isLocked() +{ + return directory->fileExists(fname); +} + +bool RAMDirectory::RAMLock::obtain() +{ + SCOPED_LOCK_MUTEX(directory->files_mutex); + if (!directory->fileExists(fname)) { + IndexOutput* tmp = directory->createOutput(fname); + tmp->close(); + _CLDELETE(tmp); + + return true; + } + return false; +} + +void RAMDirectory::RAMLock::release() +{ + directory->deleteFile(fname); +} + +RAMIndexOutput::~RAMIndexOutput() +{ + if (deleteFile) + _CLDELETE(file); + file = NULL; +} + +RAMIndexOutput::RAMIndexOutput(RAMFile* f) + : file(f) +{ + pointer = 0; + deleteFile = false; +} + +RAMIndexOutput::RAMIndexOutput() + : file(_CLNEW RAMFile) +{ + pointer = 0; + deleteFile = true; +} + +void RAMIndexOutput::writeTo(IndexOutput* out) +{ + flush(); + int64_t end = file->length; + int64_t pos = 0; + int32_t p = 0; + while (pos < end) { + int32_t length = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; + int64_t nextPos = pos + length; + if (nextPos > end) { // at the last buffer + length = (int32_t)(end - pos); + } + out->writeBytes((uint8_t*)file->buffers[p++], length); + pos = nextPos; + } +} + +void RAMIndexOutput::reset() +{ + seek(_ILONGLONG(0)); + file->length = _ILONGLONG(0); +} + +void RAMIndexOutput::flushBuffer(const uint8_t* src, const int32_t len) +{ + uint8_t* b = NULL; + int32_t bufferPos = 0; + while (bufferPos != len) { + uint32_t bufferNumber = pointer/CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; + int32_t bufferOffset = pointer%CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; + int32_t bytesInBuffer = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE - bufferOffset; + int32_t remainInSrcBuffer = len - bufferPos; + int32_t bytesToCopy = bytesInBuffer >= remainInSrcBuffer ? remainInSrcBuffer : bytesInBuffer; + + if (bufferNumber == file->buffers.size()){ + b = _CL_NEWARRAY(uint8_t, CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE); + file->buffers.push_back( b ); + }else{ + b = file->buffers[bufferNumber]; + } + memcpy(b+bufferOffset, src+bufferPos, bytesToCopy * sizeof(uint8_t)); + bufferPos += bytesToCopy; + pointer += bytesToCopy; + } + if (pointer > file->length) + file->length = pointer; + + file->lastModified = Misc::currentTimeMillis(); +} + +void RAMIndexOutput::close() +{ + BufferedIndexOutput::close(); +} + +/** Random-at methods */ +void RAMIndexOutput::seek(const int64_t pos) +{ + BufferedIndexOutput::seek(pos); + pointer = (int32_t)pos; +} + +int64_t RAMIndexOutput::length() +{ + return file->length; +} + + +RAMIndexInput::RAMIndexInput(RAMFile* f) + : file(f) +{ + pointer = 0; + _length = f->length; +} + +RAMIndexInput::RAMIndexInput(const RAMIndexInput& other) + : BufferedIndexInput(other) +{ + file = other.file; + pointer = other.pointer; + _length = other._length; +} + +RAMIndexInput::~RAMIndexInput() +{ + RAMIndexInput::close(); +} + +IndexInput* RAMIndexInput::clone() const +{ + return _CLNEW RAMIndexInput(*this); +} + +int64_t RAMIndexInput::length() +{ + return _length; +} + +QString RAMIndexInput::getDirectoryType() const +{ + return RAMDirectory::DirectoryType(); +} + +void RAMIndexInput::readInternal(uint8_t* dest, const int32_t len) +{ + const int64_t bytesAvailable = file->length - pointer; + int64_t remainder = len <= bytesAvailable ? len : bytesAvailable; + int32_t start = pointer; + int32_t destOffset = 0; + while (remainder != 0) { + int32_t bufferNumber = start / CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; + int32_t bufferOffset = start % CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; + int32_t bytesInBuffer = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE - bufferOffset; + + /* The buffer's entire length (bufferLength) is defined by IndexInput.h + ** as int32_t, so obviously the number of bytes in a given segment of the + ** buffer won't exceed the the capacity of int32_t. Therefore, the + ** int64_t->int32_t cast on the next line is safe. */ + int32_t bytesToCopy = bytesInBuffer >= remainder ? static_cast(remainder) : bytesInBuffer; + uint8_t* b = file->buffers[bufferNumber]; + memcpy(dest + destOffset, b + bufferOffset, bytesToCopy * sizeof(uint8_t)); + + destOffset += bytesToCopy; + start += bytesToCopy; + remainder -= bytesToCopy; + pointer += bytesToCopy; + } +} + +void RAMIndexInput::close() +{ + BufferedIndexInput::close(); +} + +void RAMIndexInput::seekInternal(const int64_t pos) +{ + CND_PRECONDITION(pos >= 0 && pos < this->_length, "Seeking out of range") + pointer = (int32_t)pos; +} + +// #pragma mark -- RAMDirectory + +QStringList RAMDirectory::list() const +{ + SCOPED_LOCK_MUTEX(files_mutex); + + QStringList names; + + FileMap::const_iterator itr; + for (itr = files.begin(); itr != files.end(); ++itr) + names.push_back(itr->first); + + return names; +} + +RAMDirectory::RAMDirectory() + : Directory() + , files(false, true) +{ +} + +RAMDirectory::~RAMDirectory() +{ + //todo: should call close directory? +} + +void RAMDirectory::_copyFromDir(Directory* dir, bool closeDir) +{ + QStringList names = dir->list(); + uint8_t buf[CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE]; + + foreach (const QString& name, names) { + if (!CL_NS(index)::IndexReader::isLuceneFile(name)) + continue; + + // make place on ram disk + IndexOutput* os = createOutput(name); + // read current file + IndexInput* is = dir->openInput(name); + + // and copy to ram disk + //todo: this could be a problem when copying from big indexes... + int64_t readCount = 0; + int64_t len = is->length(); + while (readCount < len) { + int32_t toRead = CL_NS(store)::BufferedIndexOutput::BUFFER_SIZE; + if ((readCount + toRead) > len) + toRead = int32_t(len - readCount); + is->readBytes(buf, toRead); + os->writeBytes(buf, toRead); + readCount += toRead; + } + + // graceful cleanup + is->close(); + _CLDELETE(is); + os->close(); + _CLDELETE(os); + } + if (closeDir) + dir->close(); +} + +RAMDirectory::RAMDirectory(Directory* dir) + : Directory() + , files(false, true) +{ + _copyFromDir(dir, false); +} + +RAMDirectory::RAMDirectory(const QString& dir) + : Directory() + , files(false, true) +{ + Directory* fsdir = FSDirectory::getDirectory(dir, false); + try { + _copyFromDir(fsdir, false); + } _CLFINALLY ( + fsdir->close(); + _CLDECDELETE(fsdir); + ); +} + +bool RAMDirectory::fileExists(const QString& name) const +{ + SCOPED_LOCK_MUTEX(files_mutex); + return files.exists(name); +} + +int64_t RAMDirectory::fileModified(const QString& name) const +{ + SCOPED_LOCK_MUTEX(files_mutex); + const RAMFile* f = files.get(name); + return f->lastModified; +} + +int64_t RAMDirectory::fileLength(const QString& name) const +{ + SCOPED_LOCK_MUTEX(files_mutex); + RAMFile* f = files.get(name); + return f->length; +} + + +IndexInput* RAMDirectory::openInput(const QString& name) +{ + SCOPED_LOCK_MUTEX(files_mutex); + RAMFile* file = files.get(name); + if (file == NULL) { + _CLTHROWA(CL_ERR_IO, // DSR:PROPOSED: Better error checking. + "[RAMDirectory::open] The requested file does not exist."); + } + return _CLNEW RAMIndexInput(file); +} + +void RAMDirectory::close() +{ + SCOPED_LOCK_MUTEX(files_mutex); + files.clear(); +} + +bool RAMDirectory::doDeleteFile(const QString& name) +{ + SCOPED_LOCK_MUTEX(files_mutex); + files.remove(name); + return true; +} + +void RAMDirectory::renameFile(const QString& from, const QString& to) +{ + SCOPED_LOCK_MUTEX(files_mutex); + FileMap::iterator itr = files.find(from); + + /* DSR:CL_BUG_LEAK: + ** If a file named $to already existed, its old value was leaked. + ** My inclination would be to prevent this implicit deletion with an + ** exception, but it happens routinely in CLucene's internals (e.g., during + ** IndexWriter.addIndexes with the file named 'segments'). */ + if (files.exists(to)) + files.remove(to); + + if (itr == files.end()) { + char tmp[1024]; + _snprintf(tmp, 1024, "cannot rename %s, file does not exist", + from.toLocal8Bit().constData()); + _CLTHROWT(CL_ERR_IO, tmp); + } + + CND_PRECONDITION(itr != files.end(), "itr == files.end()") + + RAMFile* file = itr->second; + files.removeitr(itr, true, true); + files.put(to, file); +} + + +void RAMDirectory::touchFile(const QString& name) +{ + RAMFile* file = NULL; + { + SCOPED_LOCK_MUTEX(files_mutex); + file = files.get(name); + } + uint64_t ts1 = file->lastModified; + uint64_t ts2 = Misc::currentTimeMillis(); + + //make sure that the time has actually changed + while (ts1 == ts2) { + _LUCENE_SLEEP(1); + ts2 = Misc::currentTimeMillis(); + }; + + file->lastModified = ts2; +} + +IndexOutput* RAMDirectory::createOutput(const QString& name) +{ + /* Check the $files VoidMap to see if there was a previous file named + ** $name. If so, delete the old RAMFile object, but reuse the existing + ** char buffer ($n) that holds the filename. If not, duplicate the + ** supplied filename buffer ($name) and pass ownership of that memory ($n) + ** to $files. */ + + SCOPED_LOCK_MUTEX(files_mutex); + + QString n = files.getKey(name); + if (!n.isEmpty()) { + RAMFile* rf = files.get(name); + _CLDELETE(rf); + } else { + n = name; + } + + RAMFile* file = _CLNEW RAMFile(); +#ifdef _DEBUG + file->filename = n; +#endif + files[n] = file; + + return _CLNEW RAMIndexOutput(file); +} + +LuceneLock* RAMDirectory::makeLock(const QString& name) +{ + return _CLNEW RAMLock(name, this); +} + +QString RAMDirectory::toString() const +{ + return QLatin1String("RAMDirectory"); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.h b/src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.h new file mode 100644 index 000000000..af92e30b2 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/RAMDirectory.h @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +*/ +#ifndef _lucene_store_RAMDirectory_ +#define _lucene_store_RAMDirectory_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include +#include + +#include "Lock.h" +#include "Directory.h" +#include "CLucene/util/VoidMap.h" +#include "CLucene/util/Arrays.h" + +CL_NS_DEF(store) + +class RAMFile : LUCENE_BASE +{ +public: + CL_NS(util)::CLVector > buffers; + int64_t length; + uint64_t lastModified; + +#ifdef _DEBUG + QString filename; +#endif + + RAMFile(); + ~RAMFile(); +}; + +class RAMIndexOutput : public BufferedIndexOutput +{ +protected: + RAMFile* file; + int32_t pointer; + bool deleteFile; + + // output methods: + void flushBuffer(const uint8_t* src, const int32_t len); + +public: + RAMIndexOutput(RAMFile* f); + RAMIndexOutput(); + /** Construct an empty output buffer. */ + virtual ~RAMIndexOutput(); + + virtual void close(); + + // Random-at methods + virtual void seek(const int64_t pos); + int64_t length(); + /** Resets this to an empty buffer. */ + void reset(); + /** Copy the current contents of this buffer to the named output. */ + void writeTo(IndexOutput* output); +}; + +class RAMIndexInput : public BufferedIndexInput +{ +private: + RAMFile* file; + int32_t pointer; + int64_t _length; + +protected: + /** IndexInput methods */ + RAMIndexInput(const RAMIndexInput& clone); + void readInternal(uint8_t *dest, const int32_t len); + + /** Random-at methods */ + void seekInternal(const int64_t pos); + +public: + RAMIndexInput(RAMFile* f); + ~RAMIndexInput(); + IndexInput* clone() const; + + void close(); + int64_t length(); + QString getDirectoryType() const; +}; + + +/** +* A memory-resident {@link Directory} implementation. +*/ +class RAMDirectory : public Directory +{ + class RAMLock : public LuceneLock + { + private: + RAMDirectory* directory; + QString fname; + public: + RAMLock(const QString& name, RAMDirectory* dir); + virtual ~RAMLock(); + bool obtain(); + void release(); + bool isLocked(); + virtual QString toString() const; + }; + + typedef CL_NS(util)::CLHashMap > FileMap; + +protected: + /// Removes an existing file in the directory. + virtual bool doDeleteFile(const QString& name); + + /** + * Creates a new RAMDirectory instance from a different + * Directory implementation. This can be used to load + * a disk-based index into memory. + *

+ * This should be used only with indices that can fit into memory. + * + * @param dir a Directory value + * @exception IOException if an error occurs + */ + void _copyFromDir(Directory* dir, bool closeDir); + FileMap files; // unlike the java Hashtable, FileMap is not synchronized, and all access must be protected by a lock + +public: +#ifndef _CL_DISABLE_MULTITHREADING //do this so that the mutable keyword still works without mt enabled + mutable DEFINE_MUTEX(files_mutex) // mutable: const methods must also be able to synchronize properly +#endif + + // Returns a null terminated array of strings, one for each file in the directory. + QStringList list() const; + + /** Constructs an empty {@link Directory}. */ + RAMDirectory(); + + // Destructor - only call this if you are sure the directory + // is not being used anymore. Otherwise use the ref-counting + // facilities of dir->close + virtual ~RAMDirectory(); + RAMDirectory(Directory* dir); + + /** + * Creates a new RAMDirectory instance from the {@link FSDirectory}. + * + * @param dir a String specifying the full index directory path + */ + RAMDirectory(const QString& dir); + + /// Returns true iff the named file exists in this directory. + bool fileExists(const QString& name) const; + + /// Returns the time the named file was last modified. + int64_t fileModified(const QString& name) const; + + /// Returns the length in bytes of a file in the directory. + int64_t fileLength(const QString& name) const; + + /// Removes an existing file in the directory. + virtual void renameFile(const QString& from, const QString& to); + + /** Set the modified time of an existing file to now. */ + void touchFile(const QString& name); + + /// Creates a new, empty file in the directory with the given name. + /// Returns a stream writing this file. + virtual IndexOutput* createOutput(const QString& name); + + /// Construct a {@link Lock}. + /// @param name the name of the lock file + LuceneLock* makeLock(const QString& name); + + /// Returns a stream reading an existing file. + IndexInput* openInput(const QString& name); + + virtual void close(); + + QString toString() const; + + static QString DirectoryType() { return QLatin1String("RAM"); } + QString getDirectoryType() const { return DirectoryType(); } +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp b/src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp new file mode 100644 index 000000000..056fa9bc3 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "TransactionalRAMDirectory.h" + +CL_NS_DEF(store) +CL_NS_USE(util) + +TransactionalRAMDirectory::TransactionalRAMDirectory() + : RAMDirectory() + , filesToRestoreOnAbort(false, true) +{ + transOpen = false; +} + +TransactionalRAMDirectory::~TransactionalRAMDirectory() +{ +} + +bool TransactionalRAMDirectory::archiveOrigFileIfNecessary(const QString& name) +{ + // If a file named $name was present when the transaction started and the + // original RAMFile object has not been archived for restoration upon + // transaction abort, then do so, and return true. + // In any other case, return false. + if (fileExists(name) && filesToRemoveOnAbort.find(name) == filesToRemoveOnAbort.end()) { + // The file exists, but isn't recorded as having been created after the + // start of the transaction, so it must've been present at the start of + // the transaction. + + // Transfer memory ownership of both the key and the value from files to + // filesToRestoreOnAbort. + QString origName = files.getKey(name); + RAMFile* origFile = files.get(name); + files.remove(name, true, true); + filesToRestoreOnAbort.put(origName, origFile); + + CND_CONDITION(!fileExists(name), + "File should not exist immediately after archival."); + return true; + } + + return false; +} + +void TransactionalRAMDirectory::unarchiveOrigFile(const QString& name) +{ + QString origName = filesToRestoreOnAbort.getKey(name); + if (origName.isEmpty()) { + _CLTHROWA(CL_ERR_RAMTransaction, + "File submitted for unarchival was not archived."); + } + RAMFile* origFile = filesToRestoreOnAbort.get(name); + // Transfer memory ownership back to files from filesToRestoreOnAbort. + filesToRestoreOnAbort.remove(name, true, true); + files.put(origName, origFile); +} + +bool TransactionalRAMDirectory::transIsOpen() const +{ + return transOpen; +} + +void TransactionalRAMDirectory::transStart() +{ + if (transOpen) { + _CLTHROWA(CL_ERR_RAMTransaction, + "Must resolve previous transaction before starting another."); + } + + CND_CONDITION(filesToRemoveOnAbort.size() == 0, + "filesToRemoveOnAbort should have been cleared by either its" + " constructor or transResolved."); + + CND_CONDITION(filesToRestoreOnAbort.size() == 0, + "filesToRestoreOnAbort should have been cleared by either its" + " constructor or transResolved."); + + transOpen = true; +} + +void TransactionalRAMDirectory::transResolved() +{ + // This method implements actions common to both forms of transaction + // resolution. + filesToRemoveOnAbort.clear(); + filesToRestoreOnAbort.clear(); + transOpen = false; +} + +void TransactionalRAMDirectory::transCommit() +{ + if (!transOpen) + _CLTHROWA(CL_ERR_RAMTransaction, "There is no open transaction."); + + // All storage is in memory, so commit is ultra-simple. + transResolved(); +} + +void TransactionalRAMDirectory::transAbort() +{ + if (!transOpen) + _CLTHROWA(CL_ERR_RAMTransaction, "There is no open transaction."); + + // Delete each file in filesToRemoveOnAbort. + FilenameSet::const_iterator itrDel = filesToRemoveOnAbort.begin(); + for ( ; itrDel != filesToRemoveOnAbort.end(); ++itrDel) { + size_t nameLength = itrDel->first.length(); + + // Special exception: Refrain from deleting a lock's flag file, as that + // would interfere with the operation of the lock. + if (!(nameLength >= 5 + && itrDel->first.rightRef(5) == QLatin1String(".lock"))) { + RAMDirectory::deleteFile(itrDel->first); + } + } + // Ownership of the memory of both the key and the value never left files, + // so there's no need for a special directive to filesToRemoveOnAbort. + filesToRemoveOnAbort.clear(); + + // Now that any new-since-trans-start files with the same names as + // already-present-at-trans-start files are out of the way, restore each + // file in filesToRestoreOnAbort. + TransFileMap::const_iterator itr = filesToRestoreOnAbort.begin(); + for ( ; itr != filesToRestoreOnAbort.end(); ++itr) { + files.put(itr->first, itr->second); + filesToRestoreOnAbort.remove(itr->first); + } + + CND_CONDITION(filesToRestoreOnAbort.size() == 0, + "filesToRestoreOnAbort should be empty."); + + transResolved(); +} + +bool TransactionalRAMDirectory::doDeleteFile(const QString& name) +{ + if (!transOpen) + return RAMDirectory::doDeleteFile(name); + + bool wasOriginalAndWasArchived = archiveOrigFileIfNecessary(name); + if (!wasOriginalAndWasArchived) { + // The file to be deleted wasn't present at transaction start, so instead + // of archiving it, we delete it the conventional way, making sure to + // erase its record in filesToRemoveOnAbort if it was listed there. + filesToRemoveOnAbort.remove(name); + return RAMDirectory::doDeleteFile(name); + } + return true; +} + +void TransactionalRAMDirectory::renameFile(const QString& from, const QString& to) +{ + // During the review on 2005.03.18, decided not to implement transactional + // renameFile for two reasons: + // a) It's not needed in the limited scenario for which + // TransactionalRAMDirectory was designed (IndexWriter::addDocument and + // subcode). + // b) Supporting renaming during a transaction would add considerable + // bookkeeping overhead, reducing the performance of the overwhelmingly + // typical case (commit) in order to support the rare case (abort). + // + // This was not a thinly disguised punt due to the complication of + // implementing renameFile transactionally; rather, several implementations + // were considered, but it seemed wrongheaded to degrade the performance of + // the typical case based on the mere potential need to support renameFile + // at some future point for the benefit of the atypical case. + if (transOpen) { + _CLTHROWA(CL_ERR_RAMTransaction, + "TransactionalRAMDirectory disallows renameFile during a transaction."); + } + RAMDirectory::renameFile(from, to); +} + +IndexOutput* TransactionalRAMDirectory::createOutput(const QString& name) +{ + if (!transOpen) + return RAMDirectory::createOutput(name); + + bool wasOriginalAndWasArchived = archiveOrigFileIfNecessary(name); + try { + IndexOutput* ret = RAMDirectory::createOutput(name); + // Importantly, we store a pointer to the filename memory managed by + // files, rather than that passed in by the client (name). We don't make + // an additional copy of the filename's memory because the transactional + // metadata container filesToRemoveOnAbort is not at risk of outliving + // files. + filesToRemoveOnAbort.put(files.getKey(name), NULL); + return ret; + } catch (...) { + if (wasOriginalAndWasArchived) { + unarchiveOrigFile(name); + } + throw; + } +} + +void TransactionalRAMDirectory::close() +{ + if (transOpen) + transAbort(); + + RAMDirectory::close(); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h b/src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h new file mode 100644 index 000000000..44c5e8e99 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/store/TransactionalRAMDirectory.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_store_TransactionalRAMDirectory_ +#define _lucene_store_TransactionalRAMDirectory_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "RAMDirectory.h" +#include "CLucene/util/VoidList.h" + +CL_NS_DEF(store) + +/*** +This transactional in-memory Directory was created to address a specific +situation, and was deliberately pared down to the simplest viable +implementation. For the sake of simplicity, this implementation imposes +restrictions on what operations can be performed in the directory while a +transaction is in progress (documented in TransactionalRAMDirectory.cpp). + +Because the Lucene Directory interface itself is rather simplistic, it +would not be difficult to expand TransactionalRAMDirectory so that it +provided fully general transactionality. However, the developer of this +original implementation was of the opinion that the last thing CLucene +needs is gratuitous features that exceed their required complexity and +haven't been rigorously tested. +*/ +class TransactionalRAMDirectory : public RAMDirectory +{ +private: + typedef CL_NS(util)::CLSet FilenameSet; + FilenameSet filesToRemoveOnAbort; + + typedef CL_NS(util)::CLSet > TransFileMap; + TransFileMap filesToRestoreOnAbort; + + bool transOpen; + + void transResolved(); + bool archiveOrigFileIfNecessary(const QString& name); + void unarchiveOrigFile(const QString& name); + +protected: + bool doDeleteFile(const QString& name); + +public: + TransactionalRAMDirectory(); + virtual ~TransactionalRAMDirectory(); + + bool transIsOpen() const; + void transStart(); + void transCommit(); + void transAbort(); + + // Constrained operations: + void renameFile(const QString& from, const QString& to); + IndexOutput* createOutput(const QString& name); + + void close(); +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Arrays.h b/src/assistant/3rdparty/clucene/src/CLucene/util/Arrays.h new file mode 100644 index 000000000..ba60c5638 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Arrays.h @@ -0,0 +1,164 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_Arrays_ +#define _lucene_util_Arrays_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "VoidList.h" + +CL_NS_DEF(util) + class Arrays{ + public: + template + class _Arrays { + protected: + //used by binarySearch to check for equality + virtual bool equals(_type a,_type b) const = 0; + virtual int32_t compare(_type a,_type b) const = 0; + public: + virtual ~_Arrays(){ + } + + void sort(_type* a, int32_t alen, int32_t fromIndex, int32_t toIndex) const{ + CND_PRECONDITION(fromIndex < toIndex,"fromIndex >= toIndex"); + CND_PRECONDITION(fromIndex >= 0,"fromIndex < 0"); + + // First presort the array in chunks of length 6 with insertion + // sort. A mergesort would give too much overhead for this length. + for (int32_t chunk = fromIndex; chunk < toIndex; chunk += 6) + { + int32_t end = min(chunk + 6, toIndex); + for (int32_t i = chunk + 1; i < end; i++) + { + if (compare(a[i - 1], a[i]) > 0) + { + // not already sorted + int32_t j = i; + _type elem = a[j]; + do + { + a[j] = a[j - 1]; + j--; + } + while (j > chunk && compare(a[j - 1], elem) > 0); + a[j] = elem; + } + } + } + + int32_t len = toIndex - fromIndex; + // If length is smaller or equal 6 we are done. + if (len <= 6) + return; + + _type* src = a; + _type* dest = _CL_NEWARRAY(_type,alen); + _type* t = NULL; // t is used for swapping src and dest + + // The difference of the fromIndex of the src and dest array. + int32_t srcDestDiff = -fromIndex; + + // The merges are done in this loop + for (int32_t size = 6; size < len; size <<= 1) + { + for (int32_t start = fromIndex; start < toIndex; start += size << 1) + { + // mid is the start of the second sublist; + // end the start of the next sublist (or end of array). + int32_t mid = start + size; + int32_t end = min(toIndex, mid + size); + + // The second list is empty or the elements are already in + // order - no need to merge + if (mid >= end || compare(src[mid - 1], src[mid]) <= 0) + { + memcpy(dest + start + srcDestDiff, src+start, (end-start)*sizeof(_type)); + }// The two halves just need swapping - no need to merge + else if (compare(src[start], src[end - 1]) > 0) + { + memcpy(dest+end-size+srcDestDiff, src+start, size * sizeof(_type)); + memcpy(dest+start+srcDestDiff, src+mid, (end-mid) * sizeof(_type)); + + }else{ + // Declare a lot of variables to save repeating + // calculations. Hopefully a decent JIT will put these + // in registers and make this fast + int32_t p1 = start; + int32_t p2 = mid; + int32_t i = start + srcDestDiff; + + // The main merge loop; terminates as soon as either + // half is ended + while (p1 < mid && p2 < end) + { + dest[i++] = src[(compare(src[p1], src[p2]) <= 0 + ? p1++ : p2++)]; + } + + // Finish up by copying the remainder of whichever half + // wasn't finished. + if (p1 < mid) + memcpy(dest+i,src+p1, (mid-p1) * sizeof(_type)); + else + memcpy(dest+i,src+p2, (end-p2) * sizeof(_type)); + } + } + // swap src and dest ready for the next merge + t = src; + src = dest; + dest = t; + fromIndex += srcDestDiff; + toIndex += srcDestDiff; + srcDestDiff = -srcDestDiff; + } + + // make sure the result ends up back in the right place. Note + // that src and dest may have been swapped above, so src + // contains the sorted array. + if (src != a) + { + // Note that fromIndex == 0. + memcpy(a+srcDestDiff,src,toIndex * sizeof(_type)); + } + } + }; + }; + + template + class CLListEquals: + public CL_NS_STD(binary_function) + { + typedef typename class1::const_iterator _itr1; + typedef typename class2::const_iterator _itr2; + public: + CLListEquals(){ + } + bool equals( class1* val1, class2* val2 ) const{ + static _comparator comp; + if ( val1 == val2 ) + return true; + size_t size = val1->size(); + if ( size != val2->size() ) + return false; + + _itr1 itr1 = val1->begin(); + _itr2 itr2 = val2->begin(); + while ( --size >= 0 ){ + if ( !comp(*itr1,*itr2) ) + return false; + itr1++; + itr2++; + } + return true; + } + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.cpp new file mode 100644 index 000000000..3679bd120 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "BitSet.h" +#include "CLucene/store/Directory.h" + +CL_NS_USE(store) +CL_NS_DEF(util) + +BitSet::BitSet(const BitSet& copy) + : _size(copy._size) + , _count(-1) +{ + int32_t len = (_size >> 3) + 1; + bits = _CL_NEWARRAY(uint8_t, len); + memcpy(bits, copy.bits, len); +} + +BitSet::BitSet(int32_t size) + : _size(size) + , _count(-1) +{ + int32_t len = (_size >> 3) + 1; + bits = _CL_NEWARRAY(uint8_t, len); + memset(bits, 0, len); +} + +BitSet::BitSet(CL_NS(store)::Directory* d, const QString& name) +{ + _count = -1; + CL_NS(store)::IndexInput* input = d->openInput(name); + try { + _size = input->readInt(); // read size + _count = input->readInt(); // read count + + bits = _CL_NEWARRAY(uint8_t,(_size >> 3) + 1); // allocate bits + input->readBytes(bits, (_size >> 3) + 1); // read bits + } _CLFINALLY ( + input->close(); + _CLDELETE(input ); + ); +} + +void BitSet::write(CL_NS(store)::Directory* d, const QString& name) +{ + CL_NS(store)::IndexOutput* output = d->createOutput(name); + try { + output->writeInt(size()); // write size + output->writeInt(count()); // write count + output->writeBytes(bits, (_size >> 3) + 1); // write bits + } _CLFINALLY ( + output->close(); + _CLDELETE(output); + ); +} + +BitSet::~BitSet() +{ + _CLDELETE_ARRAY(bits); +} + +void BitSet::set(int32_t bit, bool val) +{ + if (val) + bits[bit >> 3] |= 1 << (bit & 7); + else + bits[bit >> 3] &= ~(1 << (bit & 7)); + + _count = -1; +} + +int32_t BitSet::size() const +{ + return _size; +} + +int32_t BitSet::count() +{ + // if the BitSet has been modified + if (_count == -1) { + static const uint8_t BYTE_COUNTS[] = { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8}; + + int32_t c = 0; + int32_t end = (_size >> 3) + 1; + for (int32_t i = 0; i < end; i++) + c += BYTE_COUNTS[bits[i]]; // sum bits per uint8_t + _count = c; + } + return _count; +} + +BitSet* BitSet::clone() const +{ + return _CLNEW BitSet(*this); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.h b/src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.h new file mode 100644 index 000000000..e93847e98 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/BitSet.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_util_BitSet_ +#define _lucene_util_BitSet_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +#include "CLucene/store/Directory.h" + +CL_NS_DEF(util) + +class BitSet : LUCENE_BASE +{ +public: + // Create a bitset with the specified size + BitSet (int32_t size); + BitSet(CL_NS(store)::Directory* d, const QString& name); + void write(CL_NS(store)::Directory* d, const QString& name); + + // Destructor for the bit set + ~BitSet(); + + // get the value of the specified bit + inline bool get(const int32_t bit) const + { + return (bits[bit >> 3] & (1 << (bit & 7))) != 0; + } + + // set the value of the specified bit + void set(int32_t bit, bool val = true); + + ///returns the size of the bitset + int32_t size() const; + + // Returns the total number of one bits in this BitSet. This is + // efficiently computed and cached, so that, if the BitSet is not changed, + // no recomputation is done for repeated calls. + int32_t count(); + BitSet *clone() const; + +protected: + BitSet(const BitSet& copy); + +private: + int32_t _size; + int32_t _count; + uint8_t *bits; +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Equators.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/Equators.cpp new file mode 100644 index 000000000..e112bd234 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Equators.cpp @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "Equators.h" + +CL_NS_DEF(util) + +bool Equals::Int32::operator()(const int32_t val1, const int32_t val2) const +{ + return (val1)==(val2); +} + +bool Equals::Char::operator()(const char* val1, const char* val2) const +{ + if ( val1 == val2 ) + return true; + return (strcmp(val1, val2) == 0); +} + +#ifdef _UCS2 +bool Equals::WChar::operator()(const wchar_t* val1, const wchar_t* val2) const +{ + if (val1 == val2) + return true; + return (_tcscmp(val1, val2) == 0); +} +#endif + +bool Equals::Qstring::operator()(const QString& val1, const QString& val2) const +{ + return (val1 == val2); +} + +/////////////////////////////////////////////////////////////////////////////// +// Comparors +/////////////////////////////////////////////////////////////////////////////// + +int32_t Compare::Int32::getValue() const +{ + return value; +} + +Compare::Int32::Int32(int32_t val) +{ + value = val; +} + +Compare::Int32::Int32() +{ + value = 0; +} + +int32_t Compare::Int32::compareTo(void* o) +{ + try { + Int32* other = (Int32*)o; + if (value == other->value) + return 0; + // Returns just -1 or 1 on inequality; doing math might overflow. + return value > other->value ? 1 : -1; + } catch(...) { + _CLTHROWA(CL_ERR_Runtime, "Couldnt compare types"); + } +} + +bool Compare::Int32::operator()(int32_t t1, int32_t t2) const +{ + return t1 > t2 ? true : false; +} + +size_t Compare::Int32::operator()(int32_t t) const +{ + return t; +} + +qreal Compare::Float::getValue() const +{ + return value; +} + +Compare::Float::Float(qreal val) +{ + value = val; +} + +int32_t Compare::Float::compareTo(void* o) +{ + try { + Float* other = (Float*)o; + if (value == other->value) + return 0; + // Returns just -1 or 1 on inequality; doing math might overflow. + return value > other->value ? 1 : -1; + } catch(...) { + _CLTHROWA(CL_ERR_Runtime,"Couldnt compare types"); + } +} + +bool Compare::Char::operator()(const char* val1, const char* val2) const +{ + if ( val1 == val2) + return false; + return (strcmp(val1, val2) < 0); +} + +size_t Compare::Char::operator()(const char* val1) const +{ + return CL_NS(util)::Misc::ahashCode(val1); +} + +#ifdef _UCS2 +bool Compare::WChar::operator()(const wchar_t* val1, const wchar_t* val2) const +{ + if ( val1==val2) + return false; + return (_tcscmp(val1, val2) < 0); +} + +size_t Compare::WChar::operator()(const wchar_t* val1) const +{ + return CL_NS(util)::Misc::whashCode(val1); +} +#endif + +const TCHAR* Compare::TChar::getValue() const +{ + return s; +} + +Compare::TChar::TChar() +{ + s = NULL; +} + +Compare::TChar::TChar(const TCHAR* str) +{ + this->s = str; +} + +int32_t Compare::TChar::compareTo(void* o) +{ + try { + TChar* os = (TChar*)o; + return _tcscmp(s, os->s); + } catch(...) { + _CLTHROWA(CL_ERR_Runtime,"Couldnt compare types"); + } + +} + +bool Compare::TChar::operator()(const TCHAR* val1, const TCHAR* val2) const +{ + if (val1 == val2) + return false; + + return (_tcscmp(val1, val2) < 0); +} + +size_t Compare::TChar::operator()(const TCHAR* val1) const +{ + return CL_NS(util)::Misc::thashCode(val1); +} + +bool Compare::Qstring::operator()(const QString& val1, const QString& val2) const +{ + return (val1 < val2); +} + +size_t Compare::Qstring::operator ()(const QString& val1) const +{ + return CL_NS(util)::Misc::qhashCode(val1); +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Equators.h b/src/assistant/3rdparty/clucene/src/CLucene/util/Equators.h new file mode 100644 index 000000000..11fcb0eaf --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Equators.h @@ -0,0 +1,274 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_util_Equators_ +#define _lucene_util_Equators_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +//#ifdef QT_LINUXBASE +// we are going to use qreal now, we basically maintain our own clucene anyway +//// LSB doesn't define float_t - see http://bugs.linuxbase.org/show_bug.cgi?id=2374 +//typedef float float_t; +//#endif + +CL_NS_DEF(util) + +/////////////////////////////////////////////////////////////////////////////// +// Equators +/////////////////////////////////////////////////////////////////////////////// + +class Equals{ +public: + class Int32:public CL_NS_STD(binary_function) + { + public: + bool operator()( const int32_t val1, const int32_t val2 ) const; + }; + + class Char:public CL_NS_STD(binary_function) + { + public: + bool operator()( const char* val1, const char* val2 ) const; + }; +#ifdef _UCS2 + class WChar: public CL_NS_STD(binary_function) + { + public: + bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; + }; + class TChar: public WChar{ + }; +#else + class TChar: public Char{ + }; +#endif + + template + class Void:public CL_NS_STD(binary_function) + { + public: + bool operator()( _cl* val1, _cl* val2 ) const{ + return val1==val2; + } + }; + + class Qstring : public CL_NS_STD(binary_function) + { + public: + bool operator() (const QString& val1, const QString& val2) const; + }; +}; + + +/////////////////////////////////////////////////////////////////////////////// +// Comparors +/////////////////////////////////////////////////////////////////////////////// + +class Comparable : LUCENE_BASE +{ +public: + virtual ~Comparable(){ + } + + virtual int32_t compareTo(void* o) = 0; +}; + +/** @internal */ +class Compare{ +public: + class _base + { // traits class for hash containers + public: + enum + { // parameters for hash table + bucket_size = 4, // 0 < bucket_size + min_buckets = 8 + }; // min_buckets = 2 ^^ N, 0 < N + + _base() + { + } + }; + + class Int32:public _base, public Comparable{ + int32_t value; + public: + int32_t getValue() const; + Int32(int32_t val); + Int32(); + int32_t compareTo(void* o); + bool operator()( int32_t t1, int32_t t2 ) const; + size_t operator()( int32_t t ) const; + }; + + + class Float:public Comparable{ + qreal value; + public: + qreal getValue() const; + Float(qreal val); + int32_t compareTo(void* o); + }; + + + class Char: public _base // + { + public: + bool operator()( const char* val1, const char* val2 ) const; + size_t operator()( const char* val1) const; + }; + +#ifdef _UCS2 + class WChar: public _base // + { + public: + bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; + size_t operator()( const wchar_t* val1) const; + }; +#endif + + class TChar: public _base, public Comparable{ + const TCHAR* s; + public: + const TCHAR* getValue() const; + + TChar(); + TChar(const TCHAR* str); + int32_t compareTo(void* o); + bool operator()( const TCHAR* val1, const TCHAR* val2 ) const; + size_t operator()( const TCHAR* val1) const; + }; + + + template + class Void:public _base // + { + public: + int32_t compareTo(_cl* o){ + if ( this == o ) + return o; + else + return this > o ? 1 : -1; + } + bool operator()( _cl* t1, _cl* t2 ) const{ + return t1 > t2 ? true : false; + } + size_t operator()( _cl* t ) const{ + return (size_t)t; + } + }; + + class Qstring : public _base + { + public: + bool operator() (const QString& val1, const QString& val2) const; + size_t operator() (const QString& val1) const; + }; +}; + +/////////////////////////////////////////////////////////////////////////////// +// allocators +/////////////////////////////////////////////////////////////////////////////// + +class Deletor +{ +public: + + template + class Array{ + public: + static void doDelete(_kt* arr){ + _CLDELETE_LARRAY(arr); + } + }; + class tcArray{ + public: + static void doDelete(const TCHAR* arr){ + _CLDELETE_CARRAY(arr); + } + }; + class acArray{ + public: + static void doDelete(const char* arr){ + _CLDELETE_CaARRAY(arr); + } + }; + + class Unintern{ + public: + static void doDelete(TCHAR* arr); + }; + template + class Object{ + public: + static void doDelete(_kt* obj){ + _CLLDELETE(obj); + } + }; + template + class Void{ + public: + static void doDelete(_kt* obj){ + _CLVDELETE(obj); + } + }; + class Dummy{ + public: + static void doDelete(const void* nothing) + { + // TODO: remove all occurances where it hits this point + // CND_WARNING(false, "Deletor::Dummy::doDelete run, set deleteKey + // or deleteValue to false"); + } + }; + class DummyInt32{ + public: + static void doDelete(const int32_t nothing){ + } + }; + class DummyFloat{ + public: + static void doDelete(const qreal nothing){ + } + }; + template + class ConstNullVal{ + public: + static void doDelete(const _type nothing) + { + // TODO: remove all occurances where it hits this point + // CND_WARNING(false, "Deletor::Dummy::doDelete run, set deleteKey + // or deleteValue to false"); + } + }; + + template + class NullVal{ + public: + static void doDelete(_type nothing) + { + // TODO: remove all occurances where it hits this point + // CND_WARNING(false, "Deletor::Dummy::doDelete run, set deleteKey + // or deleteValue to false"); + } + }; + class DummyQString { + public: + static void doDelete(const QString& nothing) { + } + }; +}; +//////////////////////////////////////////////////////////////////////////////// + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp new file mode 100644 index 000000000..f9fbe9b10 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.cpp @@ -0,0 +1,107 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "FastCharStream.h" + +#include "CLucene/util/Reader.h" + +CL_NS_DEF(util) + +const int32_t FastCharStream::maxRewindSize = LUCENE_MAX_WORD_LEN*2; + + FastCharStream::FastCharStream(Reader* reader): + pos(0), + rewindPos(0), + resetPos(0), + col(1), + line(1), + input(reader) + { + input->mark(maxRewindSize); + } + FastCharStream::~FastCharStream(){ + } + void FastCharStream::readChar(TCHAR &c) { + try{ + int32_t r = input->read(); + if ( r == -1 ) + input = NULL; + c = r; + }catch(CLuceneError& err){ + if ( err.number() == CL_ERR_IO ) + input = 0; + throw err; + } + } + int FastCharStream::GetNext() + { + // printf("getnext\n"); + if (input == 0 ) // end of file + { + _CLTHROWA(CL_ERR_IO,"warning : FileReader.GetNext : Read TCHAR over EOS."); + } + // this is rather inefficient + // implementing the functions from the java version of + // charstream will be much more efficient. + ++pos; + if ( pos > resetPos + maxRewindSize && rewindPos == 0) { + // move the marker one position (~expensive) + resetPos = pos-(maxRewindSize/2); + if ( resetPos != input->reset(resetPos) ) + _CLTHROWA(CL_ERR_IO,"Unexpected reset() result"); + input->mark(maxRewindSize); + input->skip((maxRewindSize/2) - 1); + } + TCHAR ch; + readChar(ch); + + if (input == NULL) { // eof + return -1; + } + if (rewindPos == 0) { + col += 1; + if(ch == '\n') { + line++; + col = 1; + } + } else { + rewindPos--; + } + return ch; + } + + void FastCharStream::UnGet(){ +// printf("UnGet \n"); + if (input == 0) + return; + if ( pos == 0 ) { + _CLTHROWA(CL_ERR_IO,"error : No character can be UnGet"); + } + rewindPos++; + + input->reset(pos-1); + pos--; + } + + int FastCharStream::Peek() { + int c = GetNext(); + UnGet(); + return c; + } + + bool FastCharStream::Eos() const { + return input==NULL; + } + + int32_t FastCharStream::Column() const { + return col; + } + + int32_t FastCharStream::Line() const { + return line; + } +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.h b/src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.h new file mode 100644 index 000000000..24e5b5612 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/FastCharStream.h @@ -0,0 +1,55 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_FastCharStream_ +#define _lucene_util_FastCharStream_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/Reader.h" + +CL_NS_DEF(util) + + /** Ported implementation of the FastCharStream class. */ + class FastCharStream:LUCENE_BASE + { + static const int32_t maxRewindSize; + int32_t pos; + int32_t rewindPos; + int64_t resetPos; + int32_t col; + int32_t line; + // read character from stream return false on error + void readChar(TCHAR &); + public: + Reader* input; + + /// Initializes a new instance of the FastCharStream class LUCENE_EXPORT. + FastCharStream(Reader* reader); + ~FastCharStream(); + + /// Returns the next TCHAR from the stream. + int GetNext(); + + void UnGet(); + + /// Returns the current top TCHAR from the input stream without removing it. + int Peek(); + + + /// Returns True if the end of stream was reached. + bool Eos() const; + + /// Gets the current column. + int32_t Column() const; + + /// Gets the current line. + int32_t Line() const; + }; +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Misc.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/Misc.cpp new file mode 100644 index 000000000..42e3fd0a8 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Misc.cpp @@ -0,0 +1,295 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#include "CLucene/StdHeader.h" +#include "Misc.h" + +#ifdef _CL_TIME_WITH_SYS_TIME +# include +# include +#else +# if defined(_CL_HAVE_SYS_TIME_H) +# include +# else +# include +# endif +#endif + +#ifdef _CL_HAVE_SYS_TIMEB_H +# include +#endif + +#ifdef UNDER_CE +#include +#endif + +CL_NS_DEF(util) + +uint64_t Misc::currentTimeMillis() +{ +#ifndef UNDER_CE +#if defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) || defined(__BORLANDC__) + struct _timeb tstruct; + _ftime(&tstruct); + + return (((uint64_t) tstruct.time) * 1000) + tstruct.millitm; +#else + struct timeval tstruct; + if (gettimeofday(&tstruct, NULL) < 0) { + _CLTHROWA(CL_ERR_Runtime,"Error in gettimeofday call."); + } + + return (((uint64_t) tstruct.tv_sec) * 1000) + tstruct.tv_usec / 1000; +#endif +#else //UNDER_CE + QT_USE_NAMESPACE + QTime t = QTime::currentTime(); + return t.second() * 1000 + t.msec(); +#endif //UNDER_CE +} + +// #pragma mark -- char related utils + +size_t Misc::ahashCode(const char* str) +{ + // Compute the hash code using a local variable to be reentrant. + size_t hashCode = 0; + while (*str != 0) + hashCode = hashCode * 31 + *str++; + return hashCode; +} + +size_t Misc::ahashCode(const char* str, size_t len) +{ + // Compute the hash code using a local variable to be reentrant. + size_t count = len; + size_t hashCode = 0; + for (size_t i = 0; i < count; i++) + hashCode = hashCode * 31 + *str++; + return hashCode; +} + +char* Misc::ajoin(const char* a, const char* b, const char* c, const char* d, + const char* e, const char* f) +{ +#define aLEN(x) (x == NULL ? 0 : strlen(x)) + const size_t totalLen = aLEN(a) + aLEN(b) + aLEN(c) + aLEN(d) + aLEN(e) + + aLEN(f) + sizeof(char); /* Space for terminator. */ + + char* buf = _CL_NEWARRAY(char, totalLen); + buf[0] = 0; + if (a != NULL) + strcat(buf, a); + + if (b != NULL) + strcat(buf, b); + + if (c != NULL) + strcat(buf, c); + + if (d != NULL) + strcat(buf, d); + + if (e != NULL) + strcat(buf, e); + + if (f != NULL) + strcat(buf, f); + + return buf; +} + +char* Misc::segmentname(const char* segment, const char* ext, int32_t x) +{ + CND_PRECONDITION(ext != NULL, "ext is NULL"); + + char* buf = _CL_NEWARRAY(char, CL_MAX_PATH); + if (x == -1) + _snprintf(buf, CL_MAX_PATH, "%s%s", segment, ext); + else + _snprintf(buf, CL_MAX_PATH, "%s%s%d", segment, ext, x); + return buf; +} + +void Misc::segmentname(char* buffer, int32_t bufferLen, const char* segment, + const char* ext, int32_t x) +{ + CND_PRECONDITION(buffer != NULL, "buffer is NULL"); + CND_PRECONDITION(segment != NULL, "segment is NULL"); + CND_PRECONDITION(ext != NULL, "extention is NULL"); + + if (x == -1) + _snprintf(buffer, bufferLen, "%s%s", segment, ext); + else + _snprintf(buffer, bufferLen, "%s%s%d", segment, ext, x); +} + +// #pragma mark -- qt related utils + +size_t Misc::qhashCode(const QString& str) +{ + size_t hashCode = 0; + for (int i = 0; i < str.count(); ++i) + hashCode = hashCode * 31 + str.at(i).unicode(); + return hashCode; +} + +size_t Misc::qhashCode(const QString& str, size_t len) +{ + size_t count = len; + size_t hashCode = 0; + for (size_t i = 0; i < count; ++i) + hashCode = hashCode * 31 + str.at(i).unicode(); + return hashCode; +} + +QString Misc::qjoin(const QString &a, const QString &b, const QString &c, + const QString &d, const QString &e, const QString &f) +{ + QString buffer; + + if (!a.isNull() && !a.isEmpty()) + buffer.append(a); + + if (!b.isNull() && !b.isEmpty()) + buffer.append(b); + + if (!c.isNull() && !c.isEmpty()) + buffer.append(c); + + if (!d.isNull() && !d.isEmpty()) + buffer.append(d); + + if (!e.isNull() && !e.isEmpty()) + buffer.append(e); + + if (!f.isNull() && !f.isEmpty()) + buffer.append(f); + + return buffer; +} + +QString Misc::segmentname(const QString& segment, const QString& ext, int32_t x) +{ + CND_PRECONDITION(!ext.isEmpty(), "ext is NULL"); + + if (x == -1) + return QString(segment + ext); + + QString buf(QLatin1String("%1%2%3")); + return buf.arg(segment).arg(ext).arg(x); +} + +void Misc::segmentname(QString& buffer, int32_t bufferLen, + const QString& segment, const QString& ext, int32_t x) +{ + CND_PRECONDITION(!segment.isEmpty(), "segment is NULL"); + CND_PRECONDITION(!ext.isEmpty(), "extention is NULL"); + + buffer = segment + ext; + if (x != -1) + buffer += QString::number(x); +} + +// #pragma mark -- TCHAR related utils + +int32_t Misc::stringDifference(const TCHAR* s1, int32_t len1, const TCHAR* s2, + int32_t len2) +{ + int32_t len = len1 < len2 ? len1 : len2; + for (int32_t i = 0; i < len; i++) + if (s1[i] != s2[i]) + return i; + return len; +} + +/* DSR:CL_BUG: (See comment for join method in Misc.h): */ +TCHAR* Misc::join (const TCHAR* a, const TCHAR* b, const TCHAR* c, + const TCHAR* d, const TCHAR* e, const TCHAR* f) +{ +#define LEN(x) (x == NULL ? 0 : _tcslen(x)) + const size_t totalLen = LEN(a) + LEN(b) + LEN(c) + LEN(d) + LEN(e) + LEN(f) + + sizeof(TCHAR); /* Space for terminator. */ + + TCHAR* buf = _CL_NEWARRAY(TCHAR, totalLen); + buf[0] = 0; + if (a != NULL) + _tcscat(buf, a); + + if (b != NULL) + _tcscat(buf, b); + + if (c != NULL) + _tcscat(buf, c); + + if (d != NULL) + _tcscat(buf, d); + + if (e != NULL) + _tcscat(buf, e); + + if (f != NULL) + _tcscat(buf, f); + + return buf; +} + +#ifdef _UCS2 + +size_t Misc::whashCode(const wchar_t* str) +{ + // Compute the hash code using a local variable to be reentrant. + size_t hashCode = 0; + while (*str != 0) + hashCode = hashCode * 31 + *str++; + return hashCode; +} + +size_t Misc::whashCode(const wchar_t* str, size_t len) +{ + // Compute the hash code using a local variable to be reentrant. + size_t count = len; + size_t hashCode = 0; + for (size_t i = 0; i < count; i++) + hashCode = hashCode * 31 + *str++; + return hashCode; +} + +char* Misc::_wideToChar(const wchar_t* s CL_FILELINEPARAM) +{ + size_t len = _tcslen(s); + char* msg = _CL_NEWARRAY(char, len + 1); + _cpywideToChar(s, msg, len + 1); + return msg; +} + +void Misc::_cpywideToChar(const wchar_t* s, char* d, size_t len) +{ + size_t sLen = wcslen(s); + for (uint32_t i = 0; i < len && i < sLen + 1; i++) + d[i] = LUCENE_OOR_CHAR(s[i]); +} + +wchar_t* Misc::_charToWide(const char* s CL_FILELINEPARAM) +{ + size_t len = strlen(s); + wchar_t* msg = _CL_NEWARRAY(wchar_t, len + 1); + _cpycharToWide(s, msg, len + 1); + return msg; +} + +void Misc::_cpycharToWide(const char* s, wchar_t* d, size_t len) +{ + size_t sLen = strlen(s); + for (uint32_t i = 0; i < len && i < sLen + 1; i++) + d[i] = s[i]; +} + +#endif + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Misc.h b/src/assistant/3rdparty/clucene/src/CLucene/util/Misc.h new file mode 100644 index 000000000..561c6e4d9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Misc.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team + * + * Distributable under the terms of either the Apache License (Version 2.0) or + * the GNU Lesser General Public License, as specified in the COPYING file. + * + * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. +*/ +#ifndef _lucene_util_Misc_H +#define _lucene_util_Misc_H + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include + +CL_NS_DEF(util) + +class Misc +{ +public: + static uint64_t currentTimeMillis(); + + static size_t ahashCode(const char* str); + static size_t ahashCode(const char* str, size_t len); + static char* ajoin(const char* a, const char* b, const char* c = NULL, + const char* d = NULL, const char* e = NULL, const char* f = NULL); + static char* segmentname(const char* segment, const char* ext, int32_t x = -1); + static void segmentname(char* buffer, int32_t bufferLen, const char* segment, + const char* ext, int32_t x = -1); + + static size_t qhashCode(const QString& str); + static size_t qhashCode(const QString& str, size_t len); + static QString qjoin(const QString& a, const QString& b, + const QString& c = QString(), const QString& d = QString(), + const QString& e = QString(), const QString& f = QString()); + static QString segmentname(const QString& segment, const QString& ext, + int32_t x = -1 ); + static void segmentname(QString& buffer, int32_t bufferLen, + const QString& Segment, const QString& ext, int32_t x = -1); + + // Compares two strings, character by character, and returns the + // first position where the two strings differ from one another. + // + // @param s1 The first string to compare + // @param s1Len The length of the first string to compare + // @param s2 The second string to compare + // @param s2Len The length of the second string to compare + // @return The first position where the two strings differ. + static int32_t stringDifference(const TCHAR* s1, int32_t s1Len, + const TCHAR* s2, int32_t s2Len); + static TCHAR* join (const TCHAR* a, const TCHAR* b, const TCHAR* c = NULL, + const TCHAR* d = NULL, const TCHAR* e = NULL, const TCHAR* f = NULL ); + +#ifdef _UCS2 + static size_t whashCode(const wchar_t* str); + static size_t whashCode(const wchar_t* str, size_t len); + +# define thashCode whashCode + + static char* _wideToChar(const wchar_t* s CL_FILELINEPARAM); + static void _cpywideToChar(const wchar_t* s, char* d, size_t len); + + static wchar_t* _charToWide(const char* s CL_FILELINEPARAM); + static void _cpycharToWide(const char* s, wchar_t* d, size_t len); + +#else +# define thashCode ahashCode +#endif +}; + +CL_NS_END + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/PriorityQueue.h b/src/assistant/3rdparty/clucene/src/CLucene/util/PriorityQueue.h new file mode 100644 index 000000000..45649ee7f --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/PriorityQueue.h @@ -0,0 +1,177 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_PriorityQueue_ +#define _lucene_util_PriorityQueue_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif +CL_NS_DEF(util) + +// A PriorityQueue maintains a partial ordering of its elements such that the +// least element can always be found in constant time. Put()'s and pop()'s +// require log(size) time. +template class PriorityQueue:LUCENE_BASE { + private: + _type* heap; //(was object[]) + size_t _size; + bool dk; + size_t maxSize; + + void upHeap(){ + size_t i = _size; + _type node = heap[i]; // save bottom node (WAS object) + int32_t j = ((uint32_t)i) >> 1; + while (j > 0 && lessThan(node,heap[j])) { + heap[i] = heap[j]; // shift parents down + i = j; + j = ((uint32_t)j) >> 1; + } + heap[i] = node; // install saved node + } + void downHeap(){ + size_t i = 1; + _type node = heap[i]; // save top node + size_t j = i << 1; // find smaller child + size_t k = j + 1; + if (k <= _size && lessThan(heap[k], heap[j])) { + j = k; + } + while (j <= _size && lessThan(heap[j],node)) { + heap[i] = heap[j]; // shift up child + i = j; + j = i << 1; + k = j + 1; + if (k <= _size && lessThan(heap[k], heap[j])) { + j = k; + } + } + heap[i] = node; // install saved node + } + + protected: + PriorityQueue(){ + this->_size = 0; + this->dk = false; + this->heap = NULL; + this->maxSize = 0; + } + + // Determines the ordering of objects in this priority queue. Subclasses + // must define this one method. + virtual bool lessThan(_type a, _type b)=0; + + // Subclass constructors must call this. + void initialize(const int32_t maxSize, bool deleteOnClear){ + _size = 0; + dk = deleteOnClear; + int32_t heapSize = maxSize + 1; + heap = _CL_NEWARRAY(_type,heapSize); + this->maxSize = maxSize; + } + + public: + virtual ~PriorityQueue(){ + clear(); + _CLDELETE_ARRAY(heap); + } + + /** + * Adds an Object to a PriorityQueue in log(size) time. + * If one tries to add more objects than maxSize from initialize + * a RuntimeException (ArrayIndexOutOfBound) is thrown. + */ + void put(_type element){ + if ( _size>=maxSize ) + _CLTHROWA(CL_ERR_IndexOutOfBounds,"add is out of bounds"); + + ++_size; + heap[_size] = element; + upHeap(); + } + + /** + * Adds element to the PriorityQueue in log(size) time if either + * the PriorityQueue is not full, or not lessThan(element, top()). + * @param element + * @return true if element is added, false otherwise. + */ + bool insert(_type element){ + if(_size < maxSize){ + put(element); + return true; + }else if(_size > 0 && !lessThan(element, top())){ + if ( dk ){ + _valueDeletor::doDelete(heap[1]); + } + heap[1] = element; + adjustTop(); + return true; + }else + return false; + } + + /** + * Returns the least element of the PriorityQueue in constant time. + */ + _type top(){ + if (_size > 0) + return heap[1]; + else + return NULL; + } + + /** Removes and returns the least element of the PriorityQueue in log(size) + * time. + */ + _type pop(){ + if (_size > 0) { + _type result = heap[1]; // save first value + heap[1] = heap[_size]; // move last to first + + heap[_size] = (_type)0; // permit GC of objects + --_size; + downHeap(); // adjust heap + return result; + } else + return (_type)NULL; + } + + /**Should be called when the object at top changes values. Still log(n) + worst case, but it's at least twice as fast to

+		    { pq.top().change(); pq.adjustTop(); }
+		   
instead of
+		    { o = pq.pop(); o.change(); pq.push(o); }
+		   
+ */ + void adjustTop(){ + downHeap(); + } + + + /** + * Returns the number of elements currently stored in the PriorityQueue. + */ + size_t size(){ + return _size; + } + + /** + * Removes all entries from the PriorityQueue. + */ + void clear(){ + for (size_t i = 1; i <= _size; ++i){ + if ( dk ){ + _valueDeletor::doDelete(heap[i]); + } + } + _size = 0; + } + }; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Reader.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/Reader.cpp new file mode 100644 index 000000000..1ce97106d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Reader.cpp @@ -0,0 +1,186 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "Reader.h" + +CL_NS_DEF(util) + +StringReader::StringReader ( const TCHAR* value ): + Reader(NULL,true){ + reader = new jstreams::StringReader(value); +} +StringReader::StringReader ( const TCHAR* value, const int32_t length ): + Reader(NULL,true){ + reader = new jstreams::StringReader(value,length); +} +StringReader::StringReader ( const TCHAR* value, const int32_t length, bool copyData ): + Reader(NULL,true){ + reader = new jstreams::StringReader(value,length, copyData); +} +StringReader::~StringReader(){ +} + + +FileReader::FileReader ( const char* path, const char* enc, + const int32_t cachelen, const int32_t /*cachebuff*/ ): + Reader(NULL, true) +{ + this->input = new jstreams::FileInputStream(path, cachelen); + this->reader = new SimpleInputStreamReader(this->input,enc); //(this is a jstream object) +} + +FileReader::~FileReader (){ + if (input) + delete input; +} +int32_t FileReader::read(const TCHAR*& start, int32_t _min, int32_t _max) { + return reader->read(start, _min, _max); +} +int64_t FileReader::mark(int32_t readlimit) { + return reader->mark(readlimit); +} +int64_t FileReader::reset(int64_t newpos) { + return reader->reset(newpos); +} + + + +SimpleInputStreamReader::SimpleInputStreamReader(jstreams::StreamBase *i, const char* enc) +{ + finishedDecoding = false; + input = i; + charbuf.setSize(262); + + if ( strcmp(enc,"ASCII")==0 ) + encoding = ASCII; +#ifdef _UCS2 + else if ( strcmp(enc,"UTF-8")==0 ) + encoding = UTF8; + else if ( strcmp(enc,"UCS-2LE")==0 ) + encoding = UCS2_LE; +#endif + else + _CLTHROWA(CL_ERR_IllegalArgument,"Unsupported encoding, use jstreams iconv based instead"); + + mark(262); + charsLeft = 0; +} +SimpleInputStreamReader::~SimpleInputStreamReader(){ + input = NULL; +} +int32_t SimpleInputStreamReader::decode(TCHAR* start, int32_t space){ + // decode from charbuf + const char *inbuf = charbuf.readPos; + const char *inbufend = charbuf.readPos + charbuf.avail; + TCHAR *outbuf = start; + const TCHAR *outbufend = outbuf + space; + + if ( encoding == ASCII ){ + while ( outbuf inbufend ){ + break; //character incomplete + }else{ + size_t rd = lucene_utf8towc(outbuf,inbuf,inbufend-inbuf); + if ( rd == 0 ){ + error = "Invalid multibyte sequence."; + status = jstreams::Error; + return -1; + }else{ + inbuf+=rd; + outbuf++; + } + } + } +#endif //_UCS2 + }else + _CLTHROWA(CL_ERR_Runtime,"Unexpected encoding"); + + if ( outbuf < outbufend ) { + //we had enough room to convert the entire input + if ( inbuf < inbufend ) { + // last character is incomplete + // move from inbuf to the end to the start of + // the buffer + memmove(charbuf.start, inbuf, inbufend-inbuf); + charbuf.readPos = charbuf.start; + charbuf.avail = inbufend-inbuf; + } else if ( outbuf < outbufend ) { //input sequence was completely converted + charbuf.readPos = charbuf.start; + charbuf.avail = 0; + if (input == NULL) { + finishedDecoding = true; + } + } + } else { + charbuf.readPos += charbuf.avail - (inbufend-inbuf); + charbuf.avail = inbufend-inbuf; + } + return outbuf-start; +} + +int32_t SimpleInputStreamReader::fillBuffer(TCHAR* start, int32_t space) { + // fill up charbuf + if (input && charbuf.readPos == charbuf.start) { + const char *begin; + int32_t numRead; + numRead = input->read(begin, 1, charbuf.size - charbuf.avail); + //printf("filled up charbuf\n"); + if (numRead < -1) { + error = input->getError(); + status = jstreams::Error; + input = 0; + return numRead; + } + if (numRead < 1) { + // signal end of input buffer + input = 0; + if (charbuf.avail) { + error = "stream ends on incomplete character"; + status = jstreams::Error; + } + return -1; + } + // copy data into other buffer + memmove( charbuf.start + charbuf.avail, begin, numRead * sizeof(char)); + charbuf.avail = numRead + charbuf.avail; + } + // decode + int32_t n = decode(start, space); + //printf("decoded %i\n", n); + return n; +} + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/Reader.h b/src/assistant/3rdparty/clucene/src/CLucene/util/Reader.h new file mode 100644 index 000000000..6b018b3aa --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/Reader.h @@ -0,0 +1,138 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_Reader_ +#define _lucene_util_Reader_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "streambase.h" +#include "stringreader.h" +#include "fileinputstream.h" +#include "bufferedstream.h" + +CL_NS_DEF(util) +/** +* An inline wrapper that reads from Jos van den Oever's jstreams +*/ +class Reader:LUCENE_BASE { +typedef jstreams::StreamBase jsReader; +public: + bool deleteReader; + jsReader* reader; + + Reader(jsReader* reader, bool deleteReader){ + this->reader = reader; + this->deleteReader = deleteReader; + } + virtual ~Reader(){ + if ( deleteReader ) + delete reader; + reader = NULL; + } + inline int read(){ + const TCHAR*b; + int32_t nread = reader->read(b, 1,1); + if ( nread < -1 ) //if not eof + _CLTHROWA(CL_ERR_IO,reader->getError() ); + else if ( nread == -1 ) + return -1; + else + return b[0]; + } + /** + * Read at least 1 character, and as much as is conveniently available + */ + inline int32_t read(const TCHAR*& start){ + int32_t nread = reader->read(start,1,0); + if ( nread < -1 ) //if not eof + _CLTHROWA(CL_ERR_IO,reader->getError()); + else + return nread; + } + inline int32_t read(const TCHAR*& start, int32_t len){ + int32_t nread = reader->read(start, len, len); + if ( nread < -1 ) //if not eof + _CLTHROWA(CL_ERR_IO,reader->getError()); + else + return nread; + } + inline int64_t skip(int64_t ntoskip){ + int64_t skipped = reader->skip(ntoskip); + if ( skipped < 0 ) + _CLTHROWA(CL_ERR_IO,reader->getError()); + else + return skipped; + } + inline int64_t mark(int32_t readAheadlimit){ + int64_t pos = reader->mark(readAheadlimit); + if ( pos < 0 ) + _CLTHROWA(CL_ERR_IO,reader->getError()); + else + return pos; + } + int64_t reset(int64_t pos){ + int64_t r = reader->reset(pos); + if ( r < 0 ) + _CLTHROWA(CL_ERR_IO,reader->getError()); + else + return r; + } +}; + +///A helper class which constructs a the jstreams StringReader. +class StringReader: public Reader{ +public: + StringReader ( const TCHAR* value ); + StringReader ( const TCHAR* value, const int32_t length ); + StringReader ( const TCHAR* value, const int32_t length, bool copyData ); + ~StringReader(); +}; + +/** A very simple inputstreamreader implementation. For a +* more complete InputStreamReader, use the jstreams version +* located in the contrib package +*/ +class SimpleInputStreamReader: public jstreams::BufferedInputStream{ + int32_t decode(TCHAR* start, int32_t space); + int encoding; + enum{ + ASCII=1, + UTF8=2, + UCS2_LE=3 + }; + bool finishedDecoding; + jstreams::StreamBase* input; + int32_t charsLeft; + + jstreams::InputStreamBuffer charbuf; + int32_t fillBuffer(TCHAR* start, int32_t space); +public: + SimpleInputStreamReader(jstreams::StreamBase *i, const char* encoding); + ~SimpleInputStreamReader(); +}; + +/** +* A helper class which constructs a FileReader with a specified +* simple encodings, or a given inputstreamreader +*/ +class FileReader: public Reader{ + jstreams::FileInputStream* input; +public: + FileReader ( const char* path, const char* enc, + const int32_t cachelen = 13, + const int32_t cachebuff = 14 ); //todo: optimise these cache values + ~FileReader (); + + int32_t read(const TCHAR*& start, int32_t _min, int32_t _max); + int64_t mark(int32_t readlimit); + int64_t reset(int64_t); +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp new file mode 100644 index 000000000..b5f1ca238 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/StringBuffer.cpp @@ -0,0 +1,335 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "StringBuffer.h" +#include "Misc.h" + +CL_NS_DEF(util) + + StringBuffer::StringBuffer(TCHAR* buf,int32_t maxlen, const bool consumeBuffer){ + buffer = buf; + bufferLength = maxlen; + bufferOwner = !consumeBuffer; + len = 0; + } + StringBuffer::StringBuffer(){ + //Func - Constructor. Allocates a buffer with the default length. + //Pre - true + //Post - buffer of length bufferLength has been allocated + + //Initialize + bufferLength = LUCENE_DEFAULT_TOKEN_BUFFER_SIZE; + len = 0; + //Allocate a buffer of length bufferLength + buffer = _CL_NEWARRAY(TCHAR,bufferLength); + bufferOwner = true; + } + + StringBuffer::StringBuffer(const int32_t initSize){ + //Func - Constructor. Allocates a buffer of length initSize + 1 + //Pre - initSize > 0 + //Post - A buffer has been allocated of length initSize + 1 + + //Initialize the bufferLength to initSize + 1 The +1 is for the terminator '\0' + bufferLength = initSize + 1; + len = 0; + //Allocate a buffer of length bufferLength + buffer = _CL_NEWARRAY(TCHAR,bufferLength); + bufferOwner = true; + } + + StringBuffer::StringBuffer(const TCHAR* value){ + //Func - Constructor. + // Creates an instance of Stringbuffer containing a copy of the string value + //Pre - value != NULL + //Post - An instance of StringBuffer has been created containing the copy of the string value + + //Initialize the length of the string to be stored in buffer + len = (int32_t) _tcslen(value); + + //Calculate the space occupied in buffer by a copy of value + const int32_t occupiedLength = len + 1; + + // Minimum allocated buffer length is LUCENE_DEFAULT_TOKEN_BUFFER_SIZE. + bufferLength = (occupiedLength >= LUCENE_DEFAULT_TOKEN_BUFFER_SIZE + ? occupiedLength : LUCENE_DEFAULT_TOKEN_BUFFER_SIZE); + + //Allocate a buffer of length bufferLength + buffer = _CL_NEWARRAY(TCHAR,bufferLength); + bufferOwner = true; + //Copy the string value into buffer + _tcsncpy(buffer, value, occupiedLength); + //Assert that the buffer has been terminated at the end of the string + CND_PRECONDITION (buffer[len] == '\0', "Buffer was not correctly terminated"); + } + + StringBuffer::~StringBuffer() { + // Func - Destructor + // Pre - true + // Post - Instanc has been destroyed + + if( bufferOwner ){ + _CLDELETE_CARRAY(buffer); + }else + buffer = NULL; + } + void StringBuffer::clear(){ + //Func - Clears the Stringbuffer and resets it to it default empty state + //Pre - true + //Post - pre(buffer) has been destroyed and a new one has been allocated + + //Destroy the current buffer if present + _CLDELETE_CARRAY(buffer); + + //Initialize + len = 0; + bufferLength = LUCENE_DEFAULT_TOKEN_BUFFER_SIZE; + //Allocate a buffer of length bufferLength + buffer = _CL_NEWARRAY(TCHAR,bufferLength); + } + + void StringBuffer::appendChar(const TCHAR character) { + //Func - Appends a single character + //Pre - true + //Post - The character has been appended to the string in the buffer + + //Check if the current buffer length is sufficient to have the string value appended + if (len + 1 > bufferLength){ + //Have the size of the current string buffer increased because it is too small + growBuffer(len + 1); + } + //Put character at position len which is the end of the string in the buffer + //Note that this action might overwrite the terminator of the string '\0', which + //is kind of tricky + buffer[len] = character; + //Increase the len by to represent the correct length of the string in the buffer + len++; + } + + void StringBuffer::append(const TCHAR* value) { + //Func - Appends a copy of the string value + //Pre - value != NULL + //Post - value has been copied and appended to the string in buffer + + append(value, _tcslen(value)); + } + void StringBuffer::append(const TCHAR* value, size_t appendedLength) { + //Func - Appends a copy of the string value + //Pre - value != NULL + // appendedLength contains the length of the string value which is to be appended + //Post - value has been copied and appended to the string in buffer + + //Check if the current buffer length is sufficient to have the string value appended + if (len + appendedLength + 1 > bufferLength){ + //Have the size of the current string buffer increased because it is too small + growBuffer(len + appendedLength + 1); + } + + //Copy the string value into the buffer at postion len + _tcsncpy(buffer + len, value, appendedLength); + + //Add the length of the copied string to len to reflect the new length of the string in + //the buffer (Note: len is not the bufferlength!) + len += appendedLength; + } + + void StringBuffer::appendInt(const int32_t value) { + //Func - Appends an integer (after conversion to a character string) + //Pre - true + //Post - The converted integer value has been appended to the string in buffer + + //instantiate a buffer of 30 charactes for the conversion of the integer + TCHAR buf[30]; + //Convert the integer value to a string buf using the radix 10 (duh) + _i64tot(value, buf, 10); + //Have the converted integer now stored in buf appended to the string in buffer + append(buf); + } + + void StringBuffer::appendFloat(const qreal value, const int32_t digits){ + //Func - Appends a qreal (after conversion to a character string) + //Pre - digits > 0. Indicates the minimum number of characters printed + //Post - The converted qreal value has been appended to the string in buffer + + //using sprintf("%f" was not reliable on other plaforms... we use a custom float convertor + //bvk: also, using sprintf and %f seems excessivelly slow + if(digits>8) + _CLTHROWA(CL_ERR_IllegalArgument,"Too many digits..."); + + //the maximum number of characters that int64 will hold is 23. so we need 23*2+2 + TCHAR buf[48]; //the buffer to hold + int64_t v = (int64_t)value; //the integer value of the float + _i64tot(v,buf,10); //add the whole number + + size_t len = 99-_tcslen(buf); //how many digits we have to work with? + size_t dig = len< (size_t)digits ? len : digits; + if ( dig > 0 ){ + _tcscat(buf,_T(".")); //add a decimal point + + int64_t remi=(int64_t)((value-v)*pow((qreal)10,(qreal)(dig+1))); //take the remainder and make a whole number + if ( remi<0 ) remi*=-1; + int64_t remadj=remi/10; + if ( remi-(remadj*10) >=5 ) + remadj++; //adjust remainder + + // add as many zeros as necessary between the decimal point and the + // significant part of the number. Fixes a bug when trying to print + // numbers that have zeros right after the decimal point + if (remadj) { + int32_t numZeros = dig - (int32_t)log10((qreal)remadj) - 1; + while(numZeros-- > 0) + _tcscat(buf,_T("0")); //add a zero before the decimal point + } + + _i64tot(remadj,buf+_tcslen(buf),10); //add the remainder + } + + append(buf); + } + + void StringBuffer::prepend(const TCHAR* value){ + //Func - Puts a copy of the string value infront of the current string in the StringBuffer + //Pre - value != NULL + //Post - The string in pre(buffer) has been shifted n positions where n equals the length of value. + // The string value was then copied to the beginning of stringbuffer + + prepend(value, _tcslen(value)); + } + + void StringBuffer::prepend(const TCHAR* value, const size_t prependedLength) { + //Func - Puts a copy of the string value in front of the string in the StringBuffer + //Pre - value != NULL + // prependedLength contains the length of the string value which is to be prepended + //Post - A copy of the string value is has been in front of the string in buffer + //todo: something is wrong with this code, i'm sure... it only grows (and therefore moves if the buffer is to small) + //Check if the current buffer length is sufficient to have the string value prepended + if (prependedLength + len + 1 > bufferLength){ + //Have the size of the current string buffer increased because it is too small + //Because prependedLength is passed as the second argument to growBuffer, + //growBuffer will have left the first prependedLength characters empty + //when it recopied buffer during reallocation. + growBuffer(prependedLength + len + 1, prependedLength); + } + + //Copy the string value into the buffer at postion 0 + _tcsncpy(buffer, value, prependedLength); + //Add the length of the copied string to len to reflect the new length of the string in + //the buffer (Note: len is not the bufferlength!) + len += prependedLength; + } + + int32_t StringBuffer::length() const{ + //Func - Returns the length of the string in the StringBuffer + //Pre - true + //Post - The length len of the string in the buffer has been returned + + return len; + } + TCHAR* StringBuffer::toString(){ + //Func - Returns a copy of the current string in the StringBuffer sized equal to the length of the string + // in the StringBuffer. + //Pre - true + //Post - The copied string has been returned + + //Instantiate a buffer equal to the length len + 1 + TCHAR* ret = _CL_NEWARRAY(TCHAR,len + 1); + if (ret){ + //Copy the string in buffer + _tcsncpy(ret, buffer, len); + //terminate the string + ret[len] = '\0'; + } + //return the the copy + return ret; + } + TCHAR* StringBuffer::getBuffer() { + //Func - '\0' terminates the buffer and returns its pointer + //Pre - true + //Post - buffer has been '\0' terminated and returned + + // Check if the current buffer is '\0' terminated + if (len == bufferLength){ + //Make space for terminator, if necessary. + growBuffer(len + 1); + } + //'\0' buffer so it can be returned properly + buffer[len] = '\0'; + + return buffer; + } + + void StringBuffer::reserve(const int32_t size){ + if ( bufferLength >= size ) + return; + bufferLength = size; + + //Allocate a new buffer of length bufferLength + TCHAR* tmp = _CL_NEWARRAY(TCHAR,bufferLength); + _tcsncpy(tmp, buffer, len); + tmp[len] = '\0'; + + //destroy the old buffer + if (buffer){ + _CLDELETE_CARRAY(buffer); + } + //Assign the new buffer tmp to buffer + buffer = tmp; + } + + void StringBuffer::growBuffer(const int32_t minLength) { + //Func - Has the buffer grown to a minimum length of minLength or bigger + //Pre - minLength >= len + 1 + //Post - The buffer has been grown to a minimum length of minLength or bigger + + growBuffer(minLength, 0); + } + void StringBuffer::growBuffer(const int32_t minLength, const int32_t skippingNInitialChars) { + //Func - Has the buffer grown to a minimum length of minLength or bigger and shifts the + // current string in buffer by skippingNInitialChars forward + //Pre - After growth, must have at least enough room for contents + terminator so + // minLength >= skippingNInitialChars + len + 1 + // skippingNInitialChars >= 0 + //Post - The buffer has been grown to a minimum length of minLength or bigger and + // if skippingNInitialChars > 0, the contents of the buffer has beeen shifted + // forward by skippingNInitialChars positions as the buffer is reallocated, + // leaving the first skippingNInitialChars uninitialized (presumably to be + // filled immediately thereafter by the caller). + + CND_PRECONDITION (skippingNInitialChars >= 0, "skippingNInitialChars is less than zero"); + CND_PRECONDITION (minLength >= skippingNInitialChars + len + 1,"skippingNInitialChars is not large enough"); + + //More aggressive growth strategy to offset smaller default buffer size: + if ( !bufferOwner ){ + if ( bufferLength 0 ){ + printf("ERROR: stringaPool still contains intern'd strings (refcounts):\n"); + __strintrntype::iterator itr = stringaPool.begin(); + while ( itr != stringaPool.end() ){ + printf(" %s (%d)\n",(itr->first), (itr->second)); + ++itr; + } + } + + if ( stringPool.size() > 0 ){ + printf("ERROR: stringPool still contains intern'd strings (refcounts):\n"); + __wcsintrntype::iterator itr = stringPool.begin(); + while ( itr != stringPool.end() ){ + _tprintf(_T(" %s (%d)\n"),(itr->first), (itr->second)); + ++itr; + } + } + #endif + } + + const TCHAR* CLStringIntern::intern(const TCHAR* str CL_FILELINEPARAM){ + if ( str == NULL ) + return NULL; + if ( str[0] == 0 ) + return LUCENE_BLANK_STRING; + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + __wcsintrntype::iterator itr = stringPool.find(str); + if ( itr==stringPool.end() ){ +#ifdef _UCS2 + TCHAR* ret = lucenewcsdup(str CL_FILELINEREF); +#else + TCHAR* ret = lucenestrdup(str CL_FILELINEREF); +#endif + stringPool[ret]= 1; + return ret; + }else{ + (itr->second)++; + return itr->first; + } + } + + bool CLStringIntern::unintern(const TCHAR* str){ + if ( str == NULL ) + return false; + if ( str[0] == 0 ) + return false; + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + __wcsintrntype::iterator itr = stringPool.find(str); + if ( itr != stringPool.end() ){ + if ( (itr->second) == 1 ){ + stringPool.removeitr(itr); + return true; + }else + (itr->second)--; + } + return false; + } + + const char* CLStringIntern::internA(const char* str CL_FILELINEPARAM){ + if ( str == NULL ) + return NULL; + if ( str[0] == 0 ) + return _LUCENE_BLANK_ASTRING; + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + __strintrntype::iterator itr = stringaPool.find(str); + if ( itr==stringaPool.end() ){ + char* ret = lucenestrdup(str CL_FILELINE); + stringaPool[ret] = 1; + return ret; + }else{ + (itr->second)++; + return itr->first; + } + } + + bool CLStringIntern::uninternA(const char* str){ + if ( str == NULL ) + return false; + if ( str[0] == 0 ) + return false; + + SCOPED_LOCK_MUTEX(THIS_LOCK) + + __strintrntype::iterator itr = stringaPool.find(str); + if ( itr!=stringaPool.end() ){ + if ( (itr->second) == 1 ){ + stringaPool.removeitr(itr); + return true; + }else + (itr->second)--; + } + return false; + } + + /* removed because of multi-threading problems... + __wcsintrntype::iterator CLStringIntern::internitr(const TCHAR* str CL_FILELINEPARAM){ + if ( str[0] == 0 ){ + if ( !blanksinitd ){ + CLStringIntern::stringPool.put(LUCENE_BLANK_STRING,1); + wblank=stringPool.find(str); + blanksinitd=true; + } + return wblank; + } + __wcsintrntype::iterator itr = stringPool.find(str); + if (itr==stringPool.end()){ +#ifdef _UCS2 + TCHAR* ret = lucenewcsdup(str CL_FILELINEREF); +#else + TCHAR* ret = lucenestrdup(str CL_FILELINEREF); +#endif + stringPool.put(ret,1); + return stringPool.find(str); + }else{ + (itr->second)++; + return itr; + } + } + bool CLStringIntern::uninternitr(__wcsintrntype::iterator itr){ + if ( itr!=stringPool.end() ){ + if ( itr==wblank ) + return false; + if ( (itr->second) == 1 ){ + stringPool.removeitr(itr); + return true; + }else + (itr->second)--; + } + return false; + } +*/ + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/StringIntern.h b/src/assistant/3rdparty/clucene/src/CLucene/util/StringIntern.h new file mode 100644 index 000000000..ded060c64 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/StringIntern.h @@ -0,0 +1,61 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_StringIntern_H +#define _lucene_util_StringIntern_H + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "VoidMap.h" +CL_NS_DEF(util) +typedef CL_NS(util)::CLHashMap __wcsintrntype; +typedef CL_NS(util)::CLHashMap __strintrntype; + + /** Functions for intern'ing strings. This + * is a process of pooling strings thus using less memory, + * and furthermore allows intern'd strings to be directly + * compared: + * string1==string2, rather than _tcscmp(string1,string2) + */ + class CLStringIntern{ + static __wcsintrntype stringPool; + static __strintrntype stringaPool; + STATIC_DEFINE_MUTEX(THIS_LOCK) + public: + /** + * Internalise the specified string. + * \return Returns a pointer to the internalised string + */ + static const char* internA(const char* str CL_FILELINEPARAM); + /** + * Uninternalise the specified string. Decreases + * the reference count and frees the string if + * reference count is zero + * \returns true if string was destroyed, otherwise false + */ + static bool uninternA(const char* str); + + /** + * Internalise the specified string. + * \return Returns a pointer to the internalised string + */ + static const TCHAR* intern(const TCHAR* str CL_FILELINEPARAM); + + /** + * Uninternalise the specified string. Decreases + * the reference count and frees the string if + * reference count is zero + * \returns true if string was destroyed, otherwise false + */ + static bool unintern(const TCHAR* str); + + static void shutdown(); + }; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp new file mode 100644 index 000000000..a54c86916 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.cpp @@ -0,0 +1,55 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" +#include "CLucene/LuceneThreads.h" +#include "ThreadLocal.h" + +CL_NS_DEF(util) + +DEFINE_MUTEX(ThreadLocalBase::ThreadLocalBase_THIS_LOCK) + +ThreadLocalBase::ShutdownHooksType ThreadLocalBase::shutdownHooks(false); +ThreadLocalBase::ThreadLocalsType ThreadLocalBase::threadLocals(false,false); + +ThreadLocalBase::ThreadLocalBase(){ +} +ThreadLocalBase::~ThreadLocalBase(){ +} + +void ThreadLocalBase::UnregisterCurrentThread(){ + _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; + SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) + + ThreadLocalsType::iterator itr = threadLocals.lower_bound(id); + ThreadLocalsType::iterator end = threadLocals.upper_bound(id); + while ( itr != end ){ + itr->second->setNull(); + ++itr; + } +} +void ThreadLocalBase::shutdown(){ + SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) + + ThreadLocalsType::iterator itr = threadLocals.begin(); + while ( itr != threadLocals.end() ){ + itr->second->setNull(); + ++itr; + } + + ShutdownHooksType::iterator itr2 = shutdownHooks.begin(); + while ( itr2 != shutdownHooks.end() ){ + ShutdownHook* hook = *itr2; + hook(false); + } +} +void ThreadLocalBase::registerShutdownHook(ShutdownHook* hook){ + SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) + shutdownHooks.insert(hook); +} + + +CL_NS_END diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.h b/src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.h new file mode 100644 index 000000000..f67c76ca9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/ThreadLocal.h @@ -0,0 +1,143 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_ThreadLocal_H +#define _lucene_util_ThreadLocal_H + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "CLucene/util/VoidMap.h" + +CL_NS_DEF(util) + +class ThreadLocalBase: LUCENE_BASE{ +public: + /** + * A hook called when CLucene is starting or shutting down, + * this can be used for setting up and tearing down static + * variables + */ + typedef void ShutdownHook(bool startup); + +protected: + STATIC_DEFINE_MUTEX(ThreadLocalBase_THIS_LOCK) + typedef CL_NS(util)::CLMultiMap<_LUCENE_THREADID_TYPE, ThreadLocalBase*, + CL_NS(util)::CLuceneThreadIdCompare, + CL_NS(util)::Deletor::ConstNullVal<_LUCENE_THREADID_TYPE>, + CL_NS(util)::Deletor::ConstNullVal > ThreadLocalsType; + static ThreadLocalsType threadLocals; + //todo: using http://en.wikipedia.org/wiki/Thread-local_storage#Pthreads_implementation + //would work better... but lots of testing would be needed first... + typedef CL_NS(util)::CLSetList, + CL_NS(util)::Deletor::ConstNullVal > ShutdownHooksType; + static ShutdownHooksType shutdownHooks; + + ThreadLocalBase(); +public: + virtual ~ThreadLocalBase(); + + /** + * Call this function to clear the local thread data for this + * ThreadLocal. Calling set(NULL) does the same thing, except + * this function is virtual and can be called without knowing + * the template. + */ + virtual void setNull() = 0; + + /** + * If you want to clean up thread specific memory, then you should + * make sure this thread is called when the thread is not going to be used + * again. This will clean up threadlocal data which can contain quite a lot + * of data, so if you are creating lots of new threads, then it is a good idea + * to use this function, otherwise there will be many memory leaks. + */ + static void UnregisterCurrentThread(); + + /** + * Call this function to shutdown CLucene + */ + static void shutdown(); + + /** + * Add this function to the shutdown hook list. This function will be called + * when CLucene is shutdown. + */ + static void registerShutdownHook(ShutdownHook* hook); +}; + +template +class ThreadLocal: public ThreadLocalBase{ + typedef CL_NS(util)::CLSet<_LUCENE_THREADID_TYPE, T, + CL_NS(util)::CLuceneThreadIdCompare, + CL_NS(util)::Deletor::ConstNullVal<_LUCENE_THREADID_TYPE>, + _deletor > LocalsType; + LocalsType locals; + DEFINE_MUTEX(locals_LOCK) +public: + ThreadLocal(); + ~ThreadLocal(); + T get(); + void setNull(); + void set(T t); +}; + +template +ThreadLocal::ThreadLocal(): + locals(false,true) +{ + //add this object to the base's list of threadlocals to be + //notified in case of UnregisterThread() + _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; + SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) + threadLocals.insert( CL_NS_STD(pair)(id, this) ); +} + +template +ThreadLocal::~ThreadLocal(){ + //remove this object to the base's list of threadlocals + _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; + SCOPED_LOCK_MUTEX(ThreadLocalBase_THIS_LOCK) + + //remove all the thread local data for this object + locals.clear(); + + //remove this object from the ThreadLocalBase threadLocal list + ThreadLocalsType::iterator itr = threadLocals.lower_bound(id); + ThreadLocalsType::iterator end = threadLocals.upper_bound(id); + while ( itr != end ){ + if ( itr->second == this){ + threadLocals.erase(itr); + break; + } + ++itr; + } +} + +template +T ThreadLocal::get(){ + return locals.get(_LUCENE_CURRTHREADID); +} + +template +void ThreadLocal::setNull(){ + set(NULL); +} + +template +void ThreadLocal::set(T t){ + _LUCENE_THREADID_TYPE id = _LUCENE_CURRTHREADID; + locals.remove(id); + if ( t != NULL ) + locals.insert( CL_NS_STD(pair)(id, t) ); +} + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h new file mode 100644 index 000000000..cd6908876 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h @@ -0,0 +1,175 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_VoidList_ +#define _lucene_util_VoidList_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#include "Equators.h" + +CL_NS_DEF(util) + +/** +* A template to encapsulate various list type classes +* @internal +*/ +template +class __CLList:public _base,LUCENE_BASE { +private: + bool dv; + typedef _base base; +public: + DEFINE_MUTEX(THIS_LOCK) + + typedef typename _base::const_iterator const_iterator; + typedef typename _base::iterator iterator; + + virtual ~__CLList(){ + clear(); + } + + __CLList ( const bool deleteValue ): + dv(deleteValue) + { + } + + void setDoDelete(bool val){ dv=val; } + + //sets array to the contents of this array. + //array must be size+1, otherwise memory may be overwritten + void toArray(_kt* into) const{ + int i=0; + for ( const_iterator itr=base::begin();itr!=base::end();itr++ ){ + into[i] = *itr; + i++; + } + into[i] = NULL; + } + + void set(int32_t i, _kt val) { + if ( dv ) + _valueDeletor::doDelete((*this)[i]); + (*this)[i] = val; + } + + //todo: check this + void delete_back(){ + if ( base::size() > 0 ){ + iterator itr = base::end(); + if ( itr != base::begin()) + itr --; + _kt key = *itr; + base::erase(itr); + if ( dv ) + _valueDeletor::doDelete(key); + } + } + + void delete_front(){ + if ( base::size() > 0 ){ + iterator itr = base::begin(); + _kt key = *itr; + base::erase(itr); + if ( dv ) + _valueDeletor::doDelete(key); + } + } + + void clear(){ + if ( dv ){ + iterator itr = base::begin(); + while ( itr != base::end() ){ + _valueDeletor::doDelete(*itr); + ++itr; + } + } + base::clear(); + } + + void remove(int32_t i, bool dontDelete=false){ + iterator itr=base::begin(); + itr+=i; + _kt key = *itr; + base::erase( itr ); + if ( dv && !dontDelete ) + _valueDeletor::doDelete(key); + } + void remove(iterator itr, bool dontDelete=false){ + _kt key = *itr; + base::erase( itr ); + if ( dv && !dontDelete ) + _valueDeletor::doDelete(key); + } + +}; + +//growable arrays of Objects (like a collection or list) +//a list, so can contain duplicates +//it grows in chunks... todo: check jlucene for initial size of array, and growfactors +template +class CLVector:public __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor> +{ +public: + CLVector ( const bool deleteValue=true ): + __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor>(deleteValue) + { + } +}; + +//An array-backed implementation of the List interface +//a list, so can contain duplicates +//*** a very simple list - use +//(This class is roughly equivalent to Vector, except that it is unsynchronized.) +#define CLArrayList CLVector +#define CLHashSet CLHashList + +//implementation of the List interface, provides access to the first and last list elements in O(1) +//no comparator is required... and so can contain duplicates +//a simple list with no comparator +//*** a very simple list - use +#ifdef LUCENE_DISABLE_HASHING + #define CLHashList CLSetList +#else + +template +class CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> +{ +public: + CLHashList ( const bool deleteValue=true ): + __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor>(deleteValue) + { + } +}; +#endif + +template +class CLLinkedList:public __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor> +{ +public: + CLLinkedList ( const bool deleteValue=true ): + __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor>(deleteValue) + { + } +}; +template +class CLSetList:public __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor> +{ +public: + CLSetList ( const bool deleteValue=true ): + __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor>(deleteValue) + { + } +}; + +CL_NS_END +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h new file mode 100644 index 000000000..b22b507e9 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h @@ -0,0 +1,270 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_util_VoidMap_ +#define _lucene_util_VoidMap_ + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + + +CL_NS_DEF(util) + +/** +* A template to encapsulate various map type classes +* @internal +*/ +template +class __CLMap:public _base,LUCENE_BASE { +private: + bool dk; + bool dv; + typedef _base base; +public: + DEFINE_MUTEX(THIS_LOCK) + + typedef typename _base::iterator iterator; + typedef typename _base::const_iterator const_iterator; + typedef CL_NS_STD(pair)<_kt, _vt> _pair; + + ///Default constructor for the __CLMap + __CLMap (): + dk(true), + dv(true) + { + } + + ///Deconstructor for the __CLMap + ~__CLMap (){ + clear(); + } + + void setDeleteKey(bool val){ dk = val; } + void setDeleteValue(bool val){ dv = val; } + + ///Construct the VoidMap and set the deleteTypes to the specified values + ///\param deleteKey if true then the key variable is deleted when an object is deleted + ///\param keyDelType delete the key variable using the specified type + ///\param deleteValue if true then the value variable is deleted when an object is deleted + ///\param valueDelType delete the value variable using the specified type + /*__CLMap ( const bool deleteKey, const bool deleteValue ): + dk(deleteKey), + dv(deleteValue) + { + }*/ + + ///checks to see if the specified key exists + ///\param k the key to check for + ///\returns true if the key exists + bool exists(_kt k)const{ + const_iterator itr = base::find(k); + bool ret = itr!=base::end(); + return ret; + } + + ///put the specified pair into the map. remove any old items first + ///\param k the key + ///\param v the value + void put(_kt k,_vt v){ + //todo: check if this is always right! + //must should look through code, for + //cases where map is not unique!!! + if ( dk || dv ) + remove(k); + + //todo: replacing the old item might be quicker... + + base::insert(_pair(k,v)); + } + + + ///using a non-const key, get a non-const value + _vt get( _kt k) const { + const_iterator itr = base::find(k); + if ( itr==base::end() ) + return _vt(); + else + return itr->second; + } + ///using a non-const key, get the actual key + _kt getKey( _kt k) const { + const_iterator itr = base::find(k); + if ( itr==base::end() ) + return _kt(); + else + return itr->first; + } + + void removeitr (iterator itr, const bool dontDeleteKey = false, const bool dontDeleteValue = false){ + //delete key&val first. This prevents potential loops (deleting object removes itself) + _kt key = itr->first; + _vt val = itr->second; + base::erase(itr); + + //keys & vals need to be deleted after erase, because the hashvalue is still needed + if ( dk && !dontDeleteKey ) + _KeyDeletor::doDelete(key); + if ( dv && !dontDeleteValue ) + _ValueDeletor::doDelete(val); + } + ///delete and optionally delete the specified key and associated value + void remove(_kt key, const bool dontDeleteKey = false, const bool dontDeleteValue = false){ + iterator itr = base::find(key); + if ( itr!=base::end() ) + removeitr(itr,dontDeleteKey,dontDeleteValue); + } + + ///clear all keys and values in the map + void clear(){ + if ( dk || dv ){ + iterator itr = base::begin(); + while ( itr!=base::end() ){ + #ifdef _CL_HAVE_EXT_HASH_MAP + removeitr(itr); + itr = base::begin(); + + #else + if ( dk ) + _KeyDeletor::doDelete(itr->first); + if ( dv ) + _ValueDeletor::doDelete(itr->second); + ++itr; + + #endif + } + } + base::clear(); + } +}; + +// makes no guarantees as to the order of the map +// cannot contain duplicate keys; each key can map to at most one value +#define CLHashtable CLHashMap + +#if defined(_CL_HAVE_GOOGLE_DENSE_HASH_MAP) +//do nothing +#elif defined(LUCENE_DISABLE_HASHING) + + //a CLSet with CLHashMap traits +template +class CLHashMap:public __CLMap<_kt,_vt, + CL_NS_STD(map)<_kt,_vt, _Compare>, + _KeyDeletor,_ValueDeletor> +{ + typedef typename CL_NS_STD(map)<_kt,_vt,_Compare> _base; + typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, _Compare>, + _KeyDeletor,_ValueDeletor> _this; +public: + CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) + { + _this::setDeleteKey(deleteKey); + _this::setDeleteValue(deleteValue); + } +}; +#elif defined(_CL_HAVE_EXT_HASH_MAP) + //ext/hash_map syntax +//HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized +template +class CLHashMap:public __CLMap<_kt,_vt, + CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, + _KeyDeletor,_ValueDeletor> +{ + typedef __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, + _KeyDeletor,_ValueDeletor> _this; +public: + CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) + { + _this::setDeleteKey(deleteKey); + _this::setDeleteValue(deleteValue); + } +}; + +#else +//HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized +template +class CLHashMap:public __CLMap<_kt,_vt, + CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, + _KeyDeletor,_ValueDeletor> +{ + typedef __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, + _KeyDeletor,_ValueDeletor> _this; +public: + CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) + { + _this::setDeleteKey(deleteKey); + _this::setDeleteValue(deleteValue); + } +}; +#endif + +//A collection that contains no duplicates +//does not guarantee that the order will remain constant over time +template +class CLSet:public __CLMap<_kt,_vt, + CL_NS_STD(map)<_kt,_vt, _Compare>, + _KeyDeletor,_ValueDeletor> +{ + typedef typename CL_NS_STD(map)<_kt,_vt,_Compare> _base; + typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, _Compare>, + _KeyDeletor,_ValueDeletor> _this; +public: + CLSet ( const bool deleteKey=false, const bool deleteValue=false ) + { + _this::setDeleteKey(deleteKey); + _this::setDeleteValue(deleteValue); + } +}; + + +//A collection that can contains duplicates +template +class CLMultiMap:public __CLMap<_kt,_vt, + CL_NS_STD(multimap)<_kt,_vt>, + _KeyDeletor,_ValueDeletor> +{ + typedef typename CL_NS_STD(multimap)<_kt,_vt> _base; + typedef __CLMap<_kt, _vt, CL_NS_STD(multimap)<_kt,_vt>, + _KeyDeletor,_ValueDeletor> _this; +public: + CLMultiMap ( const bool deleteKey=false, const bool deleteValue=false ) + { + _this::setDeleteKey(deleteKey); + _this::setDeleteValue(deleteValue); + } +}; + + +//*** need to create a class that allows duplicates - use +//#define CLSet __CLMap +CL_NS_END + +#ifdef _CL_HAVE_GOOGLE_DENSE_HASH_MAP +#include "GoogleSparseMap.h" +#endif + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/bufferedstream.h b/src/assistant/3rdparty/clucene/src/CLucene/util/bufferedstream.h new file mode 100644 index 000000000..d905955b1 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/bufferedstream.h @@ -0,0 +1,157 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2006 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef BUFFEREDSTREAM_H +#define BUFFEREDSTREAM_H + +#include "streambase.h" +#include "inputstreambuffer.h" + +#include +#include + +namespace jstreams { + +template +class BufferedInputStream : public StreamBase { +private: + bool finishedWritingToBuffer; + InputStreamBuffer buffer; + + void writeToBuffer(int32_t minsize); + int32_t read_(const T*& start, int32_t min, int32_t max); +protected: + /** + * This function must be implemented by the subclasses. + * It should write a maximum of @p space characters at the buffer + * position pointed to by @p start. If no more data is available due to + * end of file, -1 should be returned. If an error occurs, the status + * should be set to Error, an error message should be set and the function + * must return -1. + **/ + virtual int32_t fillBuffer(T* start, int32_t space) = 0; + // this function might be useful if you want to reuse a bufferedstream + void resetBuffer() {printf("implement 'resetBuffer'\n");} + BufferedInputStream(); +public: + int32_t read(const T*& start, int32_t min, int32_t max); + int64_t reset(int64_t); + virtual int64_t skip(int64_t ntoskip); +}; + +template +BufferedInputStream::BufferedInputStream() { + finishedWritingToBuffer = false; +} + +template +void +BufferedInputStream::writeToBuffer(int32_t ntoread) { + int32_t missing = ntoread - buffer.avail; + int32_t nwritten = 0; + while (missing > 0 && nwritten >= 0) { + int32_t space; + space = buffer.makeSpace(missing); + T* start = buffer.readPos + buffer.avail; + nwritten = fillBuffer(start, space); + assert(StreamBase::status != Eof); + if (nwritten > 0) { + buffer.avail += nwritten; + missing = ntoread - buffer.avail; + } + } + if (nwritten < 0) { + finishedWritingToBuffer = true; + } +} +template +int32_t +BufferedInputStream::read(const T*& start, int32_t min, int32_t max) { + if (StreamBase::status == Error) return -2; + if (StreamBase::status == Eof) return -1; + + // do we need to read data into the buffer? + if (!finishedWritingToBuffer && min > buffer.avail) { + // do we have enough space in the buffer? + writeToBuffer(min); + if (StreamBase::status == Error) return -2; + } + + int32_t nread = buffer.read(start, max); + + BufferedInputStream::position += nread; + if (BufferedInputStream::position > BufferedInputStream::size + && BufferedInputStream::size > 0) { + // error: we read more than was specified in size + // this is an error because all dependent code might have been labouring + // under a misapprehension + BufferedInputStream::status = Error; + BufferedInputStream::error = "Stream is longer than specified."; + nread = -2; + } else if (BufferedInputStream::status == Ok && buffer.avail == 0 + && finishedWritingToBuffer) { + BufferedInputStream::status = Eof; + if (BufferedInputStream::size == -1) { + BufferedInputStream::size = BufferedInputStream::position; + } + // save one call to read() by already returning -1 if no data is there + if (nread == 0) nread = -1; + } + return nread; +} +template +int64_t +BufferedInputStream::reset(int64_t newpos) { + if (StreamBase::status == Error) return -2; + // check to see if we have this position + int64_t d = BufferedInputStream::position - newpos; + if (buffer.readPos - d >= buffer.start && -d < buffer.avail) { + BufferedInputStream::position -= d; + buffer.avail += (int32_t)d; + buffer.readPos -= d; + StreamBase::status = Ok; + } + return StreamBase::position; +} +template +int64_t +BufferedInputStream::skip(int64_t ntoskip) { + const T *begin; + int32_t nread; + int64_t skipped = 0; + while (ntoskip) { + int32_t step = (int32_t)((ntoskip > buffer.size) ?buffer.size :ntoskip); + nread = read(begin, 1, step); + if (nread <= 0) { + return skipped; + } + ntoskip -= nread; + skipped += nread; + } + return skipped; +} +} + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/dirent.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/dirent.cpp new file mode 100644 index 000000000..3c5c54200 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/dirent.cpp @@ -0,0 +1,221 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Matt J. Weinstein +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "CLucene/StdHeader.h" + +#if !defined(_CL_HAVE_DIRENT_H) && !defined(_CL_HAVE_SYS_NDIR_H) && !defined(_CL_HAVE_SYS_DIR_H) && !defined(_CL_HAVE_NDIR_H) +#include "dirent.h" + +DIR * +opendir (const char *szPath) +{ + DIR *nd; + char szFullPath[CL_MAX_PATH]; + + errno = 0; + + if (!szPath) + { + errno = EFAULT; + return NULL; + } + + if (szPath[0] == '\0') + { + errno = ENOTDIR; + return NULL; + } + + /* Attempt to determine if the given path really is a directory. */ + struct _stat rcs; + if ( _stat(szPath,&rcs) == -1) + { + /* call GetLastError for more error info */ + errno = ENOENT; + return NULL; + } + if (!(rcs.st_mode & _S_IFDIR)) + { + /* Error, entry exists but not a directory. */ + errno = ENOTDIR; + return NULL; + } + + /* Make an absolute pathname. */ + _realpath(szPath,szFullPath); + + /* Allocate enough space to store DIR structure and the complete + * directory path given. */ + //nd = (DIR *) malloc (sizeof (DIR) + _tcslen (szFullPath) + _tcslen (DIRENT_SLASH) + + // _tcslen (DIRENT_SEARCH_SUFFIX)+1); + nd = new DIR; + + if (!nd) + { + /* Error, out of memory. */ + errno = ENOMEM; + return NULL; + } + + /* Create the search expression. */ + strcpy (nd->dd_name, szFullPath); + + /* Add on a slash if the path does not end with one. */ + if (nd->dd_name[0] != '\0' && + nd->dd_name[strlen (nd->dd_name) - 1] != '/' && + nd->dd_name[strlen (nd->dd_name) - 1] != '\\') + { + strcat (nd->dd_name, DIRENT_SLASH); + } + + /* Add on the search pattern */ + strcat (nd->dd_name, DIRENT_SEARCH_SUFFIX); + + /* Initialize handle to -1 so that a premature closedir doesn't try + * to call _findclose on it. */ + nd->dd_handle = -1; + + /* Initialize the status. */ + nd->dd_stat = 0; + + /* Initialize the dirent structure. ino and reclen are invalid under + * Win32, and name simply points at the appropriate part of the + * findfirst_t structure. */ + //nd->dd_dir.d_ino = 0; + //nd->dd_dir.d_reclen = 0; + nd->dd_dir.d_namlen = 0; + nd->dd_dir.d_name = nd->dd_dta.name; + + return nd; +} + + +struct dirent * readdir (DIR * dirp) +{ + errno = 0; + + /* Check for valid DIR struct. */ + if (!dirp) + { + errno = EFAULT; + return NULL; + } + + if (dirp->dd_dir.d_name != dirp->dd_dta.name) + { + /* The structure does not seem to be set up correctly. */ + errno = EINVAL; + return NULL; + } + + bool bCallFindNext = true; + + if (dirp->dd_stat < 0) + { + /* We have already returned all files in the directory + * (or the structure has an invalid dd_stat). */ + return NULL; + } + else if (dirp->dd_stat == 0) + { + /* We haven't started the search yet. */ + /* Start the search */ + dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta)); + + if (dirp->dd_handle == -1) + { + /* Whoops! Seems there are no files in that + * directory. */ + dirp->dd_stat = -1; + } + else + { + dirp->dd_stat = 1; + } + + /* Dont call _findnext first time. */ + bCallFindNext = false; + } + + while (dirp->dd_stat > 0) + { + if (bCallFindNext) + { + /* Get the next search entry. */ + if (_findnext (dirp->dd_handle, &(dirp->dd_dta))) + { + /* We are off the end or otherwise error. */ + _findclose (dirp->dd_handle); + dirp->dd_handle = -1; + dirp->dd_stat = -1; + return NULL; + } + else + { + /* Update the status to indicate the correct + * number. */ + dirp->dd_stat++; + } + } + + /* Successfully got an entry. Everything about the file is + * already appropriately filled in except the length of the + * file name. */ + dirp->dd_dir.d_namlen = strlen (dirp->dd_dir.d_name); + + bool bThisFolderOrUpFolder = dirp->dd_dir.d_name[0] == '.' && + (dirp->dd_dir.d_name[1] == 0 || (dirp->dd_dir.d_name[1] == '.' && dirp->dd_dir.d_name[2] == 0)); + + if (!bThisFolderOrUpFolder) + { + struct _stat buf; + char buffer[CL_MAX_DIR]; + size_t bl = strlen(dirp->dd_name)-strlen(DIRENT_SEARCH_SUFFIX); + strncpy(buffer,dirp->dd_name,bl); + buffer[bl]=0; + strcat(buffer, dirp->dd_dir.d_name); + if ( _stat(buffer,&buf) == 0 ) + { + /* Finally we have a valid entry. */ + return &dirp->dd_dir; + } + } + + /* Allow to find next file. */ + bCallFindNext = true; + } + + return NULL; +} + + + +int32_t +closedir (DIR * dirp) +{ + int32_t rc; + + errno = 0; + rc = 0; + + if (!dirp) + { + errno = EFAULT; + return -1; + } + + if (dirp->dd_handle != -1) + { + rc = _findclose (dirp->dd_handle); + } + + /* Delete the dir structure. */ + _CLVDELETE(dirp); + + return rc; +} +#endif //HAVE_DIRENT_H + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/dirent.h b/src/assistant/3rdparty/clucene/src/CLucene/util/dirent.h new file mode 100644 index 000000000..71cd34c0a --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/dirent.h @@ -0,0 +1,105 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Matt J. Weinstein +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef lucene_util_dirent_H +#define lucene_util_dirent_H + +#if defined(_LUCENE_PRAGMA_ONCE) +# pragma once +#endif + +#if !defined(_CL_HAVE_DIRENT_H) && !defined(_CL_HAVE_SYS_NDIR_H) && !defined(_CL_HAVE_SYS_DIR_H) && !defined(_CL_HAVE_NDIR_H) + +/** +\unit + * dirent.c + * + * Derived from DIRLIB.C by Matt J. Weinstein + * This note appears in the DIRLIB.H + * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 + * + * Updated by Jeremy Bettis + * Significantly revised and rewinddir, seekdir and telldir added by Colin + * Cut down again & changed by Ben van Klinken + * Peters + * + */ + +/** dirent structure - used by the dirent.h directory iteration functions */ +struct dirent +{ + unsigned short d_namlen; /* Length of name in d_name. */ + char *d_name; /* File name. */ +}; + +/** DIR structure - used by the dirent.h directory iteration functions*/ +struct DIR +{ + /** disk transfer area for this dir */ + struct _finddata_t dd_dta; + + /* dirent struct to return from dir (NOTE: this makes this thread + * safe as long as only one thread uses a particular DIR struct at + * a time) */ + struct dirent dd_dir; + + /** _findnext handle */ + intptr_t dd_handle; + + /** + * Status of search: + * 0 = not started yet (next entry to read is first entry) + * -1 = off the end + * positive = 0 based index of next entry + */ + int32_t dd_stat; + + /** given path for dir with search pattern (struct is extended) */ + char dd_name[CL_MAX_DIR]; + +}; + +#define DIRENT_SEARCH_SUFFIX "*" +#define DIRENT_SLASH PATH_DELIMITERA + + +/** +* Returns a pointer to a DIR structure appropriately filled in to begin +* searching a directory. +*/ +DIR* opendir (const char* filespec); + +/** +* Return a pointer to a dirent structure filled with the information on the +* next entry in the directory. +*/ +struct dirent* readdir (DIR* dir); + +/** +* Frees up resources allocated by opendir. +*/ +int32_t closedir (DIR* dir); + + +#elif defined (_CL_HAVE_DIRENT_H) +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) + +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if defined(_CL_HAVE_SYS_NDIR_H) +# include +# endif +# if defined(_CL_HHAVE_SYS_DIR_H) +# include +# endif +# if defined(_CL_HHAVE_NDIR_H) +# include +# endif + +#endif //HAVE_DIRENT_H +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp b/src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp new file mode 100644 index 000000000..9125d8478 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.cpp @@ -0,0 +1,103 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2006 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#include "jstreamsconfig.h" +#include "fileinputstream.h" + +#ifndef UNDER_CE +#include +#endif +#include +namespace jstreams { + +const int32_t FileInputStream::defaultBufferSize = 1048576; +FileInputStream::FileInputStream(const char *filepath, int32_t buffersize) { + // try to open the file for reading + file = fopen(filepath, "rb"); + this->filepath = filepath; + if (file == 0) { + // handle error + error = "Could not read file '"; + error += filepath; + error += "': "; +#ifndef UNDER_CE + error += strerror(errno); +#endif + status = Error; + return; + } + // determine file size. if the stream is not seekable, the size will be -1 + fseek(file, 0, SEEK_END); + size = ftell(file); + fseek(file, 0, SEEK_SET); + + // if the file has size 0, make sure that it's really empty + // this is useful for filesystems like /proc that report files as size 0 + // for files that do contain content + if (size == 0) { + char dummy[1]; + size_t n = fread(dummy, 1, 1, file); + if (n == 1) { + size = -1; + fseek(file, 0, SEEK_SET); + } else { + fclose(file); + file = 0; + return; + } + } + + // allocate memory in the buffer + int32_t bufsize = (size <= buffersize) ?size+1 :buffersize; + mark(bufsize); +} +FileInputStream::~FileInputStream() { + if (file) { + if (fclose(file)) { + // handle error + error = "Could not close file '" + filepath + "'."; + } + } +} +int32_t +FileInputStream::fillBuffer(char* start, int32_t space) { + if (file == 0) return -1; + // read into the buffer + int32_t nwritten = fread(start, 1, space, file); + // check the file stream status + if (ferror(file)) { + error = "Could not read from file '" + filepath + "'."; + fclose(file); + file = 0; + status = Error; + return -1; + } + if (feof(file)) { + fclose(file); + file = 0; + } + return nwritten; +} +} diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.h b/src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.h new file mode 100644 index 000000000..144423da8 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/fileinputstream.h @@ -0,0 +1,38 @@ +/** + * Copyright 2003-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef FILEINPUTSTREAM_H +#define FILEINPUTSTREAM_H + +#include "bufferedstream.h" + +namespace jstreams { + +class FileInputStream : public BufferedInputStream { +private: + FILE *file; + std::string filepath; + +public: + static const int32_t defaultBufferSize; + FileInputStream(const char *filepath, int32_t buffersize=defaultBufferSize); + ~FileInputStream(); + int32_t fillBuffer(char* start, int32_t space); +}; + +} // end namespace jstreams + +#endif + diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h b/src/assistant/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h new file mode 100644 index 000000000..873e811cd --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/inputstreambuffer.h @@ -0,0 +1,126 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2006 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef INPUTSTREAMBUFFER_H +#define INPUTSTREAMBUFFER_H + +#include + +namespace jstreams { + +template +class InputStreamBuffer { +private: +public: + T* start; + int32_t size; + T* readPos; + int32_t avail; + + InputStreamBuffer(); + ~InputStreamBuffer(); + void setSize(int32_t size); + int32_t read(const T*& start, int32_t max=0); + + /** + * This function prepares the buffer for a new write. + * returns the number of available places. + **/ + int32_t makeSpace(int32_t needed); +}; + +template +InputStreamBuffer::InputStreamBuffer() { + readPos = start = 0; + size = avail = 0; +} +template +InputStreamBuffer::~InputStreamBuffer() { + free(start); +} +template +void +InputStreamBuffer::setSize(int32_t size) { + // store pointer information + int32_t offset = (int32_t)(readPos - start); + + // allocate memory in the buffer + if ( start == 0 ) + start = (T*)malloc(size*sizeof(T)); + else + start = (T*)realloc(start, size*sizeof(T)); + this->size = size; + + // restore pointer information + readPos = start + offset; +} +template +int32_t +InputStreamBuffer::makeSpace(int32_t needed) { + // determine how much space is available for writing + int32_t space = size - ((int32_t)(readPos - start)) - avail; + if (space >= needed) { + // there's enough space + return space; + } + + if (avail) { + if (readPos != start) { +// printf("moving\n"); + // move data to the start of the buffer + memmove(start, readPos, avail*sizeof(T)); + space += (int32_t)(readPos - start); + readPos = start; + } + } else { + // we may start writing at the start of the buffer + readPos = start; + space = size; + } + if (space >= needed) { + // there's enough space now + return space; + } + + // still not enough space, we have to allocate more +// printf("resize %i %i %i %i %i\n", avail, needed, space, size + needed - space, size); + setSize(size + needed - space); + return needed; +} +template +int32_t +InputStreamBuffer::read(const T*& start, int32_t max) { + start = readPos; + if (max <= 0 || max > avail) { + max = avail; + } + readPos += max; + avail -= max; + return max; +} + +} // end namespace jstreams + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h b/src/assistant/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h new file mode 100644 index 000000000..2a6ce9f8d --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/jstreamsconfig.h @@ -0,0 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ + +//this is just a compatibility header for jstreams +#include "CLucene/StdHeader.h" diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/streambase.h b/src/assistant/3rdparty/clucene/src/CLucene/util/streambase.h new file mode 100644 index 000000000..b0d9dc167 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/streambase.h @@ -0,0 +1,148 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +* +* Changes are Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2006 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef STREAMBASE_H +#define STREAMBASE_H + +#include + +#if defined(_BUILD_FOR_QT_) + #include "StdHeader.h" +#endif + +#define INT32MAX 0x7FFFFFFFL + +namespace jstreams { + +enum StreamStatus { Ok, Eof, Error }; + +/** + * @short Base class for stream read access to many different file types. + * + * This class is based on the interface java.io.InputStream. It allows + * for uniform access to streamed resources. + * The main difference with the java equivalent is a performance improvement. + * When reading data, data is not copied into a buffer provided by the caller, + * but a pointer to the read data is provided. This makes this interface + * especially useful for deriving from it and implementing filterers or + * transformers. + */ +// java mapping: long=int64, int=int32, byte=uint8_t +template +class StreamBase { +protected: + int64_t size; + int64_t position; + std::string error; + StreamStatus status; +public: + StreamBase() :size(-1), position(0), status(Ok){ } + virtual ~StreamBase(){} + /** + * @brief Return a string representation of the last error. + * If no error has occurred, an empty string is returned. + **/ + const char* getError() const { return error.c_str(); } + StreamStatus getStatus() const { return status; } + /** + * @brief Get the current position in the stream. + * The value obtained from this function can be used to reset the stream. + **/ + int64_t getPosition() const { return position; } + /** + * @brief Return the size of the stream. + * If the size of the stream is unknown, -1 + * is returned. If the end of the stream has been reached the size is + * always known. + **/ + int64_t getSize() const { return size; } + /** + * @brief Reads characters from the stream and sets \a start to + * the first character that was read. + * + * If @p ntoread is @c 0, then at least one character will be read. + * + * @param start Pointer passed by reference that will be set to point to + * the retrieved array of characters. If the end of the stream + * is encountered or an error occurs, the value of @p start + * is undefined. + * @param min The number of characters to read from the stream. + * @param max The maximum number of characters to read from the stream. + * @return the number of characters that were read. If -1 is returned, the + * end of the stream has been reached. If -2 is returned, an error + * has occurred. + **/ + virtual int32_t read(const T*& start, int32_t min, int32_t max) = 0; + /** + * Skip @param ntoskip bytes. Unless an error occurs or the end of file is + * encountered, this amount of bytes is skipped. + * This function returns new position in the stream. + **/ + virtual int64_t skip(int64_t ntoskip); + /** + * @brief Repositions this stream to given requested position. + * Reset is guaranteed to work after a successful call to read(), + * when the new position is in the range of the data returned by read(). + * This means that @p pos must lie between than the position + * corresponding to the start parameter (x) of the read function + * and the position corresponding to the last position in the returned + * buffer (x + nread). + **/ + virtual int64_t reset(int64_t pos) = 0; + int64_t mark(int32_t readlimit) { + int64_t p = getPosition(); + const T* ptr; + read(ptr, readlimit, -1); + return reset(p); + } +}; +#define SKIPSTEP 1024 +template +int64_t +StreamBase::skip(int64_t ntoskip) { + const T *begin; + int32_t nread; + int64_t skipped = 0; + while (ntoskip) { + int32_t step = (int32_t)((ntoskip > SKIPSTEP) ?SKIPSTEP :ntoskip); + nread = read(begin, 1, step); + if (nread < -1 ) { + // an error occurred + return nread; + } else if (nread < 1) { + ntoskip = 0; + } else { + skipped += nread; + ntoskip -= nread; + } + } + return skipped; +} + +} // end namespace jstreams + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/stringreader.h b/src/assistant/3rdparty/clucene/src/CLucene/util/stringreader.h new file mode 100644 index 000000000..698d07e37 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/stringreader.h @@ -0,0 +1,124 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2006 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef STRINGREADER_H +#define STRINGREADER_H + +/** + * Author: Jos van den Oever + * Ben van Klinken + **/ + + +#include "streambase.h" + +namespace jstreams { + +template +class StringReader : public StreamBase { +private: + int64_t markpt; + T* data; + bool dataowner; + StringReader(const StringReader&); + void operator=(const StringReader&); +public: + StringReader(const T* value, int32_t length = -1, bool copy = true); + ~StringReader(); + int32_t read(const T*& start, int32_t min, int32_t max); + int64_t skip(int64_t ntoskip); + int64_t reset(int64_t pos); +}; + +typedef StringReader StringInputStream; + +template +StringReader::StringReader(const T* value, int32_t length, bool copy) + : markpt(0), dataowner(copy) { + if (length < 0) { + length = 0; + while (value[length] != '\0') { + length++; + } + } + StreamBase::size = length; + if (copy) { + data = new T[length+1]; + size_t s = (size_t)(length*sizeof(T)); + memcpy(data, value, s); + data[length] = 0; + } else { + // casting away const is ok, because we don't write anyway + data = (T*)value; + } +} +template +StringReader::~StringReader() { + if (dataowner) { + delete [] data; + } +} +template +int32_t +StringReader::read(const T*& start, int32_t min, int32_t max) { + int64_t left = StreamBase::size - StreamBase::position; + if (left == 0) { + StreamBase::status = Eof; + return -1; + } + if (min < 0) min = 0; + int32_t nread = (int32_t)((max > left || max < 1) ?left :max); + start = data + StreamBase::position; + StreamBase::position += nread; + if (StreamBase::position == StreamBase::size) { + StreamBase::status = Eof; + } + return nread; +} +template +int64_t +StringReader::skip(int64_t ntoskip) { + const T* start; + return read(start, ntoskip, ntoskip); +} +template +int64_t +StringReader::reset(int64_t newpos) { + if (newpos < 0) { + StreamBase::status = Ok; + StreamBase::position = 0; + } else if (newpos < StreamBase::size) { + StreamBase::status = Ok; + StreamBase::position = newpos; + } else { + StreamBase::position = StreamBase::size; + StreamBase::status = Eof; + } + return StreamBase::position; +} + +} // end namespace jstreams + +#endif diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/subinputstream.h b/src/assistant/3rdparty/clucene/src/CLucene/util/subinputstream.h new file mode 100644 index 000000000..8ae3e33c7 --- /dev/null +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/subinputstream.h @@ -0,0 +1,141 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search + * + * Copyright (C) 2006 Jos van den Oever + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ +#ifndef SUBINPUTSTREAM_H +#define SUBINPUTSTREAM_H + +#include "streambase.h" + +namespace jstreams { + +template +class SubInputStream : public StreamBase { +private: + const int64_t offset; + StreamBase *input; +public: + SubInputStream(StreamBase *input, int64_t size=-1); + int32_t read(const T*& start, int32_t min, int32_t max); + int64_t reset(int64_t newpos); + int64_t skip(int64_t ntoskip); +}; +template +SubInputStream::SubInputStream(StreamBase *i, int64_t length) + : offset(i->getPosition()), input(i) { + assert(length >= -1); +// printf("substream offset: %lli\n", offset); + StreamBase::size = length; +} + +template +int32_t SubInputStream::read(const T*& start, int32_t min, int32_t max) { + if (StreamBase::size != -1) { + const int64_t left = StreamBase::size - StreamBase::position; + if (left == 0) { + return -1; + } + // restrict the amount of data that can be read + if (max <= 0 || max > left) { + max = (int32_t)left; + } + if (min > max) min = max; + if (left < min) min = (int32_t)left; + } + int32_t nread = input->read(start, min, max); + if (nread < -1) { + fprintf(stderr, "substream too short.\n"); + StreamBase::status = Error; + StreamBase::error = input->getError(); + } else if (nread < min) { + if (StreamBase::size == -1) { + StreamBase::status = Eof; + if (nread > 0) { + StreamBase::position += nread; + StreamBase::size = StreamBase::position; + } + } else { +// fprintf(stderr, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! nread %i min %i max %i size %lli\n", nread, min, max, size); +// fprintf(stderr, "pos %lli parentpos %lli\n", position, input->getPosition()); +// fprintf(stderr, "status: %i error: %s\n", input->getStatus(), input->getError()); + // we expected data but didn't get enough so that's an error + StreamBase::status = Error; + StreamBase::error = "Premature end of stream\n"; + nread = -2; + } + } else { + StreamBase::position += nread; + if (StreamBase::position == StreamBase::size) { + StreamBase::status = Eof; + } + } + return nread; +} + +template +int64_t SubInputStream::reset(int64_t newpos) { +// fprintf(stderr, "subreset pos: %lli newpos: %lli offset: %lli\n", position, +// newpos, offset); + StreamBase::position = input->reset(newpos + offset); + if (StreamBase::position < offset) { + printf("###########\n"); + StreamBase::status = Error; + StreamBase::error = input->getError(); + } else { + StreamBase::position -= offset; + StreamBase::status = input->getStatus(); + } + return StreamBase::position; +} + +template +int64_t SubInputStream::skip(int64_t ntoskip) { +// printf("subskip pos: %lli ntoskip: %lli offset: %lli\n", position, ntoskip, offset); + if (StreamBase::size == StreamBase::position) { + StreamBase::status = Eof; + return -1; + } + if (StreamBase::size != -1) { + const int64_t left = StreamBase::size - StreamBase::position; + // restrict the amount of data that can be skipped + if (ntoskip > left) { + ntoskip = left; + } + } + int64_t skipped = input->skip(ntoskip); + if (input->getStatus() == Error) { + StreamBase::status = Error; + StreamBase::error = input->getError(); + } else { + StreamBase::position += skipped; + if (StreamBase::position == StreamBase::size) { + StreamBase::status = Eof; + } + } + return skipped; +} + +} //end namespace jstreams + +#endif diff --git a/src/assistant/assistant.pro b/src/assistant/assistant.pro index 97196b253..b16a1892b 100644 --- a/src/assistant/assistant.pro +++ b/src/assistant/assistant.pro @@ -1,6 +1,10 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS += lib/fulltextsearch \ - lib \ - tools +SUBDIRS += clucene \ + help \ + assistant \ + qhelpgenerator \ + qcollectiongenerator \ + qhelpconverter + diff --git a/src/assistant/assistant/Info_mac.plist b/src/assistant/assistant/Info_mac.plist new file mode 100644 index 000000000..76369a1c5 --- /dev/null +++ b/src/assistant/assistant/Info_mac.plist @@ -0,0 +1,18 @@ + + + + + CFBundleIconFile + @ICON@ + CFBundlePackageType + APPL + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + ???? + CFBundleIdentifier + com.trolltech.assistant + CFBundleExecutable + @EXECUTABLE@ + + diff --git a/src/assistant/assistant/aboutdialog.cpp b/src/assistant/assistant/aboutdialog.cpp new file mode 100644 index 000000000..d306812bb --- /dev/null +++ b/src/assistant/assistant/aboutdialog.cpp @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "aboutdialog.h" + +#include "helpviewer.h" +#include "tracer.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +AboutLabel::AboutLabel(QWidget *parent) + : QTextBrowser(parent) +{ + TRACE_OBJ + setFrameStyle(QFrame::NoFrame); + QPalette p; + p.setColor(QPalette::Base, p.color(QPalette::Background)); + setPalette(p); +} + +void AboutLabel::setText(const QString &text, const QByteArray &resources) +{ + TRACE_OBJ + QDataStream in(resources); + in >> m_resourceMap; + + QTextBrowser::setText(text); +} + +QSize AboutLabel::minimumSizeHint() const +{ + TRACE_OBJ + QTextDocument *doc = document(); + doc->adjustSize(); + return QSize(int(doc->size().width()), int(doc->size().height())); +} + +QVariant AboutLabel::loadResource(int type, const QUrl &name) +{ + TRACE_OBJ + if (type == 2 || type == 3) { + if (m_resourceMap.contains(name.toString())) { + return m_resourceMap.value(name.toString()); + } + } + return QVariant(); +} + +void AboutLabel::setSource(const QUrl &url) +{ + TRACE_OBJ + if (url.isValid() && (!HelpViewer::isLocalUrl(url) + || !HelpViewer::canOpenPage(url.path()))) { + if (!QDesktopServices::openUrl(url)) { + QMessageBox::warning(this, tr("Warning"), + tr("Unable to launch external application.\n"), tr("OK")); + } + } +} + +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | + Qt::WindowTitleHint|Qt::WindowSystemMenuHint) +{ + TRACE_OBJ + m_pixmapLabel = 0; + m_aboutLabel = new AboutLabel(); + + m_closeButton = new QPushButton(); + m_closeButton->setText(tr("&Close")); + connect(m_closeButton, SIGNAL(clicked()), this, SLOT(close())); + + m_layout = new QGridLayout(this); + m_layout->addWidget(m_aboutLabel, 1, 0, 1, -1); + m_layout->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum, + QSizePolicy::Fixed), 2, 1, 1, 1); + m_layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding), 3, 0, 1, 1); + m_layout->addWidget(m_closeButton, 3, 1, 1, 1); + m_layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding), 3, 2, 1, 1); +} + +void AboutDialog::setText(const QString &text, const QByteArray &resources) +{ + TRACE_OBJ + m_aboutLabel->setText(text, resources); + updateSize(); +} + +void AboutDialog::setPixmap(const QPixmap &pixmap) +{ + TRACE_OBJ + if (!m_pixmapLabel) { + m_pixmapLabel = new QLabel(); + m_layout->addWidget(m_pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter); + } + m_pixmapLabel->setPixmap(pixmap); + updateSize(); +} + +QString AboutDialog::documentTitle() const +{ + TRACE_OBJ + return m_aboutLabel->documentTitle(); +} + +void AboutDialog::updateSize() +{ + TRACE_OBJ + QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()) + .size(); + int limit = qMin(screenSize.width()/2, 500); + +#ifdef Q_WS_MAC + limit = qMin(screenSize.width()/2, 420); +#endif + + layout()->activate(); + int width = layout()->totalMinimumSize().width(); + + if (width > limit) + width = limit; + + QFontMetrics fm(qApp->font("QWorkspaceTitleBar")); + int windowTitleWidth = qMin(fm.width(windowTitle()) + 50, limit); + if (windowTitleWidth > width) + width = windowTitleWidth; + + layout()->activate(); + int height = (layout()->hasHeightForWidth()) + ? layout()->totalHeightForWidth(width) + : layout()->totalMinimumSize().height(); + setFixedSize(width, height); + QCoreApplication::removePostedEvents(this, QEvent::LayoutRequest); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/aboutdialog.h b/src/assistant/assistant/aboutdialog.h new file mode 100644 index 000000000..70b315714 --- /dev/null +++ b/src/assistant/assistant/aboutdialog.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QLabel; +class QPushButton; +class QGridLayout; + +class AboutLabel : public QTextBrowser +{ + Q_OBJECT + +public: + AboutLabel(QWidget *parent = 0); + void setText(const QString &text, const QByteArray &resources); + QSize minimumSizeHint() const; + +private: + QVariant loadResource(int type, const QUrl &name); + void setSource(const QUrl &url); + + QMap m_resourceMap; +}; + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + AboutDialog(QWidget *parent = 0); + void setText(const QString &text, const QByteArray &resources); + void setPixmap(const QPixmap &pixmap); + QString documentTitle() const; + +private: + void updateSize(); + + QLabel *m_pixmapLabel; + AboutLabel *m_aboutLabel; + QPushButton *m_closeButton; + QGridLayout *m_layout; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/assistant/assistant.icns b/src/assistant/assistant/assistant.icns new file mode 100644 index 000000000..6291dd397 Binary files /dev/null and b/src/assistant/assistant/assistant.icns differ diff --git a/src/assistant/assistant/assistant.ico b/src/assistant/assistant/assistant.ico new file mode 100644 index 000000000..9e1b83f1b Binary files /dev/null and b/src/assistant/assistant/assistant.ico differ diff --git a/src/assistant/assistant/assistant.pro b/src/assistant/assistant/assistant.pro new file mode 100644 index 000000000..37e0282ce --- /dev/null +++ b/src/assistant/assistant/assistant.pro @@ -0,0 +1,119 @@ +TEMPLATE = app +LANGUAGE = C++ +TARGET = assistant +!isEmpty(QT.webkit.name) { + QT += webkit +} else { + DEFINES += QT_NO_WEBKIT +} +CONFIG += qt \ + warn_on \ + help +QT += widgets printsupport network help +PROJECTNAME = Assistant + +DEPENDPATH += ../shared + +include(../../shared/fontpanel/fontpanel.pri) + +# ## Work around a qmake issue when statically linking to +# ## not-yet-installed plugins +QMAKE_LIBDIR += $$QT_BUILD_TREE/plugins/sqldrivers +HEADERS += aboutdialog.h \ + bookmarkdialog.h \ + bookmarkfiltermodel.h \ + bookmarkitem.h \ + bookmarkmanager.h \ + bookmarkmanagerwidget.h \ + bookmarkmodel.h \ + centralwidget.h \ + cmdlineparser.h \ + contentwindow.h \ + findwidget.h \ + filternamedialog.h \ + helpenginewrapper.h \ + helpviewer.h \ + helpviewer_p.h \ + indexwindow.h \ + installdialog.h \ + mainwindow.h \ + preferencesdialog.h \ + qtdocinstaller.h \ + remotecontrol.h \ + searchwidget.h \ + topicchooser.h \ + tracer.h \ + xbelsupport.h \ + ../shared/collectionconfiguration.h \ + openpagesmodel.h \ + globalactions.h \ + openpageswidget.h \ + openpagesmanager.h \ + openpagesswitcher.h +win32:HEADERS += remotecontrol_win.h + +SOURCES += aboutdialog.cpp \ + bookmarkdialog.cpp \ + bookmarkfiltermodel.cpp \ + bookmarkitem.cpp \ + bookmarkmanager.cpp \ + bookmarkmanagerwidget.cpp \ + bookmarkmodel.cpp \ + centralwidget.cpp \ + cmdlineparser.cpp \ + contentwindow.cpp \ + findwidget.cpp \ + filternamedialog.cpp \ + helpenginewrapper.cpp \ + helpviewer.cpp \ + indexwindow.cpp \ + installdialog.cpp \ + main.cpp \ + mainwindow.cpp \ + preferencesdialog.cpp \ + qtdocinstaller.cpp \ + remotecontrol.cpp \ + searchwidget.cpp \ + topicchooser.cpp \ + xbelsupport.cpp \ + ../shared/collectionconfiguration.cpp \ + openpagesmodel.cpp \ + globalactions.cpp \ + openpageswidget.cpp \ + openpagesmanager.cpp \ + openpagesswitcher.cpp +contains(QT_CONFIG, webkit) { + SOURCES += helpviewer_qwv.cpp +} else { + SOURCES += helpviewer_qtb.cpp +} + +FORMS += bookmarkdialog.ui \ + bookmarkmanagerwidget.ui \ + bookmarkwidget.ui \ + filternamedialog.ui \ + installdialog.ui \ + preferencesdialog.ui \ + topicchooser.ui + +RESOURCES += assistant.qrc \ + assistant_images.qrc + +win32 { + !wince*:LIBS += -lshell32 + RC_FILE = assistant.rc +} + +mac { + ICON = assistant.icns + TARGET = Assistant + QMAKE_INFO_PLIST = Info_mac.plist +} + +contains(CONFIG, static): { + SQLPLUGINS = $$unique(sql-plugins) + contains(SQLPLUGINS, sqlite): { + QTPLUGIN += qsqlite + DEFINES += USE_STATIC_SQLITE_PLUGIN + } +} diff --git a/src/assistant/assistant/assistant.qch b/src/assistant/assistant/assistant.qch new file mode 100644 index 000000000..e6d52997b Binary files /dev/null and b/src/assistant/assistant/assistant.qch differ diff --git a/src/assistant/assistant/assistant.qrc b/src/assistant/assistant/assistant.qrc new file mode 100644 index 000000000..dddf1be75 --- /dev/null +++ b/src/assistant/assistant/assistant.qrc @@ -0,0 +1,5 @@ + + + assistant.qch + + diff --git a/src/assistant/assistant/assistant.rc b/src/assistant/assistant/assistant.rc new file mode 100644 index 000000000..b1bf97b5c --- /dev/null +++ b/src/assistant/assistant/assistant.rc @@ -0,0 +1,32 @@ +#include "winver.h" + +IDI_ICON1 ICON DISCARDABLE "assistant.ico" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,0 + PRODUCTVERSION 1,0,0,0 + FILEFLAGS 0x0L + FILEFLAGSMASK 0x3fL + FILEOS 0x00040004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)" + VALUE "FileDescription", "Qt Assistant" + VALUE "FileVersion", "1.0.0.0" + VALUE "LegalCopyright", "Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)." + VALUE "InternalName", "assistant.exe" + VALUE "OriginalFilename", "assistant.exe" + VALUE "ProductName", "Qt Assistant" + VALUE "ProductVersion", "1.0.0.0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/src/assistant/assistant/assistant_images.qrc b/src/assistant/assistant/assistant_images.qrc new file mode 100644 index 000000000..b4f25236d --- /dev/null +++ b/src/assistant/assistant/assistant_images.qrc @@ -0,0 +1,37 @@ + + + images/trolltech-logo.png + images/assistant-128.png + images/assistant.png + images/wrap.png + images/bookmark.png + images/mac/addtab.png + images/mac/book.png + images/mac/closetab.png + images/mac/editcopy.png + images/mac/find.png + images/mac/home.png + images/mac/next.png + images/mac/previous.png + images/mac/print.png + images/mac/synctoc.png + images/mac/zoomin.png + images/mac/zoomout.png + images/mac/resetzoom.png + images/win/addtab.png + images/win/book.png + images/win/closetab.png + images/win/editcopy.png + images/win/find.png + images/win/home.png + images/win/next.png + images/win/previous.png + images/win/print.png + images/win/synctoc.png + images/win/zoomin.png + images/win/zoomout.png + images/win/resetzoom.png + images/closebutton.png + images/darkclosebutton.png + + diff --git a/src/assistant/assistant/bookmarkdialog.cpp b/src/assistant/assistant/bookmarkdialog.cpp new file mode 100644 index 000000000..e3cd9ac60 --- /dev/null +++ b/src/assistant/assistant/bookmarkdialog.cpp @@ -0,0 +1,237 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkdialog.h" +#include "bookmarkfiltermodel.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" +#include "helpenginewrapper.h" +#include "tracer.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +BookmarkDialog::BookmarkDialog(BookmarkModel *sourceModel, const QString &title, + const QString &url, QWidget *parent) + : QDialog(parent) + , m_url(url) + , m_title(title) + , bookmarkModel(sourceModel) +{ + TRACE_OBJ + ui.setupUi(this); + + ui.bookmarkEdit->setText(m_title); + ui.newFolderButton->setVisible(false); + ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); + + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejected())); + connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addFolder())); + connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); + connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + + bookmarkProxyModel = new BookmarkFilterModel(this); + bookmarkProxyModel->setSourceModel(bookmarkModel); + ui.bookmarkFolders->setModel(bookmarkProxyModel); + connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(int)), this, + SLOT(currentIndexChanged(int))); + + bookmarkTreeModel = new BookmarkTreeModel(this); + bookmarkTreeModel->setSourceModel(bookmarkModel); + ui.treeView->setModel(bookmarkTreeModel); + + ui.treeView->expandAll(); + ui.treeView->setVisible(false); + ui.treeView->installEventFilter(this); + ui.treeView->viewport()->installEventFilter(this); + ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); + + connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); + connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, + QModelIndex)), this, SLOT(currentIndexChanged(QModelIndex))); + + ui.bookmarkFolders->setCurrentIndex(0); + ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); + + const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.usesAppFont()) + setFont(helpEngine.appFont()); +} + +BookmarkDialog::~BookmarkDialog() +{ + TRACE_OBJ +} + +bool BookmarkDialog::isRootItem(const QModelIndex &index) const +{ + return !bookmarkTreeModel->parent(index).isValid(); +} + +bool BookmarkDialog::eventFilter(QObject *object, QEvent *event) +{ + TRACE_OBJ + if (object != ui.treeView && object != ui.treeView->viewport()) + return QWidget::eventFilter(object, event); + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + switch (ke->key()) { + case Qt::Key_F2: { + const QModelIndex &index = ui.treeView->currentIndex(); + if (!isRootItem(index)) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(index); + bookmarkModel->setItemsEditable(false); + } + } break; + default: break; + } + } + + return QObject::eventFilter(object, event); +} + +void BookmarkDialog::currentIndexChanged(int row) +{ + TRACE_OBJ + QModelIndex next = bookmarkProxyModel->index(row, 0, QModelIndex()); + if (next.isValid()) { + next = bookmarkProxyModel->mapToSource(next); + ui.treeView->setCurrentIndex(bookmarkTreeModel->mapFromSource(next)); + } +} + +void BookmarkDialog::currentIndexChanged(const QModelIndex &index) +{ + TRACE_OBJ + const QModelIndex current = bookmarkTreeModel->mapToSource(index); + if (current.isValid()) { + const int row = bookmarkProxyModel->mapFromSource(current).row(); + ui.bookmarkFolders->setCurrentIndex(row); + } +} + +void BookmarkDialog::accepted() +{ + TRACE_OBJ + QModelIndex index = ui.treeView->currentIndex(); + if (index.isValid()) { + index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index)); + bookmarkModel->setData(index, DataVector() << m_title << m_url << false); + } else + rejected(); + + accept(); +} + +void BookmarkDialog::rejected() +{ + TRACE_OBJ + foreach (const QPersistentModelIndex &index, cache) + bookmarkModel->removeItem(index); + reject(); +} + +void BookmarkDialog::addFolder() +{ + TRACE_OBJ + QModelIndex index = ui.treeView->currentIndex(); + if (index.isValid()) { + index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index), + true); + cache.append(index); + + index = bookmarkTreeModel->mapFromSource(index); + if (index.isValid()) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(index); + ui.treeView->expand(index); + ui.treeView->setCurrentIndex(index); + bookmarkModel->setItemsEditable(false); + } + } +} + +void BookmarkDialog::toolButtonClicked() +{ + TRACE_OBJ + const bool visible = !ui.treeView->isVisible(); + ui.treeView->setVisible(visible); + ui.newFolderButton->setVisible(visible); + + if (visible) { + resize(QSize(width(), 400)); + ui.toolButton->setText(QLatin1String("-")); + } else { + resize(width(), minimumHeight()); + ui.toolButton->setText(QLatin1String("+")); + } +} + +void BookmarkDialog::textChanged(const QString& text) +{ + m_title = text; +} + +void BookmarkDialog::customContextMenuRequested(const QPoint &point) +{ + TRACE_OBJ + const QModelIndex &index = ui.treeView->currentIndex(); + if (isRootItem(index)) + return; // check if we go to rename the "Bookmarks Menu", bail + + QMenu menu(QLatin1String(""), this); + QAction *renameItem = menu.addAction(tr("Rename Folder")); + + QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); + if (picked == renameItem) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(index); + bookmarkModel->setItemsEditable(false); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/bookmarkdialog.h b/src/assistant/assistant/bookmarkdialog.h new file mode 100644 index 000000000..dfa65bbf8 --- /dev/null +++ b/src/assistant/assistant/bookmarkdialog.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKDIALOG_H +#define BOOKMARKDIALOG_H + +#include "ui_bookmarkdialog.h" + +QT_BEGIN_NAMESPACE + +class BookmarkModel; +class BookmarkFilterModel; +class BookmarkTreeModel; + +class BookmarkDialog : public QDialog +{ + Q_OBJECT +public: + BookmarkDialog(BookmarkModel *bookmarkModel, const QString &title, + const QString &url, QWidget *parent = 0); + ~BookmarkDialog(); + +private: + bool isRootItem(const QModelIndex &index) const; + bool eventFilter(QObject *object, QEvent *event); + +private slots: + void currentIndexChanged(int index); + void currentIndexChanged(const QModelIndex &index); + + void accepted(); + void rejected(); + + void addFolder(); + void toolButtonClicked(); + void textChanged(const QString& text); + void customContextMenuRequested(const QPoint &point); + +private: + QString m_url; + QString m_title; + Ui::BookmarkDialog ui; + QList cache; + + BookmarkModel *bookmarkModel; + BookmarkTreeModel *bookmarkTreeModel; + BookmarkFilterModel *bookmarkProxyModel; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKDIALOG_H diff --git a/src/assistant/assistant/bookmarkdialog.ui b/src/assistant/assistant/bookmarkdialog.ui new file mode 100644 index 000000000..51315317b --- /dev/null +++ b/src/assistant/assistant/bookmarkdialog.ui @@ -0,0 +1,156 @@ + + + BookmarkDialog + + + + 0 + 0 + 450 + 133 + + + + + 0 + 0 + + + + Add Bookmark + + + + + + + + + + Bookmark: + + + + + + + Add in Folder: + + + + + + + + + + + + + + + + + + + + + + + + 25 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + true + + + true + + + true + + + + + + + + + New Folder + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + BookmarkDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + BookmarkDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/assistant/assistant/bookmarkfiltermodel.cpp b/src/assistant/assistant/bookmarkfiltermodel.cpp new file mode 100644 index 000000000..412e08e5d --- /dev/null +++ b/src/assistant/assistant/bookmarkfiltermodel.cpp @@ -0,0 +1,321 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkfiltermodel.h" + +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +BookmarkFilterModel::BookmarkFilterModel(QObject *parent) + : QAbstractProxyModel(parent) + , hideBookmarks(true) + , sourceModel(0) +{ +} + +void BookmarkFilterModel::setSourceModel(QAbstractItemModel *_sourceModel) +{ + beginResetModel(); + + if (sourceModel) { + disconnect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), + this, SLOT(changed(QModelIndex, QModelIndex))); + disconnect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(rowsInserted(QModelIndex, int, int))); + disconnect(sourceModel, + SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, + SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); + disconnect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), + this, SLOT(rowsRemoved(QModelIndex, int, int))); + disconnect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, + SLOT(layoutAboutToBeChanged())); + disconnect(sourceModel, SIGNAL(layoutChanged()), this, + SLOT(layoutChanged())); + disconnect(sourceModel, SIGNAL(modelAboutToBeReset()), this, + SLOT(modelAboutToBeReset())); + disconnect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + } + + QAbstractProxyModel::setSourceModel(sourceModel); + sourceModel = qobject_cast (_sourceModel); + + connect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(changed(QModelIndex, QModelIndex))); + + connect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(rowsInserted(QModelIndex, int, int))); + + connect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), + this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); + connect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + SLOT(rowsRemoved(QModelIndex, int, int))); + + connect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, + SLOT(layoutAboutToBeChanged())); + connect(sourceModel, SIGNAL(layoutChanged()), this, + SLOT(layoutChanged())); + + connect(sourceModel, SIGNAL(modelAboutToBeReset()), this, + SLOT(modelAboutToBeReset())); + connect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + + if (sourceModel) + setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); + + endResetModel(); +} + +int BookmarkFilterModel::rowCount(const QModelIndex &index) const +{ + Q_UNUSED(index) + return cache.count(); +} + +int BookmarkFilterModel::columnCount(const QModelIndex &index) const +{ + Q_UNUSED(index) + if (sourceModel) + return sourceModel->columnCount(); + return 0; +} + +QModelIndex BookmarkFilterModel::mapToSource(const QModelIndex &proxyIndex) const +{ + const int row = proxyIndex.row(); + if (proxyIndex.isValid() && row >= 0 && row < cache.count()) + return cache[row]; + return QModelIndex(); +} + +QModelIndex BookmarkFilterModel::mapFromSource(const QModelIndex &sourceIndex) const +{ + return index(cache.indexOf(sourceIndex), 0, QModelIndex()); +} + +QModelIndex BookmarkFilterModel::parent(const QModelIndex &child) const +{ + Q_UNUSED(child) + return QModelIndex(); +} + +QModelIndex BookmarkFilterModel::index(int row, int column, + const QModelIndex &index) const +{ + Q_UNUSED(index) + if (row < 0 || column < 0 || cache.count() <= row + || !sourceModel || sourceModel->columnCount() <= column) { + return QModelIndex(); + } + return createIndex(row, 0); +} + +Qt::DropActions BookmarkFilterModel::supportedDropActions () const +{ + if (sourceModel) + return sourceModel->supportedDropActions(); + return Qt::IgnoreAction; +} + +Qt::ItemFlags BookmarkFilterModel::flags(const QModelIndex &index) const +{ + if (sourceModel) + return sourceModel->flags(index); + return Qt::NoItemFlags; +} + +QVariant BookmarkFilterModel::data(const QModelIndex &index, int role) const +{ + if (sourceModel) + return sourceModel->data(mapToSource(index), role); + return QVariant(); +} + +bool BookmarkFilterModel::setData(const QModelIndex &index, const QVariant &value, + int role) +{ + if (sourceModel) + return sourceModel->setData(mapToSource(index), value, role); + return false; +} + +void BookmarkFilterModel::filterBookmarks() +{ + if (sourceModel) { + beginResetModel(); + hideBookmarks = true; + setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); + endResetModel(); + } +} + +void BookmarkFilterModel::filterBookmarkFolders() +{ + if (sourceModel) { + beginResetModel(); + hideBookmarks = false; + setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); + endResetModel(); + } +} + +void BookmarkFilterModel::changed(const QModelIndex &topLeft, + const QModelIndex &bottomRight) +{ + emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight)); +} + +void BookmarkFilterModel::rowsInserted(const QModelIndex &parent, int start, + int end) +{ + if (!sourceModel) + return; + + QModelIndex cachePrevious = parent; + if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { + BookmarkItem *newItem = parentItem->child(start); + + // iterate over tree hirarchie to find the previous folder + for (int i = 0; i < parentItem->childCount(); ++i) { + if (BookmarkItem *child = parentItem->child(i)) { + const QModelIndex &tmp = sourceModel->indexFromItem(child); + if (tmp.data(UserRoleFolder).toBool() && child != newItem) + cachePrevious = tmp; + } + } + + const QModelIndex &newIndex = sourceModel->indexFromItem(newItem); + const bool isFolder = newIndex.data(UserRoleFolder).toBool(); + if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) { + beginInsertRows(mapFromSource(parent), start, end); + const int index = cache.indexOf(cachePrevious) + 1; + if (cache.value(index, QPersistentModelIndex()) != newIndex) + cache.insert(index, newIndex); + endInsertRows(); + } + } +} + +void BookmarkFilterModel::rowsAboutToBeRemoved(const QModelIndex &parent, + int start, int end) +{ + if (!sourceModel) + return; + + if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { + if (BookmarkItem *child = parentItem->child(start)) { + indexToRemove = sourceModel->indexFromItem(child); + if (cache.contains(indexToRemove)) + beginRemoveRows(mapFromSource(parent), start, end); + } + } +} + +void BookmarkFilterModel::rowsRemoved(const QModelIndex &/*parent*/, int, int) +{ + if (cache.contains(indexToRemove)) { + cache.removeAll(indexToRemove); + endRemoveRows(); + } +} + +void BookmarkFilterModel::layoutAboutToBeChanged() +{ + // TODO: ??? +} + +void BookmarkFilterModel::layoutChanged() +{ + // TODO: ??? +} + +void BookmarkFilterModel::modelAboutToBeReset() +{ + beginResetModel(); +} + +void BookmarkFilterModel::modelReset() +{ + if (sourceModel) + setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); + endResetModel(); +} + +void BookmarkFilterModel::setupCache(const QModelIndex &parent) +{ + cache.clear(); + for (int i = 0; i < sourceModel->rowCount(parent); ++i) + collectItems(sourceModel->index(i, 0, parent)); +} + +void BookmarkFilterModel::collectItems(const QModelIndex &parent) +{ + if (parent.isValid()) { + bool isFolder = sourceModel->data(parent, UserRoleFolder).toBool(); + if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) + cache.append(parent); + + if (sourceModel->hasChildren(parent)) { + for (int i = 0; i < sourceModel->rowCount(parent); ++i) + collectItems(sourceModel->index(i, 0, parent)); + } + } +} + +// -- BookmarkTreeModel + +BookmarkTreeModel::BookmarkTreeModel(QObject *parent) + : QSortFilterProxyModel(parent) +{ +} + +int BookmarkTreeModel::columnCount(const QModelIndex &parent) const +{ + return qMin(1, QSortFilterProxyModel::columnCount(parent)); +} + +bool BookmarkTreeModel::filterAcceptsRow(int row, const QModelIndex &parent) const +{ + Q_UNUSED(row) + BookmarkModel *model = qobject_cast (sourceModel()); + if (model->rowCount(parent) > 0 + && model->data(model->index(row, 0, parent), UserRoleFolder).toBool()) + return true; + return false; +} diff --git a/src/assistant/assistant/bookmarkfiltermodel.h b/src/assistant/assistant/bookmarkfiltermodel.h new file mode 100644 index 000000000..310e27512 --- /dev/null +++ b/src/assistant/assistant/bookmarkfiltermodel.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKFILTERMODEL_H +#define BOOKMARKFILTERMODEL_H + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class BookmarkItem; +class BookmarkModel; + +typedef QList PersistentModelIndexCache; + +class BookmarkFilterModel : public QAbstractProxyModel +{ + Q_OBJECT +public: + explicit BookmarkFilterModel(QObject *parent = 0); + + void setSourceModel(QAbstractItemModel *sourceModel); + + int rowCount(const QModelIndex &index) const; + int columnCount(const QModelIndex &index) const; + + QModelIndex mapToSource(const QModelIndex &proxyIndex) const; + QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; + + QModelIndex parent(const QModelIndex &child) const; + QModelIndex index(int row, int column, const QModelIndex &parent) const; + + Qt::DropActions supportedDropActions () const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role); + + void filterBookmarks(); + void filterBookmarkFolders(); + +private slots: + void changed(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void rowsInserted(const QModelIndex &parent, int start, int end); + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + void rowsRemoved(const QModelIndex &parent, int start, int end); + void layoutAboutToBeChanged(); + void layoutChanged(); + void modelAboutToBeReset(); + void modelReset(); + +private: + void setupCache(const QModelIndex &parent); + void collectItems(const QModelIndex &parent); + +private: + bool hideBookmarks; + BookmarkModel *sourceModel; + PersistentModelIndexCache cache; + QPersistentModelIndex indexToRemove; +}; + +// -- BookmarkTreeModel + +class BookmarkTreeModel : public QSortFilterProxyModel +{ + Q_OBJECT +public: + BookmarkTreeModel(QObject *parent = 0); + int columnCount(const QModelIndex &parent = QModelIndex()) const; + +protected: + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKFILTERMODEL_H diff --git a/src/assistant/assistant/bookmarkitem.cpp b/src/assistant/assistant/bookmarkitem.cpp new file mode 100644 index 000000000..8bcf451c1 --- /dev/null +++ b/src/assistant/assistant/bookmarkitem.cpp @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "bookmarkitem.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +BookmarkItem::BookmarkItem(const DataVector &data, BookmarkItem *parent) + : m_data(data) + , m_parent(parent) +{ +} + +BookmarkItem::~BookmarkItem() +{ + qDeleteAll(m_children); +} + +BookmarkItem* +BookmarkItem::parent() const +{ + return m_parent; +} + +void +BookmarkItem::setParent(BookmarkItem *parent) +{ + m_parent = parent; +} + +void +BookmarkItem::addChild(BookmarkItem *child) +{ + child->setParent(this); + m_children.append(child); +} + +BookmarkItem* +BookmarkItem::child(int number) const +{ + if (number >= 0 && number < m_children.count()) + return m_children[number]; + return 0; +} + +int BookmarkItem::childCount() const +{ + return m_children.count(); +} + +int BookmarkItem::childNumber() const +{ + if (m_parent) + return m_parent->m_children.indexOf(const_cast(this)); + return 0; +} + +QVariant +BookmarkItem::data(int column) const +{ + if (column == 0) + return m_data[0]; + + if (column == 1 || column == UserRoleUrl) + return m_data[1]; + + if (column == UserRoleFolder) + return m_data[1].toString() == QLatin1String("Folder"); + + if (column == UserRoleExpanded) + return m_data[2]; + + return QVariant(); +} + +void +BookmarkItem::setData(const DataVector &data) +{ + m_data = data; +} + +bool +BookmarkItem::setData(int column, const QVariant &newValue) +{ + int index = -1; + if (column == 0 || column == 1) + index = column; + + if (column == UserRoleUrl || column == UserRoleFolder) + index = 1; + + if (column == UserRoleExpanded) + index = 2; + + if (index < 0) + return false; + + m_data[index] = newValue; + return true; +} + +bool +BookmarkItem::insertChildren(bool isFolder, int position, int count) +{ + if (position < 0 || position > m_children.size()) + return false; + + for (int row = 0; row < count; ++row) { + m_children.insert(position, new BookmarkItem(DataVector() + << (isFolder + ? QCoreApplication::translate("BookmarkItem", "New Folder") + : QCoreApplication::translate("BookmarkItem", "Untitled")) + << (isFolder ? "Folder" : "about:blank") << false, this)); + } + + return true; +} + +bool +BookmarkItem::removeChildren(int position, int count) +{ + if (position < 0 || position > m_children.size()) + return false; + + for (int row = 0; row < count; ++row) + delete m_children.takeAt(position); + + return true; +} + +void +BookmarkItem::dumpTree(int indent) const +{ + const QString tree(indent, ' '); + qDebug() << tree + (data(UserRoleFolder).toBool() ? "Folder" : "Bookmark") + << "Label:" << data(0).toString() << "parent:" << m_parent << "this:" + << this; + + foreach (BookmarkItem *item, m_children) + item->dumpTree(indent + 4); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/bookmarkitem.h b/src/assistant/assistant/bookmarkitem.h new file mode 100644 index 000000000..96ce786be --- /dev/null +++ b/src/assistant/assistant/bookmarkitem.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BOOKMARKITEM_H +#define BOOKMARKITEM_H + +#include +#include + +QT_BEGIN_NAMESPACE + +enum { + UserRoleUrl = Qt::UserRole + 50, + UserRoleFolder = Qt::UserRole + 100, + UserRoleExpanded = Qt::UserRole + 150 +}; + +typedef QVector DataVector; + +class BookmarkItem +{ +public: + explicit BookmarkItem(const DataVector &data, BookmarkItem *parent = 0); + ~BookmarkItem(); + + BookmarkItem *parent() const; + void setParent(BookmarkItem *parent); + + void addChild(BookmarkItem *child); + BookmarkItem *child(int number) const; + + int childCount() const; + int childNumber() const; + + QVariant data(int column) const; + void setData(const DataVector &data); + bool setData(int column, const QVariant &value); + + bool insertChildren(bool isFolder, int position, int count); + bool removeChildren(int position, int count); + + void dumpTree(int indent) const; + +private: + DataVector m_data; + + BookmarkItem *m_parent; + QList m_children; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKITEM_H diff --git a/src/assistant/assistant/bookmarkmanager.cpp b/src/assistant/assistant/bookmarkmanager.cpp new file mode 100644 index 000000000..29d8567a7 --- /dev/null +++ b/src/assistant/assistant/bookmarkmanager.cpp @@ -0,0 +1,559 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "bookmarkmanager.h" +#include "bookmarkmanagerwidget.h" +#include "bookmarkdialog.h" +#include "bookmarkfiltermodel.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" +#include "centralwidget.h" +#include "helpenginewrapper.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +// -- BookmarkManager::BookmarkWidget + +void BookmarkManager::BookmarkWidget::focusInEvent(QFocusEvent *event) +{ + TRACE_OBJ + if (event->reason() != Qt::MouseFocusReason) { + ui.lineEdit->selectAll(); + ui.lineEdit->setFocus(); + + // force the focus in event on bookmark manager + emit focusInEvent(); + } +} + +// -- BookmarkManager::BookmarkTreeView + +BookmarkManager::BookmarkTreeView::BookmarkTreeView(QWidget *parent) + : QTreeView(parent) +{ + TRACE_OBJ + setAcceptDrops(true); + setDragEnabled(true); + setAutoExpandDelay(1000); + setUniformRowHeights(true); + setDropIndicatorShown(true); + setExpandsOnDoubleClick(true); + + connect(this, SIGNAL(expanded(QModelIndex)), this, + SLOT(setExpandedData(QModelIndex))); + connect(this, SIGNAL(collapsed(QModelIndex)), this, + SLOT(setExpandedData(QModelIndex))); + +} + +void BookmarkManager::BookmarkTreeView::subclassKeyPressEvent(QKeyEvent *event) +{ + TRACE_OBJ + QTreeView::keyPressEvent(event); +} + +void BookmarkManager::BookmarkTreeView::setExpandedData(const QModelIndex &index) +{ + TRACE_OBJ + if (BookmarkModel *treeModel = qobject_cast (model())) + treeModel->setData(index, isExpanded(index), UserRoleExpanded); +} + +// -- BookmarkManager + +QMutex BookmarkManager::mutex; +BookmarkManager* BookmarkManager::bookmarkManager = 0; + +// -- public + +BookmarkManager* BookmarkManager::instance() +{ + TRACE_OBJ + if (!bookmarkManager) { + QMutexLocker _(&mutex); + if (!bookmarkManager) + bookmarkManager = new BookmarkManager(); + } + return bookmarkManager; +} + +void BookmarkManager::destroy() +{ + TRACE_OBJ + delete bookmarkManager; + bookmarkManager = 0; +} + +QWidget* BookmarkManager::bookmarkDockWidget() const +{ + TRACE_OBJ + if (bookmarkWidget) + return bookmarkWidget; + return 0; +} + +void BookmarkManager::setBookmarksMenu(QMenu* menu) +{ + TRACE_OBJ + bookmarkMenu = menu; + refreshBookmarkMenu(); +} + +void BookmarkManager::setBookmarksToolbar(QToolBar *toolBar) +{ + TRACE_OBJ + m_toolBar = toolBar; + refreshBookmarkToolBar(); +} + +// -- public slots + +void BookmarkManager::addBookmark(const QString &title, const QString &url) +{ + TRACE_OBJ + showBookmarkDialog(title.isEmpty() ? tr("Untitled") : title, + url.isEmpty() ? QLatin1String("about:blank") : url); +} + +// -- private + +BookmarkManager::BookmarkManager() + : typeAndSearch(false) + , bookmarkMenu(0) + , m_toolBar(0) + , bookmarkModel(new BookmarkModel) + , bookmarkFilterModel(0) + , typeAndSearchModel(0) + , bookmarkWidget(new BookmarkWidget) + , bookmarkTreeView(new BookmarkTreeView) + , bookmarkManagerWidget(0) +{ + TRACE_OBJ + bookmarkWidget->installEventFilter(this); + connect(bookmarkWidget->ui.add, SIGNAL(clicked()), this, + SLOT(addBookmark())); + connect(bookmarkWidget->ui.remove, SIGNAL(clicked()), this, + SLOT(removeBookmark())); + connect(bookmarkWidget->ui.lineEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + connect(bookmarkWidget, SIGNAL(focusInEvent()), this, SLOT(focusInEvent())); + + bookmarkTreeView->setModel(bookmarkModel); + bookmarkTreeView->installEventFilter(this); + bookmarkTreeView->viewport()->installEventFilter(this); + bookmarkTreeView->setContextMenuPolicy(Qt::CustomContextMenu); + bookmarkWidget->ui.stackedWidget->addWidget(bookmarkTreeView); + + connect(bookmarkTreeView, SIGNAL(activated(QModelIndex)), this, + SLOT(setSourceFromIndex(QModelIndex))); + connect(bookmarkTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); + + connect(&HelpEngineWrapper::instance(), SIGNAL(setupFinished()), this, + SLOT(setupFinished())); + connect(bookmarkModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + SLOT(refreshBookmarkMenu())); + connect(bookmarkModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, + SLOT(refreshBookmarkMenu())); + connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(refreshBookmarkMenu())); + + connect(bookmarkModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + SLOT(refreshBookmarkToolBar())); + connect(bookmarkModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, + SLOT(refreshBookmarkToolBar())); + connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(refreshBookmarkToolBar())); +} + +BookmarkManager::~BookmarkManager() +{ + TRACE_OBJ + delete bookmarkManagerWidget; + HelpEngineWrapper::instance().setBookmarks(bookmarkModel->bookmarks()); + delete bookmarkModel; +} + +void BookmarkManager::removeItem(const QModelIndex &index) +{ + TRACE_OBJ + QModelIndex current = index; + if (typeAndSearch) { // need to map because of proxy + current = typeAndSearchModel->mapToSource(current); + current = bookmarkFilterModel->mapToSource(current); + } else if (!bookmarkModel->parent(index).isValid()) { + return; // check if we should delete the "Bookmarks Menu", bail + } + + if (bookmarkModel->hasChildren(current)) { + int value = QMessageBox::question(bookmarkTreeView, tr("Remove"), + tr("You are going to delete a Folder, this will also
" + "remove it's content. Are you sure to continue?"), + QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); + if (value == QMessageBox::Cancel) + return; + } + bookmarkModel->removeItem(current); +} + +bool BookmarkManager::eventFilter(QObject *object, QEvent *event) +{ + if (object != bookmarkTreeView && object != bookmarkTreeView->viewport() + && object != bookmarkWidget) + return QObject::eventFilter(object, event); + + TRACE_OBJ + const bool isWidget = object == bookmarkWidget; + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + switch (ke->key()) { + case Qt::Key_F2: { + renameBookmark(bookmarkTreeView->currentIndex()); + } break; + + case Qt::Key_Delete: { + removeItem(bookmarkTreeView->currentIndex()); + return true; + } break; + + case Qt::Key_Up: { // needs event filter on widget + case Qt::Key_Down: + if (isWidget) + bookmarkTreeView->subclassKeyPressEvent(ke); + } break; + + case Qt::Key_Escape: { + emit escapePressed(); + } break; + + default: break; + } + } + + if (event->type() == QEvent::MouseButtonRelease && !isWidget) { + QMouseEvent *me = static_cast(event); + switch (me->button()) { + case Qt::LeftButton: { + if (me->modifiers() & Qt::ControlModifier) + setSourceFromIndex(bookmarkTreeView->currentIndex(), true); + } break; + + case Qt::MidButton: { + setSourceFromIndex(bookmarkTreeView->currentIndex(), true); + } break; + + default: break; + } + } + + return QObject::eventFilter(object, event); +} + +void BookmarkManager::buildBookmarksMenu(const QModelIndex &index, QMenu* menu) +{ + TRACE_OBJ + if (!index.isValid()) + return; + + const QString &text = index.data().toString(); + const QIcon &icon = qvariant_cast(index.data(Qt::DecorationRole)); + if (index.data(UserRoleFolder).toBool()) { + if (QMenu* subMenu = menu->addMenu(icon, text)) { + for (int i = 0; i < bookmarkModel->rowCount(index); ++i) + buildBookmarksMenu(bookmarkModel->index(i, 0, index), subMenu); + } + } else { + QAction *action = menu->addAction(icon, text); + action->setData(index.data(UserRoleUrl).toString()); + } +} + +void BookmarkManager::showBookmarkDialog(const QString &name, const QString &url) +{ + TRACE_OBJ + BookmarkDialog dialog(bookmarkModel, name, url, bookmarkTreeView); + dialog.exec(); +} + +// -- private slots + +void BookmarkManager::setupFinished() +{ + TRACE_OBJ + bookmarkModel->setBookmarks(HelpEngineWrapper::instance().bookmarks()); + bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); + + refreshBookmarkMenu(); + refreshBookmarkToolBar(); + + bookmarkTreeView->hideColumn(1); + bookmarkTreeView->header()->setVisible(false); + bookmarkTreeView->header()->setStretchLastSection(true); + + if (!bookmarkFilterModel) + bookmarkFilterModel = new BookmarkFilterModel(this); + bookmarkFilterModel->setSourceModel(bookmarkModel); + bookmarkFilterModel->filterBookmarkFolders(); + + if (!typeAndSearchModel) + typeAndSearchModel = new QSortFilterProxyModel(this); + typeAndSearchModel->setDynamicSortFilter(true); + typeAndSearchModel->setSourceModel(bookmarkFilterModel); +} + +void BookmarkManager::addBookmark() +{ + TRACE_OBJ + if (CentralWidget *widget = CentralWidget::instance()) + addBookmark(widget->currentTitle(), widget->currentSource().toString()); +} + +void BookmarkManager::removeBookmark() +{ + TRACE_OBJ + removeItem(bookmarkTreeView->currentIndex()); +} + +void BookmarkManager::manageBookmarks() +{ + TRACE_OBJ + if (bookmarkManagerWidget == 0) { + bookmarkManagerWidget = new BookmarkManagerWidget(bookmarkModel); + connect(bookmarkManagerWidget, SIGNAL(setSource(QUrl)), this, + SIGNAL(setSource(QUrl))); + connect(bookmarkManagerWidget, SIGNAL(setSourceInNewTab(QUrl)) + , this, SIGNAL(setSourceInNewTab(QUrl))); + connect(bookmarkManagerWidget, SIGNAL(managerWidgetAboutToClose()) + , this, SLOT(managerWidgetAboutToClose())); + } + bookmarkManagerWidget->show(); + bookmarkManagerWidget->raise(); +} + +void BookmarkManager::refreshBookmarkMenu() +{ + TRACE_OBJ + if (!bookmarkMenu) + return; + + bookmarkMenu->clear(); + + bookmarkMenu->addAction(tr("Manage Bookmarks..."), this, + SLOT(manageBookmarks())); + bookmarkMenu->addAction(QIcon::fromTheme("bookmark-new"), + tr("Add Bookmark..."), this, SLOT(addBookmark()), QKeySequence(tr("Ctrl+D"))); + + bookmarkMenu->addSeparator(); + + QModelIndex root = bookmarkModel->index(0, 0, QModelIndex()).parent(); + buildBookmarksMenu(bookmarkModel->index(0, 0, root), bookmarkMenu); + + bookmarkMenu->addSeparator(); + + root = bookmarkModel->index(1, 0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) + buildBookmarksMenu(bookmarkModel->index(i, 0, root), bookmarkMenu); + + connect(bookmarkMenu, SIGNAL(triggered(QAction*)), this, + SLOT(setSourceFromAction(QAction*))); +} + +void BookmarkManager::refreshBookmarkToolBar() +{ + TRACE_OBJ + if (!m_toolBar) + return; + + m_toolBar->clear(); + m_toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + + const QModelIndex &root = bookmarkModel->index(0, 0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) { + const QModelIndex &index = bookmarkModel->index(i, 0, root); + if (index.data(UserRoleFolder).toBool()) { + QToolButton *button = new QToolButton(m_toolBar); + button->setPopupMode(QToolButton::InstantPopup); + button->setText(index.data().toString()); + QMenu *menu = new QMenu(button); + for (int j = 0; j < bookmarkModel->rowCount(index); ++j) + buildBookmarksMenu(bookmarkModel->index(j, 0, index), menu); + connect(menu, SIGNAL(triggered(QAction*)), this, + SLOT(setSourceFromAction(QAction*))); + button->setMenu(menu); + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + button->setIcon(qvariant_cast(index.data(Qt::DecorationRole))); + QAction *a = m_toolBar->addWidget(button); + a->setText(index.data().toString()); + } else { + QAction *action = m_toolBar->addAction( + qvariant_cast(index.data(Qt::DecorationRole)), + index.data().toString(), this, SLOT(setSourceFromAction())); + action->setData(index.data(UserRoleUrl).toString()); + } + } +} + +void BookmarkManager::renameBookmark(const QModelIndex &index) +{ + // check if we should rename the "Bookmarks Menu", bail + if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) + return; + + bookmarkModel->setItemsEditable(true); + bookmarkTreeView->edit(index); + bookmarkModel->setItemsEditable(false); +} + + +void BookmarkManager::setSourceFromAction() +{ + TRACE_OBJ + setSourceFromAction(qobject_cast (sender())); +} + +void BookmarkManager::setSourceFromAction(QAction *action) +{ + TRACE_OBJ + if (action) { + const QVariant &data = action->data(); + if (data.canConvert()) + emit setSource(data.toUrl()); + } +} + +void BookmarkManager::setSourceFromIndex(const QModelIndex &index, bool newTab) +{ + TRACE_OBJ + QAbstractItemModel *base = bookmarkModel; + if (typeAndSearch) + base = typeAndSearchModel; + + if (base->data(index, UserRoleFolder).toBool()) + return; + + const QVariant &data = base->data(index, UserRoleUrl); + if (data.canConvert()) { + if (newTab) + emit setSourceInNewTab(data.toUrl()); + else + emit setSource(data.toUrl()); + } +} + +void BookmarkManager::customContextMenuRequested(const QPoint &point) +{ + TRACE_OBJ + QModelIndex index = bookmarkTreeView->indexAt(point); + if (!index.isValid()) + return; + + // check if we should open the menu on "Bookmarks Menu", bail + if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) + return; + + QAction *remove = 0; + QAction *rename = 0; + QAction *showItem = 0; + QAction *showItemInNewTab = 0; + + QMenu menu(QLatin1String("")); + if (!typeAndSearch && bookmarkModel->data(index, UserRoleFolder).toBool()) { + remove = menu.addAction(tr("Delete Folder")); + rename = menu.addAction(tr("Rename Folder")); + } else { + showItem = menu.addAction(tr("Show Bookmark")); + showItemInNewTab = menu.addAction(tr("Show Bookmark in New Tab")); + menu.addSeparator(); + remove = menu.addAction(tr("Delete Bookmark")); + rename = menu.addAction(tr("Rename Bookmark")); + } + + QAction *pickedAction = menu.exec(bookmarkTreeView->mapToGlobal(point)); + if (pickedAction == rename) + renameBookmark(index); + else if (pickedAction == remove) + removeItem(index); + else if (pickedAction == showItem || pickedAction == showItemInNewTab) + setSourceFromIndex(index, pickedAction == showItemInNewTab); +} + +void BookmarkManager::focusInEvent() +{ + TRACE_OBJ + const QModelIndex &index = bookmarkTreeView->indexAt(QPoint(2, 2)); + if (index.isValid()) + bookmarkTreeView->setCurrentIndex(index); +} + +void BookmarkManager::managerWidgetAboutToClose() +{ + delete bookmarkManagerWidget; + bookmarkManagerWidget = 0; +} + +void BookmarkManager::textChanged(const QString &text) +{ + TRACE_OBJ + if (!bookmarkWidget->ui.lineEdit->text().isEmpty()) { + if (!typeAndSearch) { + typeAndSearch = true; + bookmarkTreeView->setItemsExpandable(false); + bookmarkTreeView->setRootIsDecorated(false); + bookmarkTreeView->setModel(typeAndSearchModel); + } + typeAndSearchModel->setFilterRegExp(QRegExp(text)); + } else { + typeAndSearch = false; + bookmarkTreeView->setModel(bookmarkModel); + bookmarkTreeView->setItemsExpandable(true); + bookmarkTreeView->setRootIsDecorated(true); + bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/bookmarkmanager.h b/src/assistant/assistant/bookmarkmanager.h new file mode 100644 index 000000000..0b6275af9 --- /dev/null +++ b/src/assistant/assistant/bookmarkmanager.h @@ -0,0 +1,160 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKMANAGER_H +#define BOOKMARKMANAGER_H + +#include +#include + +#include "ui_bookmarkwidget.h" + +QT_BEGIN_NAMESPACE + +class BookmarkManagerWidget; +class BookmarkModel; +class BookmarkFilterModel; +class QKeyEvent; +class QSortFilterProxyModel; +class QToolBar; + +class BookmarkManager : public QObject +{ + Q_OBJECT + class BookmarkWidget; + class BookmarkTreeView; + class BookmarkListView; + Q_DISABLE_COPY(BookmarkManager); + +public: + static BookmarkManager* instance(); + static void destroy(); + + QWidget* bookmarkDockWidget() const; + void setBookmarksMenu(QMenu* menu); + void setBookmarksToolbar(QToolBar *toolBar); + +public slots: + void addBookmark(const QString &title, const QString &url); + +signals: + void escapePressed(); + void setSource(const QUrl &url); + void setSourceInNewTab(const QUrl &url); + +private: + BookmarkManager(); + ~BookmarkManager(); + + void removeItem(const QModelIndex &index); + bool eventFilter(QObject *object, QEvent *event); + void buildBookmarksMenu(const QModelIndex &index, QMenu *menu); + void showBookmarkDialog(const QString &name, const QString &url); + +private slots: + void setupFinished(); + + void addBookmark(); + void removeBookmark(); + void manageBookmarks(); + void refreshBookmarkMenu(); + void refreshBookmarkToolBar(); + void renameBookmark(const QModelIndex &index); + + void setSourceFromAction(); + void setSourceFromAction(QAction *action); + void setSourceFromIndex(const QModelIndex &index, bool newTab = false); + + void focusInEvent(); + void managerWidgetAboutToClose(); + void textChanged(const QString &text); + void customContextMenuRequested(const QPoint &point); + +private: + bool typeAndSearch; + + static QMutex mutex; + static BookmarkManager *bookmarkManager; + + QMenu *bookmarkMenu; + QToolBar *m_toolBar; + + BookmarkModel *bookmarkModel; + BookmarkFilterModel *bookmarkFilterModel; + QSortFilterProxyModel *typeAndSearchModel; + + BookmarkWidget *bookmarkWidget; + BookmarkTreeView *bookmarkTreeView; + BookmarkManagerWidget *bookmarkManagerWidget; +}; + +class BookmarkManager::BookmarkWidget : public QWidget +{ + Q_OBJECT +public: + BookmarkWidget(QWidget *parent = 0) + : QWidget(parent) { ui.setupUi(this); } + virtual ~BookmarkWidget() {} + + Ui::BookmarkWidget ui; + +signals: + void focusInEvent(); + +private: + void focusInEvent(QFocusEvent *event); +}; + +class BookmarkManager::BookmarkTreeView : public QTreeView +{ + Q_OBJECT +public: + BookmarkTreeView(QWidget *parent = 0); + ~BookmarkTreeView() {} + + void subclassKeyPressEvent(QKeyEvent *event); + +private slots: + void setExpandedData(const QModelIndex &index); +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKMANAGER_H diff --git a/src/assistant/assistant/bookmarkmanagerwidget.cpp b/src/assistant/assistant/bookmarkmanagerwidget.cpp new file mode 100644 index 000000000..87a1f65be --- /dev/null +++ b/src/assistant/assistant/bookmarkmanagerwidget.cpp @@ -0,0 +1,321 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkmanagerwidget.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" +#include "tracer.h" +#include "xbelsupport.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace { + #define TR(x) QCoreApplication::translate("BookmarkManager", x) +} + +BookmarkManagerWidget::BookmarkManagerWidget(BookmarkModel *sourceModel, + QWidget *parent) + : QWidget(parent) + , bookmarkModel(sourceModel) +{ + TRACE_OBJ + ui.setupUi(this); + + ui.treeView->setModel(bookmarkModel); + + ui.treeView->expandAll(); + ui.treeView->installEventFilter(this); + ui.treeView->viewport()->installEventFilter(this); + ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); + + connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); + + connect(ui.remove, SIGNAL(clicked()), this, SLOT(removeItem())); + connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + new QShortcut(QKeySequence::Find, ui.lineEdit, SLOT(setFocus())); + + importExportMenu.addAction(tr("Import..."), this, SLOT(importBookmarks())); + importExportMenu.addAction(tr("Export..."), this, SLOT(exportBookmarks())); + ui.importExport->setMenu(&importExportMenu); + + new QShortcut(QKeySequence::FindNext, this, SLOT(findNext())); + new QShortcut(QKeySequence::FindPrevious, this, SLOT(findPrevious())); + + connect(bookmarkModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + SLOT(refeshBookmarkCache())); + connect(bookmarkModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, + SLOT(refeshBookmarkCache())); + connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(refeshBookmarkCache())); + + ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); +} + +BookmarkManagerWidget::~BookmarkManagerWidget() +{ + TRACE_OBJ +} + +void BookmarkManagerWidget::closeEvent(QCloseEvent *event) +{ + TRACE_OBJ + event->accept(); + emit managerWidgetAboutToClose(); +} + +void BookmarkManagerWidget::renameItem(const QModelIndex &index) +{ + TRACE_OBJ + // check if we should rename the "Bookmarks Menu", bail + if (!bookmarkModel->parent(index).isValid()) + return; + + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(index); + bookmarkModel->setItemsEditable(false); +} + +static int nextIndex(int current, int count, bool forward) +{ + TRACE_OBJ + if (current >= 0) + return (forward ? (current + 1) : ((current - 1) + count)) % count; + return 0; +} + +void BookmarkManagerWidget::selectNextIndex(bool direction) const +{ + QModelIndex current = ui.treeView->currentIndex(); + if (current.isValid() && !cache.isEmpty()) { + current = cache.at(nextIndex(cache.indexOf(current), cache.count(), + direction)); + } + ui.treeView->setCurrentIndex(current); +} + +bool BookmarkManagerWidget::eventFilter(QObject *object, QEvent *event) +{ + TRACE_OBJ + if (object != ui.treeView && object != ui.treeView->viewport()) + return QWidget::eventFilter(object, event); + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + switch (ke->key()) { + case Qt::Key_F2: { + renameItem(ui.treeView->currentIndex()); + } break; + + case Qt::Key_Delete: { + removeItem(ui.treeView->currentIndex()); + } break; + + default: break; + } + } + + if (event->type() == QEvent::MouseButtonRelease) { + QMouseEvent *me = static_cast(event); + switch (me->button()) { + case Qt::LeftButton: { + if (me->modifiers() & Qt::ControlModifier) + setSourceFromIndex(ui.treeView->currentIndex(), true); + } break; + + case Qt::MidButton: { + setSourceFromIndex(ui.treeView->currentIndex(), true); + } break; + + default: break; + } + } + return QObject::eventFilter(object, event); +} + +void BookmarkManagerWidget::findNext() +{ + TRACE_OBJ + selectNextIndex(true); +} + +void BookmarkManagerWidget::findPrevious() +{ + TRACE_OBJ + selectNextIndex(false); +} + +void BookmarkManagerWidget::importBookmarks() +{ + TRACE_OBJ + const QString &fileName = QFileDialog::getOpenFileName(0, TR("Open File"), + QDir::currentPath(), TR("Files (*.xbel)")); + + if (fileName.isEmpty()) + return; + + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) { + XbelReader reader(bookmarkModel); + reader.readFromFile(&file); + } +} + +void BookmarkManagerWidget::exportBookmarks() +{ + TRACE_OBJ + QString fileName = QFileDialog::getSaveFileName(0, TR("Save File"), + QLatin1String("untitled.xbel"), TR("Files (*.xbel)")); + + const QLatin1String suffix(".xbel"); + if (!fileName.endsWith(suffix)) + fileName.append(suffix); + + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + XbelWriter writer(bookmarkModel); + writer.writeToFile(&file); + } else { + QMessageBox::information(this, TR("Qt Assistant"), + TR("Unable to save bookmarks."), TR("OK")); + } +} + +void BookmarkManagerWidget::refeshBookmarkCache() +{ + TRACE_OBJ + cache.clear(); + + const QString &text = ui.lineEdit->text(); + if (!text.isEmpty()) + cache = bookmarkModel->indexListFor(text); +} + +void BookmarkManagerWidget::textChanged(const QString &/*text*/) +{ + TRACE_OBJ + refeshBookmarkCache(); + if (!cache.isEmpty()) + ui.treeView->setCurrentIndex(cache.at(0)); +} + +void BookmarkManagerWidget::removeItem(const QModelIndex &index) +{ + TRACE_OBJ + QModelIndex current = index.isValid() ? index : ui.treeView->currentIndex(); + if (!bookmarkModel->parent(current).isValid()) + return; // check if we should delete the "Bookmarks Menu", bail + + if (bookmarkModel->hasChildren(current)) { + int value = QMessageBox::question(this, TR("Remove"), TR("You are going" + "to delete a Folder, this will also
remove it's content. Are " + "you sure to continue?"), + QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); + if (value == QMessageBox::Cancel) + return; + } + bookmarkModel->removeItem(current); +} + +void BookmarkManagerWidget::customContextMenuRequested(const QPoint &point) +{ + TRACE_OBJ + const QModelIndex &index = ui.treeView->indexAt(point); + if (!index.isValid()) + return; + + // check if we should open the menu on "Bookmarks Menu", bail + if (!bookmarkModel->parent(index).isValid()) + return; + + QAction *remove = 0; + QAction *rename = 0; + QAction *showItem = 0; + QAction *showItemInNewTab = 0; + + QMenu menu(QLatin1String("")); + if (bookmarkModel->data(index, UserRoleFolder).toBool()) { + remove = menu.addAction(TR("Delete Folder")); + rename = menu.addAction(TR("Rename Folder")); + } else { + showItem = menu.addAction(TR("Show Bookmark")); + showItemInNewTab = menu.addAction(TR("Show Bookmark in New Tab")); + menu.addSeparator(); + remove = menu.addAction(TR("Delete Bookmark")); + rename = menu.addAction(TR("Rename Bookmark")); + } + + QAction *pickedAction = menu.exec(ui.treeView->mapToGlobal(point)); + if (pickedAction == rename) + renameItem(index); + else if (pickedAction == remove) + removeItem(index); + else if (pickedAction == showItem || pickedAction == showItemInNewTab) + setSourceFromIndex(index, pickedAction == showItemInNewTab); +} + +void +BookmarkManagerWidget::setSourceFromIndex(const QModelIndex &index, bool newTab) +{ + TRACE_OBJ + if (bookmarkModel->data(index, UserRoleFolder).toBool()) + return; + + const QVariant &data = bookmarkModel->data(index, UserRoleUrl); + if (data.canConvert()) { + if (newTab) + emit setSourceInNewTab(data.toUrl()); + else + emit setSource(data.toUrl()); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/bookmarkmanagerwidget.h b/src/assistant/assistant/bookmarkmanagerwidget.h new file mode 100644 index 000000000..5c461b937 --- /dev/null +++ b/src/assistant/assistant/bookmarkmanagerwidget.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKMANAGERWIDGET_H +#define BOOKMARKMANAGERWIDGET_H + +#include "ui_bookmarkmanagerwidget.h" + +#include + +#include + +QT_BEGIN_NAMESPACE + +class BookmarkModel; +class QCloseEvent; +class QString; + +class BookmarkManagerWidget : public QWidget +{ + Q_OBJECT +public: + explicit BookmarkManagerWidget(BookmarkModel *bookmarkModel, + QWidget *parent = 0); + ~BookmarkManagerWidget(); + +protected: + void closeEvent(QCloseEvent *event); + +signals: + void setSource(const QUrl &url); + void setSourceInNewTab(const QUrl &url); + + void managerWidgetAboutToClose(); + +private: + void renameItem(const QModelIndex &index); + void selectNextIndex(bool direction) const; + bool eventFilter(QObject *object, QEvent *event); + +private slots: + void findNext(); + void findPrevious(); + + void importBookmarks(); + void exportBookmarks(); + + void refeshBookmarkCache(); + void textChanged(const QString &text); + + void removeItem(const QModelIndex &index = QModelIndex()); + + void customContextMenuRequested(const QPoint &point); + void setSourceFromIndex(const QModelIndex &index, bool newTab = false); + +private: + QMenu importExportMenu; + Ui::BookmarkManagerWidget ui; + QList cache; + + BookmarkModel *bookmarkModel; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKMANAGERWIDGET_H diff --git a/src/assistant/assistant/bookmarkmanagerwidget.ui b/src/assistant/assistant/bookmarkmanagerwidget.ui new file mode 100644 index 000000000..dc965d94e --- /dev/null +++ b/src/assistant/assistant/bookmarkmanagerwidget.ui @@ -0,0 +1,137 @@ + + + BookmarkManagerWidget + + + + 0 + 0 + 517 + 348 + + + + Manage Bookmarks + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Search: + + + + + + + + + + + + true + + + true + + + true + + + 1000 + + + true + + + true + + + 225 + + + 50 + + + 225 + + + 50 + + + + + + + + + Remove + + + + + + + Import and Backup + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + + + + + pushButton_5 + clicked() + BookmarkManagerWidget + close() + + + 445 + 328 + + + 340 + 313 + + + + + diff --git a/src/assistant/assistant/bookmarkmodel.cpp b/src/assistant/assistant/bookmarkmodel.cpp new file mode 100644 index 000000000..d27731642 --- /dev/null +++ b/src/assistant/assistant/bookmarkmodel.cpp @@ -0,0 +1,461 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkmodel.h" +#include "bookmarkitem.h" + +#include +#include + +#include +#include +#include + +const quint32 VERSION = 0xe53798; +const QLatin1String MIMETYPE("application/bookmarks.assistant"); + +BookmarkModel::BookmarkModel() + : QAbstractItemModel() + , m_folder(false) + , m_editable(false) + , rootItem(0) +{ +} + +BookmarkModel::~BookmarkModel() +{ + delete rootItem; +} + +QByteArray +BookmarkModel::bookmarks() const +{ + QByteArray ba; + QDataStream stream(&ba, QIODevice::WriteOnly); + stream << qint32(VERSION); + + const QModelIndex &root = index(0,0, QModelIndex()).parent(); + for (int i = 0; i < rowCount(root); ++i) + collectItems(index(i, 0, root), 0, &stream); + + return ba; +} + +void +BookmarkModel::setBookmarks(const QByteArray &bookmarks) +{ + beginResetModel(); + + delete rootItem; + folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); + bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); + + rootItem = new BookmarkItem(DataVector() << tr("Name") << tr("Address") + << true); + + QStack parents; + QDataStream stream(bookmarks); + + quint32 version; + stream >> version; + if (version < VERSION) { + stream.device()->seek(0); + BookmarkItem* toolbar = new BookmarkItem(DataVector() << tr("Toolbar Menu") + << QLatin1String("Folder") << true); + rootItem->addChild(toolbar); + + BookmarkItem* menu = new BookmarkItem(DataVector() << tr("Bookmarks Menu") + << QLatin1String("Folder") << true); + rootItem->addChild(menu); + parents.push(menu); + } else { + parents.push(rootItem); + } + + qint32 depth; + bool expanded; + QString name, url; + while (!stream.atEnd()) { + stream >> depth >> name >> url >> expanded; + while ((parents.count() - 1) != depth) + parents.pop(); + + BookmarkItem *item = new BookmarkItem(DataVector() << name << url << expanded); + if (url == QLatin1String("Folder")) { + parents.top()->addChild(item); + parents.push(item); + } else { + parents.top()->addChild(item); + } + } + + cache.clear(); + setupCache(index(0,0, QModelIndex().parent())); + endResetModel(); +} + +void +BookmarkModel::setItemsEditable(bool editable) +{ + m_editable = editable; +} + +void +BookmarkModel::expandFoldersIfNeeeded(QTreeView *treeView) +{ + foreach (const QModelIndex &index, cache) + treeView->setExpanded(index, index.data(UserRoleExpanded).toBool()); +} + +QModelIndex +BookmarkModel::addItem(const QModelIndex &parent, bool isFolder) +{ + m_folder = isFolder; + QModelIndex next; + if (insertRow(rowCount(parent), parent)) + next = index(rowCount(parent) - 1, 0, parent); + m_folder = false; + + return next; +} + +bool +BookmarkModel::removeItem(const QModelIndex &index) +{ + if (!index.isValid()) + return false; + + QModelIndexList indexes; + if (rowCount(index) > 0) + indexes = collectItems(index); + indexes.append(index); + + foreach (const QModelIndex &itemToRemove, indexes) { + if (!removeRow(itemToRemove.row(), itemToRemove.parent())) + return false; + cache.remove(itemFromIndex(itemToRemove)); + } + return true; +} + +int +BookmarkModel::rowCount(const QModelIndex &index) const +{ + if (BookmarkItem *item = itemFromIndex(index)) + return item->childCount(); + return 0; +} + +int +BookmarkModel::columnCount(const QModelIndex &/*index*/) const +{ + return 2; +} + +QModelIndex +BookmarkModel::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + if (BookmarkItem *childItem = itemFromIndex(index)) { + if (BookmarkItem *parent = childItem->parent()) { + if (parent != rootItem) + return createIndex(parent->childNumber(), 0, parent); + } + } + return QModelIndex(); +} + +QModelIndex +BookmarkModel::index(int row, int column, const QModelIndex &index) const +{ + if (index.isValid() && (index.column() != 0 && index.column() != 1)) + return QModelIndex(); + + if (BookmarkItem *parent = itemFromIndex(index)) { + if (BookmarkItem *childItem = parent->child(row)) + return createIndex(row, column, childItem); + } + return QModelIndex(); +} + +Qt::DropActions +BookmarkModel::supportedDropActions () const +{ + return /* Qt::CopyAction | */Qt::MoveAction; +} + +Qt::ItemFlags +BookmarkModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + return Qt::NoItemFlags; + + Qt::ItemFlags defaultFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable; + + if (m_editable) + defaultFlags |= Qt::ItemIsEditable; + + if (itemFromIndex(index) && index.data(UserRoleFolder).toBool()) { + if (index.column() > 0) + return defaultFlags &~ Qt::ItemIsEditable; + return defaultFlags | Qt::ItemIsDropEnabled; + } + + return defaultFlags | Qt::ItemIsDragEnabled; +} + +QVariant +BookmarkModel::data(const QModelIndex &index, int role) const +{ + if (index.isValid()) { + if (BookmarkItem *item = itemFromIndex(index)) { + switch (role) { + case Qt::EditRole: { + case Qt::DisplayRole: + if (index.data(UserRoleFolder).toBool() && index.column() == 1) + return QLatin1String(""); + return item->data(index.column()); + } break; + + case Qt::DecorationRole: { + if (index.column() == 0) + return index.data(UserRoleFolder).toBool() + ? folderIcon : bookmarkIcon; + } break; + + default:; + return item->data(role); + } + } + } + return QVariant(); +} + +void BookmarkModel::setData(const QModelIndex &index, const DataVector &data) +{ + if (BookmarkItem *item = itemFromIndex(index)) { + item->setData(data); + emit dataChanged(index, index); + } +} + +bool +BookmarkModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + bool result = false; + if (role != Qt::EditRole && role != UserRoleExpanded) + return result; + + if (BookmarkItem *item = itemFromIndex(index)) { + if (role == Qt::EditRole) { + const bool isFolder = index.data(UserRoleFolder).toBool(); + if (!isFolder || (isFolder && index.column() == 0)) + result = item->setData(index.column(), value); + } else if (role == UserRoleExpanded) { + result = item->setData(UserRoleExpanded, value); + } + } + + if (result) + emit dataChanged(index, index); + return result; +} + +QVariant +BookmarkModel::headerData(int section, Qt::Orientation orientation, + int role) const +{ + if (rootItem && orientation == Qt::Horizontal && role == Qt::DisplayRole) + return rootItem->data(section); + return QVariant(); +} + +QModelIndex +BookmarkModel::indexFromItem(BookmarkItem *item) const +{ + return cache.value(item, QModelIndex()); +} + +BookmarkItem* +BookmarkModel::itemFromIndex(const QModelIndex &index) const +{ + if (index.isValid()) + return static_cast(index.internalPointer()); + return rootItem; +} + +QList +BookmarkModel::indexListFor(const QString &label) const +{ + QList hits; + const QModelIndexList &list = collectItems(QModelIndex()); + foreach(const QModelIndex &index, list) { + if (index.data().toString().contains(label, Qt::CaseInsensitive)) + hits.prepend(index); // list is reverse sorted + } + return hits; +} + +bool +BookmarkModel::insertRows(int position, int rows, const QModelIndex &parent) +{ + if (!parent.data(UserRoleFolder).toBool()) + return false; + + bool success = false; + if (BookmarkItem *parentItem = itemFromIndex(parent)) { + beginInsertRows(parent, position, position + rows - 1); + success = parentItem->insertChildren(m_folder, position, rows); + if (success) { + const QModelIndex ¤t = index(position, 0, parent); + cache.insert(itemFromIndex(current), current); + } + endInsertRows(); + } + return success; +} + +bool +BookmarkModel::removeRows(int position, int rows, const QModelIndex &index) +{ + bool success = false; + if (BookmarkItem *parent = itemFromIndex(index)) { + beginRemoveRows(index, position, position + rows - 1); + success = parent->removeChildren(position, rows); + endRemoveRows(); + } + return success; +} + +QStringList +BookmarkModel::mimeTypes() const +{ + return QStringList() << MIMETYPE; +} + +QMimeData* +BookmarkModel::mimeData(const QModelIndexList &indexes) const +{ + if (indexes.isEmpty()) + return 0; + + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly); + + foreach (const QModelIndex &index, indexes) { + if (index.column() == 0) + collectItems(index, 0, &stream); + } + + QMimeData *mimeData = new QMimeData(); + mimeData->setData(MIMETYPE, data); + return mimeData; +} + +bool +BookmarkModel::dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent) +{ + if (action == Qt::IgnoreAction) + return true; + + if (!data->hasFormat(MIMETYPE) || column > 0) + return false; + + QByteArray ba = data->data(MIMETYPE); + QDataStream stream(&ba, QIODevice::ReadOnly); + while (stream.atEnd()) + return false; + + qint32 depth; + bool expanded; + QString name, url; + while (!stream.atEnd()) { + stream >> depth >> name >> url >> expanded; + if (insertRow(qMax(0, row), parent)) { + const QModelIndex ¤t = index(qMax(0, row), 0, parent); + if (current.isValid()) { + BookmarkItem* item = itemFromIndex(current); + item->setData(DataVector() << name << url << expanded); + } + } + } + return true; +} + +void +BookmarkModel::setupCache(const QModelIndex &parent) +{ + const QModelIndexList &list = collectItems(parent); + foreach (const QModelIndex &index, list) + cache.insert(itemFromIndex(index), index); +} + +QModelIndexList +BookmarkModel::collectItems(const QModelIndex &parent) const +{ + QModelIndexList list; + for (int i = rowCount(parent) - 1; i >= 0 ; --i) { + const QModelIndex &next = index(i, 0, parent); + if (data(next, UserRoleFolder).toBool()) + list += collectItems(next); + list.append(next); + } + return list; +} + +void +BookmarkModel::collectItems(const QModelIndex &parent, qint32 depth, + QDataStream *stream) const +{ + if (parent.isValid()) { + *stream << depth; + *stream << parent.data().toString(); + *stream << parent.data(UserRoleUrl).toString(); + *stream << parent.data(UserRoleExpanded).toBool(); + + for (int i = 0; i < rowCount(parent); ++i) { + if (parent.data(UserRoleFolder).toBool()) + collectItems(index(i, 0 , parent), depth + 1, stream); + } + } +} diff --git a/src/assistant/assistant/bookmarkmodel.h b/src/assistant/assistant/bookmarkmodel.h new file mode 100644 index 000000000..e23e9c41a --- /dev/null +++ b/src/assistant/assistant/bookmarkmodel.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKMODEL_H +#define BOOKMARKMODEL_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class BookmarkItem; +class QMimeData; +class QTreeView; + +typedef QMap ItemModelIndexCache; + +class BookmarkModel : public QAbstractItemModel +{ + Q_OBJECT +public: + BookmarkModel(); + ~BookmarkModel(); + + QByteArray bookmarks() const; + void setBookmarks(const QByteArray &bookmarks); + + void setItemsEditable(bool editable); + void expandFoldersIfNeeeded(QTreeView *treeView); + + QModelIndex addItem(const QModelIndex &parent, bool isFolder = false); + bool removeItem(const QModelIndex &index); + + int rowCount(const QModelIndex &index = QModelIndex()) const; + int columnCount(const QModelIndex &index = QModelIndex()) const; + + QModelIndex parent(const QModelIndex &index) const; + QModelIndex index(int row, int column, const QModelIndex &index) const; + + Qt::DropActions supportedDropActions () const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + void setData(const QModelIndex &index, const QVector &data); + bool setData(const QModelIndex &index, const QVariant &value, int role); + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + + QModelIndex indexFromItem(BookmarkItem *item) const; + BookmarkItem *itemFromIndex(const QModelIndex &index) const; + QList indexListFor(const QString &label) const; + + bool insertRows(int position, int rows, const QModelIndex &parent); + bool removeRows(int position, int rows, const QModelIndex &parent); + + QStringList mimeTypes() const; + QMimeData* mimeData(const QModelIndexList &indexes) const; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, + int column, const QModelIndex &parent); + +private: + void setupCache(const QModelIndex &parent); + QModelIndexList collectItems(const QModelIndex &parent) const; + void collectItems(const QModelIndex &parent, qint32 depth, + QDataStream *stream) const; + +private: + int columns; + bool m_folder; + bool m_editable; + QIcon folderIcon; + QIcon bookmarkIcon; + QTreeView *treeView; + BookmarkItem *rootItem; + ItemModelIndexCache cache; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKMODEL_H diff --git a/src/assistant/assistant/bookmarkwidget.ui b/src/assistant/assistant/bookmarkwidget.ui new file mode 100644 index 000000000..a31a2779c --- /dev/null +++ b/src/assistant/assistant/bookmarkwidget.ui @@ -0,0 +1,85 @@ + + + BookmarkWidget + + + + 0 + 0 + 235 + 606 + + + + Bookmarks + + + + 4 + + + + + + + Filter: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add + + + + + + + Remove + + + + + + + + + + diff --git a/src/assistant/assistant/centralwidget.cpp b/src/assistant/assistant/centralwidget.cpp new file mode 100644 index 000000000..5544dcb24 --- /dev/null +++ b/src/assistant/assistant/centralwidget.cpp @@ -0,0 +1,636 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "centralwidget.h" + +#include "findwidget.h" +#include "helpenginewrapper.h" +#include "helpviewer.h" +#include "openpagesmanager.h" +#include "tracer.h" +#include "../shared/collectionconfiguration.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +namespace { + CentralWidget *staticCentralWidget = 0; +} + +// -- TabBar + +TabBar::TabBar(QWidget *parent) + : QTabBar(parent) +{ + TRACE_OBJ +#ifdef Q_OS_MAC + setDocumentMode(true); +#endif + setMovable(true); + setShape(QTabBar::RoundedNorth); + setContextMenuPolicy(Qt::CustomContextMenu); + setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred, + QSizePolicy::TabWidget)); + connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); + connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int))); + connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(slotCustomContextMenuRequested(QPoint))); +} + +TabBar::~TabBar() +{ + TRACE_OBJ +} + +int TabBar::addNewTab(const QString &title) +{ + TRACE_OBJ + const int index = addTab(title); + setTabsClosable(count() > 1); + return index; +} + +void TabBar::setCurrent(HelpViewer *viewer) +{ + TRACE_OBJ + for (int i = 0; i < count(); ++i) { + HelpViewer *data = tabData(i).value(); + if (data == viewer) { + setCurrentIndex(i); + break; + } + } +} + +void TabBar::removeTabAt(HelpViewer *viewer) +{ + TRACE_OBJ + for (int i = 0; i < count(); ++i) { + HelpViewer *data = tabData(i).value(); + if (data == viewer) { + removeTab(i); + break; + } + } + setTabsClosable(count() > 1); +} + +void TabBar::titleChanged() +{ + TRACE_OBJ + for (int i = 0; i < count(); ++i) { + HelpViewer *data = tabData(i).value(); + QString title = data->title(); + title.replace(QLatin1Char('&'), QLatin1String("&&")); + setTabText(i, title.isEmpty() ? tr("(Untitled)") : title); + } +} + +void TabBar::slotCurrentChanged(int index) +{ + TRACE_OBJ + emit currentTabChanged(tabData(index).value()); +} + +void TabBar::slotTabCloseRequested(int index) +{ + TRACE_OBJ + OpenPagesManager::instance()->closePage(tabData(index).value()); +} + +void TabBar::slotCustomContextMenuRequested(const QPoint &pos) +{ + TRACE_OBJ + const int tab = tabAt(pos); + if (tab < 0) + return; + + QMenu menu(QLatin1String(""), this); + menu.addAction(tr("New &Tab"), OpenPagesManager::instance(), SLOT(createPage())); + + const bool enableAction = count() > 1; + QAction *closePage = menu.addAction(tr("&Close Tab")); + closePage->setEnabled(enableAction); + + QAction *closePages = menu.addAction(tr("Close Other Tabs")); + closePages->setEnabled(enableAction); + + menu.addSeparator(); + + HelpViewer *viewer = tabData(tab).value(); + QAction *newBookmark = menu.addAction(tr("Add Bookmark for this Page...")); + const QString &url = viewer->source().toString(); + if (url.isEmpty() || url == QLatin1String("about:blank")) + newBookmark->setEnabled(false); + + QAction *pickedAction = menu.exec(mapToGlobal(pos)); + if (pickedAction == closePage) + slotTabCloseRequested(tab); + else if (pickedAction == closePages) { + for (int i = count() - 1; i >= 0; --i) { + if (i != tab) + slotTabCloseRequested(i); + } + } else if (pickedAction == newBookmark) + emit addBookmark(viewer->title(), url); +} + +// -- CentralWidget + +CentralWidget::CentralWidget(QWidget *parent) + : QWidget(parent) +#ifndef QT_NO_PRINTER + , m_printer(0) +#endif + , m_findWidget(new FindWidget(this)) + , m_stackedWidget(new QStackedWidget(this)) + , m_tabBar(new TabBar(this)) +{ + TRACE_OBJ + staticCentralWidget = this; + QVBoxLayout *vboxLayout = new QVBoxLayout(this); + + vboxLayout->setMargin(0); + vboxLayout->setSpacing(0); + vboxLayout->addWidget(m_tabBar); + m_tabBar->setVisible(HelpEngineWrapper::instance().showTabs()); + vboxLayout->addWidget(m_stackedWidget); + vboxLayout->addWidget(m_findWidget); + m_findWidget->hide(); + + connect(m_findWidget, SIGNAL(findNext()), this, SLOT(findNext())); + connect(m_findWidget, SIGNAL(findPrevious()), this, SLOT(findPrevious())); + connect(m_findWidget, SIGNAL(find(QString, bool, bool)), this, + SLOT(find(QString, bool, bool))); + connect(m_findWidget, SIGNAL(escapePressed()), this, SLOT(activateTab())); + connect(m_tabBar, SIGNAL(addBookmark(QString, QString)), this, + SIGNAL(addBookmark(QString, QString))); +} + +CentralWidget::~CentralWidget() +{ + TRACE_OBJ + QStringList zoomFactors; + QStringList currentPages; + for (int i = 0; i < m_stackedWidget->count(); ++i) { + const HelpViewer * const viewer = viewerAt(i); + const QUrl &source = viewer->source(); + if (source.isValid()) { + currentPages << source.toString(); + zoomFactors << QString::number(viewer->scale()); + } + } + + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + helpEngine.setLastShownPages(currentPages); + helpEngine.setLastZoomFactors(zoomFactors); + helpEngine.setLastTabPage(m_stackedWidget->currentIndex()); + +#ifndef QT_NO_PRINTER + delete m_printer; +#endif +} + +CentralWidget *CentralWidget::instance() +{ + TRACE_OBJ + return staticCentralWidget; +} + +QUrl CentralWidget::currentSource() const +{ + TRACE_OBJ + return currentHelpViewer()->source(); +} + +QString CentralWidget::currentTitle() const +{ + TRACE_OBJ + return currentHelpViewer()->title(); +} + +bool CentralWidget::hasSelection() const +{ + TRACE_OBJ + return !currentHelpViewer()->selectedText().isEmpty(); +} + +bool CentralWidget::isForwardAvailable() const +{ + TRACE_OBJ + return currentHelpViewer()->isForwardAvailable(); +} + +bool CentralWidget::isBackwardAvailable() const +{ + TRACE_OBJ + return currentHelpViewer()->isBackwardAvailable(); +} + +HelpViewer* CentralWidget::viewerAt(int index) const +{ + TRACE_OBJ + return static_cast(m_stackedWidget->widget(index)); +} + +HelpViewer* CentralWidget::currentHelpViewer() const +{ + TRACE_OBJ + return static_cast(m_stackedWidget->currentWidget()); +} + +void CentralWidget::addPage(HelpViewer *page, bool fromSearch) +{ + TRACE_OBJ + page->installEventFilter(this); + page->setFocus(Qt::OtherFocusReason); + connectSignals(page); + const int index = m_stackedWidget->addWidget(page); + m_tabBar->setTabData(m_tabBar->addNewTab(page->title()), + QVariant::fromValue(viewerAt(index))); + connect (page, SIGNAL(titleChanged()), m_tabBar, SLOT(titleChanged())); + + if (fromSearch) { + connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); + } +} + +void CentralWidget::removePage(int index) +{ + TRACE_OBJ + const bool currentChanged = index == currentIndex(); + m_tabBar->removeTabAt(viewerAt(index)); + m_stackedWidget->removeWidget(m_stackedWidget->widget(index)); + if (currentChanged) + emit currentViewerChanged(); +} + +int CentralWidget::currentIndex() const +{ + TRACE_OBJ + return m_stackedWidget->currentIndex(); +} + +void CentralWidget::setCurrentPage(HelpViewer *page) +{ + TRACE_OBJ + m_tabBar->setCurrent(page); + m_stackedWidget->setCurrentWidget(page); + emit currentViewerChanged(); +} + +void CentralWidget::connectTabBar() +{ + TRACE_OBJ + connect(m_tabBar, SIGNAL(currentTabChanged(HelpViewer*)), + OpenPagesManager::instance(), SLOT(setCurrentPage(HelpViewer*))); +} + +// -- public slots + +void CentralWidget::copy() +{ + TRACE_OBJ + currentHelpViewer()->copy(); +} + +void CentralWidget::home() +{ + TRACE_OBJ + currentHelpViewer()->home(); +} + +void CentralWidget::zoomIn() +{ + TRACE_OBJ + currentHelpViewer()->scaleUp(); +} + +void CentralWidget::zoomOut() +{ + TRACE_OBJ + currentHelpViewer()->scaleDown(); +} + +void CentralWidget::resetZoom() +{ + TRACE_OBJ + currentHelpViewer()->resetScale(); +} + +void CentralWidget::forward() +{ + TRACE_OBJ + currentHelpViewer()->forward(); +} + +void CentralWidget::nextPage() +{ + TRACE_OBJ + m_stackedWidget->setCurrentIndex((m_stackedWidget->currentIndex() + 1) + % m_stackedWidget->count()); +} + +void CentralWidget::backward() +{ + TRACE_OBJ + currentHelpViewer()->backward(); +} + +void CentralWidget::previousPage() +{ + TRACE_OBJ + m_stackedWidget->setCurrentIndex((m_stackedWidget->currentIndex() - 1) + % m_stackedWidget->count()); +} + +void CentralWidget::print() +{ + TRACE_OBJ +#ifndef QT_NO_PRINTER + initPrinter(); + QPrintDialog dlg(m_printer, this); + + if (!currentHelpViewer()->selectedText().isEmpty()) + dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection); + dlg.addEnabledOption(QAbstractPrintDialog::PrintPageRange); + dlg.addEnabledOption(QAbstractPrintDialog::PrintCollateCopies); + dlg.setWindowTitle(tr("Print Document")); + if (dlg.exec() == QDialog::Accepted) + currentHelpViewer()->print(m_printer); +#endif +} + +void CentralWidget::pageSetup() +{ + TRACE_OBJ +#ifndef QT_NO_PRINTER + initPrinter(); + QPageSetupDialog dlg(m_printer); + dlg.exec(); +#endif +} + +void CentralWidget::printPreview() +{ + TRACE_OBJ +#ifndef QT_NO_PRINTER + initPrinter(); + QPrintPreviewDialog preview(m_printer, this); + connect(&preview, SIGNAL(paintRequested(QPrinter*)), + SLOT(printPreview(QPrinter*))); + preview.exec(); +#endif +} + +void CentralWidget::setSource(const QUrl &url) +{ + TRACE_OBJ + HelpViewer *viewer = currentHelpViewer(); + viewer->setSource(url); + viewer->setFocus(Qt::OtherFocusReason); +} + +void CentralWidget::setSourceFromSearch(const QUrl &url) +{ + TRACE_OBJ + connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); + currentHelpViewer()->setSource(url); + currentHelpViewer()->setFocus(Qt::OtherFocusReason); +} + +void CentralWidget::findNext() +{ + TRACE_OBJ + find(m_findWidget->text(), true, false); +} + +void CentralWidget::findPrevious() +{ + TRACE_OBJ + find(m_findWidget->text(), false, false); +} + +void CentralWidget::find(const QString &ttf, bool forward, bool incremental) +{ + TRACE_OBJ + bool found = false; + if (HelpViewer *viewer = currentHelpViewer()) { + HelpViewer::FindFlags flags = 0; + if (!forward) + flags |= HelpViewer::FindBackward; + if (m_findWidget->caseSensitive()) + flags |= HelpViewer::FindCaseSensitively; + found = viewer->findText(ttf, flags, incremental, false); + } + + if (!found && ttf.isEmpty()) + found = true; // the line edit is empty, no need to mark it red... + + if (!m_findWidget->isVisible()) + m_findWidget->show(); + m_findWidget->setPalette(found); +} + +void CentralWidget::activateTab() +{ + TRACE_OBJ + currentHelpViewer()->setFocus(); +} + +void CentralWidget::showTextSearch() +{ + TRACE_OBJ + m_findWidget->show(); +} + +void CentralWidget::updateBrowserFont() +{ + TRACE_OBJ + const int count = m_stackedWidget->count(); + const QFont &font = viewerAt(count - 1)->viewerFont(); + for (int i = 0; i < count; ++i) + viewerAt(i)->setViewerFont(font); +} + +void CentralWidget::updateUserInterface() +{ + m_tabBar->setVisible(HelpEngineWrapper::instance().showTabs()); +} + +// -- protected + +void CentralWidget::keyPressEvent(QKeyEvent *e) +{ + TRACE_OBJ + const QString &text = e->text(); + if (text.startsWith(QLatin1Char('/'))) { + if (!m_findWidget->isVisible()) { + m_findWidget->showAndClear(); + } else { + m_findWidget->show(); + } + } else { + QWidget::keyPressEvent(e); + } +} + +void CentralWidget::focusInEvent(QFocusEvent * /* event */) +{ + TRACE_OBJ + // If we have a current help viewer then this is the 'focus proxy', + // otherwise it's the central widget. This is needed, so an embedding + // program can just set the focus to the central widget and it does + // The Right Thing(TM) + QObject *receiver = m_stackedWidget; + if (HelpViewer *viewer = currentHelpViewer()) + receiver = viewer; + QTimer::singleShot(1, receiver, SLOT(setFocus())); +} + +// -- private slots + +void CentralWidget::highlightSearchTerms() +{ + TRACE_OBJ + QHelpSearchEngine *searchEngine = + HelpEngineWrapper::instance().searchEngine(); + QList queryList = searchEngine->query(); + + QStringList terms; + foreach (const QHelpSearchQuery &query, queryList) { + switch (query.fieldName) { + default: break; + case QHelpSearchQuery::ALL: { + case QHelpSearchQuery::PHRASE: + case QHelpSearchQuery::DEFAULT: + case QHelpSearchQuery::ATLEAST: + foreach (QString term, query.wordList) + terms.append(term.remove(QLatin1Char('"'))); + } + } + } + + HelpViewer *viewer = currentHelpViewer(); + foreach (const QString& term, terms) + viewer->findText(term, 0, false, true); + disconnect(viewer, SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); +} + +void CentralWidget::printPreview(QPrinter *p) +{ + TRACE_OBJ +#ifndef QT_NO_PRINTER + currentHelpViewer()->print(p); +#endif +} + +void CentralWidget::handleSourceChanged(const QUrl &url) +{ + TRACE_OBJ + if (sender() == currentHelpViewer()) + emit sourceChanged(url); +} + +// -- private + +void CentralWidget::initPrinter() +{ + TRACE_OBJ +#ifndef QT_NO_PRINTER + if (!m_printer) + m_printer = new QPrinter(QPrinter::HighResolution); +#endif +} + +void CentralWidget::connectSignals(HelpViewer *page) +{ + TRACE_OBJ + connect(page, SIGNAL(copyAvailable(bool)), this, + SIGNAL(copyAvailable(bool))); + connect(page, SIGNAL(forwardAvailable(bool)), this, + SIGNAL(forwardAvailable(bool))); + connect(page, SIGNAL(backwardAvailable(bool)), this, + SIGNAL(backwardAvailable(bool))); + connect(page, SIGNAL(sourceChanged(QUrl)), this, + SLOT(handleSourceChanged(QUrl))); + connect(page, SIGNAL(highlighted(QString)), this, + SIGNAL(highlighted(QString))); + connect(page, SIGNAL(printRequested()), this, SLOT(print())); +} + +bool CentralWidget::eventFilter(QObject *object, QEvent *e) +{ + TRACE_OBJ + if (e->type() != QEvent::KeyPress) + return QWidget::eventFilter(object, e); + + HelpViewer *viewer = currentHelpViewer(); + QKeyEvent *keyEvent = static_cast (e); + if (viewer == object && keyEvent->key() == Qt::Key_Backspace) { + if (viewer->isBackwardAvailable()) { +#if !defined(QT_NO_WEBKIT) + // this helps in case there is an html field + if (!viewer->hasFocus()) +#endif + viewer->backward(); + } + } + return QWidget::eventFilter(object, e); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/centralwidget.h b/src/assistant/assistant/centralwidget.h new file mode 100644 index 000000000..da8a799c8 --- /dev/null +++ b/src/assistant/assistant/centralwidget.h @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CENTRALWIDGET_H +#define CENTRALWIDGET_H + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class FindWidget; +class HelpViewer; +class QStackedWidget; +class QPrinter; + +class TabBar : public QTabBar +{ + Q_OBJECT +public: + TabBar(QWidget *parent = 0); + ~TabBar(); + + int addNewTab(const QString &title); + void setCurrent(HelpViewer *viewer); + void removeTabAt(HelpViewer *viewer); + +public slots: + void titleChanged(); + +signals: + void currentTabChanged(HelpViewer *viewer); + void addBookmark(const QString &title, const QString &url); + +private slots: + void slotCurrentChanged(int index); + void slotTabCloseRequested(int index); + void slotCustomContextMenuRequested(const QPoint &pos); +}; + +class CentralWidget : public QWidget +{ + Q_OBJECT + +public: + CentralWidget(QWidget *parent = 0); + ~CentralWidget(); + + static CentralWidget *instance(); + + QUrl currentSource() const; + QString currentTitle() const; + + bool hasSelection() const; + bool isForwardAvailable() const; + bool isBackwardAvailable() const; + + HelpViewer *viewerAt(int index) const; + HelpViewer *currentHelpViewer() const; + + void addPage(HelpViewer *page, bool fromSearch = false); + void removePage(int index); + + int currentIndex() const; + void setCurrentPage(HelpViewer *page); + + void connectTabBar(); + +public slots: + void copy(); + void home(); + + void zoomIn(); + void zoomOut(); + void resetZoom(); + + void forward(); + void nextPage(); + + void backward(); + void previousPage(); + + void print(); + void pageSetup(); + void printPreview(); + + void setSource(const QUrl &url); + void setSourceFromSearch(const QUrl &url); + + void findNext(); + void findPrevious(); + void find(const QString &text, bool forward, bool incremental); + + void activateTab(); + void showTextSearch(); + void updateBrowserFont(); + void updateUserInterface(); + +signals: + void currentViewerChanged(); + void copyAvailable(bool yes); + void sourceChanged(const QUrl &url); + void highlighted(const QString &link); + void forwardAvailable(bool available); + void backwardAvailable(bool available); + void addBookmark(const QString &title, const QString &url); + +protected: + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *event); + +private slots: + void highlightSearchTerms(); + void printPreview(QPrinter *printer); + void handleSourceChanged(const QUrl &url); + +private: + void initPrinter(); + void connectSignals(HelpViewer *page); + bool eventFilter(QObject *object, QEvent *e); + +private: +#ifndef QT_NO_PRINTER + QPrinter *m_printer; +#endif + FindWidget *m_findWidget; + QStackedWidget *m_stackedWidget; + TabBar *m_tabBar; +}; + +QT_END_NAMESPACE + +#endif // CENTRALWIDGET_H diff --git a/src/assistant/assistant/cmdlineparser.cpp b/src/assistant/assistant/cmdlineparser.cpp new file mode 100644 index 000000000..bc498a9d3 --- /dev/null +++ b/src/assistant/assistant/cmdlineparser.cpp @@ -0,0 +1,376 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include +#include +#include + +#include "cmdlineparser.h" + +QT_BEGIN_NAMESPACE + +static const char helpMessage[] = QT_TRANSLATE_NOOP("CmdLineParser", + "Usage: assistant [Options]\n\n" + "-collectionFile file Uses the specified collection\n" + " file instead of the default one\n" + "-showUrl url Shows the document with the\n" + " url.\n" + "-enableRemoteControl Enables Assistant to be\n" + " remotely controlled.\n" + "-show widget Shows the specified dockwidget\n" + " which can be \"contents\", \"index\",\n" + " \"bookmarks\" or \"search\".\n" + "-activate widget Activates the specified dockwidget\n" + " which can be \"contents\", \"index\",\n" + " \"bookmarks\" or \"search\".\n" + "-hide widget Hides the specified dockwidget\n" + " which can be \"contents\", \"index\"\n" + " \"bookmarks\" or \"search\".\n" + "-register helpFile Registers the specified help file\n" + " (.qch) in the given collection\n" + " file.\n" + "-unregister helpFile Unregisters the specified help file\n" + " (.qch) from the give collection\n" + " file.\n" + "-setCurrentFilter filter Set the filter as the active filter.\n" + "-remove-search-index Removes the full text search index.\n" + "-rebuild-search-index Re-builds the full text search index (potentially slow).\n" + "-quiet Does not display any error or\n" + " status message.\n" + "-help Displays this help.\n" + ); + + +CmdLineParser::CmdLineParser(const QStringList &arguments) + : m_pos(0), + m_enableRemoteControl(false), + m_contents(Untouched), + m_index(Untouched), + m_bookmarks(Untouched), + m_search(Untouched), + m_register(None), + m_removeSearchIndex(false), + m_rebuildSearchIndex(false), + m_quiet(false) +{ + TRACE_OBJ + for (int i = 1; i < arguments.count(); ++i) { + const QString &arg = arguments.at(i); + if (arg.toLower() == "-quiet") + m_quiet = true; + else + m_arguments.append(arg); + } +} + +CmdLineParser::Result CmdLineParser::parse() +{ + TRACE_OBJ + bool showHelp = false; + + while (m_error.isEmpty() && hasMoreArgs()) { + const QString &arg = nextArg().toLower(); + if (arg == QLatin1String("-collectionfile")) + handleCollectionFileOption(); + else if (arg == QLatin1String("-showurl")) + handleShowUrlOption(); + else if (arg == QLatin1String("-enableremotecontrol")) + m_enableRemoteControl = true; + else if (arg == QLatin1String("-show")) + handleShowOption(); + else if (arg == QLatin1String("-hide")) + handleHideOption(); + else if (arg == QLatin1String("-activate")) + handleActivateOption(); + else if (arg == QLatin1String("-register")) + handleRegisterOption(); + else if (arg == QLatin1String("-unregister")) + handleUnregisterOption(); + else if (arg == QLatin1String("-setcurrentfilter")) + handleSetCurrentFilterOption(); + else if (arg == QLatin1String("-remove-search-index")) + m_removeSearchIndex = true; + else if (arg == QLatin1String("-rebuild-search-index")) + m_rebuildSearchIndex = true; + else if (arg == QLatin1String("-help")) + showHelp = true; + else + m_error = tr("Unknown option: %1").arg(arg); + } + + if (!m_error.isEmpty()) { + showMessage(m_error + QLatin1String("\n\n\n") + tr(helpMessage), true); + return Error; + } else if (showHelp) { + showMessage(tr(helpMessage), false); + return Help; + } + return Ok; +} + +bool CmdLineParser::hasMoreArgs() const +{ + TRACE_OBJ + return m_pos < m_arguments.count(); +} + +const QString &CmdLineParser::nextArg() +{ + TRACE_OBJ + Q_ASSERT(hasMoreArgs()); + return m_arguments.at(m_pos++); +} + +void CmdLineParser::handleCollectionFileOption() +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &fileName = nextArg(); + m_collectionFile = getFileName(fileName); + if (m_collectionFile.isEmpty()) + m_error = tr("The collection file '%1' does not exist."). + arg(fileName); + } else { + m_error = tr("Missing collection file."); + } +} + +void CmdLineParser::handleShowUrlOption() +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &urlString = nextArg(); + QUrl url(urlString); + if (url.isValid()) { + m_url = url; + } else + m_error = tr("Invalid URL '%1'.").arg(urlString); + } else { + m_error = tr("Missing URL."); + } +} + +void CmdLineParser::handleShowOption() +{ + TRACE_OBJ + handleShowOrHideOrActivateOption(Show); +} + +void CmdLineParser::handleHideOption() +{ + TRACE_OBJ + handleShowOrHideOrActivateOption(Hide); +} + +void CmdLineParser::handleActivateOption() +{ + TRACE_OBJ + handleShowOrHideOrActivateOption(Activate); +} + +void CmdLineParser::handleShowOrHideOrActivateOption(ShowState state) +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &widget = nextArg().toLower(); + if (widget == QLatin1String("contents")) + m_contents = state; + else if (widget == QLatin1String("index")) + m_index = state; + else if (widget == QLatin1String("bookmarks")) + m_bookmarks = state; + else if (widget == QLatin1String("search")) + m_search = state; + else + m_error = tr("Unknown widget: %1").arg(widget); + } else { + m_error = tr("Missing widget."); + } +} + +void CmdLineParser::handleRegisterOption() +{ + TRACE_OBJ + handleRegisterOrUnregisterOption(Register); +} + +void CmdLineParser::handleUnregisterOption() +{ + TRACE_OBJ + handleRegisterOrUnregisterOption(Unregister); +} + +void CmdLineParser::handleRegisterOrUnregisterOption(RegisterState state) +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &fileName = nextArg(); + m_helpFile = getFileName(fileName); + if (m_helpFile.isEmpty()) + m_error = tr("The Qt help file '%1' does not exist.").arg(fileName); + else + m_register = state; + } else { + m_error = tr("Missing help file."); + } +} + +void CmdLineParser::handleSetCurrentFilterOption() +{ + TRACE_OBJ + if (hasMoreArgs()) + m_currentFilter = nextArg(); + else + m_error = tr("Missing filter argument."); +} + +QString CmdLineParser::getFileName(const QString &fileName) +{ + TRACE_OBJ + QFileInfo fi(fileName); + if (!fi.exists()) + return QString(); + return fi.absoluteFilePath(); +} + +void CmdLineParser::showMessage(const QString &msg, bool error) +{ + TRACE_OBJ + if (m_quiet) + return; +#ifdef Q_OS_WIN + QString message = QLatin1String("
") % msg % QLatin1String("
"); + if (error) + QMessageBox::critical(0, tr("Error"), message); + else + QMessageBox::information(0, tr("Notice"), message); +#else + fprintf(error ? stderr : stdout, "%s\n", qPrintable(msg)); +#endif +} + +void CmdLineParser::setCollectionFile(const QString &file) +{ + TRACE_OBJ + m_collectionFile = file; +} + +QString CmdLineParser::collectionFile() const +{ + TRACE_OBJ + return m_collectionFile; +} + +bool CmdLineParser::collectionFileGiven() const +{ + TRACE_OBJ + return m_arguments.contains(QLatin1String("-collectionfile"), + Qt::CaseInsensitive); +} + +QUrl CmdLineParser::url() const +{ + TRACE_OBJ + return m_url; +} + +bool CmdLineParser::enableRemoteControl() const +{ + TRACE_OBJ + return m_enableRemoteControl; +} + +CmdLineParser::ShowState CmdLineParser::contents() const +{ + TRACE_OBJ + return m_contents; +} + +CmdLineParser::ShowState CmdLineParser::index() const +{ + TRACE_OBJ + return m_index; +} + +CmdLineParser::ShowState CmdLineParser::bookmarks() const +{ + TRACE_OBJ + return m_bookmarks; +} + +CmdLineParser::ShowState CmdLineParser::search() const +{ + TRACE_OBJ + return m_search; +} + +QString CmdLineParser::currentFilter() const +{ + TRACE_OBJ + return m_currentFilter; +} + +bool CmdLineParser::removeSearchIndex() const +{ + TRACE_OBJ + return m_removeSearchIndex; +} + +bool CmdLineParser::rebuildSearchIndex() const +{ + TRACE_OBJ + return m_rebuildSearchIndex; +} + +CmdLineParser::RegisterState CmdLineParser::registerRequest() const +{ + TRACE_OBJ + return m_register; +} + +QString CmdLineParser::helpFile() const +{ + TRACE_OBJ + return m_helpFile; +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/cmdlineparser.h b/src/assistant/assistant/cmdlineparser.h new file mode 100644 index 000000000..f45679f66 --- /dev/null +++ b/src/assistant/assistant/cmdlineparser.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CMDLINEPARSER_H +#define CMDLINEPARSER_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class CmdLineParser +{ + Q_DECLARE_TR_FUNCTIONS(CmdLineParser) +public: + enum Result {Ok, Help, Error}; + enum ShowState {Untouched, Show, Hide, Activate}; + enum RegisterState {None, Register, Unregister}; + + CmdLineParser(const QStringList &arguments); + Result parse(); + + void setCollectionFile(const QString &file); + QString collectionFile() const; + bool collectionFileGiven() const; + QString cloneFile() const; + QUrl url() const; + bool enableRemoteControl() const; + ShowState contents() const; + ShowState index() const; + ShowState bookmarks() const; + ShowState search() const; + QString currentFilter() const; + bool removeSearchIndex() const; + bool rebuildSearchIndex() const; + RegisterState registerRequest() const; + QString helpFile() const; + + void showMessage(const QString &msg, bool error); + +private: + QString getFileName(const QString &fileName); + bool hasMoreArgs() const; + const QString &nextArg(); + void handleCollectionFileOption(); + void handleShowUrlOption(); + void handleShowOption(); + void handleHideOption(); + void handleActivateOption(); + void handleShowOrHideOrActivateOption(ShowState state); + void handleRegisterOption(); + void handleUnregisterOption(); + void handleRegisterOrUnregisterOption(RegisterState state); + void handleSetCurrentFilterOption(); + + QStringList m_arguments; + int m_pos; + QString m_collectionFile; + QString m_cloneFile; + QString m_helpFile; + QUrl m_url; + bool m_enableRemoteControl; + + ShowState m_contents; + ShowState m_index; + ShowState m_bookmarks; + ShowState m_search; + RegisterState m_register; + QString m_currentFilter; + bool m_removeSearchIndex; + bool m_rebuildSearchIndex; + bool m_quiet; + QString m_error; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/assistant/contentwindow.cpp b/src/assistant/assistant/contentwindow.cpp new file mode 100644 index 000000000..3fb1555e0 --- /dev/null +++ b/src/assistant/assistant/contentwindow.cpp @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "contentwindow.h" + +#include "centralwidget.h" +#include "helpenginewrapper.h" +#include "helpviewer.h" +#include "openpagesmanager.h" +#include "tracer.h" + +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +ContentWindow::ContentWindow() + : m_contentWidget(HelpEngineWrapper::instance().contentWidget()) + , m_expandDepth(-2) +{ + TRACE_OBJ + m_contentWidget->viewport()->installEventFilter(this); + m_contentWidget->setContextMenuPolicy(Qt::CustomContextMenu); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setMargin(4); + layout->addWidget(m_contentWidget); + + connect(m_contentWidget, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(showContextMenu(QPoint))); + connect(m_contentWidget, SIGNAL(linkActivated(QUrl)), this, + SIGNAL(linkActivated(QUrl))); + + QHelpContentModel *contentModel = + qobject_cast(m_contentWidget->model()); + connect(contentModel, SIGNAL(contentsCreated()), this, SLOT(expandTOC())); +} + +ContentWindow::~ContentWindow() +{ + TRACE_OBJ +} + +bool ContentWindow::syncToContent(const QUrl& url) +{ + TRACE_OBJ + QModelIndex idx = m_contentWidget->indexOf(url); + if (!idx.isValid()) + return false; + m_contentWidget->setCurrentIndex(idx); + return true; +} + +void ContentWindow::expandTOC() +{ + TRACE_OBJ + Q_ASSERT(m_expandDepth >= -2); + if (m_expandDepth > -2) { + expandToDepth(m_expandDepth); + m_expandDepth = -2; + } +} + +void ContentWindow::expandToDepth(int depth) +{ + TRACE_OBJ + Q_ASSERT(depth >= -2); + m_expandDepth = depth; + if (depth == -1) + m_contentWidget->expandAll(); + else if (depth == 0) + m_contentWidget->collapseAll(); + else + m_contentWidget->expandToDepth(depth - 1); +} + +void ContentWindow::focusInEvent(QFocusEvent *e) +{ + TRACE_OBJ + if (e->reason() != Qt::MouseFocusReason) + m_contentWidget->setFocus(); +} + +void ContentWindow::keyPressEvent(QKeyEvent *e) +{ + TRACE_OBJ + if (e->key() == Qt::Key_Escape) + emit escapePressed(); +} + +bool ContentWindow::eventFilter(QObject *o, QEvent *e) +{ + TRACE_OBJ + if (m_contentWidget && o == m_contentWidget->viewport() + && e->type() == QEvent::MouseButtonRelease) { + QMouseEvent *me = static_cast(e); + const QModelIndex &index = m_contentWidget->indexAt(me->pos()); + if (!index.isValid()) + return QWidget::eventFilter(o, e); + + const Qt::MouseButtons button = me->button(); + QItemSelectionModel *sm = m_contentWidget->selectionModel(); + if (sm->isSelected(index)) { + if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier)) + || (button == Qt::MidButton)) { + QHelpContentModel *contentModel = + qobject_cast(m_contentWidget->model()); + if (contentModel) { + QHelpContentItem *itm = contentModel->contentItemAt(index); + if (itm && HelpViewer::canOpenPage(itm->url().path())) + OpenPagesManager::instance()->createPage(itm->url()); + } + } else if (button == Qt::LeftButton) { + itemClicked(index); + } + } + } + return QWidget::eventFilter(o, e); +} + + +void ContentWindow::showContextMenu(const QPoint &pos) +{ + TRACE_OBJ + if (!m_contentWidget->indexAt(pos).isValid()) + return; + + QHelpContentModel *contentModel = + qobject_cast(m_contentWidget->model()); + QHelpContentItem *itm = + contentModel->contentItemAt(m_contentWidget->currentIndex()); + + QMenu menu; + QAction *curTab = menu.addAction(tr("Open Link")); + QAction *newTab = menu.addAction(tr("Open Link in New Tab")); + if (!HelpViewer::canOpenPage(itm->url().path())) + newTab->setEnabled(false); + + menu.move(m_contentWidget->mapToGlobal(pos)); + + QAction *action = menu.exec(); + if (curTab == action) + emit linkActivated(itm->url()); + else if (newTab == action) + OpenPagesManager::instance()->createPage(itm->url()); +} + +void ContentWindow::itemClicked(const QModelIndex &index) +{ + TRACE_OBJ + QHelpContentModel *contentModel = + qobject_cast(m_contentWidget->model()); + + if (contentModel) { + if (QHelpContentItem *itm = contentModel->contentItemAt(index)) { + const QUrl &url = itm->url(); + if (url != CentralWidget::instance()->currentSource()) + emit linkActivated(url); + } + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/contentwindow.h b/src/assistant/assistant/contentwindow.h new file mode 100644 index 000000000..9c7f4c24f --- /dev/null +++ b/src/assistant/assistant/contentwindow.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CONTENTWINDOW_H +#define CONTENTWINDOW_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpEngine; +class QHelpContentItem; +class QHelpContentWidget; + +class ContentWindow : public QWidget +{ + Q_OBJECT + +public: + ContentWindow(); + ~ContentWindow(); + + bool syncToContent(const QUrl &url); + void expandToDepth(int depth); + +signals: + void linkActivated(const QUrl &link); + void escapePressed(); + +private slots: + void showContextMenu(const QPoint &pos); + void expandTOC(); + void itemClicked(const QModelIndex &index); + +private: + void focusInEvent(QFocusEvent *e); + void keyPressEvent(QKeyEvent *e); + bool eventFilter(QObject *o, QEvent *e); + + QHelpContentWidget * const m_contentWidget; + int m_expandDepth; +}; + +QT_END_NAMESPACE + +#endif // CONTENTWINDOW_H diff --git a/src/assistant/assistant/doc/HOWTO b/src/assistant/assistant/doc/HOWTO new file mode 100644 index 000000000..a0143479e --- /dev/null +++ b/src/assistant/assistant/doc/HOWTO @@ -0,0 +1,16 @@ +How to build/ update a new assistant.qch for Assistant internal help + +- update: + - open assistant.qdocconf, update year and qt version + + - ..\..\..\..\qdoc3\debug\qdoc3.exe assistant.qdocconf + will generate an folder html containing all required stuff + + - cp assistant.qhp to generated html folder + - run qhelpgenerator html\assistant.qhp -o ..\assistant.qch + + - rebuild assistant + +- to test your changes: + - remove assistant.qch in your cache directory + - restart assistant diff --git a/src/assistant/assistant/doc/assistant.qdoc b/src/assistant/assistant/doc/assistant.qdoc new file mode 100644 index 000000000..8bd7432ec --- /dev/null +++ b/src/assistant/assistant/doc/assistant.qdoc @@ -0,0 +1,461 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page assistant.html + \title Qt Assistant + + \chapter Introduction + + This document introduces \e{Qt Assistant}, a tool for presenting on-line + documentation. It also introduces the Qt Reference Documentation which + is accessible using \e{Qt Assistant}, or with a web browser. The document is + divided into the following sections: + + Table of contents: + + \list + \o \l{Introduction} + \o \l{The One-Minute Guide to Using Qt Assistant} + \o \l{Introduction to the Qt Reference Documentation} + \o \l{Qt Assistant in More Detail} + \o \l{Full Text Searching} + \endlist + + \chapter The One-Minute Guide to Using Qt Assistant + + Once you have installed Qt, \QA should be ready to run: + + \list + \o On Windows, \QA is available as a menu option on the Qt menu. + \o On Mac OS X, \QA is installed in the /Developer/Applications/Qt directory. + \o On Unix/Linux, open a terminal, type \c{assistant} and press \key{Enter}. + \endlist + + When you start up \QA, you will be presented with a standard main window + application, with a menu bar and toolbar. Below these, on the left hand + side are navigation windows called \e{Contents}, \e{Index} and \e{Bookmarks}. + On the right, taking up most of the space, is the \e{Documentation} window. + By default, \QA loads the Qt reference documentation along with the manuals + of other Qt tools, like \QD or \QL. + + \QA works in a similar way to a Web browser. If you click hyperlinks + (cross-references), the \e{Documentation} window will present the relevant + page. You can bookmark pages of particular interest and you can click the + \gui{Previous} and \gui{Next} toolbar buttons to navigate within the pages + you have visited. + + Although \QA can be used just like a Web browser to navigate through + the documentation, \QA offers a powerful means of navigation that Web + browsers do not provide. \QA uses an advanced full text search engine + to index all the pages in each compressed help file so that you can + search for particular words and phrases. + + To perform an index search, click the \gui{Index} tab on the Sidebar + (or press \key{Alt+I}). In the \gui{'Look For'} line edit enter a word; + e.g., 'homedirpath'. As you type, words are found and highlighted in a list + beneath the line edit. If the highlighted text matches what you're + looking for, double click it, (or press \key{Enter}) and the + \e{Documentation} window will display the relevant page. You rarely have + to type in the whole word before \QA finds a match. Note that for some + words there may be more than one possible page that is relevant. + + \QA also provides full text searching for finding specific words in + the documentation. To activate the full text search, either press \key(Alt+S) + or click on the \gui{Search} tab in the \e{Documentation} window. Then + enter the term you're looking for and hit the \gui{Search} button. All + documents containing the specified term will then be listed in the list box + below. + + \chapter Introduction to the Qt Reference Documentation + + The documentation for the Qt library is written in-line in the \c + .cpp files by the developers themselves. The documentation team + revises the documentation to ensure that it is accurate and usable, + and to provide quality control. The documentation team also writes the + larger texts, such as the class descriptions that introduce a class + along with the concepts the class uses, as well as introducing the + functions and properties that the class provides. + + The documentation focuses on the API rather than the internals, since + we make great efforts to keep our API consistent and compatible with + each new version, but we may change the internals considerably to improve + performance and enhance functionality. + + The Qt Reference Documentation consists of almost 1,500 HTML pages + (over 2,500 printed pages). The overwhelming majority of pages + document Qt classes. Since developers differ in the way they + think and work we provide a variety of approaches to navigating the + documentation set: + + \list + \i The \menu{Qt's Classes} page lists every class + in Qt's public API, and consists of several hundred classes. + \i The \menu{Qt's Main Classes} page lists the + classes you're most likely to use most often, and provides a much + shorter and more managable list than the All Classes list. + \i The \menu{Grouped Classes} page presents a list + of groups, each of which leads to a list of related classes, for + example, the \menu{Advanced Widgets} list. + \i The \menu{Class Inheritance Hierarchy} page + presents a list of classes in terms of the hierarchy of Qt classes. + \i The \menu{Member Function Index} page lists all the + functions provided by Qt classes, each one with links to the class(es) + in which it appears. + \endlist + + No matter where you find yourself in the Qt documentation, you will + find extensive cross-referencing. Even snippets of example code + contain clickable links, so that for example, if you come across a + class declaration in a code example, the class name will be a + clickable link to the class's documentation. + + In addition to the class documentation some of Qt's modules have + extensive descriptions, and there are many overview documents which + describe various aspects of the Qt library; all these are linked from + the reference documentation home page. There are also two tutorials + and numerous example programs in the examples subdirectory of the Qt + distribution. + + \chapter Qt Assistant in More Detail + + \img assistant-assistant.png + + \section1 Command Line Options + + \QA handles the following command line options: + + \table + \header + \o Command Line Option + \o Brief Description + \row + \o -collectionFile + \o Uses the specified collection file instead of the default one. + \row + \o -showUrl URL + \o Shows the document referenced by URL. + \row + \o -enableRemoteControl + \o Enables \QA to be remotly controlled. + \row + \o -show + \o Shows the specified dockwidget which can be "contents", "index", + "bookmarks" or "search". + \row + \o -hide + \o Hides the specified dockwidget which can be "contents", "index", + "bookmarks" or "search. + \row + \o -activate + \o Activates the specified dockwidget which can be "contents", + "index", "bookmarks" or "search. + \row + \o -register + \o Registers the specified compressed help file in the given help + collection. + \row + \o -unregister + \o Unregisters the specified compressed help file from the given + collection file. + \row + \o -quiet + \o Doesn't show any error, warning or success messages. + \endtable + + \section1 Tool Windows + + \img assistant-dockwidgets.png + + The tool windows provide four ways to navigate the documentation: + + \list + \o The \gui{Contents} window presents a table of contents implemented as a + tree view for the documentation that is available. If you click an item, + its documentation will appear in the \e{Documentation} window. If you double + click an item or click on the control to the left of it, the item's sub-items + will appear. Click a sub-item to make its page appear in the \e{Documentation} + window. Click on the control next to an open item to hide its sub-items. + \o The \gui{Index} window is used to look up key words or phrases. + See \l{The One-Minute Guide to Using Qt Assistant} for how to use this + window. + \o The \gui{Bookmarks} window lists any bookmarks you have made. Double + click a bookmark to make its page appear in the \e{Documentation} window. + The \gui{Bookmarks} window provides a context menu with \gui{Show Item}, + \gui{Delete Item} as well as \gui{Rename Item}. Click in the main menu + \menu{Bookmark|Add Bookmark...} (or press \key{Ctrl+B}) to bookmark the + page that is currently showing in the \e{Documentation} window. Right click + a bookmark in the list to rename or delete the highlighted bookmark. + \endlist + + If you want the \gui{Documentation} window to use as much space as possible, + you can easily group, move or hide the tool windows. To group the windows, + drag one on top of the other and release the mouse. If one or all tool + windows are not shown, press \key{Alt+C}, \key{Alt+I} or \key{Alt+O} to show + the required window. + + The tool windows can be docked into the main window, so you can drag them + to the top, left, right or bottom of \e{Qt Assistant's} window, or you can + drag them outside \QA to float them as independent windows. + + \section1 Documentation Window + + \img assistant-docwindow.png + + The \gui{Documentation} window lets you create a tab for each + documentation page that you view. Click the \gui{Add Tab} button and a new + tab will appear with the page name as the tab's caption. This makes it + convenient to switch between pages when you are working with different + documentation. You can delete a tab by clicking the \gui{Close Tab} button + located on the right side of the \gui{Documentation} window. + + \section1 Toolbars + + \img assistant-toolbar.png + + The main toolbar provides fast access to the most common actions. + + \table + \header \o Action \o Description \o Menu Item \o Shortcut + \row \o \gui{Previous} \o Takes you to the previous page in the history. + \o \menu{Go|Previous} \o \key{Alt+Left Arrow} + \row \o \gui{Next} \o Takes you to the next page in the history. + \o \menu{Go|Next} \o \key{Alt+Right Arrow} + \row \o \gui{Home} + \o Takes you to the home page as specified in the Preferences Dialog. + \o \menu{Go|Home} \o \key{Ctrl+Home}. + \row \o \gui{Sync with Table of Contents} + \o Synchronizes the \gui{Contents} tool window with the page currently + shown in the \gui{Documentation} window. + \o \menu{Go|Sync with Table of Contents} \o + \row \o \gui{Copy} \o Copies any selected text to the clipboard. + \o \menu{Edit|Copy} \o \key{Ctrl+C} + \row \o \gui{Print} \o Opens the \gui{Print} dialog. + \o \menu{File|Print} \o \key{Ctrl+P} + \row \o \gui{Find in Text} \o Opens the \gui{Find Text} dialog. + \o \menu{Edit|Find in Text} \o \key{Ctrl+F} + \row \o \gui{Zoom in} + \o Increases the font size used to display text in the current tab. + \o \menu{View|Zoom in} \o \key{Ctrl++} + \row \o \gui{Zoom out} + \o Decreases the font size used to display text in the current tab. + \o \menu{View|Zoom out} \o \key{Ctrl+-} + \row \o \gui{Normal Size} + \o Resets the font size to its normal size in the current tab. + \o \menu{View|Normal Size} \o \key{Ctrl+0} + \endtable + + \img assistant-address-toolbar.png + + The address toolbar provides a fast way to enter a specific URL for a + documentation file. By default, the address toolbar is not shown, so it + has to be activated via \menu{View|Toolbars|Address Toolbar}. + + \img assistant-filter-toolbar.png + + The filter toolbar allows you to apply a filter to the currently installed + documentation. As with the address toolbar, the filter toolbar is not visible + by default and has to be activated via \menu{View|Toolbars|Filter Toolbar}. + + \section1 Menus + + \section2 File Menu + + \list + \o \menu{File|Page Setup...} invokes a dialog allowing you to define + page layout properties, such as margin sizes, page orientation and paper size. + \o \menu{File|Print Preview...} provides a preview of the printed pages. + \o \menu{File|Print...} opens the \l{#Print Dialog}{\gui{Print} dialog}. + \o \menu{File|New Tab} opens a new empty tab in the \gui{Documentation} + window. + \o \menu{File|Close Tab} closes the current tab of the + \gui{Documentation} window. + \o \menu{File|Exit} closes the \QA application. + \endlist + + \section2 Edit Menu + + \list + \o \menu{Edit|Copy} copies any selected text to the clipboard. + \o \menu{Edit|Find in Text} invokes the \l{#Find Text Control}{\gui{Find Text} + control} at the lower end of the \gui{Documentation} window. + \o \menu{Edit|Find Next} looks for the next occurance of the specified + text in the \gui{Find Text} control. + \o \menu{Edit|Find Previous} looks for the previous occurance of + the specified text in the \l{#Find Text Control}{\gui{Find Text} control}. + \o \menu{Edit|Preferences} invokes the \l{#Preferences Dialog}{\gui{Preferences} dialog}. + \endlist + + \section2 View Menu + + \list + \o \menu{View|Zoom in} increases the font size in the current tab. + \o \menu{View|Zoom out} decreases the font size in the current tab. + \o \menu{View|Normal Size} resets the font size in the current tab. + \o \menu{View|Contents} toggles the display of the \gui{Contents} tool window. + \o \menu{View|Index} toggles the display of the \gui{Index} tool window. + \o \menu{View|Bookmarks} toggles the display of the \gui{Bookmarks} tool window. + \o \menu{View|Search} toggles the display of the Search in the \gui{Documentation} window. + \endlist + + \section2 Go Menu + + \list + \o \menu{Go|Home} goes to the home page. + \o \menu{Go|Back} displays the previous page in the history. + \o \menu{Go|Forward} displays the next page in the history. + \o \menu{Go|Sync with Table of Contents} syncs the \gui{Contents} tool window to the currently shown page. + \o \menu{Go|Next Page} selects the next tab in the \gui{Documentation} window. + \o \menu{Go|Previous Page} selects the previous tab in the \gui{Documentation} window. + \endlist + + \section2 Bookmarks Menu + + \list + \o \menu{Bookmarks|Add} adds the current page to the list of bookmarks. + \endlist + + \section1 Dialogs + + \section2 Print Dialog + + This dialog is platform-specific. It gives access to various printer + options and can be used to print the document shown in the current tab. + + \section2 Preferences Dialog + + \img assistant-preferences-fonts.png + + The \menu{Fonts} page allows you to change the font family and font sizes of the + browser window displaying the documentation or the application itself. + + \img assistant-preferences-filters.png + + The \menu{Filters} page lets you create and remove documentation + filters. To add a new filter, click the \gui{Add} button, specify a + filter name in the pop-up dialog and click \gui{OK}, then select + the filter attributes in the list box on the right hand side. + You can delete a filter by selecting it and clicking the \gui{Remove} + button. + + \img assistant-preferences-documentation.png + + The \menu{Documentation} page lets you install and remove compressed help + files. Click the \gui{Install} button and choose the path of the compressed + help file (*.qch) you would like to install. + To delete a help file, select a documentation set in the list and click + \gui{Remove}. + + \img assistant-preferences-options.png + + The \menu{Options} page lets you specify the homepage \QA will display when + you click the \gui{Home} button in \QA's main user interface. You can specify + the hompage by typing it here or clicking on one of the buttons below the + textbox. \gui{Current Page} sets the currently displayed page as your home + page while \gui{Restore to default} will reset your home page to the default + home page. + + \section1 Find Text Control + + This control is used to find text in the current page. Enter the text you want + to find in the line edit. The search is incremental, meaning that the most + relevant result is shown as you enter characters into the line edit. + + If you check the \gui{Whole words only} checkbox, the search will only consider + whole words; for example, if you search for "spin" with this checkbox checked it will + not match "spinbox", but will match "spin". If you check the \gui{Case sensitive} + checkbox then, for example, "spin" will match "spin" but not "Spin". You can + search forwards or backwards from your current position in the page by clicking + the \gui{Previous} or \gui{Next} buttons. To hide the find control, either click the + \gui{Close} button or hit the \key{Esc} key. + + \section1 Filtering Help Contents + + \QA allows you to install any kind of documentation as long as it is organized + in Qt compressed help files (*.qch). For example, it is possible to install the + Qt reference documentation for Qt 4.4.0 and Qt 4.4.1 at the same time. In many + respects, this is very convenient since only one version of \QA is needed. + However, at the same time it becomes more complicated when performing tasks like + searching the index because nearly every keyword is defined in Qt 4.4.0 as well + as in Qt 4.4.1. This means that \QA will always ask the user to choose which one + should be displayed. + + We use documentation filters to solve this issue. A filter is identified by its + name, and contains a list of filter attributes. An attribute is just a string and + can be freely chosen. Attributes are defined by the documentation itself, this + means that every documentation set usually has one or more attributes. + + For example, the Qt 4.4.0 \QA documentation defines the attributes \c {assistant}, + \c{tools} and \c{4.4.0}, \QD defines \c{designer}, \c{tools} and \c{4.4.0}. + The filter to display all tools would then define only the attribute + \c{tools} since this attribute is part of both documentation sets. + Adding the attribute \c{assistant} to the filter would then only show \QA + documentation since the \QD documentation does not contain this + attribute. Having an empty list of attributes in a filter will match all + documentation; i.e., it is equivalent to requesting unfiltered documentation. + + \section1 Full Text Searching + + \img assistant-search.png + + \QA provides a powerful full text search engine. To search + for certain words or text, click the \gui{Search} tab in the \gui{Documentation} + window. Then enter the text you want to look for and press \key{Enter} + or click the \gui{Search} button. The search is not case sensitive, so, + for example, Foo, fOo and FOO are all treated as the same. The following are + examples of common search patterns: + + \list + \o \c deep -- lists all the documents that contain the word 'deep' + \o \c{deep*} -- lists all the documents that contain a word beginning + with 'deep' + \o \c{deep copy} -- lists all documents that contain both 'deep' \e + and 'copy' + \o \c{"deep copy"} -- list all documents that contain the phrase 'deep copy' + \endlist + + It is also possible to use the \gui{Advanced search} to get more flexibility. + You can specify some words so that hits containing these are excluded from the + result, or you can search for an exact phrase. Searching for similar words will + give results like these: + + \list + \o \c{QStin} -- lists all the documents with titles that are similar, such as \c{QString} + \o \c{QSting} -- lists all the documents with titles that are similar, such as \c{QString} + \o \c{QStrin} -- lists all the documents with titles that are similar, such as \c{QString} + \endlist + + Options can be combined to improve the search results. + + The list of documents found is ordered according to the number of + occurrences of the search text which they contain, with those containing + the highest number of occurrences appearing first. Simply click any + document in the list to display it in the \gui{Documentation} window. + + If the documentation has changed \mdash for example, if documents have been added + or removed \mdash \QA will index them again. +*/ diff --git a/src/assistant/assistant/doc/assistant.qdocconf b/src/assistant/assistant/doc/assistant.qdocconf new file mode 100644 index 000000000..4319b03f3 --- /dev/null +++ b/src/assistant/assistant/doc/assistant.qdocconf @@ -0,0 +1,16 @@ +include(../../../../qdoc3/test/qt.qdocconf) + +version = + +sourcedirs = $QTDIR/tools/assistant/tools/assistant/doc +imagedirs = $QTDIR/tools/assistant/tools/assistant/doc/images +outputdir = $QTDIR/tools/assistant/tools/assistant/doc/html +project = assistant +description = "Qt Assistant" +HTML.{postheader,address} = "" +HTML.footer = "


\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "
Copyright © 2011 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt 5.0.0
" diff --git a/src/assistant/assistant/doc/assistant.qhp b/src/assistant/assistant/doc/assistant.qhp new file mode 100644 index 000000000..7ea4cdd46 --- /dev/null +++ b/src/assistant/assistant/doc/assistant.qhp @@ -0,0 +1,22 @@ + + + assistant + com.trolltech.com.assistantinternal-1.0.0 + + + assistant.html + classic.css + images/assistant-address-toolbar.png + images/assistant-assistant.png + images/assistant-dockwidgets.png + images/assistant-docwindow.png + images/assistant-filter-toolbar.png + images/assistant-preferences-documentation.png + images/assistant-preferences-filters.png + images/assistant-preferences-fonts.png + images/assistant-preferences-options.png + images/assistant-search.png + images/assistant-toolbar.png + + + diff --git a/src/assistant/assistant/doc/classic.css b/src/assistant/assistant/doc/classic.css new file mode 100644 index 000000000..911354035 --- /dev/null +++ b/src/assistant/assistant/doc/classic.css @@ -0,0 +1,92 @@ +h3.fn,span.fn +{ + margin-left: 1cm; + text-indent: -1cm; +} + +a:link +{ + color: #004faf; + text-decoration: none +} + +a:visited +{ + color: #672967; + text-decoration: none +} + +td.postheader +{ + font-family: sans-serif +} + +tr.address +{ + font-family: sans-serif +} + +body +{ + background: #ffffff; + color: black +} + +table tr.odd { + background: #f0f0f0; + color: black; +} + +table tr.even { + background: #e4e4e4; + color: black; +} + +table.annotated th { + padding: 3px; + text-align: left +} + +table.annotated td { + padding: 3px; +} + +table tr pre +{ + padding-top: none; + padding-bottom: none; + padding-left: none; + padding-right: none; + border: none; + background: none +} + +tr.qt-style +{ + background: #a2c511; + color: black +} + +body pre +{ + padding: 0.2em; + border: #e7e7e7 1px solid; + background: #f1f1f1; + color: black +} + +span.preprocessor, span.preprocessor a +{ + color: darkblue; +} + +span.comment +{ + color: darkred; + font-style: italic +} + +span.string,span.char +{ + color: darkgreen; +} diff --git a/src/assistant/assistant/doc/images/assistant-address-toolbar.png b/src/assistant/assistant/doc/images/assistant-address-toolbar.png new file mode 100644 index 000000000..847b7debb Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-address-toolbar.png differ diff --git a/src/assistant/assistant/doc/images/assistant-assistant.png b/src/assistant/assistant/doc/images/assistant-assistant.png new file mode 100644 index 000000000..1ff5cc976 Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-assistant.png differ diff --git a/src/assistant/assistant/doc/images/assistant-dockwidgets.png b/src/assistant/assistant/doc/images/assistant-dockwidgets.png new file mode 100644 index 000000000..17bc064c5 Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-dockwidgets.png differ diff --git a/src/assistant/assistant/doc/images/assistant-docwindow.png b/src/assistant/assistant/doc/images/assistant-docwindow.png new file mode 100644 index 000000000..c5bac581f Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-docwindow.png differ diff --git a/src/assistant/assistant/doc/images/assistant-examples.png b/src/assistant/assistant/doc/images/assistant-examples.png new file mode 100644 index 000000000..47c01bcda Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-examples.png differ diff --git a/src/assistant/assistant/doc/images/assistant-filter-toolbar.png b/src/assistant/assistant/doc/images/assistant-filter-toolbar.png new file mode 100644 index 000000000..4e89a79b9 Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-filter-toolbar.png differ diff --git a/src/assistant/assistant/doc/images/assistant-preferences-documentation.png b/src/assistant/assistant/doc/images/assistant-preferences-documentation.png new file mode 100644 index 000000000..790fd9a1a Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-preferences-documentation.png differ diff --git a/src/assistant/assistant/doc/images/assistant-preferences-filters.png b/src/assistant/assistant/doc/images/assistant-preferences-filters.png new file mode 100644 index 000000000..7453dd66d Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-preferences-filters.png differ diff --git a/src/assistant/assistant/doc/images/assistant-preferences-fonts.png b/src/assistant/assistant/doc/images/assistant-preferences-fonts.png new file mode 100644 index 000000000..d42d190d0 Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-preferences-fonts.png differ diff --git a/src/assistant/assistant/doc/images/assistant-preferences-options.png b/src/assistant/assistant/doc/images/assistant-preferences-options.png new file mode 100644 index 000000000..d6624151a Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-preferences-options.png differ diff --git a/src/assistant/assistant/doc/images/assistant-search.png b/src/assistant/assistant/doc/images/assistant-search.png new file mode 100644 index 000000000..ef75c3329 Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-search.png differ diff --git a/src/assistant/assistant/doc/images/assistant-toolbar.png b/src/assistant/assistant/doc/images/assistant-toolbar.png new file mode 100644 index 000000000..1b41825c6 Binary files /dev/null and b/src/assistant/assistant/doc/images/assistant-toolbar.png differ diff --git a/src/assistant/assistant/filternamedialog.cpp b/src/assistant/assistant/filternamedialog.cpp new file mode 100644 index 000000000..d1424ee2a --- /dev/null +++ b/src/assistant/assistant/filternamedialog.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include + +#include "filternamedialog.h" + +QT_BEGIN_NAMESPACE + +FilterNameDialog::FilterNameDialog(QWidget *parent) + : QDialog(parent) +{ + TRACE_OBJ + m_ui.setupUi(this); + connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), + SIGNAL(clicked()), this, SLOT(accept())); + connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), + SIGNAL(clicked()), this, SLOT(reject())); + connect(m_ui.lineEdit, SIGNAL(textChanged(QString)), + this, SLOT(updateOkButton())); + m_ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true); + +} + +QString FilterNameDialog::filterName() const +{ + TRACE_OBJ + return m_ui.lineEdit->text(); +} + +void FilterNameDialog::updateOkButton() +{ + TRACE_OBJ + m_ui.buttonBox->button(QDialogButtonBox::Ok) + ->setDisabled(m_ui.lineEdit->text().isEmpty()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/filternamedialog.h b/src/assistant/assistant/filternamedialog.h new file mode 100644 index 000000000..bf65a7e15 --- /dev/null +++ b/src/assistant/assistant/filternamedialog.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FILTERNAMEDIALOG_H +#define FILTERNAMEDIALOG_H + +#include +#include "ui_filternamedialog.h" + +QT_BEGIN_NAMESPACE + +class FilterNameDialog : public QDialog +{ + Q_OBJECT + +public: + FilterNameDialog(QWidget *parent = 0); + QString filterName() const; + +private slots: + void updateOkButton(); + +private: + Ui::FilterNameDialogClass m_ui; +}; + +QT_END_NAMESPACE + +#endif // FILTERNAMEDIALOG_H diff --git a/src/assistant/assistant/filternamedialog.ui b/src/assistant/assistant/filternamedialog.ui new file mode 100644 index 000000000..755a93479 --- /dev/null +++ b/src/assistant/assistant/filternamedialog.ui @@ -0,0 +1,67 @@ + + FilterNameDialogClass + + + + 0 + 0 + 312 + 95 + + + + Add Filter Name + + + + 9 + + + 6 + + + + + Filter Name: + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + diff --git a/src/assistant/assistant/findwidget.cpp b/src/assistant/assistant/findwidget.cpp new file mode 100644 index 000000000..296da0c8d --- /dev/null +++ b/src/assistant/assistant/findwidget.cpp @@ -0,0 +1,234 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" +#include "findwidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +FindWidget::FindWidget(QWidget *parent) + : QWidget(parent) + , appPalette(qApp->palette()) +{ + TRACE_OBJ + installEventFilter(this); + QHBoxLayout *hboxLayout = new QHBoxLayout(this); + QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); + +#ifndef Q_OS_MAC + hboxLayout->setMargin(0); + hboxLayout->setSpacing(6); + resourcePath.append(QLatin1String("win")); +#else + resourcePath.append(QLatin1String("mac")); +#endif + + toolClose = setupToolButton(QLatin1String(""), + resourcePath + QLatin1String("/closetab.png")); + hboxLayout->addWidget(toolClose); + connect(toolClose, SIGNAL(clicked()), SLOT(hide())); + + editFind = new QLineEdit(this); + hboxLayout->addWidget(editFind); + editFind->setMinimumSize(QSize(150, 0)); + connect(editFind, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + connect(editFind, SIGNAL(returnPressed()), this, SIGNAL(findNext())); + connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); + + toolPrevious = setupToolButton(tr("Previous"), + resourcePath + QLatin1String("/previous.png")); + connect(toolPrevious, SIGNAL(clicked()), this, SIGNAL(findPrevious())); + + hboxLayout->addWidget(toolPrevious); + + toolNext = setupToolButton(tr("Next"), + resourcePath + QLatin1String("/next.png")); + hboxLayout->addWidget(toolNext); + connect(toolNext, SIGNAL(clicked()), this, SIGNAL(findNext())); + + checkCase = new QCheckBox(tr("Case Sensitive"), this); + hboxLayout->addWidget(checkCase); + + labelWrapped = new QLabel(this); + labelWrapped->setScaledContents(true); + labelWrapped->setTextFormat(Qt::RichText); + labelWrapped->setMinimumSize(QSize(0, 20)); + labelWrapped->setMaximumSize(QSize(105, 20)); + labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); + labelWrapped->setText(tr(" Search wrapped")); + hboxLayout->addWidget(labelWrapped); + + QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, + QSizePolicy::Minimum); + hboxLayout->addItem(spacerItem); + setMinimumWidth(minimumSizeHint().width()); + labelWrapped->hide(); + + updateButtons(); +} + +FindWidget::~FindWidget() +{ + TRACE_OBJ +} + +void FindWidget::show() +{ + TRACE_OBJ + QWidget::show(); + editFind->selectAll(); + editFind->setFocus(Qt::ShortcutFocusReason); +} + +void FindWidget::showAndClear() +{ + TRACE_OBJ + show(); + editFind->clear(); +} + +QString FindWidget::text() const +{ + TRACE_OBJ + return editFind->text(); +} + +bool FindWidget::caseSensitive() const +{ + TRACE_OBJ + return checkCase->isChecked(); +} + +void FindWidget::setPalette(bool found) +{ + TRACE_OBJ + QPalette palette = editFind->palette(); + palette.setColor(QPalette::Active, QPalette::Base, found ? Qt::white + : QColor(255, 102, 102)); + editFind->setPalette(palette); +} + +void FindWidget::setTextWrappedVisible(bool visible) +{ + TRACE_OBJ + labelWrapped->setVisible(visible); +} + +void FindWidget::hideEvent(QHideEvent* event) +{ + TRACE_OBJ +#if !defined(QT_NO_WEBKIT) + // TODO: remove this once webkit supports setting the palette + if (!event->spontaneous()) + qApp->setPalette(appPalette); +#else + Q_UNUSED(event); +#endif +} + +void FindWidget::showEvent(QShowEvent* event) +{ + TRACE_OBJ +#if !defined(QT_NO_WEBKIT) + // TODO: remove this once webkit supports setting the palette + if (!event->spontaneous()) { + QPalette p = appPalette; + p.setColor(QPalette::Inactive, QPalette::Highlight, + p.color(QPalette::Active, QPalette::Highlight)); + p.setColor(QPalette::Inactive, QPalette::HighlightedText, + p.color(QPalette::Active, QPalette::HighlightedText)); + qApp->setPalette(p); + } +#else + Q_UNUSED(event); +#endif +} + +void FindWidget::updateButtons() +{ + TRACE_OBJ + const bool enable = !editFind->text().isEmpty(); + toolNext->setEnabled(enable); + toolPrevious->setEnabled(enable); +} + +void FindWidget::textChanged(const QString &text) +{ + TRACE_OBJ + emit find(text, true, true); +} + +bool FindWidget::eventFilter(QObject *object, QEvent *e) +{ + TRACE_OBJ + if (e->type() == QEvent::KeyPress) { + if ((static_cast(e))->key() == Qt::Key_Escape) { + hide(); + emit escapePressed(); + } + } + return QWidget::eventFilter(object, e); +} + +QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) +{ + TRACE_OBJ + QToolButton *toolButton = new QToolButton(this); + + toolButton->setText(text); + toolButton->setAutoRaise(true); + toolButton->setIcon(QIcon(icon)); + toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + + return toolButton; +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/findwidget.h b/src/assistant/assistant/findwidget.h new file mode 100644 index 000000000..b24e88019 --- /dev/null +++ b/src/assistant/assistant/findwidget.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef FINDWIDGET_H +#define FINDWIDGET_H + +#include + +QT_BEGIN_NAMESPACE + +class QCheckBox; +class QLabel; +class QLineEdit; +class QToolButton; + +class FindWidget : public QWidget +{ + Q_OBJECT +public: + FindWidget(QWidget *parent = 0); + ~FindWidget(); + + void show(); + void showAndClear(); + + QString text() const; + bool caseSensitive() const; + + void setPalette(bool found); + void setTextWrappedVisible(bool visible); + +signals: + void findNext(); + void findPrevious(); + void escapePressed(); + void find(const QString &text, bool forward, bool incremental); + +protected: + void hideEvent(QHideEvent* event); + void showEvent(QShowEvent * event); + +private slots: + void updateButtons(); + void textChanged(const QString &text); + +private: + bool eventFilter(QObject *object, QEvent *e); + QToolButton* setupToolButton(const QString &text, const QString &icon); + +private: + QPalette appPalette; + + QLineEdit *editFind; + QCheckBox *checkCase; + QLabel *labelWrapped; + QToolButton *toolNext; + QToolButton *toolClose; + QToolButton *toolPrevious; +}; + +QT_END_NAMESPACE + +#endif // FINDWIDGET_H diff --git a/src/assistant/assistant/globalactions.cpp b/src/assistant/assistant/globalactions.cpp new file mode 100644 index 000000000..6b8b8ea29 --- /dev/null +++ b/src/assistant/assistant/globalactions.cpp @@ -0,0 +1,246 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "globalactions.h" + +#include "centralwidget.h" +#include "helpviewer.h" +#include "tracer.h" + +#include +#include + +#if !defined(QT_NO_WEBKIT) +#include +#endif + +GlobalActions *GlobalActions::instance(QObject *parent) +{ + Q_ASSERT(!m_instance != !parent); + if (!m_instance) + m_instance = new GlobalActions(parent); + return m_instance; +} + +GlobalActions::GlobalActions(QObject *parent) : QObject(parent) +{ + TRACE_OBJ + + // TODO: Put resource path in misc class + QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); +#ifdef Q_OS_MAC + resourcePath.append(QLatin1String("mac")); +#else + resourcePath.append(QLatin1String("win")); +#endif + CentralWidget *centralWidget = CentralWidget::instance(); + + m_backAction = new QAction(tr("&Back"), parent); + m_backAction->setEnabled(false); + m_backAction->setShortcuts(QKeySequence::Back); + m_backAction->setIcon(QIcon(resourcePath + QLatin1String("/previous.png"))); + connect(m_backAction, SIGNAL(triggered()), centralWidget, SLOT(backward())); + m_actionList << m_backAction; + + m_nextAction = new QAction(tr("&Forward"), parent); + m_nextAction->setPriority(QAction::LowPriority); + m_nextAction->setEnabled(false); + m_nextAction->setShortcuts(QKeySequence::Forward); + m_nextAction->setIcon(QIcon(resourcePath + QLatin1String("/next.png"))); + connect(m_nextAction, SIGNAL(triggered()), centralWidget, SLOT(forward())); + m_actionList << m_nextAction; + + setupNavigationMenus(m_backAction, m_nextAction, centralWidget); + + m_homeAction = new QAction(tr("&Home"), parent); + m_homeAction->setShortcut(tr("ALT+Home")); + m_homeAction->setIcon(QIcon(resourcePath + QLatin1String("/home.png"))); + connect(m_homeAction, SIGNAL(triggered()), centralWidget, SLOT(home())); + m_actionList << m_homeAction; + + QAction *separator = new QAction(parent); + separator->setSeparator(true); + m_actionList << separator; + + m_zoomInAction = new QAction(tr("Zoom &in"), parent); + m_zoomInAction->setPriority(QAction::LowPriority); + m_zoomInAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomin.png"))); + m_zoomInAction->setShortcut(QKeySequence::ZoomIn); + connect(m_zoomInAction, SIGNAL(triggered()), centralWidget, SLOT(zoomIn())); + m_actionList << m_zoomInAction; + + m_zoomOutAction = new QAction(tr("Zoom &out"), parent); + m_zoomOutAction->setPriority(QAction::LowPriority); + m_zoomOutAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomout.png"))); + m_zoomOutAction->setShortcut(QKeySequence::ZoomOut); + connect(m_zoomOutAction, SIGNAL(triggered()), centralWidget, SLOT(zoomOut())); + m_actionList << m_zoomOutAction; + + separator = new QAction(parent); + separator->setSeparator(true); + m_actionList << separator; + + m_copyAction = new QAction(tr("&Copy selected Text"), parent); + m_copyAction->setPriority(QAction::LowPriority); + m_copyAction->setIconText("&Copy"); + m_copyAction->setIcon(QIcon(resourcePath + QLatin1String("/editcopy.png"))); + m_copyAction->setShortcuts(QKeySequence::Copy); + m_copyAction->setEnabled(false); + connect(m_copyAction, SIGNAL(triggered()), centralWidget, SLOT(copy())); + m_actionList << m_copyAction; + + m_printAction = new QAction(tr("&Print..."), parent); + m_printAction->setPriority(QAction::LowPriority); + m_printAction->setIcon(QIcon(resourcePath + QLatin1String("/print.png"))); + m_printAction->setShortcut(QKeySequence::Print); + connect(m_printAction, SIGNAL(triggered()), centralWidget, SLOT(print())); + m_actionList << m_printAction; + + m_findAction = new QAction(tr("&Find in Text..."), parent); + m_findAction->setIconText(tr("&Find")); + m_findAction->setIcon(QIcon(resourcePath + QLatin1String("/find.png"))); + m_findAction->setShortcuts(QKeySequence::Find); + connect(m_findAction, SIGNAL(triggered()), centralWidget, SLOT(showTextSearch())); + m_actionList << m_findAction; + +#ifdef Q_WS_X11 + m_backAction->setIcon(QIcon::fromTheme("go-previous" , m_backAction->icon())); + m_nextAction->setIcon(QIcon::fromTheme("go-next" , m_nextAction->icon())); + m_zoomInAction->setIcon(QIcon::fromTheme("zoom-in" , m_zoomInAction->icon())); + m_zoomOutAction->setIcon(QIcon::fromTheme("zoom-out" , m_zoomOutAction->icon())); + m_copyAction->setIcon(QIcon::fromTheme("edit-copy" , m_copyAction->icon())); + m_findAction->setIcon(QIcon::fromTheme("edit-find" , m_findAction->icon())); + m_homeAction->setIcon(QIcon::fromTheme("go-home" , m_homeAction->icon())); + m_printAction->setIcon(QIcon::fromTheme("document-print" , m_printAction->icon())); +#endif +} + +void GlobalActions::updateActions() +{ + TRACE_OBJ + CentralWidget *centralWidget = CentralWidget::instance(); + m_copyAction->setEnabled(centralWidget->hasSelection()); + m_nextAction->setEnabled(centralWidget->isForwardAvailable()); + m_backAction->setEnabled(centralWidget->isBackwardAvailable()); +} + +void GlobalActions::setCopyAvailable(bool available) +{ + TRACE_OBJ + m_copyAction->setEnabled(available); +} + +#if !defined(QT_NO_WEBKIT) + +void GlobalActions::slotAboutToShowBackMenu() +{ + TRACE_OBJ + m_backMenu->clear(); + if (QWebHistory *history = CentralWidget::instance()->currentHelpViewer()->history()) { + const int currentItemIndex = history->currentItemIndex(); + QList items = history->backItems(history->count()); + for (int i = items.count() - 1; i >= 0; --i) { + QAction *action = new QAction(this); + action->setText(items.at(i).title()); + action->setData(-1 * (currentItemIndex - i)); + m_backMenu->addAction(action); + } + } +} + +void GlobalActions::slotAboutToShowNextMenu() +{ + TRACE_OBJ + m_nextMenu->clear(); + if (QWebHistory *history = CentralWidget::instance()->currentHelpViewer()->history()) { + const int count = history->count(); + QList items = history->forwardItems(count); + for (int i = 0; i < items.count(); ++i) { + QAction *action = new QAction(this); + action->setData(count - i); + action->setText(items.at(i).title()); + m_nextMenu->addAction(action); + } + } +} + +void GlobalActions::slotOpenActionUrl(QAction *action) +{ + TRACE_OBJ + if (HelpViewer* viewer = CentralWidget::instance()->currentHelpViewer()) { + const int offset = action->data().toInt(); + QWebHistory *history = viewer->history(); + if (offset > 0) { + history->goToItem(history->forwardItems(history->count() + - offset + 1).back()); // forward + } else if (offset < 0) { + history->goToItem(history->backItems(-1 * offset).first()); // back + } + } +} + +#endif + +void GlobalActions::setupNavigationMenus(QAction *back, QAction *next, + QWidget *parent) +{ +#if !defined(QT_NO_WEBKIT) + m_backMenu = new QMenu(parent); + connect(m_backMenu, SIGNAL(aboutToShow()), this, + SLOT(slotAboutToShowBackMenu())); + connect(m_backMenu, SIGNAL(triggered(QAction*)), this, + SLOT(slotOpenActionUrl(QAction*))); + back->setMenu(m_backMenu); + + m_nextMenu = new QMenu(parent); + connect(m_nextMenu, SIGNAL(aboutToShow()), this, + SLOT(slotAboutToShowNextMenu())); + connect(m_nextMenu, SIGNAL(triggered(QAction*)), this, + SLOT(slotOpenActionUrl(QAction*))); + next->setMenu(m_nextMenu); +#else + Q_UNUSED(back) + Q_UNUSED(next) + Q_UNUSED(parent) +#endif +} + +GlobalActions *GlobalActions::m_instance = 0; diff --git a/src/assistant/assistant/globalactions.h b/src/assistant/assistant/globalactions.h new file mode 100644 index 000000000..a9059a9a4 --- /dev/null +++ b/src/assistant/assistant/globalactions.h @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GLOBALACTION_H +#define GLOBALACTION_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class QAction; +class QMenu; + +class GlobalActions : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(GlobalActions) +public: + static GlobalActions *instance(QObject *parent = 0); + + QList actionList() const { return m_actionList; } + QAction *backAction() const { return m_backAction; } + QAction *nextAction() const { return m_nextAction; } + QAction *homeAction() const { return m_homeAction; } + QAction *zoomInAction() const { return m_zoomInAction; } + QAction *zoomOutAction() const { return m_zoomOutAction; } + QAction *copyAction() const { return m_copyAction; } + QAction *printAction() const { return m_printAction; } + QAction *findAction() const { return m_findAction; } + + Q_SLOT void updateActions(); + Q_SLOT void setCopyAvailable(bool available); + +#if !defined(QT_NO_WEBKIT) +private slots: + void slotAboutToShowBackMenu(); + void slotAboutToShowNextMenu(); + void slotOpenActionUrl(QAction *action); +#endif + +private: + void setupNavigationMenus(QAction *back, QAction *next, QWidget *parent); + +private: + GlobalActions(QObject *parent); + + static GlobalActions *m_instance; + + QAction *m_backAction; + QAction *m_nextAction; + QAction *m_homeAction; + QAction *m_zoomInAction; + QAction *m_zoomOutAction; + QAction *m_copyAction; + QAction *m_printAction; + QAction *m_findAction; + + QList m_actionList; + + QMenu *m_backMenu; + QMenu *m_nextMenu; +}; + +QT_END_NAMESPACE + +#endif // GLOBALACTION_H diff --git a/src/assistant/assistant/helpenginewrapper.cpp b/src/assistant/assistant/helpenginewrapper.cpp new file mode 100644 index 000000000..4c7ff5b30 --- /dev/null +++ b/src/assistant/assistant/helpenginewrapper.cpp @@ -0,0 +1,844 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "helpenginewrapper.h" +#include "../shared/collectionconfiguration.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace { + const QString Unfiltered; + const QString AppFontKey(QLatin1String("appFont")); + const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); + const QString BookmarksKey(QLatin1String("Bookmarks")); + const QString BrowserFontKey(QLatin1String("browserFont")); + const QString BrowserWritingSystemKey(QLatin1String("browserWritingSystem")); + const QString HomePageKey(QLatin1String("homepage")); + const QString MainWindowKey(QLatin1String("MainWindow")); + const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); + const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); + const QString StartOptionKey(QLatin1String("StartOption")); + const QString UseAppFontKey(QLatin1String("useAppFont")); + const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); + const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). + arg(QLatin1String(QT_VERSION_STR))); + const QString ShowTabsKey(QLatin1String("showTabs")); +} // anonymous namespace + +class TimeoutForwarder : public QObject +{ + Q_OBJECT +public: + TimeoutForwarder(const QString &fileName); +private slots: + void forward(); +private: + friend class HelpEngineWrapperPrivate; + + const QString m_fileName; +}; + +class HelpEngineWrapperPrivate : public QObject +{ + Q_OBJECT + friend class HelpEngineWrapper; + friend class TimeoutForwarder; +private slots: + void qchFileChanged(const QString &fileName); + +signals: + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + +private: + HelpEngineWrapperPrivate(const QString &collectionFile); + + void initFileSystemWatchers(); + void checkDocFilesWatched(); + void qchFileChanged(const QString &fileName, bool fromTimeout); + + static const int UpdateGracePeriod = 2000; + + QHelpEngine * const m_helpEngine; + QFileSystemWatcher * const m_qchWatcher; + typedef QPair > RecentSignal; + QMap m_recentQchUpdates; +}; + +const QString HelpEngineWrapper::TrUnfiltered = HelpEngineWrapper::tr("Unfiltered"); + +HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; + +HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) +{ + TRACE_OBJ + /* + * Note that this Singleton cannot be static, because it has to be + * deleted before the QApplication. + */ + if (helpEngineWrapper == 0) + helpEngineWrapper = new HelpEngineWrapper(collectionFile); + return *helpEngineWrapper; +} + +void HelpEngineWrapper::removeInstance() +{ + TRACE_OBJ + delete helpEngineWrapper; + helpEngineWrapper = 0; +} + +HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) + : d(new HelpEngineWrapperPrivate(collectionFile)) +{ + TRACE_OBJ + + /* + * Otherwise we will waste time if several new docs are found, + * because we will start to index them, only to be interrupted + * by the next request. Also, there is a nasty SQLITE bug that will + * cause the application to hang for minutes in that case. + * This call is reverted by initialDocSetupDone(), which must be + * called after the new docs have been installed. + */ + disconnect(d->m_helpEngine, SIGNAL(setupFinished()), + searchEngine(), SLOT(indexDocumentation())); + + connect(d, SIGNAL(documentationRemoved(QString)), + this, SIGNAL(documentationRemoved(QString))); + connect(d, SIGNAL(documentationUpdated(QString)), + this, SIGNAL(documentationUpdated(QString))); + connect(d->m_helpEngine, SIGNAL(currentFilterChanged(QString)), + this, SLOT(handleCurrentFilterChanged(QString))); + connect(d->m_helpEngine, SIGNAL(setupFinished()), + this, SIGNAL(setupFinished())); +} + +HelpEngineWrapper::~HelpEngineWrapper() +{ + TRACE_OBJ + const QStringList &namespaces = d->m_helpEngine->registeredDocumentations(); + foreach (const QString &nameSpace, namespaces) { + const QString &docFile + = d->m_helpEngine->documentationFileName(nameSpace); + d->m_qchWatcher->removePath(docFile); + } + + delete d; +} + +void HelpEngineWrapper::initialDocSetupDone() +{ + TRACE_OBJ + connect(d->m_helpEngine, SIGNAL(setupFinished()), + searchEngine(), SLOT(indexDocumentation())); + setupData(); +} + +QHelpSearchEngine *HelpEngineWrapper::searchEngine() const +{ + TRACE_OBJ + return d->m_helpEngine->searchEngine(); +} + +QHelpContentModel *HelpEngineWrapper::contentModel() const +{ + TRACE_OBJ + return d->m_helpEngine->contentModel(); +} + +QHelpIndexModel *HelpEngineWrapper::indexModel() const +{ + TRACE_OBJ + return d->m_helpEngine->indexModel(); +} + +QHelpContentWidget *HelpEngineWrapper::contentWidget() +{ + TRACE_OBJ + return d->m_helpEngine->contentWidget(); +} + +QHelpIndexWidget *HelpEngineWrapper::indexWidget() +{ + TRACE_OBJ + return d->m_helpEngine->indexWidget(); +} + +const QStringList HelpEngineWrapper::registeredDocumentations() const +{ + TRACE_OBJ + return d->m_helpEngine->registeredDocumentations(); +} + +const QString HelpEngineWrapper::collectionFile() const +{ + TRACE_OBJ + return d->m_helpEngine->collectionFile(); +} + +bool HelpEngineWrapper::registerDocumentation(const QString &docFile) +{ + TRACE_OBJ + d->checkDocFilesWatched(); + if (!d->m_helpEngine->registerDocumentation(docFile)) + return false; + d->m_qchWatcher->addPath(docFile); + d->checkDocFilesWatched(); + return true; +} + +bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) +{ + TRACE_OBJ + d->checkDocFilesWatched(); + const QString &file = d->m_helpEngine->documentationFileName(namespaceName); + if (!d->m_helpEngine->unregisterDocumentation(namespaceName)) + return false; + d->m_qchWatcher->removePath(file); + d->checkDocFilesWatched(); + return true; +} + +bool HelpEngineWrapper::setupData() +{ + TRACE_OBJ + return d->m_helpEngine->setupData(); +} + +bool HelpEngineWrapper::addCustomFilter(const QString &filterName, + const QStringList &attributes) +{ + TRACE_OBJ + return d->m_helpEngine->addCustomFilter(filterName, attributes); +} + +bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) +{ + TRACE_OBJ + return d->m_helpEngine->removeCustomFilter(filterName); +} + +void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) +{ + TRACE_OBJ + const QString &filter + = currentFilter == TrUnfiltered ? Unfiltered : currentFilter; + d->m_helpEngine->setCurrentFilter(filter); +} + +const QString HelpEngineWrapper::currentFilter() const +{ + TRACE_OBJ + const QString &filter = d->m_helpEngine->currentFilter(); + return filter == Unfiltered ? TrUnfiltered : filter; +} + +const QStringList HelpEngineWrapper::customFilters() const +{ + TRACE_OBJ + QStringList filters = d->m_helpEngine->customFilters(); + filters.removeOne(Unfiltered); + filters.prepend(TrUnfiltered); + return filters; +} + +QUrl HelpEngineWrapper::findFile(const QUrl &url) const +{ + TRACE_OBJ + return d->m_helpEngine->findFile(url); +} + +QByteArray HelpEngineWrapper::fileData(const QUrl &url) const +{ + TRACE_OBJ + return d->m_helpEngine->fileData(url); +} + +QMap HelpEngineWrapper::linksForIdentifier(const QString &id) const +{ + TRACE_OBJ + return d->m_helpEngine->linksForIdentifier(id); +} + +const QStringList HelpEngineWrapper::filterAttributes() const +{ + TRACE_OBJ + return d->m_helpEngine->filterAttributes(); +} + +const QStringList HelpEngineWrapper::filterAttributes(const QString &filterName) const +{ + TRACE_OBJ + return d->m_helpEngine->filterAttributes(filterName); +} + +QString HelpEngineWrapper::error() const +{ + TRACE_OBJ + return d->m_helpEngine->error(); +} + +const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(VersionKey.arg(component)).toString(). + split(CollectionConfiguration::ListSeparator); +} + +void HelpEngineWrapper::setQtDocInfo(const QString &component, + const QStringList &doc) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(VersionKey.arg(component), + doc.join(CollectionConfiguration::ListSeparator)); +} + +const QStringList HelpEngineWrapper::lastShownPages() const +{ + TRACE_OBJ + return CollectionConfiguration::lastShownPages(*d->m_helpEngine); +} + +void HelpEngineWrapper::setLastShownPages(const QStringList &lastShownPages) +{ + TRACE_OBJ + CollectionConfiguration::setLastShownPages(*d->m_helpEngine, lastShownPages); +} + +const QStringList HelpEngineWrapper::lastZoomFactors() const +{ + TRACE_OBJ + return CollectionConfiguration::lastZoomFactors(*d->m_helpEngine); +} + +void HelpEngineWrapper::setLastZoomFactors(const QStringList &lastZoomFactors) +{ + TRACE_OBJ + CollectionConfiguration::setLastZoomFactors(*d->m_helpEngine, lastZoomFactors); +} + +const QString HelpEngineWrapper::cacheDir() const +{ + TRACE_OBJ + return CollectionConfiguration::cacheDir(*d->m_helpEngine); +} + +bool HelpEngineWrapper::cacheDirIsRelativeToCollection() const +{ + TRACE_OBJ + return CollectionConfiguration::cacheDirIsRelativeToCollection(*d->m_helpEngine); +} + +void HelpEngineWrapper::setCacheDir(const QString &cacheDir, + bool relativeToCollection) +{ + TRACE_OBJ + CollectionConfiguration::setCacheDir(*d->m_helpEngine, cacheDir, + relativeToCollection); +} + +bool HelpEngineWrapper::filterFunctionalityEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::filterFunctionalityEnabled(*d->m_helpEngine); +} + +void HelpEngineWrapper::setFilterFunctionalityEnabled(bool enabled) +{ + TRACE_OBJ + CollectionConfiguration::setFilterFunctionalityEnabled(*d->m_helpEngine, + enabled); +} + +bool HelpEngineWrapper::filterToolbarVisible() const +{ + TRACE_OBJ + return CollectionConfiguration::filterToolbarVisible(*d->m_helpEngine); +} + +void HelpEngineWrapper::setFilterToolbarVisible(bool visible) +{ + TRACE_OBJ + CollectionConfiguration::setFilterToolbarVisible(*d->m_helpEngine, visible); +} + +bool HelpEngineWrapper::addressBarEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::addressBarEnabled(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAddressBarEnabled(bool enabled) +{ + TRACE_OBJ + CollectionConfiguration::setAddressBarEnabled(*d->m_helpEngine, enabled); +} + +bool HelpEngineWrapper::addressBarVisible() const +{ + TRACE_OBJ + return CollectionConfiguration::addressBarVisible(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAddressBarVisible(bool visible) +{ + TRACE_OBJ + CollectionConfiguration::setAddressBarVisible(*d->m_helpEngine, visible); +} + +bool HelpEngineWrapper::documentationManagerEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::documentationManagerEnabled(*d->m_helpEngine); +} + +void HelpEngineWrapper::setDocumentationManagerEnabled(bool enabled) +{ + TRACE_OBJ + CollectionConfiguration::setDocumentationManagerEnabled(*d->m_helpEngine, + enabled); +} + +const QByteArray HelpEngineWrapper::aboutMenuTexts() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutMenuTexts(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutMenuTexts(const QByteArray &texts) +{ + TRACE_OBJ + CollectionConfiguration::setAboutMenuTexts(*d->m_helpEngine, texts); +} + +const QByteArray HelpEngineWrapper::aboutIcon() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutIcon(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutIcon(const QByteArray &icon) +{ + TRACE_OBJ + CollectionConfiguration::setAboutIcon(*d->m_helpEngine, icon); +} + +const QByteArray HelpEngineWrapper::aboutImages() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutImages(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutImages(const QByteArray &images) +{ + TRACE_OBJ + CollectionConfiguration::setAboutImages(*d->m_helpEngine, images); +} + +const QByteArray HelpEngineWrapper::aboutTexts() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutTexts(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutTexts(const QByteArray &texts) +{ + TRACE_OBJ + CollectionConfiguration::setAboutTexts(*d->m_helpEngine, texts); +} + +const QString HelpEngineWrapper::windowTitle() const +{ + TRACE_OBJ + return CollectionConfiguration::windowTitle(*d->m_helpEngine); +} + +void HelpEngineWrapper::setWindowTitle(const QString &windowTitle) +{ + TRACE_OBJ + CollectionConfiguration::setWindowTitle(*d->m_helpEngine, windowTitle); +} + +const QByteArray HelpEngineWrapper::applicationIcon() const +{ + TRACE_OBJ + return CollectionConfiguration::applicationIcon(*d->m_helpEngine); +} + +void HelpEngineWrapper::setApplicationIcon(const QByteArray &icon) +{ + TRACE_OBJ + CollectionConfiguration::setApplicationIcon(*d->m_helpEngine, icon); +} + +const QByteArray HelpEngineWrapper::mainWindow() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(MainWindowKey).toByteArray(); +} + +void HelpEngineWrapper::setMainWindow(const QByteArray &mainWindow) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(MainWindowKey, mainWindow); +} + +const QByteArray HelpEngineWrapper::mainWindowGeometry() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); +} + +void HelpEngineWrapper::setMainWindowGeometry(const QByteArray &geometry) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); +} + +const QByteArray HelpEngineWrapper::bookmarks() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(BookmarksKey).toByteArray(); +} + +void HelpEngineWrapper::setBookmarks(const QByteArray &bookmarks) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(BookmarksKey, bookmarks); +} + +int HelpEngineWrapper::lastTabPage() const +{ + TRACE_OBJ + return CollectionConfiguration::lastTabPage(*d->m_helpEngine); +} + +void HelpEngineWrapper::setLastTabPage(int lastPage) +{ + TRACE_OBJ + CollectionConfiguration::setLastTabPage(*d->m_helpEngine, lastPage); +} + +int HelpEngineWrapper::startOption() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); +} + +void HelpEngineWrapper::setStartOption(int option) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(StartOptionKey, option); +} + +const QString HelpEngineWrapper::homePage() const +{ + TRACE_OBJ + const QString &homePage + = d->m_helpEngine->customValue(HomePageKey).toString(); + if (!homePage.isEmpty()) + return homePage; + return defaultHomePage(); +} + +void HelpEngineWrapper::setHomePage(const QString &page) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(HomePageKey, page); + +} + +const QString HelpEngineWrapper::defaultHomePage() const +{ + TRACE_OBJ + return CollectionConfiguration::defaultHomePage(*d->m_helpEngine); +} + +void HelpEngineWrapper::setDefaultHomePage(const QString &page) +{ + TRACE_OBJ + CollectionConfiguration::setDefaultHomePage(*d->m_helpEngine, page); +} + +bool HelpEngineWrapper::hasFontSettings() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(UseAppFontKey).isValid(); +} + +bool HelpEngineWrapper::usesAppFont() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(UseAppFontKey).toBool(); +} + +void HelpEngineWrapper::setUseAppFont(bool useAppFont) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); +} + +bool HelpEngineWrapper::usesBrowserFont() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); +} + +void HelpEngineWrapper::setUseBrowserFont(bool useBrowserFont) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); +} + +const QFont HelpEngineWrapper::appFont() const +{ + TRACE_OBJ + return qvariant_cast(d->m_helpEngine->customValue(AppFontKey)); +} + +void HelpEngineWrapper::setAppFont(const QFont &font) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(AppFontKey, font); +} + +QFontDatabase::WritingSystem HelpEngineWrapper::appWritingSystem() const +{ + TRACE_OBJ + return static_cast( + d->m_helpEngine->customValue(AppWritingSystemKey).toInt()); +} + +void HelpEngineWrapper::setAppWritingSystem(QFontDatabase::WritingSystem system) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(AppWritingSystemKey, system); +} + +const QFont HelpEngineWrapper::browserFont() const +{ + TRACE_OBJ + return qvariant_cast(d->m_helpEngine->customValue(BrowserFontKey)); +} + +void HelpEngineWrapper::setBrowserFont(const QFont &font) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(BrowserFontKey, font); +} + +QFontDatabase::WritingSystem HelpEngineWrapper::browserWritingSystem() const +{ + TRACE_OBJ + return static_cast( + d->m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); +} + +void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem system) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); +} + +void HelpEngineWrapper::handleCurrentFilterChanged(const QString &filter) +{ + TRACE_OBJ + const QString &filterToReport + = filter == Unfiltered ? TrUnfiltered : filter; + emit currentFilterChanged(filterToReport); +} + +bool HelpEngineWrapper::showTabs() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(ShowTabsKey, false).toBool(); +} + +void HelpEngineWrapper::setShowTabs(bool show) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(ShowTabsKey, show); +} + +bool HelpEngineWrapper::fullTextSearchFallbackEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::fullTextSearchFallbackEnabled(*d->m_helpEngine); +} + +// -- TimeoutForwarder + +TimeoutForwarder::TimeoutForwarder(const QString &fileName) + : m_fileName(fileName) +{ + TRACE_OBJ +} + +void TimeoutForwarder::forward() +{ + TRACE_OBJ + HelpEngineWrapper::instance().d->qchFileChanged(m_fileName, true); +} + +// -- HelpEngineWrapperPrivate + +HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile) + : m_helpEngine(new QHelpEngine(collectionFile, this)), + m_qchWatcher(new QFileSystemWatcher(this)) +{ + TRACE_OBJ + if (!m_helpEngine->customFilters().contains(Unfiltered)) + m_helpEngine->addCustomFilter(Unfiltered, QStringList()); + initFileSystemWatchers(); +} + +void HelpEngineWrapperPrivate::initFileSystemWatchers() +{ + TRACE_OBJ + foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { + const QString &docFile = m_helpEngine->documentationFileName(ns); + m_qchWatcher->addPath(docFile); + connect(m_qchWatcher, SIGNAL(fileChanged(QString)), + this, SLOT(qchFileChanged(QString))); + } + checkDocFilesWatched(); +} + +void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName) +{ + TRACE_OBJ + qchFileChanged(fileName, false); +} + +void HelpEngineWrapperPrivate::checkDocFilesWatched() +{ + TRACE_OBJ + const int watchedFilesCount = m_qchWatcher->files().count(); + const int docFilesCount = m_helpEngine->registeredDocumentations().count(); + if (watchedFilesCount != docFilesCount) { + qWarning("Strange: Have %d docs, but %d are being watched", + watchedFilesCount, docFilesCount); + } +} + +void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName, + bool fromTimeout) +{ + TRACE_OBJ + + /* + * We don't use QHelpEngineCore::namespaceName(fileName), because the file + * may not exist anymore or contain a different namespace. + */ + QString ns; + foreach (const QString &curNs, m_helpEngine->registeredDocumentations()) { + if (m_helpEngine->documentationFileName(curNs) == fileName) { + ns = curNs; + break; + } + } + + /* + * We can't do an assertion here, because QFileSystemWatcher may send the + * signal more than once. + */ + if (ns.isEmpty()) { + m_recentQchUpdates.remove(fileName); + return; + } + + /* + * Since the QFileSystemWatcher typically sends the signal more than once, + * we repeatedly delay our reaction a bit until we think the last signal + * was sent. + */ + + QMap::Iterator it = m_recentQchUpdates.find(fileName); + const QDateTime &now = QDateTime::currentDateTime(); + + // Case 1: This is the first recent signal for the file. + if (it == m_recentQchUpdates.end()) { + QSharedPointer forwarder(new TimeoutForwarder(fileName)); + m_recentQchUpdates.insert(fileName, RecentSignal(now, forwarder)); + QTimer::singleShot(UpdateGracePeriod, forwarder.data(), SLOT(forward())); + return; + } + + // Case 2: The last signal for this file has not expired yet. + if (it.value().first > now.addMSecs(-UpdateGracePeriod)) { + if (!fromTimeout) + it.value().first = now; + else + QTimer::singleShot(UpdateGracePeriod, it.value().second.data(), + SLOT(forward())); + return; + } + + // Case 3: The last signal for this file has expired. + if (m_helpEngine->unregisterDocumentation(ns)) { + if (!QFileInfo(fileName).exists() + || !m_helpEngine->registerDocumentation(fileName)) { + m_qchWatcher->removePath(fileName); + emit documentationRemoved(ns); + } else { + emit documentationUpdated(ns); + } + m_helpEngine->setupData(); + } + m_recentQchUpdates.erase(it); +} + +QT_END_NAMESPACE + +#include "helpenginewrapper.moc" diff --git a/src/assistant/assistant/helpenginewrapper.h b/src/assistant/assistant/helpenginewrapper.h new file mode 100644 index 000000000..ff825b04a --- /dev/null +++ b/src/assistant/assistant/helpenginewrapper.h @@ -0,0 +1,218 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPENGINEWRAPPER_H +#define HELPENGINEWRAPPER_H + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QFileSystemWatcher; +class QHelpContentModel; +class QHelpContentWidget; +class QHelpIndexModel; +class QHelpIndexWidget; +class QHelpSearchEngine; + +enum { + ShowHomePage = 0, + ShowBlankPage = 1, + ShowLastPages = 2 +}; + +class HelpEngineWrapperPrivate; +class TimeoutForwarder; + +class HelpEngineWrapper : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(HelpEngineWrapper) + friend class TimeoutForwarder; +public: + static HelpEngineWrapper &instance(const QString &collectionFile = QString()); + static void removeInstance(); + + // Forwarded help engine member functions, possibly enriched. + QHelpSearchEngine *searchEngine() const; + QHelpContentModel *contentModel() const; + QHelpIndexModel *indexModel() const; + QHelpContentWidget *contentWidget(); + QHelpIndexWidget *indexWidget(); + bool setupData(); + const QStringList registeredDocumentations() const; + const QString collectionFile() const; + bool registerDocumentation(const QString &docFile); + bool unregisterDocumentation(const QString &namespaceName); + bool addCustomFilter(const QString &filterName, + const QStringList &attributes); + bool removeCustomFilter(const QString &filterName); + void setCurrentFilter(const QString &filterName); + const QString currentFilter() const; + const QStringList customFilters() const; + QUrl findFile(const QUrl &url) const; + QByteArray fileData(const QUrl &url) const; + QMap linksForIdentifier(const QString &id) const; + const QStringList filterAttributes() const; + const QStringList filterAttributes(const QString &filterName) const; + QString error() const; + + /* + * To be called after assistant has finished looking for new documentation. + * This will mainly cause the search index to be updated, if necessary. + */ + void initialDocSetupDone(); + + const QStringList qtDocInfo(const QString &component) const; + void setQtDocInfo(const QString &component, const QStringList &doc); + + const QString homePage() const; + void setHomePage(const QString &page); + const QString defaultHomePage() const; + void setDefaultHomePage(const QString &page); + + int lastTabPage() const; + void setLastTabPage(int lastPage); + + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + const QStringList lastShownPages() const; + void setLastShownPages(const QStringList &lastShownPages); + const QStringList lastZoomFactors() const; + void setLastZoomFactors(const QStringList &lastZoomFactors); + + const QString cacheDir() const; + bool cacheDirIsRelativeToCollection() const; + void setCacheDir(const QString &cacheDir, bool relativeToCollection); + + bool filterFunctionalityEnabled() const; + void setFilterFunctionalityEnabled(bool enabled); + + bool filterToolbarVisible() const; + void setFilterToolbarVisible(bool visible); + + bool addressBarEnabled() const; + void setAddressBarEnabled(bool enabled); + + bool addressBarVisible() const; + void setAddressBarVisible(bool visible); + + bool documentationManagerEnabled() const; + void setDocumentationManagerEnabled(bool enabled); + + const QByteArray aboutMenuTexts() const; + void setAboutMenuTexts(const QByteArray &texts); + const QByteArray aboutTexts() const; + void setAboutTexts(const QByteArray &texts); + const QByteArray aboutIcon() const; + void setAboutIcon(const QByteArray &icon); + const QByteArray aboutImages() const; + void setAboutImages(const QByteArray &images); + + const QString windowTitle() const; + void setWindowTitle(const QString &windowTitle); + + const QByteArray applicationIcon() const; + void setApplicationIcon(const QByteArray &icon); + + const QByteArray mainWindow() const; + void setMainWindow(const QByteArray &mainWindow); + const QByteArray mainWindowGeometry() const; + void setMainWindowGeometry(const QByteArray &geometry); + + const QByteArray bookmarks() const; + void setBookmarks(const QByteArray &bookmarks); + + int startOption() const; + void setStartOption(int option); + + bool hasFontSettings() const; + bool usesAppFont() const; + void setUseAppFont(bool useAppFont); + bool usesBrowserFont() const; + void setUseBrowserFont(bool useBrowserFont); + const QFont appFont() const; + void setAppFont(const QFont &font); + QFontDatabase::WritingSystem appWritingSystem() const; + void setAppWritingSystem(QFontDatabase::WritingSystem system); + const QFont browserFont() const; + void setBrowserFont(const QFont &font); + QFontDatabase::WritingSystem browserWritingSystem() const; + void setBrowserWritingSystem(QFontDatabase::WritingSystem system); + + bool showTabs() const; + void setShowTabs(bool show); + + static const QString TrUnfiltered; + + bool fullTextSearchFallbackEnabled() const; + +signals: + + // For asynchronous doc updates triggered by external actions. + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + + // Forwarded from QHelpEngineCore. + void currentFilterChanged(const QString ¤tFilter); + void setupFinished(); + +private slots: + void handleCurrentFilterChanged(const QString &filter); + +private: + HelpEngineWrapper(const QString &collectionFile); + ~HelpEngineWrapper(); + + static HelpEngineWrapper *helpEngineWrapper; + + HelpEngineWrapperPrivate *d; +}; + +QT_END_NAMESPACE + +#endif // HELPENGINEWRAPPER_H diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp new file mode 100644 index 000000000..7bed4965a --- /dev/null +++ b/src/assistant/assistant/helpviewer.cpp @@ -0,0 +1,221 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "helpviewer.h" +#include "helpviewer_p.h" + +#include "helpenginewrapper.h" +#include "tracer.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +const QString HelpViewer::DocPath = QLatin1String("qthelp://com.trolltech."); + +const QString HelpViewer::AboutBlank = + QCoreApplication::translate("HelpViewer", "about:blank"); + +const QString HelpViewer::LocalHelpFile = QLatin1String("qthelp://" + "com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html"); + +const QString HelpViewer::PageNotFoundMessage = + QCoreApplication::translate("HelpViewer", "Error 404...


The page could not be found


'%1'" + "

"); + +struct ExtensionMap { + const char *extension; + const char *mimeType; +} extensionMap[] = { + { ".bmp", "image/bmp" }, + { ".css", "text/css" }, + { ".gif", "image/gif" }, + { ".html", "text/html" }, + { ".htm", "text/html" }, + { ".ico", "image/x-icon" }, + { ".jpeg", "image/jpeg" }, + { ".jpg", "image/jpeg" }, + { ".js", "application/x-javascript" }, + { ".mng", "video/x-mng" }, + { ".pbm", "image/x-portable-bitmap" }, + { ".pgm", "image/x-portable-graymap" }, + { ".pdf", "application/pdf" }, + { ".png", "image/png" }, + { ".ppm", "image/x-portable-pixmap" }, + { ".rss", "application/rss+xml" }, + { ".svg", "image/svg+xml" }, + { ".svgz", "image/svg+xml" }, + { ".text", "text/plain" }, + { ".tif", "image/tiff" }, + { ".tiff", "image/tiff" }, + { ".txt", "text/plain" }, + { ".xbm", "image/x-xbitmap" }, + { ".xml", "text/xml" }, + { ".xpm", "image/x-xpm" }, + { ".xsl", "text/xsl" }, + { ".xhtml", "application/xhtml+xml" }, + { ".wml", "text/vnd.wap.wml" }, + { ".wmlc", "application/vnd.wap.wmlc" }, + { "about:blank", 0 }, + { 0, 0 } +}; + +HelpViewer::~HelpViewer() +{ + TRACE_OBJ + delete d; +} + +bool HelpViewer::isLocalUrl(const QUrl &url) +{ + TRACE_OBJ + const QString &scheme = url.scheme(); + return scheme.isEmpty() + || scheme == QLatin1String("file") + || scheme == QLatin1String("qrc") + || scheme == QLatin1String("data") + || scheme == QLatin1String("qthelp") + || scheme == QLatin1String("about"); +} + +bool HelpViewer::canOpenPage(const QString &url) +{ + TRACE_OBJ + return !mimeFromUrl(url).isEmpty(); +} + +QString HelpViewer::mimeFromUrl(const QUrl &url) +{ + TRACE_OBJ + const QString &path = url.path(); + const int index = path.lastIndexOf(QLatin1Char('.')); + const QByteArray &ext = path.mid(index).toUtf8().toLower(); + + const ExtensionMap *e = extensionMap; + while (e->extension) { + if (ext == e->extension) + return QLatin1String(e->mimeType); + ++e; + } + return QLatin1String(""); +} + +bool HelpViewer::launchWithExternalApp(const QUrl &url) +{ + TRACE_OBJ + if (isLocalUrl(url)) { + const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + const QUrl &resolvedUrl = helpEngine.findFile(url); + if (!resolvedUrl.isValid()) + return false; + + const QString& path = resolvedUrl.path(); + if (!canOpenPage(path)) { + QTemporaryFile tmpTmpFile; + if (!tmpTmpFile.open()) + return false; + + const QString &extension = QFileInfo(path).completeSuffix(); + QFile actualTmpFile(tmpTmpFile.fileName() % QLatin1String(".") + % extension); + if (!actualTmpFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) + return false; + + actualTmpFile.write(helpEngine.fileData(resolvedUrl)); + actualTmpFile.close(); + return QDesktopServices::openUrl(QUrl(actualTmpFile.fileName())); + } + } else if (url.scheme() == QLatin1String("http")) { + return QDesktopServices::openUrl(url); + } + return false; +} + +// -- public slots + +void HelpViewer::home() +{ + TRACE_OBJ + setSource(HelpEngineWrapper::instance().homePage()); +} + +// -- private slots + +void HelpViewer::setLoadStarted() +{ + d->m_loadFinished = false; +} + +void HelpViewer::setLoadFinished(bool ok) +{ + d->m_loadFinished = ok; + emit sourceChanged(source()); +} + +// -- private + +bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *event) +{ + TRACE_OBJ + if (event->button() == Qt::XButton1) { + backward(); + return true; + } + + if (event->button() == Qt::XButton2) { + forward(); + return true; + } + + return false; +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/helpviewer.h b/src/assistant/assistant/helpviewer.h new file mode 100644 index 000000000..a5f4de668 --- /dev/null +++ b/src/assistant/assistant/helpviewer.h @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPVIEWER_H +#define HELPVIEWER_H + +#include +#include +#include +#include + +#include +#include + +#if defined(QT_NO_WEBKIT) +#include +#else +#include +#endif + +QT_BEGIN_NAMESPACE + +#if !defined(QT_NO_WEBKIT) +class HelpViewer : public QWebView +#else +class HelpViewer : public QTextBrowser +#endif +{ + Q_OBJECT + class HelpViewerPrivate; + Q_DISABLE_COPY(HelpViewer) + +public: + enum FindFlag { + FindBackward = 0x01, + FindCaseSensitively = 0x02 + }; + Q_DECLARE_FLAGS(FindFlags, FindFlag) + + HelpViewer(qreal zoom, QWidget *parent = 0); + ~HelpViewer(); + + QFont viewerFont() const; + void setViewerFont(const QFont &font); + + void scaleUp(); + void scaleDown(); + + void resetScale(); + qreal scale() const; + + QString title() const; + void setTitle(const QString &title); + + QUrl source() const; + void setSource(const QUrl &url); + + QString selectedText() const; + bool isForwardAvailable() const; + bool isBackwardAvailable() const; + + bool findText(const QString &text, FindFlags flags, bool incremental, + bool fromSearch); + + static const QString DocPath; + static const QString AboutBlank; + static const QString LocalHelpFile; + static const QString PageNotFoundMessage; + + static bool isLocalUrl(const QUrl &url); + static bool canOpenPage(const QString &url); + static QString mimeFromUrl(const QUrl &url); + static bool launchWithExternalApp(const QUrl &url); + +public slots: + void copy(); + void home(); + + void forward(); + void backward(); + +signals: + void titleChanged(); +#if !defined(QT_NO_WEBKIT) + void copyAvailable(bool yes); + void sourceChanged(const QUrl &url); + void forwardAvailable(bool enabled); + void backwardAvailable(bool enabled); + void highlighted(const QString &link); + void printRequested(); +#else + void loadStarted(); + void loadFinished(bool finished); +#endif + +protected: + void keyPressEvent(QKeyEvent *e); + void wheelEvent(QWheelEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + +private slots: + void actionChanged(); + void setLoadStarted(); + void setLoadFinished(bool ok); + +private: + bool eventFilter(QObject *obj, QEvent *event); + void contextMenuEvent(QContextMenuEvent *event); + QVariant loadResource(int type, const QUrl &name); + bool handleForwardBackwardMouseButtons(QMouseEvent *e); + +private: + HelpViewerPrivate *d; +}; + +QT_END_NAMESPACE +Q_DECLARE_METATYPE(HelpViewer*) + +#endif // HELPVIEWER_H diff --git a/src/assistant/assistant/helpviewer_p.h b/src/assistant/assistant/helpviewer_p.h new file mode 100644 index 000000000..8beeb94b2 --- /dev/null +++ b/src/assistant/assistant/helpviewer_p.h @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPVIEWERPRIVATE_H +#define HELPVIEWERPRIVATE_H + +#include "centralwidget.h" +#include "helpviewer.h" +#include "openpagesmanager.h" + +#include +#ifdef QT_NO_WEBKIT +#include +#endif + +QT_BEGIN_NAMESPACE + +class HelpViewer::HelpViewerPrivate : public QObject +{ + Q_OBJECT + +public: +#ifdef QT_NO_WEBKIT + HelpViewerPrivate(int zoom) + : zoomCount(zoom) + , forceFont(false) + , lastAnchor(QString()) +#else + HelpViewerPrivate() +#endif + { + m_loadFinished = false; + } + +#ifdef QT_NO_WEBKIT + bool hasAnchorAt(QTextBrowser *browser, const QPoint& pos) + { + lastAnchor = browser->anchorAt(pos); + if (lastAnchor.isEmpty()) + return false; + + lastAnchor = browser->source().resolved(lastAnchor).toString(); + if (lastAnchor.at(0) == QLatin1Char('#')) { + QString src = browser->source().toString(); + int hsh = src.indexOf(QLatin1Char('#')); + lastAnchor = (hsh >= 0 ? src.left(hsh) : src) + lastAnchor; + } + return true; + } + + void openLink(bool newPage) + { + if(lastAnchor.isEmpty()) + return; + if (newPage) + OpenPagesManager::instance()->createPage(lastAnchor); + else + CentralWidget::instance()->setSource(lastAnchor); + lastAnchor.clear(); + } + +public slots: + void openLink() + { + openLink(false); + } + + void openLinkInNewPage() + { + openLink(true); + } + +public: + int zoomCount; + bool forceFont; + QString lastAnchor; +#endif // QT_NO_WEBKIT + +public: + bool m_loadFinished; +}; + +QT_END_NAMESPACE + +#endif // HELPVIEWERPRIVATE_H diff --git a/src/assistant/assistant/helpviewer_qtb.cpp b/src/assistant/assistant/helpviewer_qtb.cpp new file mode 100644 index 000000000..d3d128b74 --- /dev/null +++ b/src/assistant/assistant/helpviewer_qtb.cpp @@ -0,0 +1,384 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "helpviewer.h" + +#include "globalactions.h" +#include "helpenginewrapper.h" +#include "helpviewer_p.h" +#include "openpagesmanager.h" +#include "tracer.h" + +#include + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +HelpViewer::HelpViewer(qreal zoom, QWidget *parent) + : QTextBrowser(parent) + , d(new HelpViewerPrivate(zoom)) +{ + TRACE_OBJ + QPalette p = palette(); + p.setColor(QPalette::Inactive, QPalette::Highlight, + p.color(QPalette::Active, QPalette::Highlight)); + p.setColor(QPalette::Inactive, QPalette::HighlightedText, + p.color(QPalette::Active, QPalette::HighlightedText)); + setPalette(p); + + installEventFilter(this); + document()->setDocumentMargin(8); + + QFont font = viewerFont(); + font.setPointSize(int(font.pointSize() + zoom)); + setViewerFont(font); + + connect(this, SIGNAL(sourceChanged(QUrl)), this, SIGNAL(titleChanged())); + connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); +} + +QFont HelpViewer::viewerFont() const +{ + TRACE_OBJ + if (HelpEngineWrapper::instance().usesBrowserFont()) + return HelpEngineWrapper::instance().browserFont(); + return qApp->font(); +} + +void HelpViewer::setViewerFont(const QFont &newFont) +{ + TRACE_OBJ + if (font() != newFont) { + d->forceFont = true; + setFont(newFont); + d->forceFont = false; + } +} + +void HelpViewer::scaleUp() +{ + TRACE_OBJ + if (d->zoomCount < 10) { + d->zoomCount++; + d->forceFont = true; + zoomIn(); + d->forceFont = false; + } +} + +void HelpViewer::scaleDown() +{ + TRACE_OBJ + if (d->zoomCount > -5) { + d->zoomCount--; + d->forceFont = true; + zoomOut(); + d->forceFont = false; + } +} + +void HelpViewer::resetScale() +{ + TRACE_OBJ + if (d->zoomCount != 0) { + d->forceFont = true; + zoomOut(d->zoomCount); + d->forceFont = false; + } + d->zoomCount = 0; +} + +qreal HelpViewer::scale() const +{ + TRACE_OBJ + return d->zoomCount; +} + +QString HelpViewer::title() const +{ + TRACE_OBJ + return documentTitle(); +} + +void HelpViewer::setTitle(const QString &title) +{ + TRACE_OBJ + setDocumentTitle(title); +} + +QUrl HelpViewer::source() const +{ + TRACE_OBJ + return QTextBrowser::source(); +} + +void HelpViewer::setSource(const QUrl &url) +{ + TRACE_OBJ + if (launchWithExternalApp(url)) + return; + + emit loadStarted(); + QString string = url.toString(); + const HelpEngineWrapper &engine = HelpEngineWrapper::instance(); + const QUrl &resolvedUrl = (string == QLatin1String("help") ? LocalHelpFile : + engine.findFile(string)); + QTextBrowser::setSource(resolvedUrl); + if (!url.isValid()) { + setHtml(string == QLatin1String("about:blank") ? AboutBlank + : PageNotFoundMessage.arg(url.toString())); + } + emit loadFinished(true); +} + +QString HelpViewer::selectedText() const +{ + TRACE_OBJ + return textCursor().selectedText(); +} + +bool HelpViewer::isForwardAvailable() const +{ + TRACE_OBJ + return QTextBrowser::isForwardAvailable(); +} + +bool HelpViewer::isBackwardAvailable() const +{ + TRACE_OBJ + return QTextBrowser::isBackwardAvailable(); +} + +bool HelpViewer::findText(const QString &text, FindFlags flags, bool incremental, + bool fromSearch) +{ + TRACE_OBJ + QTextDocument *doc = document(); + QTextCursor cursor = textCursor(); + if (!doc || cursor.isNull()) + return false; + + const int position = cursor.selectionStart(); + if (incremental) + cursor.setPosition(position); + + QTextDocument::FindFlags textDocFlags; + if (flags & HelpViewer::FindBackward) + textDocFlags |= QTextDocument::FindBackward; + if (flags & HelpViewer::FindCaseSensitively) + textDocFlags |= QTextDocument::FindCaseSensitively; + + QTextCursor found = doc->find(text, cursor, textDocFlags); + if (found.isNull()) { + if ((flags & HelpViewer::FindBackward) == 0) + cursor.movePosition(QTextCursor::Start); + else + cursor.movePosition(QTextCursor::End); + found = doc->find(text, cursor, textDocFlags); + } + + if (fromSearch) { + cursor.beginEditBlock(); + viewport()->setUpdatesEnabled(false); + + QTextCharFormat marker; + marker.setForeground(Qt::red); + cursor.movePosition(QTextCursor::Start); + setTextCursor(cursor); + + while (find(text)) { + QTextCursor hit = textCursor(); + hit.mergeCharFormat(marker); + } + + viewport()->setUpdatesEnabled(true); + cursor.endEditBlock(); + } + + bool cursorIsNull = found.isNull(); + if (cursorIsNull) { + found = textCursor(); + found.setPosition(position); + } + setTextCursor(found); + return !cursorIsNull; +} + +// -- public slots + +void HelpViewer::copy() +{ + TRACE_OBJ + QTextBrowser::copy(); +} + +void HelpViewer::forward() +{ + TRACE_OBJ + QTextBrowser::forward(); +} + +void HelpViewer::backward() +{ + TRACE_OBJ + QTextBrowser::backward(); +} + +// -- protected + +void HelpViewer::keyPressEvent(QKeyEvent *e) +{ + TRACE_OBJ + if ((e->key() == Qt::Key_Home && e->modifiers() != Qt::NoModifier) + || (e->key() == Qt::Key_End && e->modifiers() != Qt::NoModifier)) { + QKeyEvent* event = new QKeyEvent(e->type(), e->key(), Qt::NoModifier, + e->text(), e->isAutoRepeat(), e->count()); + e = event; + } + QTextBrowser::keyPressEvent(e); +} + + +void HelpViewer::wheelEvent(QWheelEvent *e) +{ + TRACE_OBJ + if (e->modifiers() == Qt::ControlModifier) { + e->accept(); + e->delta() > 0 ? scaleUp() : scaleDown(); + } else { + QTextBrowser::wheelEvent(e); + } +} + +void HelpViewer::mousePressEvent(QMouseEvent *e) +{ + TRACE_OBJ +#ifdef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(e)) + return; +#endif + + QTextBrowser::mousePressEvent(e); +} + +void HelpViewer::mouseReleaseEvent(QMouseEvent *e) +{ + TRACE_OBJ +#ifndef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(e)) + return; +#endif + + bool controlPressed = e->modifiers() & Qt::ControlModifier; + if ((controlPressed && d->hasAnchorAt(this, e->pos())) || + (e->button() == Qt::MidButton && d->hasAnchorAt(this, e->pos()))) { + d->openLinkInNewPage(); + return; + } + + QTextBrowser::mouseReleaseEvent(e); +} + +// -- private slots + +void HelpViewer::actionChanged() +{ + // stub + TRACE_OBJ +} + +// -- private + +bool HelpViewer::eventFilter(QObject *obj, QEvent *event) +{ + TRACE_OBJ + if (event->type() == QEvent::FontChange && !d->forceFont) + return true; + return QTextBrowser::eventFilter(obj, event); +} + +void HelpViewer::contextMenuEvent(QContextMenuEvent *event) +{ + TRACE_OBJ + + QMenu menu(QString(), 0); + QUrl link; + QAction *copyAnchorAction = 0; + if (d->hasAnchorAt(this, event->pos())) { + link = anchorAt(event->pos()); + if (link.isRelative()) + link = source().resolved(link); + menu.addAction(tr("Open Link"), d, SLOT(openLink())); + menu.addAction(tr("Open Link in New Tab\tCtrl+LMB"), d, SLOT(openLinkInNewPage())); + + if (!link.isEmpty() && link.isValid()) + copyAnchorAction = menu.addAction(tr("Copy &Link Location")); + } else if (!selectedText().isEmpty()) { + menu.addAction(tr("Copy"), this, SLOT(copy())); + } else { + menu.addAction(tr("Reload"), this, SLOT(reload())); + } + + if (copyAnchorAction == menu.exec(event->globalPos())) + QApplication::clipboard()->setText(link.toString()); +} + +QVariant HelpViewer::loadResource(int type, const QUrl &name) +{ + TRACE_OBJ + QByteArray ba; + if (type < 4) { + ba = HelpEngineWrapper::instance().fileData(name); + if (name.toString().endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)) { + QImage image; + image.loadFromData(ba, "svg"); + if (!image.isNull()) + return image; + } + } + return ba; +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/helpviewer_qwv.cpp b/src/assistant/assistant/helpviewer_qwv.cpp new file mode 100644 index 000000000..662177631 --- /dev/null +++ b/src/assistant/assistant/helpviewer_qwv.cpp @@ -0,0 +1,495 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "helpviewer.h" +#include "helpviewer_p.h" + +#include "centralwidget.h" +#include "helpenginewrapper.h" +#include "openpagesmanager.h" +#include "tracer.h" + +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +// -- HelpNetworkReply + +class HelpNetworkReply : public QNetworkReply +{ +public: + HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData, + const QString &mimeType); + + virtual void abort(); + + virtual qint64 bytesAvailable() const + { return data.length() + QNetworkReply::bytesAvailable(); } + +protected: + virtual qint64 readData(char *data, qint64 maxlen); + +private: + QByteArray data; + qint64 origLen; +}; + +HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, + const QByteArray &fileData, const QString& mimeType) + : data(fileData), origLen(fileData.length()) +{ + TRACE_OBJ + setRequest(request); + setOpenMode(QIODevice::ReadOnly); + + setHeader(QNetworkRequest::ContentTypeHeader, mimeType); + setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen)); + QTimer::singleShot(0, this, SIGNAL(metaDataChanged())); + QTimer::singleShot(0, this, SIGNAL(readyRead())); +} + +void HelpNetworkReply::abort() +{ + TRACE_OBJ +} + +qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) +{ + TRACE_OBJ + qint64 len = qMin(qint64(data.length()), maxlen); + if (len) { + memcpy(buffer, data.constData(), len); + data.remove(0, len); + } + if (!data.length()) + QTimer::singleShot(0, this, SIGNAL(finished())); + return len; +} + +// -- HelpNetworkAccessManager + +class HelpNetworkAccessManager : public QNetworkAccessManager +{ +public: + HelpNetworkAccessManager(QObject *parent); + +protected: + virtual QNetworkReply *createRequest(Operation op, + const QNetworkRequest &request, QIODevice *outgoingData = 0); +}; + +HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) + : QNetworkAccessManager(parent) +{ + TRACE_OBJ +} + +QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, + const QNetworkRequest &request, QIODevice* /*outgoingData*/) +{ + TRACE_OBJ + QString url = request.url().toString(); + const HelpEngineWrapper &engine = HelpEngineWrapper::instance(); + // TODO: For some reason the url to load is already wrong (passed from webkit) + // though the css file and the references inside should work that way. One + // possible problem might be that the css is loaded at the same level as the + // html, thus a path inside the css like (../images/foo.png) might cd out of + // the virtual folder + if (!engine.findFile(url).isValid()) { + if (url.startsWith(HelpViewer::DocPath)) { + QUrl newUrl = request.url(); + if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) { + newUrl.setPath(QLatin1String("qdoc") + newUrl.path()); + url = newUrl.toString(); + } + } + } + + const QString &mimeType = HelpViewer::mimeFromUrl(url); + const QByteArray &data = engine.findFile(url).isValid() ? engine.fileData(url) + : HelpViewer::PageNotFoundMessage.arg(url).toUtf8(); + + return new HelpNetworkReply(request, data, mimeType.isEmpty() + ? QLatin1String("application/octet-stream") : mimeType); +} + +// -- HelpPage + +class HelpPage : public QWebPage +{ +public: + HelpPage(QObject *parent); + +protected: + virtual QWebPage *createWindow(QWebPage::WebWindowType); + virtual void triggerAction(WebAction action, bool checked = false); + + virtual bool acceptNavigationRequest(QWebFrame *frame, + const QNetworkRequest &request, NavigationType type); + +private: + bool closeNewTabIfNeeded; + + friend class HelpViewer; + QUrl m_loadingUrl; + Qt::MouseButtons m_pressedButtons; + Qt::KeyboardModifiers m_keyboardModifiers; +}; + +HelpPage::HelpPage(QObject *parent) + : QWebPage(parent) + , closeNewTabIfNeeded(false) + , m_pressedButtons(Qt::NoButton) + , m_keyboardModifiers(Qt::NoModifier) +{ + TRACE_OBJ +} + +QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) +{ + TRACE_OBJ + HelpPage* newPage = static_cast(OpenPagesManager::instance() + ->createPage()->page()); + newPage->closeNewTabIfNeeded = closeNewTabIfNeeded; + closeNewTabIfNeeded = false; + return newPage; +} + +void HelpPage::triggerAction(WebAction action, bool checked) +{ + TRACE_OBJ + switch (action) { + case OpenLinkInNewWindow: + closeNewTabIfNeeded = true; + default: // fall through + QWebPage::triggerAction(action, checked); + break; + } +} + +bool HelpPage::acceptNavigationRequest(QWebFrame *, + const QNetworkRequest &request, QWebPage::NavigationType type) +{ + TRACE_OBJ + const bool closeNewTab = closeNewTabIfNeeded; + closeNewTabIfNeeded = false; + + const QUrl &url = request.url(); + if (HelpViewer::launchWithExternalApp(url)) { + if (closeNewTab) + QMetaObject::invokeMethod(OpenPagesManager::instance(), "closeCurrentPage"); + return false; + } + + if (type == QWebPage::NavigationTypeLinkClicked + && (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton)) { + m_pressedButtons = Qt::NoButton; + m_keyboardModifiers = Qt::NoModifier; + OpenPagesManager::instance()->createPage(url); + return false; + } + + m_loadingUrl = url; // because of async page loading, we will hit some kind + // of race condition while using a remote command, like a combination of + // SetSource; SyncContent. SetSource would be called and SyncContents shortly + // afterwards, but the page might not have finished loading and the old url + // would be returned. + return true; +} + +// -- HelpViewer + +HelpViewer::HelpViewer(qreal zoom, QWidget *parent) + : QWebView(parent) + , d(new HelpViewerPrivate) +{ + TRACE_OBJ + setAcceptDrops(false); + settings()->setAttribute(QWebSettings::JavaEnabled, false); + settings()->setAttribute(QWebSettings::PluginsEnabled, false); + + setPage(new HelpPage(this)); + page()->setNetworkAccessManager(new HelpNetworkAccessManager(this)); + + QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); + action->setText(tr("Open Link in New Page")); + + pageAction(QWebPage::DownloadLinkToDisk)->setVisible(false); + pageAction(QWebPage::DownloadImageToDisk)->setVisible(false); + pageAction(QWebPage::OpenImageInNewWindow)->setVisible(false); + + connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this, + SLOT(actionChanged())); + connect(pageAction(QWebPage::Back), SIGNAL(changed()), this, + SLOT(actionChanged())); + connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, + SLOT(actionChanged())); + connect(page(), SIGNAL(linkHovered(QString, QString, QString)), this, + SIGNAL(highlighted(QString))); + connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl))); + connect(this, SIGNAL(loadStarted()), this, SLOT(setLoadStarted())); + connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); + connect(this, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged())); + connect(page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested())); + + setFont(viewerFont()); + setTextSizeMultiplier(zoom == 0.0 ? 1.0 : zoom); +} + +QFont HelpViewer::viewerFont() const +{ + TRACE_OBJ + if (HelpEngineWrapper::instance().usesBrowserFont()) + return HelpEngineWrapper::instance().browserFont(); + + QWebSettings *webSettings = QWebSettings::globalSettings(); + return QFont(webSettings->fontFamily(QWebSettings::StandardFont), + webSettings->fontSize(QWebSettings::DefaultFontSize)); +} + +void HelpViewer::setViewerFont(const QFont &font) +{ + TRACE_OBJ + QWebSettings *webSettings = settings(); + webSettings->setFontFamily(QWebSettings::StandardFont, font.family()); + webSettings->setFontSize(QWebSettings::DefaultFontSize, font.pointSize()); +} + +void HelpViewer::scaleUp() +{ + TRACE_OBJ + setTextSizeMultiplier(textSizeMultiplier() + 0.1); +} + +void HelpViewer::scaleDown() +{ + TRACE_OBJ + setTextSizeMultiplier(qMax(0.0, textSizeMultiplier() - 0.1)); +} + +void HelpViewer::resetScale() +{ + TRACE_OBJ + setTextSizeMultiplier(1.0); +} + +qreal HelpViewer::scale() const +{ + TRACE_OBJ + return textSizeMultiplier(); +} + +QString HelpViewer::title() const +{ + TRACE_OBJ + return QWebView::title(); +} + +void HelpViewer::setTitle(const QString &title) +{ + TRACE_OBJ + Q_UNUSED(title) +} + +QUrl HelpViewer::source() const +{ + TRACE_OBJ + HelpPage *currentPage = static_cast (page()); + if (currentPage && !d->m_loadFinished) { + // see HelpPage::acceptNavigationRequest(...) + return currentPage->m_loadingUrl; + } + return url(); +} + +void HelpViewer::setSource(const QUrl &url) +{ + TRACE_OBJ + load(url.toString() == QLatin1String("help") ? LocalHelpFile : url); +} + +QString HelpViewer::selectedText() const +{ + TRACE_OBJ + return QWebView::selectedText(); +} + +bool HelpViewer::isForwardAvailable() const +{ + TRACE_OBJ + return pageAction(QWebPage::Forward)->isEnabled(); +} + +bool HelpViewer::isBackwardAvailable() const +{ + TRACE_OBJ + return pageAction(QWebPage::Back)->isEnabled(); +} + +bool HelpViewer::findText(const QString &text, FindFlags flags, bool incremental, + bool fromSearch) +{ + TRACE_OBJ + Q_UNUSED(incremental); Q_UNUSED(fromSearch); + QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; + if (flags & FindBackward) + options |= QWebPage::FindBackward; + if (flags & FindCaseSensitively) + options |= QWebPage::FindCaseSensitively; + + bool found = QWebView::findText(text, options); + options = QWebPage::HighlightAllOccurrences; + QWebView::findText(QLatin1String(""), options); // clear first + QWebView::findText(text, options); // force highlighting of all other matches + return found; +} + +// -- public slots + +void HelpViewer::copy() +{ + TRACE_OBJ + triggerPageAction(QWebPage::Copy); +} + +void HelpViewer::forward() +{ + TRACE_OBJ + QWebView::forward(); +} + +void HelpViewer::backward() +{ + TRACE_OBJ + back(); +} + +// -- protected + +void HelpViewer::keyPressEvent(QKeyEvent *e) +{ + TRACE_OBJ + // TODO: remove this once we support multiple keysequences per command + if (e->key() == Qt::Key_Insert && e->modifiers() == Qt::CTRL) { + if (!selectedText().isEmpty()) + copy(); + } + QWebView::keyPressEvent(e); +} + +void HelpViewer::wheelEvent(QWheelEvent *event) +{ + TRACE_OBJ + if (event->modifiers()& Qt::ControlModifier) { + event->accept(); + event->delta() > 0 ? scaleUp() : scaleDown(); + } else { + QWebView::wheelEvent(event); + } +} + +void HelpViewer::mousePressEvent(QMouseEvent *event) +{ + TRACE_OBJ +#ifdef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(event)) + return; +#endif + + if (HelpPage *currentPage = static_cast (page())) { + currentPage->m_pressedButtons = event->buttons(); + currentPage->m_keyboardModifiers = event->modifiers(); + } + + QWebView::mousePressEvent(event); +} + +void HelpViewer::mouseReleaseEvent(QMouseEvent *event) +{ + TRACE_OBJ +#ifndef Q_OS_LINUX + if (handleForwardBackwardMouseButtons(event)) + return; +#endif + + QWebView::mouseReleaseEvent(event); +} + +// -- private slots + +void HelpViewer::actionChanged() +{ + TRACE_OBJ + QAction *a = qobject_cast(sender()); + if (a == pageAction(QWebPage::Copy)) + emit copyAvailable(a->isEnabled()); + else if (a == pageAction(QWebPage::Back)) + emit backwardAvailable(a->isEnabled()); + else if (a == pageAction(QWebPage::Forward)) + emit forwardAvailable(a->isEnabled()); +} + +// -- private + +bool HelpViewer::eventFilter(QObject *obj, QEvent *event) +{ + TRACE_OBJ + return QWebView::eventFilter(obj, event); +} + +void HelpViewer::contextMenuEvent(QContextMenuEvent *event) +{ + TRACE_OBJ + QWebView::contextMenuEvent(event); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/images/assistant-128.png b/src/assistant/assistant/images/assistant-128.png new file mode 100644 index 000000000..f05949f6d Binary files /dev/null and b/src/assistant/assistant/images/assistant-128.png differ diff --git a/src/assistant/assistant/images/assistant.png b/src/assistant/assistant/images/assistant.png new file mode 100644 index 000000000..ea4d1e70c Binary files /dev/null and b/src/assistant/assistant/images/assistant.png differ diff --git a/src/assistant/assistant/images/bookmark.png b/src/assistant/assistant/images/bookmark.png new file mode 100644 index 000000000..57e57e343 Binary files /dev/null and b/src/assistant/assistant/images/bookmark.png differ diff --git a/src/assistant/assistant/images/closebutton.png b/src/assistant/assistant/images/closebutton.png new file mode 100644 index 000000000..c978cf51a Binary files /dev/null and b/src/assistant/assistant/images/closebutton.png differ diff --git a/src/assistant/assistant/images/darkclosebutton.png b/src/assistant/assistant/images/darkclosebutton.png new file mode 100644 index 000000000..1077663b2 Binary files /dev/null and b/src/assistant/assistant/images/darkclosebutton.png differ diff --git a/src/assistant/assistant/images/mac/addtab.png b/src/assistant/assistant/images/mac/addtab.png new file mode 100644 index 000000000..20928fb40 Binary files /dev/null and b/src/assistant/assistant/images/mac/addtab.png differ diff --git a/src/assistant/assistant/images/mac/book.png b/src/assistant/assistant/images/mac/book.png new file mode 100644 index 000000000..7a3204c87 Binary files /dev/null and b/src/assistant/assistant/images/mac/book.png differ diff --git a/src/assistant/assistant/images/mac/closetab.png b/src/assistant/assistant/images/mac/closetab.png new file mode 100644 index 000000000..ab9d669ee Binary files /dev/null and b/src/assistant/assistant/images/mac/closetab.png differ diff --git a/src/assistant/assistant/images/mac/editcopy.png b/src/assistant/assistant/images/mac/editcopy.png new file mode 100644 index 000000000..f55136446 Binary files /dev/null and b/src/assistant/assistant/images/mac/editcopy.png differ diff --git a/src/assistant/assistant/images/mac/find.png b/src/assistant/assistant/images/mac/find.png new file mode 100644 index 000000000..3561745f0 Binary files /dev/null and b/src/assistant/assistant/images/mac/find.png differ diff --git a/src/assistant/assistant/images/mac/home.png b/src/assistant/assistant/images/mac/home.png new file mode 100644 index 000000000..78d94da18 Binary files /dev/null and b/src/assistant/assistant/images/mac/home.png differ diff --git a/src/assistant/assistant/images/mac/next.png b/src/assistant/assistant/images/mac/next.png new file mode 100644 index 000000000..a585cab80 Binary files /dev/null and b/src/assistant/assistant/images/mac/next.png differ diff --git a/src/assistant/assistant/images/mac/previous.png b/src/assistant/assistant/images/mac/previous.png new file mode 100644 index 000000000..612fb34dc Binary files /dev/null and b/src/assistant/assistant/images/mac/previous.png differ diff --git a/src/assistant/assistant/images/mac/print.png b/src/assistant/assistant/images/mac/print.png new file mode 100644 index 000000000..10ca56c82 Binary files /dev/null and b/src/assistant/assistant/images/mac/print.png differ diff --git a/src/assistant/assistant/images/mac/resetzoom.png b/src/assistant/assistant/images/mac/resetzoom.png new file mode 100644 index 000000000..759b38296 Binary files /dev/null and b/src/assistant/assistant/images/mac/resetzoom.png differ diff --git a/src/assistant/assistant/images/mac/synctoc.png b/src/assistant/assistant/images/mac/synctoc.png new file mode 100644 index 000000000..067fa941b Binary files /dev/null and b/src/assistant/assistant/images/mac/synctoc.png differ diff --git a/src/assistant/assistant/images/mac/zoomin.png b/src/assistant/assistant/images/mac/zoomin.png new file mode 100644 index 000000000..d46f5aff0 Binary files /dev/null and b/src/assistant/assistant/images/mac/zoomin.png differ diff --git a/src/assistant/assistant/images/mac/zoomout.png b/src/assistant/assistant/images/mac/zoomout.png new file mode 100644 index 000000000..46326566d Binary files /dev/null and b/src/assistant/assistant/images/mac/zoomout.png differ diff --git a/src/assistant/assistant/images/trolltech-logo.png b/src/assistant/assistant/images/trolltech-logo.png new file mode 100644 index 000000000..c53e744ca Binary files /dev/null and b/src/assistant/assistant/images/trolltech-logo.png differ diff --git a/src/assistant/assistant/images/win/addtab.png b/src/assistant/assistant/images/win/addtab.png new file mode 100644 index 000000000..4bb0feb92 Binary files /dev/null and b/src/assistant/assistant/images/win/addtab.png differ diff --git a/src/assistant/assistant/images/win/book.png b/src/assistant/assistant/images/win/book.png new file mode 100644 index 000000000..09ec4d33f Binary files /dev/null and b/src/assistant/assistant/images/win/book.png differ diff --git a/src/assistant/assistant/images/win/closetab.png b/src/assistant/assistant/images/win/closetab.png new file mode 100644 index 000000000..ef9e02086 Binary files /dev/null and b/src/assistant/assistant/images/win/closetab.png differ diff --git a/src/assistant/assistant/images/win/editcopy.png b/src/assistant/assistant/images/win/editcopy.png new file mode 100644 index 000000000..1121b47d8 Binary files /dev/null and b/src/assistant/assistant/images/win/editcopy.png differ diff --git a/src/assistant/assistant/images/win/find.png b/src/assistant/assistant/images/win/find.png new file mode 100644 index 000000000..6ea35e930 Binary files /dev/null and b/src/assistant/assistant/images/win/find.png differ diff --git a/src/assistant/assistant/images/win/home.png b/src/assistant/assistant/images/win/home.png new file mode 100644 index 000000000..b1c6ae191 Binary files /dev/null and b/src/assistant/assistant/images/win/home.png differ diff --git a/src/assistant/assistant/images/win/next.png b/src/assistant/assistant/images/win/next.png new file mode 100644 index 000000000..8df4127a0 Binary files /dev/null and b/src/assistant/assistant/images/win/next.png differ diff --git a/src/assistant/assistant/images/win/previous.png b/src/assistant/assistant/images/win/previous.png new file mode 100644 index 000000000..0780bc23d Binary files /dev/null and b/src/assistant/assistant/images/win/previous.png differ diff --git a/src/assistant/assistant/images/win/print.png b/src/assistant/assistant/images/win/print.png new file mode 100644 index 000000000..ba7c02dc1 Binary files /dev/null and b/src/assistant/assistant/images/win/print.png differ diff --git a/src/assistant/assistant/images/win/resetzoom.png b/src/assistant/assistant/images/win/resetzoom.png new file mode 100644 index 000000000..b69ae4e7f Binary files /dev/null and b/src/assistant/assistant/images/win/resetzoom.png differ diff --git a/src/assistant/assistant/images/win/synctoc.png b/src/assistant/assistant/images/win/synctoc.png new file mode 100644 index 000000000..da301bc59 Binary files /dev/null and b/src/assistant/assistant/images/win/synctoc.png differ diff --git a/src/assistant/assistant/images/win/zoomin.png b/src/assistant/assistant/images/win/zoomin.png new file mode 100644 index 000000000..2e586fc7b Binary files /dev/null and b/src/assistant/assistant/images/win/zoomin.png differ diff --git a/src/assistant/assistant/images/win/zoomout.png b/src/assistant/assistant/images/win/zoomout.png new file mode 100644 index 000000000..a736d3934 Binary files /dev/null and b/src/assistant/assistant/images/win/zoomout.png differ diff --git a/src/assistant/assistant/images/wrap.png b/src/assistant/assistant/images/wrap.png new file mode 100644 index 000000000..90f18d9f7 Binary files /dev/null and b/src/assistant/assistant/images/wrap.png differ diff --git a/src/assistant/assistant/indexwindow.cpp b/src/assistant/assistant/indexwindow.cpp new file mode 100644 index 000000000..069e821cd --- /dev/null +++ b/src/assistant/assistant/indexwindow.cpp @@ -0,0 +1,231 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "indexwindow.h" + +#include "centralwidget.h" +#include "helpenginewrapper.h" +#include "helpviewer.h" +#include "openpagesmanager.h" +#include "topicchooser.h" +#include "tracer.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +IndexWindow::IndexWindow(QWidget *parent) + : QWidget(parent) + , m_searchLineEdit(new QLineEdit) + , m_indexWidget(HelpEngineWrapper::instance().indexWidget()) +{ + TRACE_OBJ + QVBoxLayout *layout = new QVBoxLayout(this); + QLabel *l = new QLabel(tr("&Look for:")); + layout->addWidget(l); + + l->setBuddy(m_searchLineEdit); + connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, + SLOT(filterIndices(QString))); + m_searchLineEdit->installEventFilter(this); + layout->setMargin(4); + layout->addWidget(m_searchLineEdit); + + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + m_indexWidget->installEventFilter(this); + connect(helpEngine.indexModel(), SIGNAL(indexCreationStarted()), this, + SLOT(disableSearchLineEdit())); + connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, + SLOT(enableSearchLineEdit())); + connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this, + SIGNAL(linkActivated(QUrl))); + connect(m_indexWidget, SIGNAL(linksActivated(QMap,QString)), + this, SIGNAL(linksActivated(QMap,QString))); + connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget, + SLOT(activateCurrentItem())); + layout->addWidget(m_indexWidget); + + m_indexWidget->viewport()->installEventFilter(this); +} + +IndexWindow::~IndexWindow() +{ + TRACE_OBJ +} + +void IndexWindow::filterIndices(const QString &filter) +{ + TRACE_OBJ + if (filter.contains(QLatin1Char('*'))) + m_indexWidget->filterIndices(filter, filter); + else + m_indexWidget->filterIndices(filter, QString()); +} + +bool IndexWindow::eventFilter(QObject *obj, QEvent *e) +{ + TRACE_OBJ + if (obj == m_searchLineEdit && e->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(e); + QModelIndex idx = m_indexWidget->currentIndex(); + switch (ke->key()) { + case Qt::Key_Up: + idx = m_indexWidget->model()->index(idx.row()-1, + idx.column(), idx.parent()); + if (idx.isValid()) { + m_indexWidget->setCurrentIndex(idx); + return true; + } + break; + case Qt::Key_Down: + idx = m_indexWidget->model()->index(idx.row()+1, + idx.column(), idx.parent()); + if (idx.isValid()) { + m_indexWidget->setCurrentIndex(idx); + return true; + } + break; + case Qt::Key_Escape: + emit escapePressed(); + return true; + default: ; // stop complaining + } + } else if (obj == m_indexWidget && e->type() == QEvent::ContextMenu) { + QContextMenuEvent *ctxtEvent = static_cast(e); + QModelIndex idx = m_indexWidget->indexAt(ctxtEvent->pos()); + if (idx.isValid()) { + QMenu menu; + QAction *curTab = menu.addAction(tr("Open Link")); + QAction *newTab = menu.addAction(tr("Open Link in New Tab")); + menu.move(m_indexWidget->mapToGlobal(ctxtEvent->pos())); + + QAction *action = menu.exec(); + if (curTab == action) + m_indexWidget->activateCurrentItem(); + else if (newTab == action) { + open(m_indexWidget, idx); + } + } + } else if (m_indexWidget && obj == m_indexWidget->viewport() + && e->type() == QEvent::MouseButtonRelease) { + QMouseEvent *mouseEvent = static_cast(e); + QModelIndex idx = m_indexWidget->indexAt(mouseEvent->pos()); + if (idx.isValid()) { + Qt::MouseButtons button = mouseEvent->button(); + if (((button == Qt::LeftButton) && (mouseEvent->modifiers() & Qt::ControlModifier)) + || (button == Qt::MidButton)) { + open(m_indexWidget, idx); + } + } + } +#ifdef Q_OS_MAC + else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(e); + if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) + m_indexWidget->activateCurrentItem(); + } +#endif + return QWidget::eventFilter(obj, e); +} + +void IndexWindow::enableSearchLineEdit() +{ + TRACE_OBJ + m_searchLineEdit->setDisabled(false); + filterIndices(m_searchLineEdit->text()); +} + +void IndexWindow::disableSearchLineEdit() +{ + TRACE_OBJ + m_searchLineEdit->setDisabled(true); +} + +void IndexWindow::setSearchLineEditText(const QString &text) +{ + TRACE_OBJ + m_searchLineEdit->setText(text); +} + +void IndexWindow::focusInEvent(QFocusEvent *e) +{ + TRACE_OBJ + if (e->reason() != Qt::MouseFocusReason) { + m_searchLineEdit->selectAll(); + m_searchLineEdit->setFocus(); + } +} + +void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) +{ + TRACE_OBJ + QHelpIndexModel *model = qobject_cast(indexWidget->model()); + if (model) { + QString keyword = model->data(index, Qt::DisplayRole).toString(); + QMap links = model->linksForKeyword(keyword); + + QUrl url; + if (links.count() > 1) { + TopicChooser tc(this, keyword, links); + if (tc.exec() == QDialog::Accepted) + url = tc.link(); + } else if (links.count() == 1) { + url = links.constBegin().value(); + } else { + return; + } + + if (!HelpViewer::canOpenPage(url.path())) + CentralWidget::instance()->setSource(url); + else + OpenPagesManager::instance()->createPage(url); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/indexwindow.h b/src/assistant/assistant/indexwindow.h new file mode 100644 index 000000000..1873cd6e4 --- /dev/null +++ b/src/assistant/assistant/indexwindow.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef INDEXWINDOW_H +#define INDEXWINDOW_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpIndexWidget; +class QModelIndex; + +class IndexWindow : public QWidget +{ + Q_OBJECT + +public: + IndexWindow(QWidget *parent = 0); + ~IndexWindow(); + + void setSearchLineEditText(const QString &text); + QString searchLineEditText() const + { + return m_searchLineEdit->text(); + } + +signals: + void linkActivated(const QUrl &link); + void linksActivated(const QMap &links, + const QString &keyword); + void escapePressed(); + +private slots: + void filterIndices(const QString &filter); + void enableSearchLineEdit(); + void disableSearchLineEdit(); + +private: + bool eventFilter(QObject *obj, QEvent *e); + void focusInEvent(QFocusEvent *e); + void open(QHelpIndexWidget *indexWidget, const QModelIndex &index); + + QLineEdit *m_searchLineEdit; + QHelpIndexWidget *m_indexWidget; +}; + +QT_END_NAMESPACE + +#endif // INDEXWINDOW_H diff --git a/src/assistant/assistant/installdialog.cpp b/src/assistant/assistant/installdialog.cpp new file mode 100644 index 000000000..82c0ccaa9 --- /dev/null +++ b/src/assistant/assistant/installdialog.cpp @@ -0,0 +1,355 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "installdialog.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +QT_BEGIN_NAMESPACE +#ifndef QT_NO_HTTP + +#define QCH_FILENAME 92943 +#define QCH_NAMESPACE 92944 +#define QCH_CHECKSUM 92945 + +InstallDialog::InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent, + const QString &host, int port) + : QDialog(parent), m_helpEngine(helpEngine), m_host(host), m_port(port) +{ + TRACE_OBJ + m_ui.setupUi(this); + + m_ui.installButton->setEnabled(false); + m_ui.cancelButton->setEnabled(false); + m_ui.pathLineEdit->setText(QFileInfo(m_helpEngine->collectionFile()).absolutePath()); + m_ui.progressBar->hide(); + + m_windowTitle = tr("Install Documentation"); + + m_http = new QHttp(this); + connect(m_http, SIGNAL(requestFinished(int,bool)), + this, SLOT(httpRequestFinished(int,bool))); + connect(m_http, SIGNAL(dataReadProgress(int,int)), + this, SLOT(updateDataReadProgress(int,int))); + connect(m_http, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), + this, SLOT(readResponseHeader(QHttpResponseHeader))); + connect(m_ui.installButton, SIGNAL(clicked()), this, SLOT(install())); + connect(m_ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelDownload())); + connect(m_ui.browseButton, SIGNAL(clicked()), this, SLOT(browseDirectories())); + + connect(m_ui.listWidget, SIGNAL(itemChanged(QListWidgetItem*)), + this, SLOT(updateInstallButton())); + + QTimer::singleShot(0, this, SLOT(init())); +} + +InstallDialog::~InstallDialog() +{ + TRACE_OBJ +} + +QStringList InstallDialog::installedDocumentations() const +{ + TRACE_OBJ + return m_installedDocumentations; +} + +void InstallDialog::init() +{ + TRACE_OBJ + m_ui.statusLabel->setText(tr("Downloading documentation info...")); + m_ui.progressBar->show(); + + QUrl url(QLatin1String("http://qt.nokia.com/doc/assistantdocs/docs.txt")); + m_buffer = new QBuffer(); + m_buffer->open(QBuffer::ReadWrite); + + if (m_port > -1) + m_http->setProxy(m_host, m_port); + m_http->setHost(url.host()); + m_httpAborted = false; + m_docInfoId = m_http->get(url.path(), m_buffer); + + m_ui.cancelButton->setEnabled(true); + m_ui.closeButton->setEnabled(false); +} + +void InstallDialog::updateInstallButton() +{ + TRACE_OBJ + QListWidgetItem *item = 0; + for (int i=0; icount(); ++i) { + item = m_ui.listWidget->item(i); + if (item->checkState() == Qt::Checked + && item->flags() & Qt::ItemIsEnabled) { + m_ui.installButton->setEnabled(true); + return; + } + } + m_ui.installButton->setEnabled(false); +} + +void InstallDialog::updateDocItemList() +{ + TRACE_OBJ + QStringList registeredDocs = m_helpEngine->registeredDocumentations(); + QListWidgetItem *item = 0; + for (int i=0; icount(); ++i) { + item = m_ui.listWidget->item(i); + QString ns = item->data(QCH_NAMESPACE).toString(); + if (!ns.isEmpty() && registeredDocs.contains(ns)) { + item->setFlags(Qt::ItemIsUserCheckable); + item->setCheckState(Qt::Checked); + } + item->setCheckState(Qt::Unchecked); + } +} + +void InstallDialog::cancelDownload() +{ + TRACE_OBJ + m_ui.statusLabel->setText(tr("Download canceled.")); + m_httpAborted = true; + m_itemsToInstall.clear(); + m_http->abort(); + m_ui.cancelButton->setEnabled(false); + m_ui.closeButton->setEnabled(true); + updateInstallButton(); +} + +void InstallDialog::install() +{ + TRACE_OBJ + QListWidgetItem *item = 0; + for (int i=0; icount(); ++i) { + item = m_ui.listWidget->item(i); + if (item->checkState() == Qt::Checked) + m_itemsToInstall.append(item); + } + m_ui.installButton->setEnabled(false); + downloadNextFile(); +} + +void InstallDialog::downloadNextFile() +{ + TRACE_OBJ + if (!m_itemsToInstall.count()) { + m_ui.cancelButton->setEnabled(false); + m_ui.closeButton->setEnabled(true); + m_ui.statusLabel->setText(tr("Done.")); + m_ui.progressBar->hide(); + updateDocItemList(); + updateInstallButton(); + return; + } + + QListWidgetItem *item = m_itemsToInstall.dequeue(); + m_currentCheckSum = item->data(QCH_CHECKSUM).toString(); + QString fileName = item->data(QCH_FILENAME).toString(); + QString saveFileName = m_ui.pathLineEdit->text() + QDir::separator() + + fileName; + + if (QFile::exists(saveFileName) + && QMessageBox::information(this, m_windowTitle, + tr("The file %1 already exists. Do you want to overwrite it?") + .arg(saveFileName), QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes) == QMessageBox::No) { + installFile(saveFileName); + downloadNextFile(); + return; + } + + m_file = new QFile(saveFileName); + if (!m_file->open(QIODevice::WriteOnly|QIODevice::Truncate)) { + QMessageBox::information(this, m_windowTitle, + tr("Unable to save the file %1: %2.") + .arg(saveFileName).arg(m_file->errorString())); + delete m_file; + m_file = 0; + downloadNextFile(); + return; + } + + m_ui.statusLabel->setText(tr("Downloading %1...").arg(fileName)); + m_ui.progressBar->show(); + + QLatin1String urlStr("http://qt.nokia.com/doc/assistantdocs/%1"); + QUrl url(QString(urlStr).arg(fileName)); + + m_httpAborted = false; + m_docId = m_http->get(url.path(), m_file); + + m_ui.cancelButton->setEnabled(true); + m_ui.closeButton->setEnabled(false); +} + +void InstallDialog::httpRequestFinished(int requestId, bool error) +{ + TRACE_OBJ + if (requestId == m_docInfoId && m_buffer) { + m_ui.progressBar->hide(); + if (error) { + QMessageBox::information(this, m_windowTitle, + tr("Download failed: %1.") + .arg(m_http->errorString())); + } else if (!m_httpAborted) { + QStringList registeredDocs = m_helpEngine->registeredDocumentations(); + m_buffer->seek(0); + while (m_buffer->canReadLine()) { + QByteArray ba = m_buffer->readLine(); + QStringList lst = QString::fromAscii(ba.constData()).split(QLatin1Char('|')); + if (lst.count() != 4) { + QMessageBox::information(this, m_windowTitle, + tr("Documentation info file is corrupt!")); + } else { + QListWidgetItem *item = new QListWidgetItem(m_ui.listWidget); + item->setText(lst.at(2).trimmed()); + item->setData(QCH_FILENAME, lst.first()); + item->setData(QCH_NAMESPACE, lst.at(1)); + item->setData(QCH_CHECKSUM, lst.last().trimmed()); + } + } + updateDocItemList(); + } + if (m_buffer) + m_buffer->close(); + delete m_buffer; + m_buffer = 0; + m_ui.statusLabel->setText(tr("Done.")); + m_ui.cancelButton->setEnabled(false); + m_ui.closeButton->setEnabled(true); + updateInstallButton(); + } else if (requestId == m_docId) { + m_file->close(); + if (!m_httpAborted) { + QString checkSum; + if (m_file->open(QIODevice::ReadOnly)) { + QByteArray digest = QCryptographicHash::hash(m_file->readAll(), + QCryptographicHash::Md5); + m_file->close(); + checkSum = QString::fromLatin1(digest.toHex()); + } + if (error) { + m_file->remove(); + QMessageBox::warning(this, m_windowTitle, + tr("Download failed: %1.") + .arg(m_http->errorString())); + } else if (checkSum.isEmpty() || m_currentCheckSum != checkSum) { + m_file->remove(); + QMessageBox::warning(this, m_windowTitle, + tr("Download failed: Downloaded file is corrupted.")); + } else { + m_ui.statusLabel->setText(tr("Installing documentation %1...") + .arg(QFileInfo(m_file->fileName()).fileName())); + m_ui.progressBar->setMaximum(0); + m_ui.statusLabel->setText(tr("Done.")); + installFile(m_file->fileName()); + } + } else { + m_file->remove(); + } + delete m_file; + m_file = 0; + downloadNextFile(); + } +} + +void InstallDialog::installFile(const QString &fileName) +{ + TRACE_OBJ + if (m_helpEngine->registerDocumentation(fileName)) { + m_installedDocumentations + .append(QHelpEngineCore::namespaceName(fileName)); + } else { + QMessageBox::information(this, m_windowTitle, + tr("Error while installing documentation:\n%1") + .arg(m_helpEngine->error())); + } +} + +void InstallDialog::readResponseHeader(const QHttpResponseHeader &responseHeader) +{ + TRACE_OBJ + if (responseHeader.statusCode() != 200) { + QMessageBox::information(this, m_windowTitle, + tr("Download failed: %1.") + .arg(responseHeader.reasonPhrase())); + m_httpAborted = true; + m_ui.progressBar->hide(); + m_http->abort(); + return; + } +} + +void InstallDialog::updateDataReadProgress(int bytesRead, int totalBytes) +{ + TRACE_OBJ + if (m_httpAborted) + return; + + m_ui.progressBar->setMaximum(totalBytes); + m_ui.progressBar->setValue(bytesRead); +} + +void InstallDialog::browseDirectories() +{ + TRACE_OBJ + QString dir = QFileDialog::getExistingDirectory(this, m_windowTitle, + m_ui.pathLineEdit->text()); + if (!dir.isEmpty()) + m_ui.pathLineEdit->setText(dir); +} + +#endif +QT_END_NAMESPACE diff --git a/src/assistant/assistant/installdialog.h b/src/assistant/assistant/installdialog.h new file mode 100644 index 000000000..0f57b9ef0 --- /dev/null +++ b/src/assistant/assistant/installdialog.h @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef INSTALLDIALOG_H +#define INSTALLDIALOG_H + +#include +#include +#include +#include "ui_installdialog.h" + +#ifndef QT_NO_HTTP + +QT_BEGIN_NAMESPACE + +class QHttp; +class QBuffer; +class QFile; +class QHelpEngineCore; + +class InstallDialog : public QDialog +{ + Q_OBJECT + +public: + explicit InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent = 0, + const QString &host = QString(), int port = -1); + ~InstallDialog(); + + QStringList installedDocumentations() const; + +private slots: + void init(); + void cancelDownload(); + void install(); + void httpRequestFinished(int requestId, bool error); + void readResponseHeader(const QHttpResponseHeader &responseHeader); + void updateDataReadProgress(int bytesRead, int totalBytes); + void updateInstallButton(); + void browseDirectories(); + +private: + void downloadNextFile(); + void updateDocItemList(); + void installFile(const QString &fileName); + + Ui::InstallDialog m_ui; + QHelpEngineCore *m_helpEngine; + QHttp *m_http; + QBuffer *m_buffer; + QFile *m_file; + bool m_httpAborted; + int m_docInfoId; + int m_docId; + QQueue m_itemsToInstall; + QString m_currentCheckSum; + QString m_windowTitle; + QStringList m_installedDocumentations; + QString m_host; + int m_port; +}; + +QT_END_NAMESPACE + +#endif + +#endif // INSTALLDIALOG_H diff --git a/src/assistant/assistant/installdialog.ui b/src/assistant/assistant/installdialog.ui new file mode 100644 index 000000000..21a05da77 --- /dev/null +++ b/src/assistant/assistant/installdialog.ui @@ -0,0 +1,118 @@ + + InstallDialog + + + + 0 + 0 + 436 + 245 + + + + Install Documentation + + + + + + Available Documentation: + + + + + + + + + + Install + + + + + + + Cancel + + + + + + + Close + + + + + + + Qt::Vertical + + + + 20 + 56 + + + + + + + + Installation Path: + + + + + + + + + + ... + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + + + Qt::Horizontal + + + + + + + + + closeButton + clicked() + InstallDialog + accept() + + + 330 + 107 + + + 332 + 158 + + + + + diff --git a/src/assistant/assistant/main.cpp b/src/assistant/assistant/main.cpp new file mode 100644 index 000000000..d6e78d473 --- /dev/null +++ b/src/assistant/assistant/main.cpp @@ -0,0 +1,440 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +#include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" +#include "mainwindow.h" +#include "cmdlineparser.h" + +// #define TRACING_REQUESTED + +QT_USE_NAMESPACE + +#if defined(USE_STATIC_SQLITE_PLUGIN) + #include + Q_IMPORT_PLUGIN(qsqlite) +#endif + +namespace { + +void +updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) +{ + TRACE_OBJ + int lastPage = CollectionConfiguration::lastTabPage(helpEngine); + QStringList currentPages = CollectionConfiguration::lastShownPages(helpEngine); + if (!currentPages.isEmpty()) { + QStringList zoomList = CollectionConfiguration::lastZoomFactors(helpEngine); + while (zoomList.count() < currentPages.count()) + zoomList.append(CollectionConfiguration::DefaultZoomFactor); + + for (int i = currentPages.count(); --i >= 0;) { + if (QUrl(currentPages.at(i)).host() == nsName) { + zoomList.removeAt(i); + currentPages.removeAt(i); + lastPage = (lastPage == (i + 1)) ? 1 : lastPage; + } + } + + CollectionConfiguration::setLastShownPages(helpEngine, currentPages); + CollectionConfiguration::setLastTabPage(helpEngine, lastPage); + CollectionConfiguration::setLastZoomFactors(helpEngine, zoomList); + } +} + +bool +updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) +{ + TRACE_OBJ + if (!CollectionConfiguration::isNewer(caller, user)) + return false; + CollectionConfiguration::copyConfiguration(caller, user); + return true; +} + +void stripNonexistingDocs(QHelpEngineCore& collection) +{ + TRACE_OBJ + const QStringList &namespaces = collection.registeredDocumentations(); + foreach (const QString &ns, namespaces) { + QFileInfo fi(collection.documentationFileName(ns)); + if (!fi.exists() || !fi.isFile()) + collection.unregisterDocumentation(ns); + } +} + +QString indexFilesFolder(const QString &collectionFile) +{ + TRACE_OBJ + QString indexFilesFolder = QLatin1String(".fulltextsearch"); + if (!collectionFile.isEmpty()) { + QFileInfo fi(collectionFile); + indexFilesFolder = QLatin1Char('.') + + fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc"))); + } + return indexFilesFolder; +} + +/* + * Returns the expected absolute file path of the cached collection file + * correspondinging to the given collection's file. + * It may or may not exist yet. + */ +QString constructCachedCollectionFilePath(const QHelpEngineCore &collection) +{ + TRACE_OBJ + const QString &filePath = collection.collectionFile(); + const QString &fileName = QFileInfo(filePath).fileName(); + const QString &cacheDir = CollectionConfiguration::cacheDir(collection); + const QString &dir = !cacheDir.isEmpty() + && CollectionConfiguration::cacheDirIsRelativeToCollection(collection) + ? QFileInfo(filePath).dir().absolutePath() + + QDir::separator() + cacheDir + : MainWindow::collectionFileDirectory(false, cacheDir); + return dir + QDir::separator() + fileName; +} + +bool synchronizeDocs(QHelpEngineCore &collection, + QHelpEngineCore &cachedCollection, + CmdLineParser &cmd) +{ + TRACE_OBJ + const QDateTime &lastCollectionRegisterTime = + CollectionConfiguration::lastRegisterTime(collection); + if (!lastCollectionRegisterTime.isValid() || lastCollectionRegisterTime + < CollectionConfiguration::lastRegisterTime(cachedCollection)) + return true; + + const QStringList &docs = collection.registeredDocumentations(); + const QStringList &cachedDocs = cachedCollection.registeredDocumentations(); + + /* + * Ensure that the cached collection contains all docs that + * the collection contains. + */ + foreach (const QString &doc, docs) { + if (!cachedDocs.contains(doc)) { + const QString &docFile = collection.documentationFileName(doc); + if (!cachedCollection.registerDocumentation(docFile)) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error registering documentation file '%1': %2"). + arg(docFile).arg(cachedCollection.error()), true); + return false; + } + } + } + + CollectionConfiguration::updateLastRegisterTime(cachedCollection); + + return true; +} + +bool removeSearchIndex(const QString &collectionFile) +{ + TRACE_OBJ + QString path = QFileInfo(collectionFile).path(); + path += QLatin1Char('/') + indexFilesFolder(collectionFile); + + QLocalSocket localSocket; + localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) + .arg(QLatin1String(QT_VERSION_STR))); + + QDir dir(path); // check if there is no other instance ruinning + if (!dir.exists() || localSocket.waitForConnected()) + return false; + + QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); + foreach (const QString &item, lst) + dir.remove(item); + return true; +} + +bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, + CmdLineParser &cmd) +{ + TRACE_OBJ + QHelpEngine engine(collectionFile); + if (!engine.setupData()) { + cmd.showMessage(QCoreApplication::translate("Assistant", "Error: %1") + .arg(engine.error()), true); + return false; + } + + QHelpSearchEngine * const searchEngine = engine.searchEngine(); + QObject::connect(searchEngine, SIGNAL(indexingFinished()), &app, + SLOT(quit())); + searchEngine->reindexDocumentation(); + return app.exec() == 0; +} + +bool useGui(int argc, char *argv[]) +{ + TRACE_OBJ + bool gui = true; +#ifndef Q_OS_WIN + // Look for arguments that imply command-line mode. + const char * cmdModeArgs[] = { + "-help", "-register", "-unregister", "-remove-search-index", + "-rebuild-search-index" + }; + for (int i = 1; i < argc; ++i) { + for (size_t j = 0; j < sizeof cmdModeArgs/sizeof *cmdModeArgs; ++j) { + if(strcmp(argv[i], cmdModeArgs[j]) == 0) { + gui = false; + break; + } + } + } +#else + Q_UNUSED(argc) + Q_UNUSED(argv) +#endif + return gui; +} + +bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, + bool printSuccess) +{ + TRACE_OBJ + if (!collection.registerDocumentation(cmd.helpFile())) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Could not register documentation file\n%1\n\nReason:\n%2") + .arg(cmd.helpFile()).arg(collection.error()), true); + return false; + } + if (printSuccess) + cmd.showMessage(QCoreApplication::translate("Assistant", + "Documentation successfully registered."), + false); + CollectionConfiguration::updateLastRegisterTime(collection); + return true; +} + +bool unregisterDocumentation(QHelpEngineCore &collection, + const QString &namespaceName, CmdLineParser &cmd, bool printSuccess) +{ + TRACE_OBJ + if (!collection.unregisterDocumentation(namespaceName)) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Could not unregister documentation" + " file\n%1\n\nReason:\n%2"). + arg(cmd.helpFile()).arg(collection.error()), true); + return false; + } + updateLastPagesOnUnregister(collection, namespaceName); + if (printSuccess) + cmd.showMessage(QCoreApplication::translate("Assistant", + "Documentation successfully unregistered."), + false); + return true; +} + +void setupTranslation(const QString &fileName, const QString &dir) +{ + QTranslator *translator = new QTranslator(QCoreApplication::instance()); + if (translator->load(fileName, dir)) { + QCoreApplication::installTranslator(translator); + } else if (!fileName.endsWith(QLatin1String("en_US")) + && !fileName.endsWith(QLatin1String("_C"))) { + qWarning("Could not load translation file %s in directory %s.", + qPrintable(fileName), qPrintable(dir)); + } +} + +void setupTranslations() +{ + TRACE_OBJ + const QString& locale = QLocale::system().name(); + const QString &resourceDir + = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + setupTranslation(QLatin1String("assistant_") + locale, resourceDir); + setupTranslation(QLatin1String("qt_") + locale, resourceDir); + setupTranslation(QLatin1String("qt_help_") + locale, resourceDir); +} + +} // Anonymous namespace. + +int main(int argc, char *argv[]) +{ + TRACE_OBJ + QApplication a(argc, argv, useGui(argc, argv)); + a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); + setupTranslations(); + + // Parse arguments. + CmdLineParser cmd(a.arguments()); + CmdLineParser::Result res = cmd.parse(); + if (res == CmdLineParser::Help) + return 0; + else if (res == CmdLineParser::Error) + return -1; + + /* + * Create the collection objects that we need. We always have the + * cached collection file. Depending on whether the user specified + * one, we also may have an input collection file. + */ + const QString collectionFile = cmd.collectionFile(); + const bool collectionFileGiven = !collectionFile.isEmpty(); + QScopedPointer collection; + if (collectionFileGiven) { + collection.reset(new QHelpEngineCore(collectionFile)); + if (!collection->setupData()) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error reading collection file '%1': %2."). + arg(collectionFile).arg(collection->error()), true); + return EXIT_FAILURE; + } + } + const QString &cachedCollectionFile = collectionFileGiven + ? constructCachedCollectionFilePath(*collection) + : MainWindow::defaultHelpCollectionFileName(); + if (collectionFileGiven && !QFileInfo(cachedCollectionFile).exists() + && !collection->copyCollectionFile(cachedCollectionFile)) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error creating collection file '%1': %2."). + arg(cachedCollectionFile).arg(collection->error()), true); + return EXIT_FAILURE; + } + QHelpEngineCore cachedCollection(cachedCollectionFile); + if (!cachedCollection.setupData()) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error reading collection file '%1': %2."). + arg(cachedCollectionFile). + arg(cachedCollection.error()), true); + return EXIT_FAILURE; + } + + stripNonexistingDocs(cachedCollection); + if (collectionFileGiven) { + if (CollectionConfiguration::isNewer(*collection, cachedCollection)) + CollectionConfiguration::copyConfiguration(*collection, + cachedCollection); + if (!synchronizeDocs(*collection, cachedCollection, cmd)) + return EXIT_FAILURE; + } + + if (cmd.registerRequest() != CmdLineParser::None) { + const QStringList &cachedDocs = + cachedCollection.registeredDocumentations(); + const QString &namespaceName = + QHelpEngineCore::namespaceName(cmd.helpFile()); + if (cmd.registerRequest() == CmdLineParser::Register) { + if (collectionFileGiven + && !registerDocumentation(*collection, cmd, true)) + return EXIT_FAILURE; + if (!cachedDocs.contains(namespaceName) + && !registerDocumentation(cachedCollection, cmd, !collectionFileGiven)) + return EXIT_FAILURE; + return EXIT_SUCCESS; + } + if (cmd.registerRequest() == CmdLineParser::Unregister) { + if (collectionFileGiven + && !unregisterDocumentation(*collection, namespaceName, cmd, true)) + return EXIT_FAILURE; + if (cachedDocs.contains(namespaceName) + && !unregisterDocumentation(cachedCollection, namespaceName, + cmd, !collectionFileGiven)) + return EXIT_FAILURE; + return EXIT_SUCCESS; + } + } + + if (cmd.removeSearchIndex()) { + return removeSearchIndex(cachedCollectionFile) + ? EXIT_SUCCESS : EXIT_FAILURE; + } + + if (cmd.rebuildSearchIndex()) { + return rebuildSearchIndex(a, cachedCollectionFile, cmd) + ? EXIT_SUCCESS : EXIT_FAILURE; + } + + if (!QSqlDatabase::isDriverAvailable(QLatin1String("QSQLITE"))) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Cannot load sqlite database driver!"), + true); + return EXIT_FAILURE; + } + + if (!cmd.currentFilter().isEmpty()) { + if (collectionFileGiven) + collection->setCurrentFilter(cmd.currentFilter()); + cachedCollection.setCurrentFilter(cmd.currentFilter()); + } + + if (collectionFileGiven) + cmd.setCollectionFile(cachedCollectionFile); + + MainWindow *w = new MainWindow(&cmd); + w->show(); + a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + + /* + * We need to be careful here: The main window has to be deleted before + * the help engine wrapper, which has to be deleted before the + * QApplication. + */ + const int retval = a.exec(); + delete w; + HelpEngineWrapper::removeInstance(); + return retval; +} diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp new file mode 100644 index 000000000..18a215ecd --- /dev/null +++ b/src/assistant/assistant/mainwindow.cpp @@ -0,0 +1,1099 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "mainwindow.h" + +#include "aboutdialog.h" +#include "bookmarkmanager.h" +#include "centralwidget.h" +#include "cmdlineparser.h" +#include "contentwindow.h" +#include "globalactions.h" +#include "helpenginewrapper.h" +#include "indexwindow.h" +#include "openpagesmanager.h" +#include "preferencesdialog.h" +#include "qtdocinstaller.h" +#include "remotecontrol.h" +#include "searchwidget.h" +#include "topicchooser.h" +#include "tracer.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) + : QMainWindow(parent) + , m_bookmarkWidget(0) + , m_filterCombo(0) + , m_toolBarMenu(0) + , m_cmdLine(cmdLine) + , m_progressWidget(0) + , m_qtDocInstaller(0) + , m_connectedInitSignals(false) +{ + TRACE_OBJ + + setToolButtonStyle(Qt::ToolButtonFollowStyle); + setDockOptions(dockOptions() | AllowNestedDocks); + + QString collectionFile; + if (usesDefaultCollection()) { + MainWindow::collectionFileDirectory(true); + collectionFile = MainWindow::defaultHelpCollectionFileName(); + } else { + collectionFile = cmdLine->collectionFile(); + } + HelpEngineWrapper &helpEngineWrapper = + HelpEngineWrapper::instance(collectionFile); + BookmarkManager *bookMarkManager = BookmarkManager::instance(); + + if (!initHelpDB(!cmdLine->collectionFileGiven())) { + qDebug("Fatal error: Help engine initialization failed. " + "Error message was: %s\nAssistant will now exit.", + qPrintable(HelpEngineWrapper::instance().error())); + std::exit(1); + } + + m_centralWidget = new CentralWidget(this); + setCentralWidget(m_centralWidget); + + m_indexWindow = new IndexWindow(this); + QDockWidget *indexDock = new QDockWidget(tr("Index"), this); + indexDock->setObjectName(QLatin1String("IndexWindow")); + indexDock->setWidget(m_indexWindow); + addDockWidget(Qt::LeftDockWidgetArea, indexDock); + + m_contentWindow = new ContentWindow; + QDockWidget *contentDock = new QDockWidget(tr("Contents"), this); + contentDock->setObjectName(QLatin1String("ContentWindow")); + contentDock->setWidget(m_contentWindow); + addDockWidget(Qt::LeftDockWidgetArea, contentDock); + + m_searchWindow = new SearchWidget(helpEngineWrapper.searchEngine()); + m_searchWindow->setFont(!helpEngineWrapper.usesBrowserFont() ? qApp->font() + : helpEngineWrapper.browserFont()); + QDockWidget *searchDock = new QDockWidget(tr("Search"), this); + searchDock->setObjectName(QLatin1String("SearchWindow")); + searchDock->setWidget(m_searchWindow); + addDockWidget(Qt::LeftDockWidgetArea, searchDock); + + QDockWidget *bookmarkDock = new QDockWidget(tr("Bookmarks"), this); + bookmarkDock->setObjectName(QLatin1String("BookmarkWindow")); + bookmarkDock->setWidget(m_bookmarkWidget + = bookMarkManager->bookmarkDockWidget()); + addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); + + QDockWidget *openPagesDock = new QDockWidget(tr("Open Pages"), this); + openPagesDock->setObjectName(QLatin1String("Open Pages")); + OpenPagesManager *openPagesManager + = OpenPagesManager::createInstance(this, usesDefaultCollection(), m_cmdLine->url()); + openPagesDock->setWidget(openPagesManager->openPagesWidget()); + addDockWidget(Qt::LeftDockWidgetArea, openPagesDock); + + connect(m_centralWidget, SIGNAL(addBookmark(QString, QString)), + bookMarkManager, SLOT(addBookmark(QString, QString))); + connect(bookMarkManager, SIGNAL(escapePressed()), this, + SLOT(activateCurrentCentralWidgetTab())); + connect(bookMarkManager, SIGNAL(setSource(QUrl)), m_centralWidget, + SLOT(setSource(QUrl))); + connect(bookMarkManager, SIGNAL(setSourceInNewTab(QUrl)), + openPagesManager, SLOT(createPage(QUrl))); + + QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine(); + connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted())); + connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); + + QString defWindowTitle = tr("Qt Assistant"); + setWindowTitle(defWindowTitle); + + setupActions(); + statusBar()->show(); + m_centralWidget->connectTabBar(); + + setupFilterToolbar(); + setupAddressToolbar(); + + const QString windowTitle = helpEngineWrapper.windowTitle(); + setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle); + QByteArray iconArray = helpEngineWrapper.applicationIcon(); + if (iconArray.size() > 0) { + QPixmap pix; + pix.loadFromData(iconArray); + QIcon appIcon(pix); + qApp->setWindowIcon(appIcon); + } else { + QIcon appIcon(QLatin1String(":/trolltech/assistant/images/assistant-128.png")); + qApp->setWindowIcon(appIcon); + } + + QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar")); + toolBar->setObjectName(QLatin1String("Bookmark Toolbar")); + bookMarkManager->setBookmarksToolbar(toolBar); + + // Show the widget here, otherwise the restore geometry and state won't work + // on x11. + show(); + + toolBar->hide(); + toolBarMenu()->addAction(toolBar->toggleViewAction()); + + QByteArray ba(helpEngineWrapper.mainWindow()); + if (!ba.isEmpty()) + restoreState(ba); + + ba = helpEngineWrapper.mainWindowGeometry(); + if (!ba.isEmpty()) { + restoreGeometry(ba); + } else { + tabifyDockWidget(contentDock, indexDock); + tabifyDockWidget(indexDock, bookmarkDock); + tabifyDockWidget(bookmarkDock, searchDock); + contentDock->raise(); + const QRect screen = QApplication::desktop()->screenGeometry(); + resize(4*screen.width()/5, 4*screen.height()/5); + } + + if (!helpEngineWrapper.hasFontSettings()) { + helpEngineWrapper.setUseAppFont(false); + helpEngineWrapper.setUseBrowserFont(false); + helpEngineWrapper.setAppFont(qApp->font()); + helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin); + helpEngineWrapper.setBrowserFont(qApp->font()); + helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin); + } else { + updateApplicationFont(); + } + + updateAboutMenuText(); + + QTimer::singleShot(0, this, SLOT(insertLastPages())); + if (m_cmdLine->enableRemoteControl()) + (void)new RemoteControl(this); + + if (m_cmdLine->contents() == CmdLineParser::Show) + showContents(); + else if (m_cmdLine->contents() == CmdLineParser::Hide) + hideContents(); + + if (m_cmdLine->index() == CmdLineParser::Show) + showIndex(); + else if (m_cmdLine->index() == CmdLineParser::Hide) + hideIndex(); + + if (m_cmdLine->bookmarks() == CmdLineParser::Show) + showBookmarksDockWidget(); + else if (m_cmdLine->bookmarks() == CmdLineParser::Hide) + hideBookmarksDockWidget(); + + if (m_cmdLine->search() == CmdLineParser::Show) + showSearch(); + else if (m_cmdLine->search() == CmdLineParser::Hide) + hideSearch(); + + if (m_cmdLine->contents() == CmdLineParser::Activate) + showContents(); + else if (m_cmdLine->index() == CmdLineParser::Activate) + showIndex(); + else if (m_cmdLine->bookmarks() == CmdLineParser::Activate) + showBookmarksDockWidget(); + + if (!m_cmdLine->currentFilter().isEmpty()) { + const QString &curFilter = m_cmdLine->currentFilter(); + if (helpEngineWrapper.customFilters().contains(curFilter)) + helpEngineWrapper.setCurrentFilter(curFilter); + } + + if (usesDefaultCollection()) + QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation())); + else + checkInitState(); + + connect(&helpEngineWrapper, SIGNAL(documentationRemoved(QString)), + this, SLOT(documentationRemoved(QString))); + connect(&helpEngineWrapper, SIGNAL(documentationUpdated(QString)), + this, SLOT(documentationUpdated(QString))); + + setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); + GlobalActions::instance()->updateActions(); + if (helpEngineWrapper.addressBarEnabled()) + showNewAddress(); +} + +MainWindow::~MainWindow() +{ + TRACE_OBJ + if (m_qtDocInstaller) + delete m_qtDocInstaller; +} + +bool MainWindow::usesDefaultCollection() const +{ + TRACE_OBJ + return m_cmdLine->collectionFile().isEmpty(); +} + +void MainWindow::closeEvent(QCloseEvent *e) +{ + TRACE_OBJ + BookmarkManager::destroy(); + HelpEngineWrapper::instance().setMainWindow(saveState()); + HelpEngineWrapper::instance().setMainWindowGeometry(saveGeometry()); + QMainWindow::closeEvent(e); +} + +bool MainWindow::initHelpDB(bool registerInternalDoc) +{ + TRACE_OBJ + HelpEngineWrapper &helpEngineWrapper = HelpEngineWrapper::instance(); + if (!helpEngineWrapper.setupData()) + return false; + + if (!registerInternalDoc) { + if (helpEngineWrapper.defaultHomePage() == QLatin1String("help")) + helpEngineWrapper.setDefaultHomePage(QLatin1String("about:blank")); + return true; + } + bool assistantInternalDocRegistered = false; + QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); + foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { + if (ns.startsWith(intern)) { + intern = ns; + assistantInternalDocRegistered = true; + break; + } + } + + const QString &collectionFile = helpEngineWrapper.collectionFile(); + QFileInfo fi(collectionFile); + QString helpFile; + QTextStream(&helpFile) << fi.absolutePath() << QDir::separator() + << QLatin1String("assistant.qch.") << (QT_VERSION >> 16) + << QLatin1Char('.') << ((QT_VERSION >> 8) & 0xFF); + + bool needsSetup = false; + if (!assistantInternalDocRegistered || !QFile::exists(helpFile)) { + QFile file(helpFile); + if (file.open(QIODevice::WriteOnly)) { + QResource res(QLatin1String(":/trolltech/assistant/assistant.qch")); + if (file.write((const char*)res.data(), res.size()) != res.size()) + qDebug() << QLatin1String("could not write assistant.qch..."); + + file.close(); + } + helpEngineWrapper.unregisterDocumentation(intern); + helpEngineWrapper.registerDocumentation(helpFile); + needsSetup = true; + } + + if (needsSetup) + helpEngineWrapper.setupData(); + return true; +} + +void MainWindow::lookForNewQtDocumentation() +{ + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + QStringList docs; + docs << QLatin1String("assistant") + << QLatin1String("designer") + << QLatin1String("linguist") + << QLatin1String("qmake") + << QLatin1String("qt"); + QList qtDocInfos; + foreach (const QString &doc, docs) + qtDocInfos.append(QtDocInstaller::DocInfo(doc, helpEngine.qtDocInfo(doc))); + + m_qtDocInstaller = new QtDocInstaller(qtDocInfos); + connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, + SLOT(qtDocumentationInstalled())); + connect(m_qtDocInstaller, SIGNAL(qchFileNotFound(QString)), this, + SLOT(resetQtDocInfo(QString))); + connect(m_qtDocInstaller, SIGNAL(registerDocumentation(QString, QString)), + this, SLOT(registerDocumentation(QString, QString))); + if (helpEngine.qtDocInfo(QLatin1String("qt")).count() != 2) + statusBar()->showMessage(tr("Looking for Qt Documentation...")); + m_qtDocInstaller->installDocs(); +} + +void MainWindow::qtDocumentationInstalled() +{ + TRACE_OBJ + statusBar()->clearMessage(); + checkInitState(); +} + +void MainWindow::checkInitState() +{ + TRACE_OBJ + HelpEngineWrapper::instance().initialDocSetupDone(); + if (!m_cmdLine->enableRemoteControl()) + return; + + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.contentModel()->isCreatingContents() + || helpEngine.indexModel()->isCreatingIndex()) { + if (!m_connectedInitSignals) { + connect(helpEngine.contentModel(), SIGNAL(contentsCreated()), + this, SLOT(checkInitState())); + connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, + SLOT(checkInitState())); + m_connectedInitSignals = true; + } + } else { + if (m_connectedInitSignals) { + disconnect(helpEngine.contentModel(), 0, this, 0); + disconnect(helpEngine.indexModel(), 0, this, 0); + } + emit initDone(); + } +} + +void MainWindow::insertLastPages() +{ + TRACE_OBJ + if (m_cmdLine->search() == CmdLineParser::Activate) + showSearch(); +} + +void MainWindow::setupActions() +{ + TRACE_OBJ + QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); +#ifdef Q_OS_MAC + setUnifiedTitleAndToolBarOnMac(true); + resourcePath.append(QLatin1String("mac")); +#else + resourcePath.append(QLatin1String("win")); +#endif + + QMenu *menu = menuBar()->addMenu(tr("&File")); + + OpenPagesManager * const openPages = OpenPagesManager::instance(); + m_newTabAction + = menu->addAction(tr("New &Tab"), openPages, SLOT(createPage())); + m_newTabAction->setShortcut(QKeySequence::AddTab); + m_closeTabAction = menu->addAction(tr("&Close Tab"), + openPages, SLOT(closeCurrentPage())); + m_closeTabAction->setShortcuts(QKeySequence::Close); + + menu->addSeparator(); + + m_pageSetupAction = menu->addAction(tr("Page Set&up..."), m_centralWidget, + SLOT(pageSetup())); + m_printPreviewAction = menu->addAction(tr("Print Preview..."), m_centralWidget, + SLOT(printPreview())); + + GlobalActions *globalActions = GlobalActions::instance(this); + menu->addAction(globalActions->printAction()); + menu->addSeparator(); + + QIcon appExitIcon = QIcon::fromTheme("application-exit"); + QAction *tmp; +#ifdef Q_OS_WIN + tmp = menu->addAction(appExitIcon, tr("E&xit"), this, SLOT(close())); + tmp->setShortcut(QKeySequence(tr("CTRL+Q"))); +#else + tmp = menu->addAction(appExitIcon, tr("&Quit"), this, SLOT(close())); + tmp->setShortcut(QKeySequence::Quit); +#endif + tmp->setMenuRole(QAction::QuitRole); + + menu = menuBar()->addMenu(tr("&Edit")); + menu->addAction(globalActions->copyAction()); + menu->addAction(globalActions->findAction()); + + QAction *findNextAction = menu->addAction(tr("Find &Next"), m_centralWidget, + SLOT(findNext())); + findNextAction->setShortcuts(QKeySequence::FindNext); + + QAction *findPreviousAction = menu->addAction(tr("Find &Previous"), + m_centralWidget, SLOT(findPrevious())); + findPreviousAction->setShortcuts(QKeySequence::FindPrevious); + + menu->addSeparator(); + tmp = menu->addAction(tr("Preferences..."), this, SLOT(showPreferences())); + tmp->setMenuRole(QAction::PreferencesRole); + + m_viewMenu = menuBar()->addMenu(tr("&View")); + m_viewMenu->addAction(globalActions->zoomInAction()); + m_viewMenu->addAction(globalActions->zoomOutAction()); + + m_resetZoomAction = m_viewMenu->addAction(tr("Normal &Size"), m_centralWidget, + SLOT(resetZoom())); + m_resetZoomAction->setPriority(QAction::LowPriority); + m_resetZoomAction->setIcon(QIcon(resourcePath + QLatin1String("/resetzoom.png"))); + m_resetZoomAction->setShortcut(tr("Ctrl+0")); + + m_viewMenu->addSeparator(); + + m_viewMenu->addAction(tr("Contents"), this, SLOT(showContents()), + QKeySequence(tr("ALT+C"))); + m_viewMenu->addAction(tr("Index"), this, SLOT(showIndex()), + QKeySequence(tr("ALT+I"))); + m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarksDockWidget()), + QKeySequence(tr("ALT+O"))); + m_viewMenu->addAction(tr("Search"), this, SLOT(showSearch()), + QKeySequence(tr("ALT+S"))); + m_viewMenu->addAction(tr("Open Pages"), this, SLOT(showOpenPages()), + QKeySequence(tr("ALT+P"))); + + menu = menuBar()->addMenu(tr("&Go")); + menu->addAction(globalActions->homeAction()); + menu->addAction(globalActions->backAction()); + menu->addAction(globalActions->nextAction()); + + m_syncAction = menu->addAction(tr("Sync with Table of Contents"), this, + SLOT(syncContents())); + m_syncAction->setIconText(tr("Sync")); + m_syncAction->setIcon(QIcon(resourcePath + QLatin1String("/synctoc.png"))); + + menu->addSeparator(); + + tmp = menu->addAction(tr("Next Page"), openPages, SLOT(nextPage())); + tmp->setShortcuts(QList() << QKeySequence(tr("Ctrl+Alt+Right")) + << QKeySequence(Qt::CTRL + Qt::Key_PageDown)); + + tmp = menu->addAction(tr("Previous Page"), openPages, SLOT(previousPage())); + tmp->setShortcuts(QList() << QKeySequence(tr("Ctrl+Alt+Left")) + << QKeySequence(Qt::CTRL + Qt::Key_PageUp)); + +#ifdef Q_WS_MAC + QShortcut *sct = new QShortcut(QKeySequence(Qt::ALT + Qt::Key_Tab), this); + connect(sct, SIGNAL(activated()), openPages, SLOT(nextPageWithSwitcher())); + sct = new QShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_Tab), this); + connect(sct, SIGNAL(activated()), openPages, SLOT(previousPageWithSwitcher())); +#else + QShortcut *sct = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Tab), this); + connect(sct, SIGNAL(activated()), openPages, SLOT(nextPageWithSwitcher())); + sct = new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab), this); + connect(sct, SIGNAL(activated()), openPages, SLOT(previousPageWithSwitcher())); +#endif + + BookmarkManager::instance()->setBookmarksMenu(menuBar()->addMenu(tr("&Bookmarks"))); + + menu = menuBar()->addMenu(tr("&Help")); + m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog())); + m_aboutAction->setMenuRole(QAction::AboutRole); + +#ifdef Q_WS_X11 + m_resetZoomAction->setIcon(QIcon::fromTheme("zoom-original" , m_resetZoomAction->icon())); + m_syncAction->setIcon(QIcon::fromTheme("view-refresh" , m_syncAction->icon())); +#endif + + QToolBar *navigationBar = addToolBar(tr("Navigation Toolbar")); + navigationBar->setObjectName(QLatin1String("NavigationToolBar")); + navigationBar->addAction(globalActions->backAction()); + navigationBar->addAction(globalActions->nextAction()); + navigationBar->addAction(globalActions->homeAction()); + navigationBar->addAction(m_syncAction); + navigationBar->addSeparator(); + navigationBar->addAction(globalActions->copyAction()); + navigationBar->addAction(globalActions->printAction()); + navigationBar->addAction(globalActions->findAction()); + navigationBar->addSeparator(); + navigationBar->addAction(globalActions->zoomInAction()); + navigationBar->addAction(globalActions->zoomOutAction()); + navigationBar->addAction(m_resetZoomAction); + +#if defined(Q_WS_MAC) + QMenu *windowMenu = new QMenu(tr("&Window"), this); + menuBar()->insertMenu(menu->menuAction(), windowMenu); + windowMenu->addAction(tr("Zoom"), this, SLOT(showMaximized())); + windowMenu->addAction(tr("Minimize"), this, SLOT(showMinimized()), + QKeySequence(tr("Ctrl+M"))); +#endif + + // content viewer connections + connect(m_centralWidget, SIGNAL(copyAvailable(bool)), globalActions, + SLOT(setCopyAvailable(bool))); + connect(m_centralWidget, SIGNAL(currentViewerChanged()), globalActions, + SLOT(updateActions())); + connect(m_centralWidget, SIGNAL(forwardAvailable(bool)), globalActions, + SLOT(updateActions())); + connect(m_centralWidget, SIGNAL(backwardAvailable(bool)), globalActions, + SLOT(updateActions())); + connect(m_centralWidget, SIGNAL(highlighted(QString)), statusBar(), + SLOT(showMessage(QString))); + + // index window + connect(m_indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, + SLOT(setSource(QUrl))); + connect(m_indexWindow, SIGNAL(linksActivated(QMap,QString)), + this, SLOT(showTopicChooser(QMap,QString))); + connect(m_indexWindow, SIGNAL(escapePressed()), this, + SLOT(activateCurrentCentralWidgetTab())); + + // content window + connect(m_contentWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, + SLOT(setSource(QUrl))); + connect(m_contentWindow, SIGNAL(escapePressed()), this, + SLOT(activateCurrentCentralWidgetTab())); + + // search window + connect(m_searchWindow, SIGNAL(requestShowLink(QUrl)), + CentralWidget::instance(), SLOT(setSourceFromSearch(QUrl))); + connect(m_searchWindow, SIGNAL(requestShowLinkInNewTab(QUrl)), + OpenPagesManager::instance(), SLOT(createNewPageFromSearch(QUrl))); + +#if defined(QT_NO_PRINTER) + m_pageSetupAction->setVisible(false); + m_printPreviewAction->setVisible(false); + m_printAction->setVisible(false); +#endif +} + +QMenu *MainWindow::toolBarMenu() +{ + TRACE_OBJ + if (!m_toolBarMenu) { + m_viewMenu->addSeparator(); + m_toolBarMenu = m_viewMenu->addMenu(tr("Toolbars")); + } + return m_toolBarMenu; +} + +void MainWindow::setupFilterToolbar() +{ + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.filterFunctionalityEnabled()) + return; + + m_filterCombo = new QComboBox(this); + m_filterCombo->setMinimumWidth(QFontMetrics(QFont()). + width(QLatin1String("MakeTheComboBoxWidthEnough"))); + + QToolBar *filterToolBar = addToolBar(tr("Filter Toolbar")); + filterToolBar->setObjectName(QLatin1String("FilterToolBar")); + filterToolBar->addWidget(new QLabel(tr("Filtered by:").append(QLatin1Char(' ')), + this)); + filterToolBar->addWidget(m_filterCombo); + + if (!helpEngine.filterToolbarVisible()) + filterToolBar->hide(); + toolBarMenu()->addAction(filterToolBar->toggleViewAction()); + + connect(&helpEngine, SIGNAL(setupFinished()), this, + SLOT(setupFilterCombo()), Qt::QueuedConnection); + connect(m_filterCombo, SIGNAL(activated(QString)), this, + SLOT(filterDocumentation(QString))); + connect(&helpEngine, SIGNAL(currentFilterChanged(QString)), this, + SLOT(currentFilterChanged(QString))); + + setupFilterCombo(); +} + +void MainWindow::setupAddressToolbar() +{ + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.addressBarEnabled()) + return; + + m_addressLineEdit = new QLineEdit(this); + QToolBar *addressToolBar = addToolBar(tr("Address Toolbar")); + addressToolBar->setObjectName(QLatin1String("AddressToolBar")); + insertToolBarBreak(addressToolBar); + + addressToolBar->addWidget(new QLabel(tr("Address:").append(QLatin1String(" ")), + this)); + addressToolBar->addWidget(m_addressLineEdit); + + if (!helpEngine.addressBarVisible()) + addressToolBar->hide(); + toolBarMenu()->addAction(addressToolBar->toggleViewAction()); + + // address lineedit + connect(m_addressLineEdit, SIGNAL(returnPressed()), this, + SLOT(gotoAddress())); + connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, + SLOT(showNewAddress())); + connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this, + SLOT(showNewAddress(QUrl))); +} + +void MainWindow::updateAboutMenuText() +{ + TRACE_OBJ + QByteArray ba = HelpEngineWrapper::instance().aboutMenuTexts(); + if (ba.size() > 0) { + QString lang; + QString str; + QString trStr; + QString currentLang = QLocale::system().name(); + int i = currentLang.indexOf(QLatin1Char('_')); + if (i > -1) + currentLang = currentLang.left(i); + QDataStream s(&ba, QIODevice::ReadOnly); + while (!s.atEnd()) { + s >> lang; + s >> str; + if (lang == QLatin1String("default") && trStr.isEmpty()) { + trStr = str; + } else if (lang == currentLang) { + trStr = str; + break; + } + } + if (!trStr.isEmpty()) + m_aboutAction->setText(trStr); + } +} + +void MainWindow::showNewAddress() +{ + TRACE_OBJ + showNewAddress(m_centralWidget->currentSource()); +} + +void MainWindow::showNewAddress(const QUrl &url) +{ + TRACE_OBJ + m_addressLineEdit->setText(url.toString()); +} + +void MainWindow::gotoAddress() +{ + TRACE_OBJ + m_centralWidget->setSource(m_addressLineEdit->text()); +} + +void MainWindow::showTopicChooser(const QMap &links, + const QString &keyword) +{ + TRACE_OBJ + TopicChooser tc(this, keyword, links); + if (tc.exec() == QDialog::Accepted) { + m_centralWidget->setSource(tc.link()); + } +} + +void MainWindow::showPreferences() +{ + TRACE_OBJ + PreferencesDialog dia(this); + connect(&dia, SIGNAL(updateApplicationFont()), this, + SLOT(updateApplicationFont())); + connect(&dia, SIGNAL(updateBrowserFont()), m_centralWidget, + SLOT(updateBrowserFont())); + connect(&dia, SIGNAL(updateUserInterface()), m_centralWidget, + SLOT(updateUserInterface())); + dia.showDialog(); +} + +void MainWindow::syncContents() +{ + TRACE_OBJ + qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); + const QUrl url = m_centralWidget->currentSource(); + showContents(); + if (!m_contentWindow->syncToContent(url)) + statusBar()->showMessage( + tr("Could not find the associated content item."), 3000); + qApp->restoreOverrideCursor(); +} + +void MainWindow::showAboutDialog() +{ + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + QByteArray contents; + QByteArray ba = helpEngine.aboutTexts(); + if (!ba.isEmpty()) { + QString lang; + QByteArray cba; + QString currentLang = QLocale::system().name(); + int i = currentLang.indexOf(QLatin1Char('_')); + if (i > -1) + currentLang = currentLang.left(i); + QDataStream s(&ba, QIODevice::ReadOnly); + while (!s.atEnd()) { + s >> lang; + s >> cba; + if (lang == QLatin1String("default") && contents.isEmpty()) { + contents = cba; + } else if (lang == currentLang) { + contents = cba; + break; + } + } + } + + AboutDialog aboutDia(this); + + QByteArray iconArray; + if (!contents.isEmpty()) { + iconArray = helpEngine.aboutIcon(); + QByteArray resources = helpEngine.aboutImages(); + QPixmap pix; + pix.loadFromData(iconArray); + aboutDia.setText(QString::fromUtf8(contents), resources); + if (!pix.isNull()) + aboutDia.setPixmap(pix); + aboutDia.setWindowTitle(aboutDia.documentTitle()); + } else { + QByteArray resources; + aboutDia.setText(tr("
" + "

%1

" + "

Version %2

" + "

Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).

") + .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)), + resources); + QLatin1String path(":/trolltech/assistant/images/assistant-128.png"); + aboutDia.setPixmap(QString(path)); + } + if (aboutDia.windowTitle().isEmpty()) + aboutDia.setWindowTitle(tr("About %1").arg(windowTitle())); + aboutDia.exec(); +} + +void MainWindow::setContentsVisible(bool visible) +{ + TRACE_OBJ + if (visible) + showContents(); + else + hideContents(); +} + +void MainWindow::showContents() +{ + TRACE_OBJ + activateDockWidget(m_contentWindow); +} + +void MainWindow::hideContents() +{ + TRACE_OBJ + m_contentWindow->parentWidget()->hide(); +} + +void MainWindow::setIndexVisible(bool visible) +{ + TRACE_OBJ + if (visible) + showIndex(); + else + hideIndex(); +} + +void MainWindow::showIndex() +{ + TRACE_OBJ + activateDockWidget(m_indexWindow); +} + +void MainWindow::hideIndex() +{ + TRACE_OBJ + m_indexWindow->parentWidget()->hide(); +} + +void MainWindow::setBookmarksVisible(bool visible) +{ + TRACE_OBJ + if (visible) + showBookmarksDockWidget(); + else + hideBookmarksDockWidget(); +} + +void MainWindow::showBookmarksDockWidget() +{ + TRACE_OBJ + activateDockWidget(m_bookmarkWidget); +} + +void MainWindow::hideBookmarksDockWidget() +{ + TRACE_OBJ + m_bookmarkWidget->parentWidget()->hide(); +} + +void MainWindow::setSearchVisible(bool visible) +{ + TRACE_OBJ + if (visible) + showSearch(); + else + hideSearch(); +} + +void MainWindow::showSearch() +{ + TRACE_OBJ + activateDockWidget(m_searchWindow); +} + +void MainWindow::showOpenPages() +{ + TRACE_OBJ + activateDockWidget(OpenPagesManager::instance()->openPagesWidget()); +} + +void MainWindow::hideSearch() +{ + TRACE_OBJ + m_searchWindow->parentWidget()->hide(); +} + +void MainWindow::activateDockWidget(QWidget *w) +{ + TRACE_OBJ + w->parentWidget()->show(); + w->parentWidget()->raise(); + w->setFocus(); +} + +void MainWindow::setIndexString(const QString &str) +{ + TRACE_OBJ + m_indexWindow->setSearchLineEditText(str); +} + +void MainWindow::activateCurrentBrowser() +{ + TRACE_OBJ + CentralWidget::instance()->activateTab(); +} + +void MainWindow::activateCurrentCentralWidgetTab() +{ + TRACE_OBJ + m_centralWidget->activateTab(); +} + +void MainWindow::updateApplicationFont() +{ + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + QFont font = qApp->font(); + if (helpEngine.usesAppFont()) + font = helpEngine.appFont(); + + const QWidgetList &widgets = qApp->allWidgets(); + foreach (QWidget* widget, widgets) + widget->setFont(font); +} + +void MainWindow::setupFilterCombo() +{ + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + QString curFilter = m_filterCombo->currentText(); + if (curFilter.isEmpty()) + curFilter = helpEngine.currentFilter(); + m_filterCombo->clear(); + m_filterCombo->addItems(helpEngine.customFilters()); + int idx = m_filterCombo->findText(curFilter); + if (idx < 0) + idx = 0; + m_filterCombo->setCurrentIndex(idx); +} + +void MainWindow::filterDocumentation(const QString &customFilter) +{ + TRACE_OBJ + HelpEngineWrapper::instance().setCurrentFilter(customFilter); +} + +void MainWindow::expandTOC(int depth) +{ + TRACE_OBJ + Q_ASSERT(depth >= -1); + m_contentWindow->expandToDepth(depth); +} + +void MainWindow::indexingStarted() +{ + TRACE_OBJ + if (!m_progressWidget) { + m_progressWidget = new QWidget(); + QLayout* hlayout = new QHBoxLayout(m_progressWidget); + + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); + + QLabel *label = new QLabel(tr("Updating search index")); + label->setSizePolicy(sizePolicy); + hlayout->addWidget(label); + + QProgressBar *progressBar = new QProgressBar(); + progressBar->setRange(0, 0); + progressBar->setTextVisible(false); + progressBar->setSizePolicy(sizePolicy); + + hlayout->setSpacing(6); + hlayout->setMargin(0); + hlayout->addWidget(progressBar); + + statusBar()->addPermanentWidget(m_progressWidget); + } +} + +void MainWindow::indexingFinished() +{ + TRACE_OBJ + statusBar()->removeWidget(m_progressWidget); + delete m_progressWidget; + m_progressWidget = 0; +} + +QString MainWindow::collectionFileDirectory(bool createDir, const QString &cacheDir) +{ + TRACE_OBJ + QString collectionPath = + QDesktopServices::storageLocation(QDesktopServices::DataLocation); + if (collectionPath.isEmpty()) { + if (cacheDir.isEmpty()) + collectionPath = QDir::homePath() + QDir::separator() + + QLatin1String(".assistant"); + else + collectionPath = QDir::homePath() + QLatin1String("/.") + cacheDir; + } else { + if (cacheDir.isEmpty()) + collectionPath = collectionPath + QLatin1String("/Trolltech/Assistant"); + else + collectionPath = collectionPath + QDir::separator() + cacheDir; + } + collectionPath = QDir::cleanPath(collectionPath); + if (createDir) { + QDir dir; + if (!dir.exists(collectionPath)) + dir.mkpath(collectionPath); + } + return collectionPath; +} + +QString MainWindow::defaultHelpCollectionFileName() +{ + TRACE_OBJ + // forces creation of the default collection file path + return collectionFileDirectory(true) + QDir::separator() + + QString(QLatin1String("qthelpcollection_%1.qhc")). + arg(QLatin1String(QT_VERSION_STR)); +} + +void MainWindow::currentFilterChanged(const QString &filter) +{ + TRACE_OBJ + const int index = m_filterCombo->findText(filter); + Q_ASSERT(index != -1); + m_filterCombo->setCurrentIndex(index); +} + +void MainWindow::documentationRemoved(const QString &namespaceName) +{ + TRACE_OBJ + OpenPagesManager::instance()->closePages(namespaceName); +} + +void MainWindow::documentationUpdated(const QString &namespaceName) +{ + TRACE_OBJ + OpenPagesManager::instance()->reloadPages(namespaceName); +} + +void MainWindow::resetQtDocInfo(const QString &component) +{ + TRACE_OBJ + HelpEngineWrapper::instance().setQtDocInfo(component, + QStringList(QDateTime().toString(Qt::ISODate))); +} + +void MainWindow::registerDocumentation(const QString &component, + const QString &absFileName) +{ + TRACE_OBJ + QString ns = QHelpEngineCore::namespaceName(absFileName); + if (ns.isEmpty()) + return; + + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.registeredDocumentations().contains(ns)) + helpEngine.unregisterDocumentation(ns); + if (!helpEngine.registerDocumentation(absFileName)) { + QMessageBox::warning(this, tr("Qt Assistant"), + tr("Could not register file '%1': %2"). + arg(absFileName).arg(helpEngine.error())); + } else { + QStringList docInfo; + docInfo << QFileInfo(absFileName).lastModified().toString(Qt::ISODate) + << absFileName; + helpEngine.setQtDocInfo(component, docInfo); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/mainwindow.h b/src/assistant/assistant/mainwindow.h new file mode 100644 index 000000000..1ea0bbaf2 --- /dev/null +++ b/src/assistant/assistant/mainwindow.h @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QAction; +class QComboBox; +class QFileSystemWatcher; +class QLineEdit; +class QMenu; + +class CentralWidget; +class CmdLineParser; +class ContentWindow; +class IndexWindow; +class OpenPagesWindow; +class QtDocInstaller; +class QHelpEngineCore; +class QHelpEngine; +class SearchWidget; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(CmdLineParser *cmdLine, QWidget *parent = 0); + ~MainWindow(); + + static void activateCurrentBrowser(); + static QString collectionFileDirectory(bool createDir = false, + const QString &cacheDir = QString()); + static QString defaultHelpCollectionFileName(); + +public: + void setIndexString(const QString &str); + void expandTOC(int depth); + bool usesDefaultCollection() const; + +signals: + void initDone(); + +public slots: + void setContentsVisible(bool visible); + void setIndexVisible(bool visible); + void setBookmarksVisible(bool visible); + void setSearchVisible(bool visible); + void syncContents(); + void activateCurrentCentralWidgetTab(); + void currentFilterChanged(const QString &filter); + +private slots: + void showContents(); + void showIndex(); + void showSearch(); + void showOpenPages(); + void insertLastPages(); + void gotoAddress(); + void showPreferences(); + void showNewAddress(); + void showAboutDialog(); + void showNewAddress(const QUrl &url); + void showTopicChooser(const QMap &links, const QString &keyword); + void updateApplicationFont(); + void filterDocumentation(const QString &customFilter); + void setupFilterCombo(); + void lookForNewQtDocumentation(); + void indexingStarted(); + void indexingFinished(); + void qtDocumentationInstalled(); + void registerDocumentation(const QString &component, + const QString &absFileName); + void resetQtDocInfo(const QString &component); + void checkInitState(); + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + +private: + bool initHelpDB(bool registerInternalDoc); + void setupActions(); + void closeEvent(QCloseEvent *e); + void activateDockWidget(QWidget *w); + void updateAboutMenuText(); + void setupFilterToolbar(); + void setupAddressToolbar(); + QMenu *toolBarMenu(); + void hideContents(); + void hideIndex(); + void hideSearch(); + +private slots: + void showBookmarksDockWidget(); + void hideBookmarksDockWidget(); + +private: + QWidget *m_bookmarkWidget; + +private: + CentralWidget *m_centralWidget; + IndexWindow *m_indexWindow; + ContentWindow *m_contentWindow; + SearchWidget *m_searchWindow; + QLineEdit *m_addressLineEdit; + QComboBox *m_filterCombo; + + QAction *m_syncAction; + QAction *m_printPreviewAction; + QAction *m_pageSetupAction; + QAction *m_resetZoomAction; + QAction *m_aboutAction; + QAction *m_closeTabAction; + QAction *m_newTabAction; + + QMenu *m_viewMenu; + QMenu *m_toolBarMenu; + + CmdLineParser *m_cmdLine; + + QWidget *m_progressWidget; + QtDocInstaller *m_qtDocInstaller; + + bool m_connectedInitSignals; +}; + +QT_END_NAMESPACE + +#endif // MAINWINDOW_H diff --git a/src/assistant/assistant/openpagesmanager.cpp b/src/assistant/assistant/openpagesmanager.cpp new file mode 100644 index 000000000..7bafeeafc --- /dev/null +++ b/src/assistant/assistant/openpagesmanager.cpp @@ -0,0 +1,378 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "openpagesmanager.h" + +#include "centralwidget.h" +#include "helpenginewrapper.h" +#include "helpviewer.h" +#include "openpagesmodel.h" +#include "openpagesswitcher.h" +#include "openpageswidget.h" +#include "tracer.h" +#include "../shared/collectionconfiguration.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +OpenPagesManager *OpenPagesManager::m_instance = 0; + +OpenPagesManager *OpenPagesManager::createInstance(QObject *parent, + bool defaultCollection, const QUrl &cmdLineUrl) +{ + TRACE_OBJ + Q_ASSERT(!m_instance); + m_instance = new OpenPagesManager(parent, defaultCollection, cmdLineUrl); + return m_instance; +} + +OpenPagesManager *OpenPagesManager::instance() +{ + TRACE_OBJ + Q_ASSERT(m_instance); + return m_instance; +} + +OpenPagesManager::OpenPagesManager(QObject *parent, bool defaultCollection, + const QUrl &cmdLineUrl) + : QObject(parent) + , m_model(new OpenPagesModel(this)) + , m_openPagesWidget(0) + , m_openPagesSwitcher(0) +{ + TRACE_OBJ + m_openPagesWidget = new OpenPagesWidget(m_model); + m_openPagesWidget->setFrameStyle(QFrame::NoFrame); + connect(m_openPagesWidget, SIGNAL(setCurrentPage(QModelIndex)), this, + SLOT(setCurrentPage(QModelIndex))); + connect(m_openPagesWidget, SIGNAL(closePage(QModelIndex)), this, + SLOT(closePage(QModelIndex))); + connect(m_openPagesWidget, SIGNAL(closePagesExcept(QModelIndex)), this, + SLOT(closePagesExcept(QModelIndex))); + + m_openPagesSwitcher = new OpenPagesSwitcher(m_model); + connect(m_openPagesSwitcher, SIGNAL(closePage(QModelIndex)), this, + SLOT(closePage(QModelIndex))); + connect(m_openPagesSwitcher, SIGNAL(setCurrentPage(QModelIndex)), this, + SLOT(setCurrentPage(QModelIndex))); + + setupInitialPages(defaultCollection, cmdLineUrl); +} + +OpenPagesManager ::~OpenPagesManager() +{ + TRACE_OBJ + m_instance = 0; + delete m_openPagesSwitcher; +} + +int OpenPagesManager::pageCount() const +{ + TRACE_OBJ + return m_model->rowCount(); +} + +void OpenPagesManager::setupInitialPages(bool defaultCollection, + const QUrl &cmdLineUrl) +{ + TRACE_OBJ + if (cmdLineUrl.isValid()) { + createPage(cmdLineUrl); + return; + } + + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + int initialPage = 0; + switch (helpEngine.startOption()) { + case ShowHomePage: + m_model->addPage(helpEngine.homePage()); + break; + case ShowBlankPage: + m_model->addPage(QUrl(QLatin1String("about:blank"))); + break; + case ShowLastPages: { + const QStringList &lastShownPageList = helpEngine.lastShownPages(); + const int pageCount = lastShownPageList.count(); + if (pageCount == 0) { + if (defaultCollection) + m_model->addPage(QUrl(QLatin1String("help"))); + else + m_model->addPage(QUrl(QLatin1String("about:blank"))); + } else { + QStringList zoomFactors = helpEngine.lastZoomFactors(); + while (zoomFactors.count() < pageCount) + zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); + initialPage = helpEngine.lastTabPage(); + if (initialPage >= pageCount) { + qWarning("Initial page set to %d, maximum possible value is %d", + initialPage, pageCount - 1); + initialPage = 0; + } + for (int curPage = 0; curPage < pageCount; ++curPage) { + const QString &curFile = lastShownPageList.at(curPage); + if (helpEngine.findFile(curFile).isValid() + || curFile == QLatin1String("about:blank")) { + m_model->addPage(curFile, zoomFactors.at(curPage).toFloat()); + } else if (curPage <= initialPage && initialPage > 0) + --initialPage; + } + } + break; + } + default: + Q_ASSERT(!"Unhandled option"); + } + + if (m_model->rowCount() == 0) + m_model->addPage(helpEngine.homePage()); + for (int i = 0; i < m_model->rowCount(); ++i) + CentralWidget::instance()->addPage(m_model->pageAt(i)); + setCurrentPage((initialPage >= m_model->rowCount()) + ? m_model->rowCount() - 1 : initialPage); + m_openPagesSwitcher->selectCurrentPage(); +} + +HelpViewer *OpenPagesManager::createPage() +{ + TRACE_OBJ + return createPage(QUrl(QLatin1String("about:blank"))); +} + +void OpenPagesManager::closeCurrentPage() +{ + TRACE_OBJ + Q_ASSERT(m_model->rowCount() > 1); + const QModelIndexList selectedIndexes + = m_openPagesWidget->selectionModel()->selectedRows(); + if (selectedIndexes.isEmpty()) + return; + Q_ASSERT(selectedIndexes.count() == 1); + removePage(selectedIndexes.first().row()); +} + +HelpViewer *OpenPagesManager::createPage(const QUrl &url, bool fromSearch) +{ + TRACE_OBJ + if (HelpViewer::launchWithExternalApp(url)) + return 0; + + m_model->addPage(url); + const int index = m_model->rowCount() - 1; + HelpViewer * const page = m_model->pageAt(index); + CentralWidget::instance()->addPage(page, fromSearch); + setCurrentPage(index); + return page; +} + +HelpViewer *OpenPagesManager::createNewPageFromSearch(const QUrl &url) +{ + TRACE_OBJ + return createPage(url, true); +} + +void OpenPagesManager::closePage(HelpViewer *viewer) +{ + TRACE_OBJ + for (int i = 0; i < m_model->rowCount(); ++i) { + if (m_model->pageAt(i) == viewer) { + removePage(i); + break; + } + } +} + +void OpenPagesManager::closePage(const QModelIndex &index) +{ + TRACE_OBJ + if (index.isValid()) + removePage(index.row()); +} + +void OpenPagesManager::closePages(const QString &nameSpace) +{ + TRACE_OBJ + closeOrReloadPages(nameSpace, false); +} + +void OpenPagesManager::reloadPages(const QString &nameSpace) +{ + TRACE_OBJ + closeOrReloadPages(nameSpace, true); + m_openPagesWidget->selectCurrentPage(); +} + +void OpenPagesManager::closeOrReloadPages(const QString &nameSpace, bool tryReload) +{ + TRACE_OBJ + for (int i = m_model->rowCount() - 1; i >= 0; --i) { + HelpViewer *page = m_model->pageAt(i); + if (page->source().host() != nameSpace) + continue; + if (tryReload && HelpEngineWrapper::instance().findFile(page->source()).isValid()) + page->reload(); + else if (m_model->rowCount() == 1) + page->setSource(QUrl(QLatin1String("about:blank"))); + else + removePage(i); + } +} + +bool OpenPagesManager::pagesOpenForNamespace(const QString &nameSpace) const +{ + TRACE_OBJ + for (int i = 0; i < m_model->rowCount(); ++i) + if (m_model->pageAt(i)->source().host() == nameSpace) + return true; + return false; +} + +void OpenPagesManager::setCurrentPage(const QModelIndex &index) +{ + TRACE_OBJ + if (index.isValid()) + setCurrentPage(index.row()); +} + +void OpenPagesManager::setCurrentPage(int index) +{ + TRACE_OBJ + setCurrentPage(m_model->pageAt(index)); +} + +void OpenPagesManager::setCurrentPage(HelpViewer *page) +{ + TRACE_OBJ + CentralWidget::instance()->setCurrentPage(page); + m_openPagesWidget->selectCurrentPage(); +} + +void OpenPagesManager::removePage(int index) +{ + TRACE_OBJ + CentralWidget::instance()->removePage(index); + m_model->removePage(index); + m_openPagesWidget->selectCurrentPage(); +} + + +void OpenPagesManager::closePagesExcept(const QModelIndex &index) +{ + TRACE_OBJ + if (!index.isValid()) + return; + + int i = 0; + HelpViewer *viewer = m_model->pageAt(index.row()); + while (m_model->rowCount() > 1) { + if (m_model->pageAt(i) != viewer) + removePage(i); + else + ++i; + } +} + +QAbstractItemView *OpenPagesManager::openPagesWidget() const +{ + TRACE_OBJ + return m_openPagesWidget; +} + +void OpenPagesManager::nextPage() +{ + TRACE_OBJ + nextOrPreviousPage(1); +} + +void OpenPagesManager::nextPageWithSwitcher() +{ + TRACE_OBJ + if (!m_openPagesSwitcher->isVisible()) { + m_openPagesSwitcher->selectCurrentPage(); + m_openPagesSwitcher->gotoNextPage(); + showSwitcherOrSelectPage(); + } else { + m_openPagesSwitcher->gotoNextPage(); + } +} + +void OpenPagesManager::previousPage() +{ + TRACE_OBJ + nextOrPreviousPage(-1); +} + +void OpenPagesManager::previousPageWithSwitcher() +{ + TRACE_OBJ + if (!m_openPagesSwitcher->isVisible()) { + m_openPagesSwitcher->selectCurrentPage(); + m_openPagesSwitcher->gotoPreviousPage(); + showSwitcherOrSelectPage(); + } else { + m_openPagesSwitcher->gotoPreviousPage(); + } +} + +void OpenPagesManager::nextOrPreviousPage(int offset) +{ + TRACE_OBJ + setCurrentPage((CentralWidget::instance()->currentIndex() + offset + + m_model->rowCount()) % m_model->rowCount()); +} + +void OpenPagesManager::showSwitcherOrSelectPage() const +{ + TRACE_OBJ + if (QApplication::keyboardModifiers() != Qt::NoModifier) { + const int width = CentralWidget::instance()->width(); + const int height = CentralWidget::instance()->height(); + const QPoint p(CentralWidget::instance()->mapToGlobal(QPoint(0, 0))); + m_openPagesSwitcher->move((width - m_openPagesSwitcher->width()) / 2 + p.x(), + (height - m_openPagesSwitcher->height()) / 2 + p.y()); + m_openPagesSwitcher->setVisible(true); + } else { + m_openPagesSwitcher->selectAndHide(); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/openpagesmanager.h b/src/assistant/assistant/openpagesmanager.h new file mode 100644 index 000000000..c34686c8c --- /dev/null +++ b/src/assistant/assistant/openpagesmanager.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OPENPAGESMANAGER_H +#define OPENPAGESMANAGER_H + +#include + +QT_BEGIN_NAMESPACE + +class QAbstractItemView; +class QModelIndex; +class QUrl; + +class HelpViewer; +class OpenPagesModel; +class OpenPagesSwitcher; +class OpenPagesWidget; + +class OpenPagesManager : public QObject +{ + Q_OBJECT +public: + static OpenPagesManager *createInstance(QObject *parent, + bool defaultCollection, const QUrl &cmdLineUrl); + static OpenPagesManager *instance(); + + bool pagesOpenForNamespace(const QString &nameSpace) const; + void closePages(const QString &nameSpace); + void reloadPages(const QString &nameSpace); + + QAbstractItemView* openPagesWidget() const; + + int pageCount() const; + void setCurrentPage(int index); + +public slots: + HelpViewer *createPage(const QUrl &url, bool fromSearch = false); + HelpViewer *createNewPageFromSearch(const QUrl &url); + HelpViewer *createPage(); + void closeCurrentPage(); + + void nextPage(); + void nextPageWithSwitcher(); + void previousPage(); + void previousPageWithSwitcher(); + + void closePage(HelpViewer *page); + void setCurrentPage(HelpViewer *page); + +private slots: + void setCurrentPage(const QModelIndex &index); + void closePage(const QModelIndex &index); + void closePagesExcept(const QModelIndex &index); + +private: + OpenPagesManager(QObject *parent, bool defaultCollection, + const QUrl &cmdLineUrl); + ~OpenPagesManager(); + + void setupInitialPages(bool defaultCollection, const QUrl &cmdLineUrl); + void closeOrReloadPages(const QString &nameSpace, bool tryReload); + void removePage(int index); + + void nextOrPreviousPage(int offset); + void showSwitcherOrSelectPage() const; + + OpenPagesModel *m_model; + OpenPagesWidget *m_openPagesWidget; + OpenPagesSwitcher *m_openPagesSwitcher; + + static OpenPagesManager *m_instance; +}; + +QT_END_NAMESPACE + +#endif // OPENPAGESMANAGER_H diff --git a/src/assistant/assistant/openpagesmodel.cpp b/src/assistant/assistant/openpagesmodel.cpp new file mode 100644 index 000000000..3517693f9 --- /dev/null +++ b/src/assistant/assistant/openpagesmodel.cpp @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "openpagesmodel.h" + +#include "helpenginewrapper.h" +#include "helpviewer.h" +#include "tracer.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +OpenPagesModel::OpenPagesModel(QObject *parent) : QAbstractTableModel(parent) +{ + TRACE_OBJ +} + +int OpenPagesModel::rowCount(const QModelIndex &parent) const +{ + TRACE_OBJ + return parent.isValid() ? 0 : m_pages.count(); +} + +int OpenPagesModel::columnCount(const QModelIndex &/*parent*/) const +{ + TRACE_OBJ + return 2; +} + +QVariant OpenPagesModel::data(const QModelIndex &index, int role) const +{ + TRACE_OBJ + if (!index.isValid() || index.row() >= rowCount() || index.column() > 0 + || role != Qt::DisplayRole) + return QVariant(); + QString title = m_pages.at(index.row())->title(); + title.replace(QLatin1Char('&'), QLatin1String("&&")); + return title.isEmpty() ? QLatin1String("(Untitled)") : title; +} + +void OpenPagesModel::addPage(const QUrl &url, qreal zoom) +{ + TRACE_OBJ + beginInsertRows(QModelIndex(), rowCount(), rowCount()); + HelpViewer *page = new HelpViewer(zoom); + connect(page, SIGNAL(titleChanged()), this, SLOT(handleTitleChanged())); + m_pages << page; + endInsertRows(); + page->setSource(url); +} + +void OpenPagesModel::removePage(int index) +{ + TRACE_OBJ + Q_ASSERT(index >= 0 && index < rowCount()); + beginRemoveRows(QModelIndex(), index, index); + HelpViewer *page = m_pages.at(index); + m_pages.removeAt(index); + endRemoveRows(); + page->deleteLater(); +} + +HelpViewer *OpenPagesModel::pageAt(int index) const +{ + TRACE_OBJ + Q_ASSERT(index >= 0 && index < rowCount()); + return m_pages.at(index); +} + +void OpenPagesModel::handleTitleChanged() +{ + TRACE_OBJ + HelpViewer *page = static_cast(sender()); + const int row = m_pages.indexOf(page); + Q_ASSERT(row != -1 ); + const QModelIndex &item = index(row, 0); + emit dataChanged(item, item); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/openpagesmodel.h b/src/assistant/assistant/openpagesmodel.h new file mode 100644 index 000000000..dd28a7c5f --- /dev/null +++ b/src/assistant/assistant/openpagesmodel.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OPENPAGESMODEL_H +#define OPENPAGESMODEL_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class HelpViewer; +class QUrl; + +class OpenPagesModel : public QAbstractTableModel +{ + Q_OBJECT +public: + OpenPagesModel(QObject *parent); + + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; + virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + + void addPage(const QUrl &url, qreal zoom = 0); + void removePage(int index); + HelpViewer *pageAt(int index) const; + +private slots: + void handleTitleChanged(); + +private: + QList m_pages; +}; + +QT_END_NAMESPACE + +#endif // OPENPAGESMODEL_H diff --git a/src/assistant/assistant/openpagesswitcher.cpp b/src/assistant/assistant/openpagesswitcher.cpp new file mode 100644 index 000000000..b1f70d784 --- /dev/null +++ b/src/assistant/assistant/openpagesswitcher.cpp @@ -0,0 +1,194 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "openpagesswitcher.h" + +#include "centralwidget.h" +#include "openpagesmodel.h" +#include "openpageswidget.h" +#include "tracer.h" + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +const int gWidth = 300; +const int gHeight = 200; + +OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model) + : QFrame(0, Qt::Popup) + , m_openPagesModel(model) +{ + TRACE_OBJ + resize(gWidth, gHeight); + + m_openPagesWidget = new OpenPagesWidget(m_openPagesModel); + + // We disable the frame on this list view and use a QFrame around it instead. + // This improves the look with QGTKStyle. +#ifndef Q_WS_MAC + setFrameStyle(m_openPagesWidget->frameStyle()); +#endif + m_openPagesWidget->setFrameStyle(QFrame::NoFrame); + + m_openPagesWidget->allowContextMenu(false); + m_openPagesWidget->installEventFilter(this); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setMargin(0); + layout->addWidget(m_openPagesWidget); + + connect(m_openPagesWidget, SIGNAL(closePage(QModelIndex)), this, + SIGNAL(closePage(QModelIndex))); + connect(m_openPagesWidget, SIGNAL(setCurrentPage(QModelIndex)), this, + SIGNAL(setCurrentPage(QModelIndex))); +} + +OpenPagesSwitcher::~OpenPagesSwitcher() +{ + TRACE_OBJ +} + +void OpenPagesSwitcher::gotoNextPage() +{ + TRACE_OBJ + selectPageUpDown(1); +} + +void OpenPagesSwitcher::gotoPreviousPage() +{ + TRACE_OBJ + selectPageUpDown(-1); +} + +void OpenPagesSwitcher::selectAndHide() +{ + TRACE_OBJ + setVisible(false); + emit setCurrentPage(m_openPagesWidget->currentIndex()); +} + +void OpenPagesSwitcher::selectCurrentPage() +{ + TRACE_OBJ + m_openPagesWidget->selectCurrentPage(); +} + +void OpenPagesSwitcher::setVisible(bool visible) +{ + TRACE_OBJ + QWidget::setVisible(visible); + if (visible) + setFocus(); +} + +void OpenPagesSwitcher::focusInEvent(QFocusEvent *event) +{ + TRACE_OBJ + Q_UNUSED(event) + m_openPagesWidget->setFocus(); +} + +bool OpenPagesSwitcher::eventFilter(QObject *object, QEvent *event) +{ + TRACE_OBJ + if (object == m_openPagesWidget) { + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + if (ke->key() == Qt::Key_Escape) { + setVisible(false); + return true; + } + + const int key = ke->key(); + if (key == Qt::Key_Return || key == Qt::Key_Enter || key == Qt::Key_Space) { + emit setCurrentPage(m_openPagesWidget->currentIndex()); + return true; + } + + Qt::KeyboardModifier modifier = Qt::ControlModifier; +#ifdef Q_WS_MAC + modifier = Qt::AltModifier; +#endif + if (key == Qt::Key_Backtab + && (ke->modifiers() == (modifier | Qt::ShiftModifier))) + gotoPreviousPage(); + else if (key == Qt::Key_Tab && (ke->modifiers() == modifier)) + gotoNextPage(); + } else if (event->type() == QEvent::KeyRelease) { + QKeyEvent *ke = static_cast(event); + if (ke->modifiers() == 0 + /*HACK this is to overcome some event inconsistencies between platforms*/ + || (ke->modifiers() == Qt::AltModifier + && (ke->key() == Qt::Key_Alt || ke->key() == -1))) { + selectAndHide(); + } + } + } + return QWidget::eventFilter(object, event); +} + +void OpenPagesSwitcher::selectPageUpDown(int summand) +{ + TRACE_OBJ + const int pageCount = m_openPagesModel->rowCount(); + if (pageCount < 2) + return; + + const QModelIndexList &list = m_openPagesWidget->selectionModel()->selectedIndexes(); + if (list.isEmpty()) + return; + + QModelIndex index = list.first(); + if (!index.isValid()) + return; + + index = m_openPagesModel->index((index.row() + summand + pageCount) % pageCount, 0); + if (index.isValid()) { + m_openPagesWidget->setCurrentIndex(index); + m_openPagesWidget->scrollTo(index, QAbstractItemView::PositionAtCenter); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/openpagesswitcher.h b/src/assistant/assistant/openpagesswitcher.h new file mode 100644 index 000000000..c3e3a33ce --- /dev/null +++ b/src/assistant/assistant/openpagesswitcher.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OPENPAGESSWITCHER_H +#define OPENPAGESSWITCHER_H + +#include + +QT_BEGIN_NAMESPACE + +class OpenPagesModel; +class OpenPagesWidget; +class QModelIndex; + +class OpenPagesSwitcher : public QFrame +{ + Q_OBJECT + +public: + OpenPagesSwitcher(OpenPagesModel *model); + ~OpenPagesSwitcher(); + + void gotoNextPage(); + void gotoPreviousPage(); + + void selectAndHide(); + void selectCurrentPage(); + + void setVisible(bool visible); + void focusInEvent(QFocusEvent *event); + bool eventFilter(QObject *object, QEvent *event); + +signals: + void closePage(const QModelIndex &index); + void setCurrentPage(const QModelIndex &index); + +private: + void selectPageUpDown(int summand); + +private: + OpenPagesModel *m_openPagesModel; + OpenPagesWidget *m_openPagesWidget; +}; + +QT_END_NAMESPACE + +#endif // OPENPAGESSWITCHER_H diff --git a/src/assistant/assistant/openpageswidget.cpp b/src/assistant/assistant/openpageswidget.cpp new file mode 100644 index 000000000..6947c312c --- /dev/null +++ b/src/assistant/assistant/openpageswidget.cpp @@ -0,0 +1,237 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "openpageswidget.h" + +#include "centralwidget.h" +#include "openpagesmodel.h" +#include "tracer.h" + +#include +#include +#include +#include +#include +#include + +#ifdef Q_WS_MAC +#include +#endif + +QT_BEGIN_NAMESPACE + +OpenPagesDelegate::OpenPagesDelegate(QObject *parent) + : QStyledItemDelegate(parent) +{ + TRACE_OBJ +} + +void OpenPagesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + TRACE_OBJ + if (option.state & QStyle::State_MouseOver) { + if ((QApplication::mouseButtons() & Qt::LeftButton) == 0) + pressedIndex = QModelIndex(); + QBrush brush = option.palette.alternateBase(); + if (index == pressedIndex) + brush = option.palette.dark(); + painter->fillRect(option.rect, brush); + } + + QStyledItemDelegate::paint(painter, option, index); + + if (index.column() == 1 && index.model()->rowCount() > 1 + && option.state & QStyle::State_MouseOver) { + QIcon icon((option.state & QStyle::State_Selected) + ? ":/trolltech/assistant/images/closebutton.png" + : ":/trolltech/assistant/images/darkclosebutton.png"); + + const QRect iconRect(option.rect.right() - option.rect.height(), + option.rect.top(), option.rect.height(), option.rect.height()); + icon.paint(painter, iconRect, Qt::AlignRight | Qt::AlignVCenter); + } +} + +// -- OpenPagesWidget + +OpenPagesWidget::OpenPagesWidget(OpenPagesModel *model) + : m_allowContextMenu(true) +{ + TRACE_OBJ + setModel(model); + setIndentation(0); + setItemDelegate((m_delegate = new OpenPagesDelegate(this))); + + setTextElideMode(Qt::ElideMiddle); + setAttribute(Qt::WA_MacShowFocusRect, false); + + viewport()->setAttribute(Qt::WA_Hover); + setSelectionBehavior(QAbstractItemView::SelectRows); + setSelectionMode(QAbstractItemView::SingleSelection); + + header()->hide(); + header()->setStretchLastSection(false); + header()->setResizeMode(0, QHeaderView::Stretch); + header()->setResizeMode(1, QHeaderView::Fixed); + header()->resizeSection(1, 18); + + installEventFilter(this); + setUniformRowHeights(true); + setContextMenuPolicy(Qt::CustomContextMenu); + + connect(this, SIGNAL(clicked(QModelIndex)), this, + SLOT(handleClicked(QModelIndex))); + connect(this, SIGNAL(pressed(QModelIndex)), this, + SLOT(handlePressed(QModelIndex))); + connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(contextMenuRequested(QPoint))); +} + +OpenPagesWidget::~OpenPagesWidget() +{ + TRACE_OBJ +} + +void OpenPagesWidget::selectCurrentPage() +{ + TRACE_OBJ + const QModelIndex ¤t = + model()->index(CentralWidget::instance()->currentIndex(), 0); + + QItemSelectionModel * const selModel = selectionModel(); + selModel->select(current, + QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + selModel->clearSelection(); + + setCurrentIndex(current); + scrollTo(currentIndex()); +} + +void OpenPagesWidget::allowContextMenu(bool ok) +{ + TRACE_OBJ + m_allowContextMenu = ok; +} + +void OpenPagesWidget::contextMenuRequested(QPoint pos) +{ + TRACE_OBJ + QModelIndex index = indexAt(pos); + if (!index.isValid() || !m_allowContextMenu) + return; + + if (index.column() == 1) + index = index.sibling(index.row(), 0); + QMenu contextMenu; + QAction *closeEditor = contextMenu.addAction(tr("Close %1").arg(index.data() + .toString())); + QAction *closeOtherEditors = contextMenu.addAction(tr("Close All Except %1") + .arg(index.data().toString())); + + if (model()->rowCount() == 1) { + closeEditor->setEnabled(false); + closeOtherEditors->setEnabled(false); + } + + QAction *action = contextMenu.exec(mapToGlobal(pos)); + if (action == closeEditor) + emit closePage(index); + else if (action == closeOtherEditors) + emit closePagesExcept(index); +} + +void OpenPagesWidget::handlePressed(const QModelIndex &index) +{ + TRACE_OBJ + if (index.column() == 0) + emit setCurrentPage(index); + + if (index.column() == 1) + m_delegate->pressedIndex = index; +} + +void OpenPagesWidget::handleClicked(const QModelIndex &index) +{ + TRACE_OBJ + // implemented here to handle the funky close button and to work around a + // bug in item views where the delegate wouldn't get the QStyle::State_MouseOver + if (index.column() == 1) { + if (model()->rowCount() > 1) + emit closePage(index); + + QWidget *vp = viewport(); + const QPoint &cursorPos = QCursor::pos(); + QMouseEvent e(QEvent::MouseMove, vp->mapFromGlobal(cursorPos), cursorPos, + Qt::NoButton, 0, 0); + QCoreApplication::sendEvent(vp, &e); + } +} + +bool OpenPagesWidget::eventFilter(QObject *obj, QEvent *event) +{ + TRACE_OBJ + if (obj != this) + return QWidget::eventFilter(obj, event); + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + if (currentIndex().isValid() && ke->modifiers() == 0) { + const int key = ke->key(); + if (key == Qt::Key_Return || key == Qt::Key_Enter + || key == Qt::Key_Space) { + emit setCurrentPage(currentIndex()); + } else if ((key == Qt::Key_Delete || key == Qt::Key_Backspace) + && model()->rowCount() > 1) { + emit closePage(currentIndex()); + } + } + } else if (event->type() == QEvent::KeyRelease) { + QKeyEvent *ke = static_cast(event); + if (ke->modifiers() == 0 + && (ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down)) { + emit setCurrentPage(currentIndex()); + } + } + return QWidget::eventFilter(obj, event); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/openpageswidget.h b/src/assistant/assistant/openpageswidget.h new file mode 100644 index 000000000..e629e4ffe --- /dev/null +++ b/src/assistant/assistant/openpageswidget.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Assistant module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OPENPAGESWIDGET_H +#define OPENPAGESWIDGET_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class OpenPagesModel; + +class OpenPagesDelegate : public QStyledItemDelegate +{ + Q_OBJECT +public: + explicit OpenPagesDelegate(QObject *parent = 0); + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const; + + mutable QModelIndex pressedIndex; +}; + +class OpenPagesWidget : public QTreeView +{ + Q_OBJECT +public: + OpenPagesWidget(OpenPagesModel *model); + ~OpenPagesWidget(); + + void selectCurrentPage(); + void allowContextMenu(bool ok); + +signals: + void setCurrentPage(const QModelIndex &index); + void closePage(const QModelIndex &index); + void closePagesExcept(const QModelIndex &index); + +private slots: + void contextMenuRequested(QPoint pos); + void handlePressed(const QModelIndex &index); + void handleClicked(const QModelIndex &index); + +private: + bool eventFilter(QObject *obj, QEvent *event); + + bool m_allowContextMenu; + OpenPagesDelegate *m_delegate; +}; + +QT_END_NAMESPACE + +#endif // OPENPAGESWIDGET_H diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp new file mode 100644 index 000000000..64fc3c42d --- /dev/null +++ b/src/assistant/assistant/preferencesdialog.cpp @@ -0,0 +1,507 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "preferencesdialog.h" + +#include "centralwidget.h" +#include "filternamedialog.h" +#include "fontpanel.h" +#include "helpenginewrapper.h" +#include "installdialog.h" +#include "openpagesmanager.h" +#include "tracer.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +PreferencesDialog::PreferencesDialog(QWidget *parent) + : QDialog(parent) + , m_appFontChanged(false) + , m_browserFontChanged(false) + , helpEngine(HelpEngineWrapper::instance()) +{ + TRACE_OBJ + m_ui.setupUi(this); + + connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), + this, SLOT(applyChanges())); + connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), + this, SLOT(reject())); + + m_hideFiltersTab = !helpEngine.filterFunctionalityEnabled(); + m_hideDocsTab = !helpEngine.documentationManagerEnabled(); + + if (!m_hideFiltersTab) { + m_ui.attributeWidget->header()->hide(); + m_ui.attributeWidget->setRootIsDecorated(false); + + connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), + this, SLOT(updateFilterMap())); + + connect(m_ui.filterWidget, + SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, + SLOT(updateAttributes(QListWidgetItem*))); + + connect(m_ui.filterAddButton, SIGNAL(clicked()), this, + SLOT(addFilter())); + connect(m_ui.filterRemoveButton, SIGNAL(clicked()), this, + SLOT(removeFilter())); + + updateFilterPage(); + } else { + m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.filtersTab)); + } + + if (!m_hideDocsTab) { + connect(m_ui.docAddButton, SIGNAL(clicked()), this, + SLOT(addDocumentationLocal())); + connect(m_ui.docRemoveButton, SIGNAL(clicked()), this, + SLOT(removeDocumentation())); + + m_docsBackup = helpEngine.registeredDocumentations(); + m_ui.registeredDocsListWidget->addItems(m_docsBackup); + } else { + m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab)); + } + + updateFontSettingsPage(); + updateOptionsPage(); + + if (helpEngine.usesAppFont()) + setFont(helpEngine.appFont()); +} + +PreferencesDialog::~PreferencesDialog() +{ + TRACE_OBJ + if (m_appFontChanged) { + helpEngine.setAppFont(m_appFontPanel->selectedFont()); + helpEngine.setUseAppFont(m_appFontPanel->isChecked()); + helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem()); + emit updateApplicationFont(); + } + + if (m_browserFontChanged) { + helpEngine.setBrowserFont(m_browserFontPanel->selectedFont()); + helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked()); + helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem()); + emit updateBrowserFont(); + } + + QString homePage = m_ui.homePageLineEdit->text(); + if (homePage.isEmpty()) + homePage = QLatin1String("help"); + helpEngine.setHomePage(homePage); + + int option = m_ui.helpStartComboBox->currentIndex(); + helpEngine.setStartOption(option); +} + +void PreferencesDialog::showDialog() +{ + TRACE_OBJ + if (exec() != Accepted) + m_appFontChanged = m_browserFontChanged = false; +} + +void PreferencesDialog::updateFilterPage() +{ + TRACE_OBJ + m_ui.filterWidget->clear(); + m_ui.attributeWidget->clear(); + + m_filterMapBackup.clear(); + const QStringList &filters = helpEngine.customFilters(); + foreach (const QString &filter, filters) { + if (filter == HelpEngineWrapper::TrUnfiltered) + continue; + QStringList atts = helpEngine.filterAttributes(filter); + m_filterMapBackup.insert(filter, atts); + if (!m_filterMap.contains(filter)) + m_filterMap.insert(filter, atts); + } + + m_ui.filterWidget->addItems(m_filterMap.keys()); + + foreach (const QString &a, helpEngine.filterAttributes()) + new QTreeWidgetItem(m_ui.attributeWidget, QStringList() << a); + + if (!m_filterMap.keys().isEmpty()) + m_ui.filterWidget->setCurrentRow(0); +} + +void PreferencesDialog::updateAttributes(QListWidgetItem *item) +{ + TRACE_OBJ + QStringList checkedList; + if (item) + checkedList = m_filterMap.value(item->text()); + QTreeWidgetItem *itm; + for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { + itm = m_ui.attributeWidget->topLevelItem(i); + if (checkedList.contains(itm->text(0))) + itm->setCheckState(0, Qt::Checked); + else + itm->setCheckState(0, Qt::Unchecked); + } +} + +void PreferencesDialog::updateFilterMap() +{ + TRACE_OBJ + if (!m_ui.filterWidget->currentItem()) + return; + QString filter = m_ui.filterWidget->currentItem()->text(); + if (!m_filterMap.contains(filter)) + return; + + QStringList newAtts; + QTreeWidgetItem *itm = 0; + for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { + itm = m_ui.attributeWidget->topLevelItem(i); + if (itm->checkState(0) == Qt::Checked) + newAtts.append(itm->text(0)); + } + m_filterMap[filter] = newAtts; +} + +void PreferencesDialog::addFilter() +{ + TRACE_OBJ + FilterNameDialog dia(this); + if (dia.exec() == QDialog::Rejected) + return; + + QString filterName = dia.filterName(); + if (!m_filterMap.contains(filterName)) { + m_filterMap.insert(filterName, QStringList()); + m_ui.filterWidget->addItem(filterName); + } + + QList lst = m_ui.filterWidget + ->findItems(filterName, Qt::MatchCaseSensitive); + m_ui.filterWidget->setCurrentItem(lst.first()); +} + +void PreferencesDialog::removeFilter() +{ + TRACE_OBJ + QListWidgetItem *item = + m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow()); + if (!item) + return; + + m_filterMap.remove(item->text()); + m_removedFilters.append(item->text()); + delete item; + if (m_ui.filterWidget->count()) + m_ui.filterWidget->setCurrentRow(0); +} + +void PreferencesDialog::addDocumentationLocal() +{ + TRACE_OBJ + const QStringList fileNames = QFileDialog::getOpenFileNames(this, + tr("Add Documentation"), QString(), tr("Qt Compressed Help Files (*.qch)")); + if (fileNames.isEmpty()) + return; + + QStringList invalidFiles; + QStringList alreadyRegistered; + foreach (const QString &fileName, fileNames) { + const QString nameSpace = QHelpEngineCore::namespaceName(fileName); + if (nameSpace.isEmpty()) { + invalidFiles.append(fileName); + continue; + } + + if (m_ui.registeredDocsListWidget->findItems(nameSpace, + Qt::MatchFixedString).count()) { + alreadyRegistered.append(nameSpace); + continue; + } + + if (helpEngine.registerDocumentation(fileName)) { + m_ui.registeredDocsListWidget->addItem(nameSpace); + m_regDocs.append(nameSpace); + m_unregDocs.removeAll(nameSpace); + } + } + + if (!invalidFiles.isEmpty() || !alreadyRegistered.isEmpty()) { + QString message; + if (!alreadyRegistered.isEmpty()) { + foreach (const QString &ns, alreadyRegistered) { + message += tr("The namespace %1 is already registered!") + .arg(QString("%1").arg(ns)) + QLatin1String("
"); + } + if (!invalidFiles.isEmpty()) + message.append(QLatin1String("
")); + } + + if (!invalidFiles.isEmpty()) { + message += tr("The specified file is not a valid Qt Help File!"); + message.append(QLatin1String("
    ")); + foreach (const QString &file, invalidFiles) + message += QLatin1String("
  • ") + file + QLatin1String("
  • "); + message.append(QLatin1String("
")); + } + QMessageBox::warning(this, tr("Add Documentation"), message); + } + + updateFilterPage(); +} + +void PreferencesDialog::removeDocumentation() +{ + TRACE_OBJ + + bool foundBefore = false; + QList l = m_ui.registeredDocsListWidget->selectedItems(); + foreach (QListWidgetItem* item, l) { + const QString& ns = item->text(); + if (!foundBefore && OpenPagesManager::instance()->pagesOpenForNamespace(ns)) { + if (0 == QMessageBox::information(this, tr("Remove Documentation"), + tr("Some documents currently opened in Assistant reference the " + "documentation you are attempting to remove. Removing the " + "documentation will close those documents."), tr("Cancel"), + tr("OK"))) return; + foundBefore = true; + } + + m_unregDocs.append(ns); + delete m_ui.registeredDocsListWidget->takeItem( + m_ui.registeredDocsListWidget->row(item)); + } + + if (m_ui.registeredDocsListWidget->count()) { + m_ui.registeredDocsListWidget->setCurrentRow(0, + QItemSelectionModel::ClearAndSelect); + } +} + +void PreferencesDialog::applyChanges() +{ + TRACE_OBJ + bool filtersWereChanged = false; + if (!m_hideFiltersTab) { + if (m_filterMap.count() != m_filterMapBackup.count()) { + filtersWereChanged = true; + } else { + QMapIterator it(m_filterMapBackup); + while (it.hasNext() && !filtersWereChanged) { + it.next(); + if (!m_filterMap.contains(it.key())) { + filtersWereChanged = true; + } else { + QStringList a = it.value(); + QStringList b = m_filterMap.value(it.key()); + if (a.count() != b.count()) { + filtersWereChanged = true; + } else { + QStringList::const_iterator i(a.constBegin()); + while (i != a.constEnd()) { + if (!b.contains(*i)) { + filtersWereChanged = true; + break; + } + ++i; + } + } + } + } + } + } + + if (filtersWereChanged) { + foreach (const QString &filter, m_removedFilters) + helpEngine.removeCustomFilter(filter); + QMapIterator it(m_filterMap); + while (it.hasNext()) { + it.next(); + helpEngine.addCustomFilter(it.key(), it.value()); + } + } + + foreach (const QString &doc, m_unregDocs) { + OpenPagesManager::instance()->closePages(doc); + helpEngine.unregisterDocumentation(doc); + } + + if (filtersWereChanged || !m_regDocs.isEmpty() || !m_unregDocs.isEmpty()) + helpEngine.setupData(); + + helpEngine.setShowTabs(m_ui.showTabs->isChecked()); + if (m_showTabs != m_ui.showTabs->isChecked()) + emit updateUserInterface(); + + accept(); +} + +void PreferencesDialog::updateFontSettingsPage() +{ + TRACE_OBJ + m_browserFontPanel = new FontPanel(this); + m_browserFontPanel->setCheckable(true); + m_ui.stackedWidget_2->insertWidget(0, m_browserFontPanel); + + m_appFontPanel = new FontPanel(this); + m_appFontPanel->setCheckable(true); + m_ui.stackedWidget_2->insertWidget(1, m_appFontPanel); + + m_ui.stackedWidget_2->setCurrentIndex(0); + + const QString customSettings(tr("Use custom settings")); + m_appFontPanel->setTitle(customSettings); + + QFont font = helpEngine.appFont(); + m_appFontPanel->setSelectedFont(font); + + QFontDatabase::WritingSystem system = helpEngine.appWritingSystem(); + m_appFontPanel->setWritingSystem(system); + + m_appFontPanel->setChecked(helpEngine.usesAppFont()); + + m_browserFontPanel->setTitle(customSettings); + + font = helpEngine.browserFont(); + m_browserFontPanel->setSelectedFont(font); + + system = helpEngine.browserWritingSystem(); + m_browserFontPanel->setWritingSystem(system); + + m_browserFontPanel->setChecked(helpEngine.usesBrowserFont()); + + connect(m_appFontPanel, SIGNAL(toggled(bool)), this, + SLOT(appFontSettingToggled(bool))); + connect(m_browserFontPanel, SIGNAL(toggled(bool)), this, + SLOT(browserFontSettingToggled(bool))); + + QList allCombos = m_appFontPanel->findChildren(); + foreach (QComboBox* box, allCombos) { + connect(box, SIGNAL(currentIndexChanged(int)), this, + SLOT(appFontSettingChanged(int))); + } + + allCombos = m_browserFontPanel->findChildren(); + foreach (QComboBox* box, allCombos) { + connect(box, SIGNAL(currentIndexChanged(int)), this, + SLOT(browserFontSettingChanged(int))); + } +} + +void PreferencesDialog::appFontSettingToggled(bool on) +{ + TRACE_OBJ + Q_UNUSED(on) + m_appFontChanged = true; +} + +void PreferencesDialog::appFontSettingChanged(int index) +{ + TRACE_OBJ + Q_UNUSED(index) + m_appFontChanged = true; +} + +void PreferencesDialog::browserFontSettingToggled(bool on) +{ + TRACE_OBJ + Q_UNUSED(on) + m_browserFontChanged = true; +} + +void PreferencesDialog::browserFontSettingChanged(int index) +{ + TRACE_OBJ + Q_UNUSED(index) + m_browserFontChanged = true; +} + +void PreferencesDialog::updateOptionsPage() +{ + TRACE_OBJ + m_ui.homePageLineEdit->setText(helpEngine.homePage()); + + int option = helpEngine.startOption(); + m_ui.helpStartComboBox->setCurrentIndex(option); + + m_showTabs = helpEngine.showTabs(); + m_ui.showTabs->setChecked(m_showTabs); + + connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); + connect(m_ui.currentPageButton, SIGNAL(clicked()), this, SLOT(setCurrentPage())); + connect(m_ui.defaultPageButton, SIGNAL(clicked()), this, SLOT(setDefaultPage())); +} + +void PreferencesDialog::setBlankPage() +{ + TRACE_OBJ + m_ui.homePageLineEdit->setText(QLatin1String("about:blank")); +} + +void PreferencesDialog::setCurrentPage() +{ + TRACE_OBJ + QString homepage = CentralWidget::instance()->currentSource().toString(); + if (homepage.isEmpty()) + homepage = QLatin1String("help"); + + m_ui.homePageLineEdit->setText(homepage); +} + +void PreferencesDialog::setDefaultPage() +{ + TRACE_OBJ + m_ui.homePageLineEdit->setText(helpEngine.defaultHomePage()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/preferencesdialog.h b/src/assistant/assistant/preferencesdialog.h new file mode 100644 index 000000000..04bfcf8c3 --- /dev/null +++ b/src/assistant/assistant/preferencesdialog.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef PREFERENCESDIALOG_H +#define PREFERENCESDIALOG_H + +#include +#include "ui_preferencesdialog.h" + +QT_BEGIN_NAMESPACE + +class FontPanel; +class HelpEngineWrapper; +class QFileSystemWatcher; + +class PreferencesDialog : public QDialog +{ + Q_OBJECT + +public: + PreferencesDialog(QWidget *parent = 0); + ~PreferencesDialog(); + + void showDialog(); + +private slots: + void updateAttributes(QListWidgetItem *item); + void updateFilterMap(); + void addFilter(); + void removeFilter(); + void addDocumentationLocal(); + void removeDocumentation(); + void applyChanges(); + void appFontSettingToggled(bool on); + void appFontSettingChanged(int index); + void browserFontSettingToggled(bool on); + void browserFontSettingChanged(int index); + + void setBlankPage(); + void setCurrentPage(); + void setDefaultPage(); + +signals: + void updateBrowserFont(); + void updateApplicationFont(); + void updateUserInterface(); + +private: + void updateFilterPage(); + void updateFontSettingsPage(); + void updateOptionsPage(); + + Ui::PreferencesDialogClass m_ui; + bool m_hideFiltersTab; + bool m_hideDocsTab; + QMap m_filterMapBackup; + QMap m_filterMap; + QStringList m_removedFilters; + QStringList m_docsBackup; + QStringList m_regDocs; + QStringList m_unregDocs; + FontPanel *m_appFontPanel; + FontPanel *m_browserFontPanel; + bool m_appFontChanged; + bool m_browserFontChanged; + HelpEngineWrapper &helpEngine; + bool m_showTabs; +}; + +QT_END_NAMESPACE + +#endif // SETTINGSDIALOG_H diff --git a/src/assistant/assistant/preferencesdialog.ui b/src/assistant/assistant/preferencesdialog.ui new file mode 100644 index 000000000..1c6833ad9 --- /dev/null +++ b/src/assistant/assistant/preferencesdialog.ui @@ -0,0 +1,400 @@ + + + PreferencesDialogClass + + + + 0 + 0 + 375 + 275 + + + + Preferences + + + + + + 0 + + + + Fonts + + + + + + + + + 0 + 0 + + + + Font settings: + + + + + + + + Browser + + + + + Application + + + + + + + + + + 0 + + + + + + + + + Filters + + + + + + Filter: + + + + + + + QFrame::NoFrame + + + Attributes: + + + + + + + + + + + 1 + + + + + + + + Add + + + + + + + Remove + + + + + + + + Documentation + + + + + + Registered Documentation: + + + + + + + 6 + + + 0 + + + + + QAbstractItemView::ExtendedSelection + + + + + + + 6 + + + 0 + + + + + Add... + + + + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + Options + + + + + + + + + + + + + 0 + 0 + + + + On help start: + + + + + + + + 0 + 0 + + + + + Show my home page + + + + + Show a blank page + + + + + Show my tabs from last session + + + + + + + + Qt::Horizontal + + + + 54 + 20 + + + + + + + + + + + + + + + + + + + Homepage + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Current Page + + + + + + + Blank Page + + + + + + + Restore to default + + + + + + + + + + + + Appearance + + + + + + Show tabs for each individual page + + + + + + + + + + Qt::Vertical + + + + 20 + 72 + + + + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + comboBox + currentIndexChanged(int) + stackedWidget_2 + setCurrentIndex(int) + + + 375 + 32 + + + 347 + 125 + + + + + diff --git a/src/assistant/assistant/qtdocinstaller.cpp b/src/assistant/assistant/qtdocinstaller.cpp new file mode 100644 index 000000000..ffe352c87 --- /dev/null +++ b/src/assistant/assistant/qtdocinstaller.cpp @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include +#include +#include +#include +#include +#include "helpenginewrapper.h" +#include "qtdocinstaller.h" + +QT_BEGIN_NAMESPACE + +QtDocInstaller::QtDocInstaller(const QList &docInfos) + : m_abort(false), m_docInfos(docInfos) +{ + TRACE_OBJ +} + +QtDocInstaller::~QtDocInstaller() +{ + TRACE_OBJ + if (!isRunning()) + return; + m_mutex.lock(); + m_abort = true; + m_mutex.unlock(); + wait(); +} + +void QtDocInstaller::installDocs() +{ + TRACE_OBJ + start(LowPriority); +} + +void QtDocInstaller::run() +{ + TRACE_OBJ + m_qchDir = QLibraryInfo::location(QLibraryInfo::DocumentationPath) + + QDir::separator() + QLatin1String("qch"); + m_qchFiles = m_qchDir.entryList(QStringList() << QLatin1String("*.qch")); + + bool changes = false; + foreach (const DocInfo &docInfo, m_docInfos) { + changes |= installDoc(docInfo); + m_mutex.lock(); + if (m_abort) { + m_mutex.unlock(); + return; + } + m_mutex.unlock(); + } + emit docsInstalled(changes); +} + +bool QtDocInstaller::installDoc(const DocInfo &docInfo) +{ + TRACE_OBJ + const QString &component = docInfo.first; + const QStringList &info = docInfo.second; + QDateTime dt; + if (!info.isEmpty() && !info.first().isEmpty()) + dt = QDateTime::fromString(info.first(), Qt::ISODate); + + QString qchFile; + if (info.count() == 2) + qchFile = info.last(); + + if (m_qchFiles.isEmpty()) { + emit qchFileNotFound(component); + return false; + } + foreach (const QString &f, m_qchFiles) { + if (f.startsWith(component)) { + QFileInfo fi(m_qchDir.absolutePath() + QDir::separator() + f); + if (dt.isValid() && fi.lastModified().toTime_t() == dt.toTime_t() + && qchFile == fi.absoluteFilePath()) + return false; + emit registerDocumentation(component, fi.absoluteFilePath()); + return true; + } + } + + emit qchFileNotFound(component); + return false; +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/qtdocinstaller.h b/src/assistant/assistant/qtdocinstaller.h new file mode 100644 index 000000000..909df10ce --- /dev/null +++ b/src/assistant/assistant/qtdocinstaller.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTDOCINSTALLER +#define QTDOCINSTALLER + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class HelpEngineWrapper; + +class QtDocInstaller : public QThread +{ + Q_OBJECT + +public: + typedef QPair DocInfo; + QtDocInstaller(const QList &docInfos); + ~QtDocInstaller(); + void installDocs(); + +signals: + void qchFileNotFound(const QString &component); + void registerDocumentation(const QString &component, + const QString &absFileName); + void docsInstalled(bool newDocsInstalled); + +private: + void run(); + bool installDoc(const DocInfo &docInfo); + + bool m_abort; + QMutex m_mutex; + QStringList m_qchFiles; + QDir m_qchDir; + QList m_docInfos; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/assistant/remotecontrol.cpp b/src/assistant/assistant/remotecontrol.cpp new file mode 100644 index 000000000..0990a357f --- /dev/null +++ b/src/assistant/assistant/remotecontrol.cpp @@ -0,0 +1,388 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "remotecontrol.h" + +#include "centralwidget.h" +#include "helpenginewrapper.h" +#include "mainwindow.h" +#include "openpagesmanager.h" +#include "tracer.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#ifdef Q_OS_WIN +# include "remotecontrol_win.h" +#endif + +QT_BEGIN_NAMESPACE + +#ifdef Q_OS_WIN + +StdInListenerWin::StdInListenerWin(QObject *parent) + : QThread(parent) +{ + TRACE_OBJ +} + +StdInListenerWin::~StdInListenerWin() +{ + TRACE_OBJ + terminate(); + wait(); +} + +void StdInListenerWin::run() +{ + TRACE_OBJ + bool ok = true; + char chBuf[4096]; + DWORD dwRead; + +#ifndef Q_WS_WINCE + HANDLE hStdin, hStdinDup; + + hStdin = GetStdHandle(STD_INPUT_HANDLE); + if (hStdin == INVALID_HANDLE_VALUE) + return; + + DuplicateHandle(GetCurrentProcess(), hStdin, + GetCurrentProcess(), &hStdinDup, + 0, false, DUPLICATE_SAME_ACCESS); + + CloseHandle(hStdin); +#else + HANDLE hStdinDup; + hStdinDup = stdin; +#endif + + while (ok) { + ok = ReadFile(hStdinDup, chBuf, sizeof(chBuf), &dwRead, NULL); + if (ok && dwRead != 0) + emit receivedCommand(QString::fromLocal8Bit(chBuf, dwRead)); + } +} +#endif + +RemoteControl::RemoteControl(MainWindow *mainWindow) + : QObject(mainWindow) + , m_mainWindow(mainWindow) + , m_debug(false) + , m_caching(true) + , m_syncContents(false) + , m_expandTOC(-2) + , helpEngine(HelpEngineWrapper::instance()) + +{ + TRACE_OBJ + connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); +#ifdef Q_OS_WIN + StdInListenerWin *l = new StdInListenerWin(this); + connect(l, SIGNAL(receivedCommand(QString)), + this, SLOT(handleCommandString(QString))); + l->start(); +#else + QSocketNotifier *notifier = new QSocketNotifier(fileno(stdin), + QSocketNotifier::Read, this); + connect(notifier, SIGNAL(activated(int)), this, SLOT(receivedData())); + notifier->setEnabled(true); +#endif +} + +void RemoteControl::receivedData() +{ + TRACE_OBJ + QByteArray ba; + while (true) { + char c = getc(stdin); + if (c == EOF || c == '\0') + break; + if (c) + ba.append(c); + if (c == '\n') + break; + } + handleCommandString(QString::fromLocal8Bit(ba)); +} + +void RemoteControl::handleCommandString(const QString &cmdString) +{ + TRACE_OBJ + QStringList cmds = cmdString.split(QLatin1Char(';')); + QStringList::const_iterator it = cmds.constBegin(); + while (it != cmds.constEnd()) { + QString cmd, arg; + splitInputString(*it, cmd, arg); + + if (m_debug) + QMessageBox::information(0, tr("Debugging Remote Control"), + tr("Received Command: %1 %2").arg(cmd).arg(arg)); + + if (cmd == QLatin1String("debug")) + handleDebugCommand(arg); + else if (cmd == QLatin1String("show")) + handleShowOrHideCommand(arg, true); + else if (cmd == QLatin1String("hide")) + handleShowOrHideCommand(arg, false); + else if (cmd == QLatin1String("setsource")) + handleSetSourceCommand(arg); + else if (cmd == QLatin1String("synccontents")) + handleSyncContentsCommand(); + else if (cmd == QLatin1String("activatekeyword")) + handleActivateKeywordCommand(arg); + else if (cmd == QLatin1String("activateidentifier")) + handleActivateIdentifierCommand(arg); + else if (cmd == QLatin1String("expandtoc")) + handleExpandTocCommand(arg); + else if (cmd == QLatin1String("setcurrentfilter")) + handleSetCurrentFilterCommand(arg); + else if (cmd == QLatin1String("register")) + handleRegisterCommand(arg); + else if (cmd == QLatin1String("unregister")) + handleUnregisterCommand(arg); + else + return; + + ++it; + } + m_mainWindow->raise(); + m_mainWindow->activateWindow(); +} + +void RemoteControl::splitInputString(const QString &input, QString &cmd, + QString &arg) +{ + TRACE_OBJ + QString cmdLine = input.trimmed(); + int i = cmdLine.indexOf(QLatin1Char(' ')); + cmd = cmdLine.left(i); + arg = cmdLine.mid(i+1); + cmd = cmd.toLower(); +} + +void RemoteControl::handleDebugCommand(const QString &arg) +{ + TRACE_OBJ + m_debug = arg == QLatin1String("on"); +} + +void RemoteControl::handleShowOrHideCommand(const QString &arg, bool show) +{ + TRACE_OBJ + if (arg.toLower() == QLatin1String("contents")) + m_mainWindow->setContentsVisible(show); + else if (arg.toLower() == QLatin1String("index")) + m_mainWindow->setIndexVisible(show); + else if (arg.toLower() == QLatin1String("bookmarks")) + m_mainWindow->setBookmarksVisible(show); + else if (arg.toLower() == QLatin1String("search")) + m_mainWindow->setSearchVisible(show); +} + +void RemoteControl::handleSetSourceCommand(const QString &arg) +{ + TRACE_OBJ + QUrl url(arg); + if (url.isValid()) { + if (url.isRelative()) + url = CentralWidget::instance()->currentSource().resolved(url); + if (m_caching) { + clearCache(); + m_setSource = url; + } else { + CentralWidget::instance()->setSource(url); + } + } +} + +void RemoteControl::handleSyncContentsCommand() +{ + TRACE_OBJ + if (m_caching) + m_syncContents = true; + else + m_mainWindow->syncContents(); +} + +void RemoteControl::handleActivateKeywordCommand(const QString &arg) +{ + TRACE_OBJ + if (m_caching) { + clearCache(); + m_activateKeyword = arg; + } else { + m_mainWindow->setIndexString(arg); + if (!arg.isEmpty()) { + if (!helpEngine.indexWidget()->currentIndex().isValid() + && helpEngine.fullTextSearchFallbackEnabled()) { + if (QHelpSearchEngine *se = helpEngine.searchEngine()) { + m_mainWindow->setSearchVisible(true); + if (QHelpSearchQueryWidget *w = se->queryWidget()) { + w->collapseExtendedSearch(); + QList queryList; + queryList << QHelpSearchQuery(QHelpSearchQuery::DEFAULT, + QStringList(arg)); + w->setQuery(queryList); + se->search(queryList); + } + } + } else { + m_mainWindow->setIndexVisible(true); + helpEngine.indexWidget()->activateCurrentItem(); + } + } + } +} + +void RemoteControl::handleActivateIdentifierCommand(const QString &arg) +{ + TRACE_OBJ + if (m_caching) { + clearCache(); + m_activateIdentifier = arg; + } else { + const QMap &links = helpEngine.linksForIdentifier(arg); + if (!links.isEmpty()) + CentralWidget::instance()->setSource(links.constBegin().value()); + } +} + +void RemoteControl::handleExpandTocCommand(const QString &arg) +{ + TRACE_OBJ + bool ok = false; + int depth = -2; + if (!arg.isEmpty()) + depth = arg.toInt(&ok); + if (!ok || depth < -2) + depth = -2; + + if (m_caching) + m_expandTOC = depth; + else if (depth != -2) + m_mainWindow->expandTOC(depth); +} + +void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) +{ + TRACE_OBJ + if (helpEngine.customFilters().contains(arg)) { + if (m_caching) { + clearCache(); + m_currentFilter = arg; + } else { + helpEngine.setCurrentFilter(arg); + } + } +} + +void RemoteControl::handleRegisterCommand(const QString &arg) +{ + TRACE_OBJ + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + if (helpEngine.registeredDocumentations(). + contains(QHelpEngineCore::namespaceName(absFileName))) + return; + if (helpEngine.registerDocumentation(absFileName)) + helpEngine.setupData(); +} + +void RemoteControl::handleUnregisterCommand(const QString &arg) +{ + TRACE_OBJ + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + const QString &ns = QHelpEngineCore::namespaceName(absFileName); + if (helpEngine.registeredDocumentations().contains(ns)) { + OpenPagesManager::instance()->closePages(ns); + if (helpEngine.unregisterDocumentation(ns)) + helpEngine.setupData(); + } +} + +void RemoteControl::applyCache() +{ + TRACE_OBJ + if (m_setSource.isValid()) { + CentralWidget::instance()->setSource(m_setSource); + } else if (!m_activateKeyword.isEmpty()) { + m_mainWindow->setIndexString(m_activateKeyword); + helpEngine.indexWidget()->activateCurrentItem(); + } else if (!m_activateIdentifier.isEmpty()) { + QMap links = + helpEngine.linksForIdentifier(m_activateIdentifier); + if (!links.isEmpty()) + CentralWidget::instance()->setSource(links.constBegin().value()); + } else if (!m_currentFilter.isEmpty()) { + helpEngine.setCurrentFilter(m_currentFilter); + } + + if (m_syncContents) + m_mainWindow->syncContents(); + + Q_ASSERT(m_expandTOC >= -2); + if (m_expandTOC != -2) + m_mainWindow->expandTOC(m_expandTOC); + + m_caching = false; +} + +void RemoteControl::clearCache() +{ + TRACE_OBJ + m_currentFilter.clear(); + m_setSource.clear(); + m_syncContents = false; + m_activateKeyword.clear(); + m_activateIdentifier.clear(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/remotecontrol.h b/src/assistant/assistant/remotecontrol.h new file mode 100644 index 000000000..4a185f050 --- /dev/null +++ b/src/assistant/assistant/remotecontrol.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef REMOTECONTROL_H +#define REMOTECONTROL_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class HelpEngineWrapper; +class MainWindow; + +class RemoteControl : public QObject +{ + Q_OBJECT + +public: + RemoteControl(MainWindow *mainWindow); + +private slots: + void receivedData(); + void handleCommandString(const QString &cmdString); + void applyCache(); + +private: + void clearCache(); + void splitInputString(const QString &input, QString &cmd, QString &arg); + void handleDebugCommand(const QString &arg); + void handleShowOrHideCommand(const QString &arg, bool show); + void handleSetSourceCommand(const QString &arg); + void handleSyncContentsCommand(); + void handleActivateKeywordCommand(const QString &arg); + void handleActivateIdentifierCommand(const QString &arg); + void handleExpandTocCommand(const QString &arg); + void handleSetCurrentFilterCommand(const QString &arg); + void handleRegisterCommand(const QString &arg); + void handleUnregisterCommand(const QString &arg); + +private: + MainWindow *m_mainWindow; + bool m_debug; + + bool m_caching; + QUrl m_setSource; + bool m_syncContents; + QString m_activateKeyword; + QString m_activateIdentifier; + int m_expandTOC; + QString m_currentFilter; + HelpEngineWrapper &helpEngine; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/assistant/remotecontrol_win.h b/src/assistant/assistant/remotecontrol_win.h new file mode 100644 index 000000000..807815df1 --- /dev/null +++ b/src/assistant/assistant/remotecontrol_win.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef REMOTECONTROL_WIN_H +#define REMOTECONTROL_WIN_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class StdInListenerWin : public QThread +{ + Q_OBJECT + +public: + StdInListenerWin(QObject *parent); + ~StdInListenerWin(); + +signals: + void receivedCommand(const QString &cmd); + +private: + void run(); + bool ok; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/assistant/searchwidget.cpp b/src/assistant/assistant/searchwidget.cpp new file mode 100644 index 000000000..31b8e739d --- /dev/null +++ b/src/assistant/assistant/searchwidget.cpp @@ -0,0 +1,237 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "mainwindow.h" +#include "searchwidget.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) + : QWidget(parent) + , zoomCount(0) + , searchEngine(engine) +{ + TRACE_OBJ + QVBoxLayout *vLayout = new QVBoxLayout(this); + + resultWidget = searchEngine->resultWidget(); + QHelpSearchQueryWidget *queryWidget = searchEngine->queryWidget(); + + vLayout->addWidget(queryWidget); + vLayout->addWidget(resultWidget); + + setFocusProxy(queryWidget); + + connect(queryWidget, SIGNAL(search()), this, SLOT(search())); + connect(resultWidget, SIGNAL(requestShowLink(QUrl)), this, + SIGNAL(requestShowLink(QUrl))); + + connect(searchEngine, SIGNAL(searchingStarted()), this, + SLOT(searchingStarted())); + connect(searchEngine, SIGNAL(searchingFinished(int)), this, + SLOT(searchingFinished(int))); + + QTextBrowser* browser = resultWidget->findChild(); + if (browser) // Will be null if lib was configured not to use CLucene. + browser->viewport()->installEventFilter(this); +} + +SearchWidget::~SearchWidget() +{ + TRACE_OBJ + // nothing todo +} + +void SearchWidget::zoomIn() +{ + TRACE_OBJ + QTextBrowser* browser = resultWidget->findChild(); + if (browser && zoomCount != 10) { + zoomCount++; + browser->zoomIn(); + } +} + +void SearchWidget::zoomOut() +{ + TRACE_OBJ + QTextBrowser* browser = resultWidget->findChild(); + if (browser && zoomCount != -5) { + zoomCount--; + browser->zoomOut(); + } +} + +void SearchWidget::resetZoom() +{ + TRACE_OBJ + if (zoomCount == 0) + return; + + QTextBrowser* browser = resultWidget->findChild(); + if (browser) { + browser->zoomOut(zoomCount); + zoomCount = 0; + } +} + +void SearchWidget::search() const +{ + TRACE_OBJ + QList query = searchEngine->queryWidget()->query(); + searchEngine->search(query); +} + +void SearchWidget::searchingStarted() +{ + TRACE_OBJ + qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); +} + +void SearchWidget::searchingFinished(int hits) +{ + TRACE_OBJ + Q_UNUSED(hits) + qApp->restoreOverrideCursor(); +} + +bool SearchWidget::eventFilter(QObject* o, QEvent *e) +{ + TRACE_OBJ + QTextBrowser* browser = resultWidget->findChild(); + if (browser && o == browser->viewport() + && e->type() == QEvent::MouseButtonRelease){ + QMouseEvent *me = static_cast(e); + QUrl link = resultWidget->linkAt(me->pos()); + if (!link.isEmpty() || link.isValid()) { + bool controlPressed = me->modifiers() & Qt::ControlModifier; + if((me->button() == Qt::LeftButton && controlPressed) + || (me->button() == Qt::MidButton)) { + emit requestShowLinkInNewTab(link); + } + } + } + return QWidget::eventFilter(o,e); +} + +void SearchWidget::keyPressEvent(QKeyEvent *keyEvent) +{ + TRACE_OBJ + if (keyEvent->key() == Qt::Key_Escape) + MainWindow::activateCurrentBrowser(); + else + keyEvent->ignore(); +} + +void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) +{ + TRACE_OBJ + QMenu menu; + QPoint point = contextMenuEvent->globalPos(); + + QTextBrowser* browser = resultWidget->findChild(); + if (!browser) + return; + + point = browser->mapFromGlobal(point); + if (!browser->rect().contains(point, true)) + return; + + QUrl link = browser->anchorAt(point); + + QKeySequence keySeq(QKeySequence::Copy); + QAction *copyAction = menu.addAction(tr("&Copy") + QLatin1String("\t") + + keySeq.toString(QKeySequence::NativeText)); + copyAction->setEnabled(QTextCursor(browser->textCursor()).hasSelection()); + + QAction *copyAnchorAction = menu.addAction(tr("Copy &Link Location")); + copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid()); + + keySeq = QKeySequence(Qt::CTRL); + QAction *newTabAction = menu.addAction(tr("Open Link in New Tab") + + QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText) + + QLatin1String("LMB")); + newTabAction->setEnabled(!link.isEmpty() && link.isValid()); + + menu.addSeparator(); + + keySeq = QKeySequence::SelectAll; + QAction *selectAllAction = menu.addAction(tr("Select All") + + QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText)); + + QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos())); + if (usedAction == copyAction) { + QTextCursor cursor = browser->textCursor(); + if (!cursor.isNull() && cursor.hasSelection()) { + QString selectedText = cursor.selectedText(); + QMimeData *data = new QMimeData(); + data->setText(selectedText); + QApplication::clipboard()->setMimeData(data); + } + } + else if (usedAction == copyAnchorAction) { + QApplication::clipboard()->setText(link.toString()); + } + else if (usedAction == newTabAction) { + emit requestShowLinkInNewTab(link); + } + else if (usedAction == selectAllAction) { + browser->selectAll(); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/searchwidget.h b/src/assistant/assistant/searchwidget.h new file mode 100644 index 000000000..c53498c94 --- /dev/null +++ b/src/assistant/assistant/searchwidget.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SEARCHWIDGET_H +#define SEARCHWIDGET_H + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QMouseEvent; +class QHelpSearchEngine; +class QHelpSearchResultWidget; + +class SearchWidget : public QWidget +{ + Q_OBJECT + +public: + explicit SearchWidget(QHelpSearchEngine *engine, QWidget *parent = 0); + ~SearchWidget(); + + void zoomIn(); + void zoomOut(); + void resetZoom(); + +signals: + void requestShowLink(const QUrl &url); + void requestShowLinkInNewTab(const QUrl &url); + +private slots: + void search() const; + void searchingStarted(); + void searchingFinished(int hits); + +private: + bool eventFilter(QObject* o, QEvent *e); + void keyPressEvent(QKeyEvent *keyEvent); + void contextMenuEvent(QContextMenuEvent *contextMenuEvent); + +private: + int zoomCount; + QHelpSearchEngine *searchEngine; + QHelpSearchResultWidget *resultWidget; +}; + +QT_END_NAMESPACE + +#endif // SEARCHWIDGET_H diff --git a/src/assistant/assistant/topicchooser.cpp b/src/assistant/assistant/topicchooser.cpp new file mode 100644 index 000000000..6f2810bf4 --- /dev/null +++ b/src/assistant/assistant/topicchooser.cpp @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "topicchooser.h" + +QT_BEGIN_NAMESPACE + +TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, + const QMap &links) + : QDialog(parent) +{ + TRACE_OBJ + ui.setupUi(this); + ui.label->setText(tr("Choose a topic for %1:").arg(keyword)); + + QMap::const_iterator it = links.constBegin(); + for (; it != links.constEnd(); ++it) { + ui.listWidget->addItem(it.key()); + m_links.append(it.value()); + } + + if (ui.listWidget->count() != 0) + ui.listWidget->setCurrentRow(0); + ui.listWidget->setFocus(); + + connect(ui.buttonDisplay, SIGNAL(clicked()), this, SLOT(accept())); + connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(ui.listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, + SLOT(accept())); +} + +QUrl TopicChooser::link() const +{ + TRACE_OBJ + QListWidgetItem *item = ui.listWidget->currentItem(); + if (!item) + return QUrl(); + + QString title = item->text(); + if (title.isEmpty()) + return QUrl(); + + const int row = ui.listWidget->row(item); + Q_ASSERT(row < m_links.count()); + return m_links.at(row); +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/topicchooser.h b/src/assistant/assistant/topicchooser.h new file mode 100644 index 000000000..6ac59f008 --- /dev/null +++ b/src/assistant/assistant/topicchooser.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TOPICCHOOSER_H +#define TOPICCHOOSER_H + +#include "ui_topicchooser.h" + +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class TopicChooser : public QDialog +{ + Q_OBJECT + +public: + TopicChooser(QWidget *parent, const QString &keyword, + const QMap &links); + + QUrl link() const; + +private: + Ui::TopicChooser ui; + QList m_links; +}; + +QT_END_NAMESPACE + +#endif // TOPICCHOOSER_H diff --git a/src/assistant/assistant/topicchooser.ui b/src/assistant/assistant/topicchooser.ui new file mode 100644 index 000000000..d4c90bb4b --- /dev/null +++ b/src/assistant/assistant/topicchooser.ui @@ -0,0 +1,116 @@ + + TopicChooser + + + TopicChooser + + + + 0 + 0 + 391 + 223 + + + + Choose Topic + + + true + + + + unnamed + + + 11 + + + 6 + + + + + label + + + &Topics + + + listWidget + + + + + + + listWidget + + + + + + + Layout16 + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + buttonDisplay + + + &Display + + + true + + + true + + + + + + + buttonCancel + + + &Close + + + true + + + + + + + + + diff --git a/src/assistant/assistant/tracer.h b/src/assistant/assistant/tracer.h new file mode 100644 index 000000000..1ed609acb --- /dev/null +++ b/src/assistant/assistant/tracer.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TRACER_H +#define TRACER_H + +#include + +QT_BEGIN_NAMESPACE + +class Tracer +{ +public: + Tracer(const char *func) : m_func(func) + { + qDebug("Entering function %s.", m_func); + } + + ~Tracer() + { + qDebug("Leaving function %s.", m_func); + } + +private: + const char * const m_func; +}; + +QT_END_NAMESPACE + +// #define TRACING_REQUESTED +#ifdef TRACING_REQUESTED +#define TRACE_OBJ Tracer traceObj__(Q_FUNC_INFO); +#else +#define TRACE_OBJ +#endif + +#endif // TRACER_H diff --git a/src/assistant/assistant/xbelsupport.cpp b/src/assistant/assistant/xbelsupport.cpp new file mode 100644 index 000000000..2979d10c1 --- /dev/null +++ b/src/assistant/assistant/xbelsupport.cpp @@ -0,0 +1,233 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "xbelsupport.h" + +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +struct Bookmark { + QString title; + QString url; + bool folded; +}; + +XbelWriter::XbelWriter(BookmarkModel *model) + : QXmlStreamWriter() + , bookmarkModel(model) +{ + TRACE_OBJ + setAutoFormatting(true); +} + +void XbelWriter::writeToFile(QIODevice *device) +{ + TRACE_OBJ + setDevice(device); + + writeStartDocument(); + writeDTD(QLatin1String("")); + writeStartElement(QLatin1String("xbel")); + writeAttribute(QLatin1String("version"), QLatin1String("1.0")); + + const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) + writeData(bookmarkModel->index(i, 0, root)); + writeEndDocument(); +} + +void XbelWriter::writeData(const QModelIndex &index) +{ + TRACE_OBJ + if (index.isValid()) { + Bookmark entry; + entry.title = index.data().toString(); + entry.url = index.data(UserRoleUrl).toString(); + + if (index.data(UserRoleFolder).toBool()) { + writeStartElement(QLatin1String("folder")); + entry.folded = !index.data(UserRoleExpanded).toBool(); + writeAttribute(QLatin1String("folded"), entry.folded + ? QLatin1String("yes") : QLatin1String("no")); + writeTextElement(QLatin1String("title"), entry.title); + + for (int i = 0; i < bookmarkModel->rowCount(index); ++i) + writeData(bookmarkModel->index(i, 0 , index)); + writeEndElement(); + } else { + writeStartElement(QLatin1String("bookmark")); + writeAttribute(QLatin1String("href"), entry.url); + writeTextElement(QLatin1String("title"), entry.title); + writeEndElement(); + } + } +} + +// -- XbelReader + +XbelReader::XbelReader(BookmarkModel *model) + : QXmlStreamReader() + , bookmarkModel(model) +{ + TRACE_OBJ +} + +bool XbelReader::readFromFile(QIODevice *device) +{ + TRACE_OBJ + setDevice(device); + + while (!atEnd()) { + readNext(); + + if (isStartElement()) { + if (name() == QLatin1String("xbel") + && attributes().value(QLatin1String("version")) + == QLatin1String("1.0")) { + const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); + parents.append(bookmarkModel->addItem(root, true)); + readXBEL(); + bookmarkModel->setData(parents.first(), + QDate::currentDate().toString(Qt::ISODate), Qt::EditRole); + } else { + raiseError(QLatin1String("The file is not an XBEL version 1.0 file.")); + } + } + } + + return !error(); +} + +void XbelReader::readXBEL() +{ + TRACE_OBJ + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("folder")) + readFolder(); + else if (name() == QLatin1String("bookmark")) + readBookmark(); + else + readUnknownElement(); + } + } +} + +void XbelReader::readFolder() +{ + TRACE_OBJ + parents.append(bookmarkModel->addItem(parents.last(), true)); + bookmarkModel->setData(parents.last(), + attributes().value(QLatin1String("folded")) == QLatin1String("no"), + UserRoleExpanded); + + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("title")) { + bookmarkModel->setData(parents.last(), readElementText(), + Qt::EditRole); + } else if (name() == QLatin1String("folder")) + readFolder(); + else if (name() == QLatin1String("bookmark")) + readBookmark(); + else + readUnknownElement(); + } + } + + parents.removeLast(); +} + +void XbelReader::readBookmark() +{ + TRACE_OBJ + const QModelIndex &index = bookmarkModel->addItem(parents.last(), false); + if (BookmarkItem* item = bookmarkModel->itemFromIndex(index)) { + item->setData(UserRoleUrl, attributes().value(QLatin1String("href")) + .toString()); + } + + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("title")) + bookmarkModel->setData(index, readElementText(), Qt::EditRole); + else + readUnknownElement(); + } + } +} + +void XbelReader::readUnknownElement() +{ + TRACE_OBJ + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) + readUnknownElement(); + } +} + +QT_END_NAMESPACE diff --git a/src/assistant/assistant/xbelsupport.h b/src/assistant/assistant/xbelsupport.h new file mode 100644 index 000000000..f55d3ba82 --- /dev/null +++ b/src/assistant/assistant/xbelsupport.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef XBELSUPPORT_H +#define XBELSUPPORT_H + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QIODevice) +QT_FORWARD_DECLARE_CLASS(QModelIndex) + +QT_BEGIN_NAMESPACE + +class BookmarkModel; + +class XbelWriter : public QXmlStreamWriter +{ +public: + XbelWriter(BookmarkModel *model); + void writeToFile(QIODevice *device); + +private: + void writeData(const QModelIndex &index); + +private: + BookmarkModel *bookmarkModel; +}; + +class XbelReader : public QXmlStreamReader +{ +public: + XbelReader(BookmarkModel *model); + bool readFromFile(QIODevice *device); + +private: + void readXBEL(); + void readFolder(); + void readBookmark(); + void readUnknownElement(); + +private: + BookmarkModel *bookmarkModel; + QList parents; +}; + +QT_END_NAMESPACE + +#endif // XBELSUPPORT_H diff --git a/src/assistant/clucene/clucene.pro b/src/assistant/clucene/clucene.pro new file mode 100644 index 000000000..51ada580f --- /dev/null +++ b/src/assistant/clucene/clucene.pro @@ -0,0 +1,49 @@ +load(qt_module) + +TARGET = QtCLucene +QPRO_PWD = $$PWD + +CONFIG += module +MODULE_PRI = ../../../modules/qt_clucene.pri + +QT = core + +DEFINES += QHELP_LIB + +load(qt_module_config) +HEADERS += qtcluceneversion.h + +include(fulltextsearch.pri) + +CONFIG += qt warn_off +contains(QT_CONFIG, reduce_exports) { + CONFIG += hide_symbols + # workaround for compiler errors on Ubuntu + linux*-g++*:DEFINES += _GLIBCXX_EXTERN_TEMPLATE=0 +} + +unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore + +# impossible to disable exceptions in clucene atm +CONFIG(exceptions_off) { + CONFIG -= exceptions_off + CONFIG += exceptions + !win32|win32-g++* { + QMAKE_CFLAGS -= -fno-exceptions + QMAKE_CXXFLAGS -= -fno-exceptions + QMAKE_LFLAGS -= -fno-exceptions + QMAKE_CFLAGS += -fexceptions + QMAKE_CXXFLAGS += -fexceptions + QMAKE_LFLAGS += -fexceptions + } +} + +win32-msvc.net | win32-msvc2* { + QMAKE_CFLAGS_RELEASE -= -O2 + QMAKE_CXXFLAGS_RELEASE -= -O2 +} + +# the following define could be set globally in case we need it elsewhere +solaris* { + DEFINES += Q_SOLARIS_VERSION=$$system(uname -r | sed -e 's/5\\.//') +} diff --git a/src/assistant/clucene/fulltextsearch.pri b/src/assistant/clucene/fulltextsearch.pri new file mode 100644 index 000000000..eebfba33a --- /dev/null +++ b/src/assistant/clucene/fulltextsearch.pri @@ -0,0 +1,161 @@ +DEFINES += _BUILD_FOR_QT_ LUCENE_DISABLE_MEMTRACKING +win32:DEFINES += _CRT_SECURE_NO_DEPRECATE _MT + +CLUCENEDIR = ../3rdparty/clucene/src/CLucene + +INCLUDEPATH += . .. \ + $$CLUCENEDIR \ + $$CLUCENEDIR/../ \ + $$CLUCENEDIR/analysis \ + $$CLUCENEDIR/analysis/standard \ + $$CLUCENEDIR/config \ + $$CLUCENEDIR/debug \ + $$CLUCENEDIR/document \ + $$CLUCENEDIR/index \ + $$CLUCENEDIR/queryParser \ + $$CLUCENEDIR/search \ + $$CLUCENEDIR/store \ + $$CLUCENEDIR/util + + +SOURCES += $$CLUCENEDIR/StdHeader.cpp \ + $$CLUCENEDIR/analysis/AnalysisHeader.cpp \ + $$CLUCENEDIR/analysis/Analyzers.cpp \ + $$CLUCENEDIR/config/gunichartables.cpp \ + $$CLUCENEDIR/config/repl_lltot.cpp \ + $$CLUCENEDIR/config/repl_tcscasecmp.cpp \ + $$CLUCENEDIR/config/repl_tcslwr.cpp \ + $$CLUCENEDIR/config/repl_tcstod.cpp \ + $$CLUCENEDIR/config/repl_tcstoll.cpp \ + $$CLUCENEDIR/config/repl_tprintf.cpp \ + $$CLUCENEDIR/config/threads.cpp \ + $$CLUCENEDIR/config/utf8.cpp \ + $$CLUCENEDIR/debug/condition.cpp \ + $$CLUCENEDIR/debug/error.cpp \ + $$CLUCENEDIR/debug/memtracking.cpp \ + $$CLUCENEDIR/document/DateField.cpp \ + $$CLUCENEDIR/document/Document.cpp \ + $$CLUCENEDIR/document/Field.cpp \ + $$CLUCENEDIR/index/CompoundFile.cpp \ + $$CLUCENEDIR/index/DocumentWriter.cpp \ + $$CLUCENEDIR/index/FieldInfos.cpp \ + $$CLUCENEDIR/index/FieldsReader.cpp \ + $$CLUCENEDIR/index/FieldsWriter.cpp \ + $$CLUCENEDIR/index/IndexModifier.cpp \ + $$CLUCENEDIR/index/IndexReader.cpp \ + $$CLUCENEDIR/index/IndexWriter.cpp \ + $$CLUCENEDIR/index/MultiReader.cpp \ + $$CLUCENEDIR/index/SegmentInfos.cpp \ + $$CLUCENEDIR/index/SegmentMergeInfo.cpp \ + $$CLUCENEDIR/index/SegmentMergeQueue.cpp \ + $$CLUCENEDIR/index/SegmentMerger.cpp \ + $$CLUCENEDIR/index/SegmentReader.cpp \ + $$CLUCENEDIR/index/SegmentTermDocs.cpp \ + $$CLUCENEDIR/index/SegmentTermEnum.cpp \ + $$CLUCENEDIR/index/SegmentTermPositions.cpp \ + $$CLUCENEDIR/index/SegmentTermVector.cpp \ + $$CLUCENEDIR/index/Term.cpp \ + $$CLUCENEDIR/index/TermInfo.cpp \ + $$CLUCENEDIR/index/TermInfosReader.cpp \ + $$CLUCENEDIR/index/TermInfosWriter.cpp \ + $$CLUCENEDIR/index/TermVectorReader.cpp \ + $$CLUCENEDIR/index/TermVectorWriter.cpp \ + $$CLUCENEDIR/queryParser/Lexer.cpp \ + $$CLUCENEDIR/queryParser/MultiFieldQueryParser.cpp \ + $$CLUCENEDIR/queryParser/QueryParser.cpp \ + $$CLUCENEDIR/queryParser/QueryParserBase.cpp \ + $$CLUCENEDIR/queryParser/QueryToken.cpp \ + $$CLUCENEDIR/queryParser/TokenList.cpp \ + $$CLUCENEDIR/search/BooleanQuery.cpp \ + $$CLUCENEDIR/search/BooleanScorer.cpp \ + $$CLUCENEDIR/search/CachingWrapperFilter.cpp \ + $$CLUCENEDIR/search/ChainedFilter.cpp \ + $$CLUCENEDIR/search/ConjunctionScorer.cpp \ + $$CLUCENEDIR/search/DateFilter.cpp \ + $$CLUCENEDIR/search/ExactPhraseScorer.cpp \ + $$CLUCENEDIR/search/Explanation.cpp \ + $$CLUCENEDIR/search/FieldCache.cpp \ + $$CLUCENEDIR/search/FieldCacheImpl.cpp \ + $$CLUCENEDIR/search/FieldDocSortedHitQueue.cpp \ + $$CLUCENEDIR/search/FieldSortedHitQueue.cpp \ + $$CLUCENEDIR/search/FilteredTermEnum.cpp \ + $$CLUCENEDIR/search/FuzzyQuery.cpp \ + $$CLUCENEDIR/search/HitQueue.cpp \ + $$CLUCENEDIR/search/Hits.cpp \ + $$CLUCENEDIR/search/IndexSearcher.cpp \ + $$CLUCENEDIR/search/MultiSearcher.cpp \ + $$CLUCENEDIR/search/MultiTermQuery.cpp \ + $$CLUCENEDIR/search/PhrasePositions.cpp \ + $$CLUCENEDIR/search/PhraseQuery.cpp \ + $$CLUCENEDIR/search/PhraseScorer.cpp \ + $$CLUCENEDIR/search/PrefixQuery.cpp \ + $$CLUCENEDIR/search/QueryFilter.cpp \ + $$CLUCENEDIR/search/RangeFilter.cpp \ + $$CLUCENEDIR/search/RangeQuery.cpp \ + $$CLUCENEDIR/search/SearchHeader.cpp \ + $$CLUCENEDIR/search/Similarity.cpp \ + $$CLUCENEDIR/search/SloppyPhraseScorer.cpp \ + $$CLUCENEDIR/search/Sort.cpp \ + $$CLUCENEDIR/search/TermQuery.cpp \ + $$CLUCENEDIR/search/TermScorer.cpp \ + $$CLUCENEDIR/search/WildcardQuery.cpp \ + $$CLUCENEDIR/search/WildcardTermEnum.cpp \ + $$CLUCENEDIR/store/FSDirectory.cpp \ + $$CLUCENEDIR/store/IndexInput.cpp \ + $$CLUCENEDIR/store/IndexOutput.cpp \ + $$CLUCENEDIR/store/Lock.cpp \ + $$CLUCENEDIR/store/MMapInput.cpp \ + $$CLUCENEDIR/store/RAMDirectory.cpp \ + $$CLUCENEDIR/store/TransactionalRAMDirectory.cpp \ + $$CLUCENEDIR/util/BitSet.cpp \ + $$CLUCENEDIR/util/Equators.cpp \ + $$CLUCENEDIR/util/FastCharStream.cpp \ + $$CLUCENEDIR/util/fileinputstream.cpp \ + $$CLUCENEDIR/util/Misc.cpp \ + $$CLUCENEDIR/util/Reader.cpp \ + $$CLUCENEDIR/util/StringBuffer.cpp \ + $$CLUCENEDIR/util/StringIntern.cpp \ + $$CLUCENEDIR/util/ThreadLocal.cpp \ + $$CLUCENEDIR/analysis/standard/StandardAnalyzer.cpp \ + $$CLUCENEDIR/analysis/standard/StandardFilter.cpp \ + $$CLUCENEDIR/analysis/standard/StandardTokenizer.cpp + + +#Header files +HEADERS += qclucene_global_p.h \ + qclucene-config_p.h \ + qanalyzer_p.h \ + qtokenizer_p.h \ + qtoken_p.h \ + qtokenstream_p.h \ + qdocument_p.h \ + qfield_p.h \ + qindexreader_p.h \ + qindexwriter_p.h \ + qterm_p.h \ + qqueryparser_p.h \ + qfilter_p.h \ + qhits_p.h \ + qsearchable_p.h \ + qsort_p.h \ + qquery_p.h \ + qreader_p.h + + +#Source files +SOURCES += qanalyzer.cpp \ + qtokenizer.cpp \ + qtoken.cpp \ + qtokenstream.cpp \ + qdocument.cpp \ + qfield.cpp \ + qindexreader.cpp \ + qindexwriter.cpp \ + qterm.cpp \ + qqueryparser.cpp \ + qfilter.cpp \ + qhits.cpp \ + qsearchable.cpp \ + qsort.cpp \ + qquery.cpp \ + qreader.cpp diff --git a/src/assistant/clucene/license.txt b/src/assistant/clucene/license.txt new file mode 100644 index 000000000..9ef3d701d --- /dev/null +++ b/src/assistant/clucene/license.txt @@ -0,0 +1,503 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/src/assistant/clucene/qanalyzer.cpp b/src/assistant/clucene/qanalyzer.cpp new file mode 100644 index 000000000..71dd2c972 --- /dev/null +++ b/src/assistant/clucene/qanalyzer.cpp @@ -0,0 +1,219 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qanalyzer_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneAnalyzerPrivate::QCLuceneAnalyzerPrivate() + : QSharedData() +{ + analyzer = 0; + deleteCLuceneAnalyzer = true; +} + +QCLuceneAnalyzerPrivate::QCLuceneAnalyzerPrivate(const QCLuceneAnalyzerPrivate &other) + : QSharedData() +{ + analyzer = _CL_POINTER(other.analyzer); + deleteCLuceneAnalyzer = other.deleteCLuceneAnalyzer; +} + +QCLuceneAnalyzerPrivate::~QCLuceneAnalyzerPrivate() +{ + if (deleteCLuceneAnalyzer) + _CLDECDELETE(analyzer); +} + + +QCLuceneAnalyzer::QCLuceneAnalyzer() + : d(new QCLuceneAnalyzerPrivate()) +{ + //nothing todo, private +} + +QCLuceneAnalyzer::~QCLuceneAnalyzer() +{ + // nothing todo +} + +qint32 QCLuceneAnalyzer::positionIncrementGap(const QString &fieldName) const +{ + Q_UNUSED(fieldName); + return 0; +} + +QCLuceneTokenStream QCLuceneAnalyzer::tokenStream(const QString &fieldName, + const QCLuceneReader &reader) const +{ + TCHAR *fName = QStringToTChar(fieldName); + QCLuceneTokenStream tokenStream; + tokenStream.d->tokenStream = d->analyzer->tokenStream(fName, reader.d->reader); + delete [] fName; + + return tokenStream; +} + + +QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer() + : QCLuceneAnalyzer() +{ + d->analyzer = new lucene::analysis::standard::StandardAnalyzer(); +} + +QCLuceneStandardAnalyzer::~QCLuceneStandardAnalyzer() +{ + // nothing todo +} + +QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer(const QStringList &stopWords) +{ + const TCHAR **tArray = new const TCHAR*[stopWords.count() +1]; + + for(int i = 0; i < stopWords.count(); ++i) { + TCHAR *stopWord = QStringToTChar(stopWords.at(i)); + tArray[i] = STRDUP_TtoT(stopWord); + delete [] stopWord; + } + tArray[stopWords.count()] = 0; + + d->analyzer = new lucene::analysis::standard::StandardAnalyzer(tArray); + + for (int i = 0; i < stopWords.count(); ++i) + delete [] tArray[i]; + + delete [] tArray; +} + + +QCLuceneWhitespaceAnalyzer::QCLuceneWhitespaceAnalyzer() + : QCLuceneAnalyzer() +{ + d->analyzer = new lucene::analysis::WhitespaceAnalyzer(); +} + +QCLuceneWhitespaceAnalyzer::~QCLuceneWhitespaceAnalyzer() +{ + // nothing todo +} + + +QCLuceneSimpleAnalyzer::QCLuceneSimpleAnalyzer() + : QCLuceneAnalyzer() +{ + d->analyzer = new lucene::analysis::SimpleAnalyzer(); +} + +QCLuceneSimpleAnalyzer::~QCLuceneSimpleAnalyzer() +{ + // nothing todo +} + + +QCLuceneStopAnalyzer::QCLuceneStopAnalyzer() + : QCLuceneAnalyzer() +{ + d->analyzer = new lucene::analysis::StopAnalyzer(); +} + +QCLuceneStopAnalyzer::~QCLuceneStopAnalyzer() +{ + // nothing todo +} + +QCLuceneStopAnalyzer::QCLuceneStopAnalyzer(const QStringList &stopWords) + : QCLuceneAnalyzer() +{ + const TCHAR **tArray = new const TCHAR*[stopWords.count() +1]; + + for(int i = 0; i < stopWords.count(); ++i) { + TCHAR *stopWord = QStringToTChar(stopWords.at(i)); + tArray[i] = STRDUP_TtoT(stopWord); + delete [] stopWord; + } + tArray[stopWords.count()] = 0; + + d->analyzer = new lucene::analysis::StopAnalyzer(tArray); + + for (int i = 0; i < stopWords.count(); ++i) + delete [] tArray[i]; + + delete [] tArray; +} + +QStringList QCLuceneStopAnalyzer::englishStopWords() const +{ + QStringList stopWordList; + + const TCHAR** stopWords = lucene::analysis::StopAnalyzer::ENGLISH_STOP_WORDS; + for (qint32 i = 0; stopWords[i] != 0; ++i) + stopWordList.append(TCharToQString(stopWords[i])); + + return stopWordList; +} + + +QCLuceneKeywordAnalyzer::QCLuceneKeywordAnalyzer() + : QCLuceneAnalyzer() +{ + d->analyzer = new lucene::analysis::KeywordAnalyzer(); +} + +QCLuceneKeywordAnalyzer::~QCLuceneKeywordAnalyzer() +{ + // nothing todo +} + + +QCLucenePerFieldAnalyzerWrapper::QCLucenePerFieldAnalyzerWrapper( + QCLuceneAnalyzer *defaultAnalyzer) + : QCLuceneAnalyzer() +{ + d->analyzer = new + lucene::analysis::PerFieldAnalyzerWrapper(defaultAnalyzer->d->analyzer); + + analyzers.append(defaultAnalyzer); + defaultAnalyzer->d->deleteCLuceneAnalyzer = false; +} + +QCLucenePerFieldAnalyzerWrapper::~QCLucenePerFieldAnalyzerWrapper() +{ + qDeleteAll(analyzers); +} + +void QCLucenePerFieldAnalyzerWrapper::addAnalyzer(const QString &fieldName, + QCLuceneAnalyzer *analyzer) +{ + lucene::analysis::PerFieldAnalyzerWrapper *analyzerWrapper = + static_cast (d->analyzer); + + if (analyzerWrapper == 0) + return; + + analyzers.append(analyzer); + analyzer->d->deleteCLuceneAnalyzer = false; + + TCHAR *fName = QStringToTChar(fieldName); + analyzerWrapper->addAnalyzer(fName, analyzer->d->analyzer); + delete [] fName; +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qanalyzer_p.h b/src/assistant/clucene/qanalyzer_p.h new file mode 100644 index 000000000..162d6799b --- /dev/null +++ b/src/assistant/clucene/qanalyzer_p.h @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QANALYZER_P_H +#define QANALYZER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qreader_p.h" +#include "qtokenstream_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include +#include +#include + +CL_NS_DEF(analysis) + class Analyzer; +CL_NS_END +CL_NS_USE(analysis) + +QT_BEGIN_NAMESPACE + +class QCLuceneIndexWriter; +class QCLuceneQueryParser; +class QCLuceneStopAnalyzer; +class QCLuceneSimpleAnalyzer; +class QCLuceneKeywordAnalyzer; +class QCLuceneStandardAnalyzer; +class QCLuceneWhitespaceAnalyzer; +class QCLucenePerFieldAnalyzerWrapper; + +class QHELP_EXPORT QCLuceneAnalyzerPrivate : public QSharedData +{ +public: + QCLuceneAnalyzerPrivate(); + QCLuceneAnalyzerPrivate(const QCLuceneAnalyzerPrivate &other); + + ~QCLuceneAnalyzerPrivate(); + + Analyzer *analyzer; + bool deleteCLuceneAnalyzer; + +private: + QCLuceneAnalyzerPrivate &operator=(const QCLuceneAnalyzerPrivate &other); +}; + +class QHELP_EXPORT QCLuceneAnalyzer +{ +public: + virtual ~QCLuceneAnalyzer(); + + qint32 positionIncrementGap(const QString &fieldName) const; + QCLuceneTokenStream tokenStream(const QString &fieldName, + const QCLuceneReader &reader) const; + +protected: + friend class QCLuceneIndexWriter; + friend class QCLuceneQueryParser; + friend class QCLuceneStopAnalyzer; + friend class QCLuceneSimpleAnalyzer; + friend class QCLuceneKeywordAnalyzer; + friend class QCLuceneStandardAnalyzer; + friend class QCLuceneWhitespaceAnalyzer; + friend class QCLucenePerFieldAnalyzerWrapper; + QSharedDataPointer d; + +private: + QCLuceneAnalyzer(); +}; + +class QHELP_EXPORT QCLuceneStandardAnalyzer : public QCLuceneAnalyzer +{ +public: + QCLuceneStandardAnalyzer(); + QCLuceneStandardAnalyzer(const QStringList &stopWords); + + ~QCLuceneStandardAnalyzer(); +}; + +class QHELP_EXPORT QCLuceneWhitespaceAnalyzer : public QCLuceneAnalyzer +{ +public: + QCLuceneWhitespaceAnalyzer(); + ~QCLuceneWhitespaceAnalyzer(); +}; + +class QHELP_EXPORT QCLuceneSimpleAnalyzer : public QCLuceneAnalyzer +{ +public: + QCLuceneSimpleAnalyzer(); + ~QCLuceneSimpleAnalyzer(); +}; + +class QHELP_EXPORT QCLuceneStopAnalyzer : public QCLuceneAnalyzer +{ +public: + QCLuceneStopAnalyzer(); + QCLuceneStopAnalyzer(const QStringList &stopWords); + + ~QCLuceneStopAnalyzer(); + + QStringList englishStopWords() const; +}; + +class QHELP_EXPORT QCLuceneKeywordAnalyzer : public QCLuceneAnalyzer +{ +public: + QCLuceneKeywordAnalyzer(); + ~QCLuceneKeywordAnalyzer(); +}; + +class QHELP_EXPORT QCLucenePerFieldAnalyzerWrapper : public QCLuceneAnalyzer +{ +public: + QCLucenePerFieldAnalyzerWrapper(QCLuceneAnalyzer *defaultAnalyzer); + ~QCLucenePerFieldAnalyzerWrapper(); + + void addAnalyzer(const QString &fieldName, QCLuceneAnalyzer *analyzer); + +private: + QList analyzers; +}; + +QT_END_NAMESPACE + +#endif // QANALYZER_P_H diff --git a/src/assistant/clucene/qclucene-config_p.h b/src/assistant/clucene/qclucene-config_p.h new file mode 100644 index 000000000..476296cf5 --- /dev/null +++ b/src/assistant/clucene/qclucene-config_p.h @@ -0,0 +1,557 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QCLUCENE_CONFIG_P_H +#define QCLUCENE_CONFIG_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include + +#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H +#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1 + +/* +src/CLucene/clucene-config.h. +Generated +automatically +at +end +of +configure. +*/ +/* config.h.tmp. Generated by configure. */ +/* config.h.tmp.in. Generated from configure.ac by autoheader. */ + +/* Disable multithreading */ +/* #undef _CL_DISABLE_MULTITHREADING */ + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_ALGORITHM +#define _CL_HAVE_ALGORITHM 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_CTYPE_H +#define _CL_HAVE_CTYPE_H 1 +#endif + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#ifndef _CL_HAVE_DIRENT_H +#define _CL_HAVE_DIRENT_H 1 +#endif + +#if !defined (__MINGW32__) + /* Define to 1 if you have the header file. */ +# ifndef _CL_HAVE_DLFCN_H +# define _CL_HAVE_DLFCN_H 1 +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_ERRNO_H +#define _CL_HAVE_ERRNO_H 1 +#endif + +#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) + /* Define to 1 if you have the header file. */ +# ifndef _CL_HAVE_EXT_HASH_MAP +# define _CL_HAVE_EXT_HASH_MAP 1 +# endif + + /* Define to 1 if you have the header file. */ +# ifndef _CL_HAVE_EXT_HASH_SET +# define _CL_HAVE_EXT_HASH_SET 1 +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_FCNTL_H +#define _CL_HAVE_FCNTL_H 1 +#endif + +#if !defined(__xlC__) && !defined(__xlc__) && !defined (__MINGW32__) && \ + !defined(__HP_aCC) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC) || \ + defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x550) || (defined(__HP_aCC) && defined(__ia64)) + /* Define to 1 if the system has the type `float_t'. */ +# ifndef _CL_HAVE_FLOAT_T +# define _CL_HAVE_FLOAT_T 1 +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_FUNCTIONAL +#define _CL_HAVE_FUNCTIONAL 1 +#endif + +/* Does not support new float byte<->float conversions */ +#ifndef _CL_HAVE_FUNCTIONING_FLOAT_BYTE +#define _CL_HAVE_FUNCTIONING_FLOAT_BYTE +#endif + +/* Define to 1 if you have the `getpagesize' function. */ +#ifndef _CL_HAVE_GETPAGESIZE +#define _CL_HAVE_GETPAGESIZE 1 +#endif + +/* Define to 1 if you have the header file. */ +/* #undef _CL_HAVE_HASH_MAP */ + +/* Define to 1 if you have the header file. */ +/* #undef _CL_HAVE_HASH_SET */ + +/* Define to 1 if the system has the type `intptr_t'. */ +#ifndef _CL_HAVE_INTPTR_T +#define _CL_HAVE_INTPTR_T 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_INTTYPES_H +#define _CL_HAVE_INTTYPES_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_LIST +#define _CL_HAVE_LIST 1 +#endif + +/* Define to 1 if you have the `lltoa' function. */ +/* #undef _CL_HAVE_LLTOA */ + +#if defined(__MINGW32__) + /* Define to 1 if you have the `lltow' function. */ +# ifndef _CL_HAVE_LLTOW +# define _CL_HAVE_LLTOW 1 +# endif +#endif + +#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__xlC__) && !defined(__xlc__) + /* Define to 1 if long double works and has more range or precision than double. */ +# ifndef _CL_HAVE_LONG_DOUBLE +# define _CL_HAVE_LONG_DOUBLE 1 +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_MAP +#define _CL_HAVE_MAP 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_MATH_H +#define _CL_HAVE_MATH_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_MEMORY_H +#define _CL_HAVE_MEMORY_H 1 +#endif + +#if !defined(__MINGW32__) && !defined(__HP_aCC) && !defined(__xlC__) && !defined(__xlc__) + /* Define to 1 if you have a working `mmap' system call. */ +# ifndef _CL_HAVE_MMAP +# define _CL_HAVE_MMAP 1 +# endif +#endif + +/* define if the compiler implements namespaces */ +#ifndef _CL_HAVE_NAMESPACES +#define _CL_HAVE_NAMESPACES +#endif + +#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined(__HP_aCC) || defined(__xlC__) || defined(__xlc__) + /* Define if you have the nanosleep function */ +# ifndef _CL_HAVE_NANOSLEEP +# define _CL_HAVE_NANOSLEEP 1 +# endif +#endif + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef _CL_HAVE_NDIR_H */ + +/* Does not support new float byte<->float conversions */ +/* #undef _CL_HAVE_NO_FLOAT_BYTE */ + +/* Does not support try/catch blocks */ +/* #undef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS */ + +/* Define to 1 if you have the `printf' function. */ +#ifndef _CL_HAVE_PRINTF +#define _CL_HAVE_PRINTF 1 +#endif + +#if !defined(__MINGW32__) + /* Define if you have POSIX threads libraries and header files. */ +# ifndef _CL_HAVE_PTHREAD +# define _CL_HAVE_PTHREAD 1 +# endif +#endif + +/* Define if recursive pthread mutexes are available */ +/* #undef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE */ + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_SET +#define _CL_HAVE_SET 1 +#endif + +/* Define to 1 if you have the `snprintf' function. */ +#ifndef _CL_HAVE_SNPRINTF +#define _CL_HAVE_SNPRINTF 1 +#endif + +/* Defined if the snprintf overflow test fails */ +/* #undef _CL_HAVE_SNPRINTF_BUG */ + +/* Define to 1 if you have the `snwprintf' function. */ +/* #undef _CL_HAVE_SNWPRINTF */ + +#if !defined(__HP_aCC) && !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) + /* define if the compiler supports ISO C++ standard library */ +# ifndef _CL_HAVE_STD +# define _CL_HAVE_STD +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_STDARG_H +#define _CL_HAVE_STDARG_H 1 +#endif + +/* x */ +#ifndef _CL_HAVE_STDEXCEPT +#define _CL_HAVE_STDEXCEPT +#endif + +#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__HP_aCC) && \ + !defined(__xlC__) && !defined(__xlc__) + /* Define to 1 if you have the header file. */ +# ifndef _CL_HAVE_STDINT_H +# define _CL_HAVE_STDINT_H 1 +# endif +#endif + +#if !defined(__HP_aCC) + /* Define to 1 if you have the header file. */ +# ifndef _CL_HAVE_STDLIB_H +# define _CL_HAVE_STDLIB_H 1 +# endif + + /* define if the compiler supports Standard Template Library */ +# ifndef _CL_HAVE_STL +# define _CL_HAVE_STL +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_STRINGS_H +#define _CL_HAVE_STRINGS_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_STRING_H +#define _CL_HAVE_STRING_H 1 +#endif + +/* Define to 1 if you have the `strlwr' function. */ +/* #undef _CL_HAVE_STRLWR */ + +/* Define to 1 if you have the `strtoll' function. */ +/* #undef _CL_HAVE_STRTOLL */ + +/* Define to 1 if you have the `strupr' function. */ +/* #undef _CL_HAVE_STRUPR */ + +/* Defined if the swprintf test fails */ +#ifndef _CL_HAVE_SWPRINTF_BUG +#define _CL_HAVE_SWPRINTF_BUG +#endif + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef _CL_HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef _CL_HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_SYS_STAT_H +#define _CL_HAVE_SYS_STAT_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_SYS_TIMEB_H +#define _CL_HAVE_SYS_TIMEB_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_SYS_TYPES_H +#define _CL_HAVE_SYS_TYPES_H 1 +#endif + +#if defined(__MINGW32__) + /* Define to 1 if you have the header file. */ + # ifndef _CL_HAVE_TCHAR_H + # define _CL_HAVE_TCHAR_H 1 + # endif +#endif + +#if defined(__MINGW32__) || defined(__SUNPRO_CC) || defined(__SUNPRO_C) + /* Define to 1 if you have the `tell' function. */ +# ifndef _CL_HAVE_TELL +# define _CL_HAVE_TELL 1 +# endif +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_UNISTD_H +#define _CL_HAVE_UNISTD_H 1 +#endif + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_VECTOR +#define _CL_HAVE_VECTOR 1 +#endif + +/* Define to 1 if you have the `vsnwprintf' function. */ +/* #undef _CL_HAVE_VSNWPRINTF */ + +/* Define to 1 if you have the header file. */ +#ifndef _CL_HAVE_WCHAR_H +#define _CL_HAVE_WCHAR_H 1 +#endif + +/* Define to 1 if the system has the type `wchar_t'. */ +#ifndef _CL_HAVE_WCHAR_T +#define _CL_HAVE_WCHAR_T 1 +#endif + +#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__MINGW32__) && \ + !defined(Q_OS_MAC) && !defined(__HP_aCC) + /* Define to 1 if you have the `wcscasecmp' function. */ +# ifndef _CL_HAVE_WCSCASECMP +# define _CL_HAVE_WCSCASECMP 1 +# endif +#endif + +/* Define to 1 if you have the `wcscat' function. */ +#ifndef _CL_HAVE_WCSCAT +#define _CL_HAVE_WCSCAT 1 +#endif + +/* Define to 1 if you have the `wcschr' function. */ +#ifndef _CL_HAVE_WCSCHR +#define _CL_HAVE_WCSCHR 1 +#endif + +/* Define to 1 if you have the `wcscmp' function. */ +#ifndef _CL_HAVE_WCSCMP +#define _CL_HAVE_WCSCMP 1 +#endif + +/* Define to 1 if you have the `wcscpy' function. */ +#ifndef _CL_HAVE_WCSCPY +#define _CL_HAVE_WCSCPY 1 +#endif + +/* Define to 1 if you have the `wcscspn' function. */ +#ifndef _CL_HAVE_WCSCSPN +#define _CL_HAVE_WCSCSPN 1 +#endif + +#if defined(__MINGW32__) + /* Define to 1 if you have the `wcsicmp' function. */ +# ifndef _CL_HAVE_WCSICMP +# define _CL_HAVE_WCSICMP 1 +# endif +#endif + +/* Define to 1 if you have the `wcslen' function. */ +#ifndef _CL_HAVE_WCSLEN +#define _CL_HAVE_WCSLEN 1 +#endif + +/* Define to 1 if you have the `wcsncmp' function. */ +#ifndef _CL_HAVE_WCSNCMP +#define _CL_HAVE_WCSNCMP 1 +#endif + +/* Define to 1 if you have the `wcsncpy' function. */ +#ifndef _CL_HAVE_WCSNCPY +#define _CL_HAVE_WCSNCPY 1 +#endif + +/* Define to 1 if you have the `wcsstr' function. */ +#ifndef _CL_HAVE_WCSSTR +#define _CL_HAVE_WCSSTR 1 +#endif + +/* Define to 1 if you have the `wcstod' function. */ +#ifndef _CL_HAVE_WCSTOD +#define _CL_HAVE_WCSTOD 1 +#endif + +#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__HP_aCC) + /* Define to 1 if you have the `wcstoll' function. */ +# ifndef _CL_HAVE_WCSTOLL +# define _CL_HAVE_WCSTOLL 1 +# endif +#endif + +#if defined(__MINGW32__) + /* Define to 1 if you have the `wcsupr' function. */ +# ifndef _CL_HAVE_WCSUPR +# define _CL_HAVE_WCSUPR 1 +# endif +#endif + +#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined(__HP_aCC) + /* Define to 1 if you have a functioning header file. */ +# ifndef _CL_HAVE_WCTYPE_H +# define _CL_HAVE_WCTYPE_H +# endif +#endif + +/* Define to 1 if you have the `wprintf' function. */ +/* #undef _CL_HAVE_WPRINTF */ + +#if defined(__MINGW32__) + /* Define to 1 if you have the `_filelength' function. */ +# ifndef _CL_HAVE__FILELENGTH +# define _CL_HAVE__FILELENGTH 1 +# endif +#endif + +/* How to define a static const in a class */ +#ifndef LUCENE_STATIC_CONSTANT_SYNTAX +#define LUCENE_STATIC_CONSTANT_SYNTAX 1 +#endif + +/* Name of package */ +#ifndef _CL_PACKAGE +#define _CL_PACKAGE "clucene-core" +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#ifndef _CL_PACKAGE_BUGREPORT +#define _CL_PACKAGE_BUGREPORT "" +#endif + +/* Define to the full name of this package. */ +#ifndef _CL_PACKAGE_NAME +#define _CL_PACKAGE_NAME "" +#endif + +/* Define to the full name and version of this package. */ +#ifndef _CL_PACKAGE_STRING +#define _CL_PACKAGE_STRING "" +#endif + +/* Define to the one symbol short name of this package. */ +#ifndef _CL_PACKAGE_TARNAME +#define _CL_PACKAGE_TARNAME "" +#endif + +/* Define to the version of this package. */ +#ifndef _CL_PACKAGE_VERSION +#define _CL_PACKAGE_VERSION "" +#endif + +/* Define to the necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef _CL_PTHREAD_CREATE_JOINABLE */ + +/* The size of a `unsigned char', as computed by sizeof. */ +/* #undef _CL_SIZEOF_UNSIGNED_CHAR */ + +/* The size of a `unsigned int', as computed by sizeof. */ +/* #undef _CL_SIZEOF_UNSIGNED_INT */ + +/* The size of a `unsigned long', as computed by sizeof. */ +/* #undef _CL_SIZEOF_UNSIGNED_LONG */ + +/* The size of a `unsigned long long', as computed by sizeof. */ +/* #undef _CL_SIZEOF_UNSIGNED_LONG_LONG */ + +/* The size of a `unsigned __int64', as computed by sizeof. */ +/* #undef _CL_SIZEOF_UNSIGNED___INT64 */ + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* #undef _CL_STAT_MACROS_BROKEN */ + +#if !defined(__HP_aCC) + /* Define to 1 if you have the ANSI C header files. */ +# ifndef _CL_STDC_HEADERS +# define _CL_STDC_HEADERS 1 +# endif + +/* Define to 1 if you can safely include both and . */ +# ifndef _CL_TIME_WITH_SYS_TIME +# define _CL_TIME_WITH_SYS_TIME 1 +# endif +#endif + +/* Version number of package */ +#ifndef _CL_VERSION +#define _CL_VERSION "0.9.17" +#endif + +/* Forces into Ascii mode */ +/* #undef _ASCII */ + +/* Conditional Debugging */ +/* #undef _CL__CND_DEBUG */ + +/* debugging option */ +/* #undef _DEBUG */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* If not already defined, then define as a datatype of *exactly* 32 bits. */ +/* #undef uint32_t */ + +/* If not already defined, then define as a datatype of *exactly* 64 bits. */ +/* #undef uint64_t */ + +/* If not already defined, then define as a datatype of *exactly* 8 bits. */ +/* #undef uint8_t */ + +/* once: +_SRC_CLUCENE_CLUCENE_CONFIG_H +*/ +#endif + + +#if defined Q_CC_MSVC && _MSC_VER < 1300 +# define LUCENE_NO_STDC_NAMESPACE +#endif + + +#endif // QCLUCENE_CONFIG_P_H + diff --git a/src/assistant/clucene/qclucene_global_p.h b/src/assistant/clucene/qclucene_global_p.h new file mode 100644 index 000000000..887b113e5 --- /dev/null +++ b/src/assistant/clucene/qclucene_global_p.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QCLUCENE_GLOBAL_P_H +#define QCLUCENE_GLOBAL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#if !defined(_MSC_VER) +# include "qclucene-config_p.h" +#endif + +#include +#include + +#if !defined(_MSC_VER) && !defined(__MINGW32__) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) +# if !defined(TCHAR) +# define TCHAR wchar_t +# endif +#else +# include +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#if !defined(QT_SHARED) && !defined(QT_DLL) +# define QHELP_EXPORT +#elif defined(QHELP_LIB) +# define QHELP_EXPORT Q_DECL_EXPORT +#else +# define QHELP_EXPORT Q_DECL_IMPORT +#endif + +// +// W A R N I N G +// ------------- +// +// adjustments here, need to be done in +// QTDIR/src/3rdparty/clucene/src/CLucene/StdHeader.h as well +// +#if defined(_LUCENE_DONTIMPLEMENT_NS_MACROS) + +#elif !defined(DISABLE_NAMESPACE) +# ifdef QT_NAMESPACE +# define CL_NS_DEF(sub) namespace QT_NAMESPACE { namespace lucene{ namespace sub{ +# define CL_NS_DEF2(sub,sub2) namespace QT_NAMESPACE { namespace lucene{ namespace sub{ namespace sub2 { + +# define CL_NS_END }}} +# define CL_NS_END2 }}}} + +# define CL_NS_USE(sub) using namespace QT_NAMESPACE::lucene::sub; +# define CL_NS_USE2(sub,sub2) using namespace QT_NAMESPACE::lucene::sub::sub2; + +# define CL_NS(sub) QT_NAMESPACE::lucene::sub +# define CL_NS2(sub,sub2) QT_NAMESPACE::lucene::sub::sub2 +# else +# define CL_NS_DEF(sub) namespace lucene{ namespace sub{ +# define CL_NS_DEF2(sub,sub2) namespace lucene{ namespace sub{ namespace sub2 { + +# define CL_NS_END }} +# define CL_NS_END2 }}} + +# define CL_NS_USE(sub) using namespace lucene::sub; +# define CL_NS_USE2(sub,sub2) using namespace lucene::sub::sub2; + +# define CL_NS(sub) lucene::sub +# define CL_NS2(sub,sub2) lucene::sub::sub2 +# endif +#else +# define CL_NS_DEF(sub) +# define CL_NS_DEF2(sub, sub2) +# define CL_NS_END +# define CL_NS_END2 +# define CL_NS_USE(sub) +# define CL_NS_USE2(sub,sub2) +# define CL_NS(sub) +# define CL_NS2(sub,sub2) +#endif + +namespace { + TCHAR* QStringToTChar(const QString &str) + { + TCHAR *string = new TCHAR[(str.length() +1) * sizeof(TCHAR)]; + memset(string, 0, (str.length() +1) * sizeof(TCHAR)); + #if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) + str.toWCharArray(string); + #else + const QByteArray ba = str.toAscii(); + strcpy(string, ba.constData()); + #endif + return string; + } + + QString TCharToQString(const TCHAR *string) + { + #if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) + QString retValue = QString::fromWCharArray(string); + return retValue; + #else + return QString(QLatin1String(string)); + #endif + } +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCLUCENE_GLOBAL_P_H diff --git a/src/assistant/clucene/qdocument.cpp b/src/assistant/clucene/qdocument.cpp new file mode 100644 index 000000000..3c4cc068d --- /dev/null +++ b/src/assistant/clucene/qdocument.cpp @@ -0,0 +1,180 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qdocument_p.h" +#include "qreader_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneDocumentPrivate::QCLuceneDocumentPrivate() + : QSharedData() +{ + document = 0; + deleteCLuceneDocument = true; +} + +QCLuceneDocumentPrivate::QCLuceneDocumentPrivate(const QCLuceneDocumentPrivate &other) + : QSharedData() +{ + document = _CL_POINTER(other.document); + deleteCLuceneDocument = other.deleteCLuceneDocument; +} + +QCLuceneDocumentPrivate::~QCLuceneDocumentPrivate() +{ + if (deleteCLuceneDocument) + _CLDECDELETE(document); +} + + +QCLuceneDocument::QCLuceneDocument() + : d(new QCLuceneDocumentPrivate()) +{ + // nothing todo + d->document = new lucene::document::Document(); +} + +QCLuceneDocument::~QCLuceneDocument() +{ + qDeleteAll(fieldList); + fieldList.clear(); +} + +void QCLuceneDocument::add(QCLuceneField *field) +{ + field->d->deleteCLuceneField = false; + d->document->add(*field->d->field); + fieldList.append(field); +} + +QCLuceneField* QCLuceneDocument::getField(const QString &name) const +{ + QCLuceneField* field = 0; + foreach (field, fieldList) { + if (field->name() == name && field->d->field != 0) + return field; + } + + field = 0; + TCHAR *fieldName = QStringToTChar(name); + lucene::document::Field *f = d->document->getField(fieldName); + if (f) { + field = new QCLuceneField(); + field->d->field = f; + fieldList.append(field); + field->d->deleteCLuceneField = false; + + lucene::util::Reader *r = f->readerValue(); + if (r) { + field->reader->d->reader = r; + field->reader->d->deleteCLuceneReader = false; + } + } + delete [] fieldName; + + return field; +} + +QString QCLuceneDocument::get(const QString &name) const +{ + QCLuceneField* field = getField(name); + if (field) + return field->stringValue(); + + return QString(); +} + +QString QCLuceneDocument::toString() const +{ + return TCharToQString(d->document->toString()); +} + +void QCLuceneDocument::setBoost(qreal boost) +{ + d->document->setBoost(qreal(boost)); +} + +qreal QCLuceneDocument::getBoost() const +{ + return qreal(d->document->getBoost()); +} + +void QCLuceneDocument::removeField(const QString &name) +{ + TCHAR *fieldName = QStringToTChar(name); + d->document->removeField(fieldName); + delete [] fieldName; + + QList tmp; + lucene::document::DocumentFieldEnumeration *dfe = d->document->fields(); + while (dfe->hasMoreElements()) { + const lucene::document::Field* f = dfe->nextElement(); + foreach (QCLuceneField* field, fieldList) { + if (f == field->d->field) { + tmp.append(field); + break; + } + } + } + _CLDELETE(dfe); + fieldList = tmp; +} + +void QCLuceneDocument::removeFields(const QString &name) +{ + for (qint32 i = fieldList.count() -1; i >= 0; --i) { + QCLuceneField* field = fieldList.at(i); + if (field->name() == name) + delete fieldList.takeAt(i); + } + + TCHAR *fieldName = QStringToTChar(name); + d->document->removeFields(fieldName); + delete [] fieldName; +} + +QStringList QCLuceneDocument::getValues(const QString &name) const +{ + TCHAR *fieldName = QStringToTChar(name); + TCHAR **values = d->document->getValues(fieldName); + + QStringList retValue; + if (values) { + for (qint32 i = 0; 0 != values[i]; ++i) { + retValue.append(TCharToQString((const TCHAR*)values[i])); + delete [] values[i]; values[i] = 0; + } + delete values; + } + + delete [] fieldName; + return retValue; +} + +void QCLuceneDocument::clear() +{ + d->document->clear(); + qDeleteAll(fieldList); + fieldList.clear(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qdocument_p.h b/src/assistant/clucene/qdocument_p.h new file mode 100644 index 000000000..31369af2a --- /dev/null +++ b/src/assistant/clucene/qdocument_p.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QDOCUMENT_P_H +#define QDOCUMENT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qfield_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include +#include +#include + +CL_NS_DEF(document) + class Document; +CL_NS_END +CL_NS_USE(document) + +QT_BEGIN_NAMESPACE + +class QCLuceneHits; +class QCLuceneIndexReader; +class QCLuceneIndexWriter; +class QCLuceneIndexSearcher; +class QCLuceneMultiSearcher; + +class QHELP_EXPORT QCLuceneDocumentPrivate : public QSharedData +{ +public: + QCLuceneDocumentPrivate(); + QCLuceneDocumentPrivate(const QCLuceneDocumentPrivate &other); + + ~QCLuceneDocumentPrivate(); + + Document *document; + bool deleteCLuceneDocument; + +private: + QCLuceneDocumentPrivate &operator=(const QCLuceneDocumentPrivate &other); +}; + +class QHELP_EXPORT QCLuceneDocument +{ +public: + QCLuceneDocument(); + ~QCLuceneDocument(); + + void add(QCLuceneField *field); + QCLuceneField* getField(const QString &name) const; + QString get(const QString &name) const; + QString toString() const; + void setBoost(qreal boost); + qreal getBoost() const; + void removeField(const QString &name); + void removeFields(const QString &name); + QStringList getValues(const QString &name) const; + void clear(); + +protected: + friend class QCLuceneHits; + friend class QCLuceneIndexReader; + friend class QCLuceneIndexWriter; + friend class QCLuceneIndexSearcher; + friend class QCLuceneMultiSearcher; + QSharedDataPointer d; + +private: + mutable QList fieldList; +}; + +QT_END_NAMESPACE + +#endif // QDOCUMENT_P_H diff --git a/src/assistant/clucene/qfield.cpp b/src/assistant/clucene/qfield.cpp new file mode 100644 index 000000000..448acf0e6 --- /dev/null +++ b/src/assistant/clucene/qfield.cpp @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qfield_p.h" +#include "qreader_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneFieldPrivate::QCLuceneFieldPrivate() + : QSharedData() +{ + field = 0; + deleteCLuceneField = true; +} + +QCLuceneFieldPrivate::QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other) + : QSharedData() +{ + field = _CL_POINTER(other.field); + deleteCLuceneField = other.deleteCLuceneField; +} + +QCLuceneFieldPrivate::~QCLuceneFieldPrivate() +{ + if (deleteCLuceneField) + _CLDECDELETE(field); +} + + +QCLuceneField::QCLuceneField() + : d(new QCLuceneFieldPrivate()) + , reader(0) +{ + // nothing todo +} + +QCLuceneField::QCLuceneField(const QString &name, const QString &value, int configs) + : d(new QCLuceneFieldPrivate()) + , reader(0) +{ + TCHAR* fieldName = QStringToTChar(name); + TCHAR* fieldValue = QStringToTChar(value); + + d->field = new lucene::document::Field(fieldName, fieldValue, configs); + + delete [] fieldName; + delete [] fieldValue; +} + +QCLuceneField::QCLuceneField(const QString &name, QCLuceneReader *reader, + int configs) + : d(new QCLuceneFieldPrivate()) + , reader(reader) +{ + TCHAR* fieldName = QStringToTChar(name); + + reader->d->deleteCLuceneReader = false; // clucene takes ownership + d->field = new lucene::document::Field(fieldName, reader->d->reader, configs); + + delete [] fieldName; +} + +QCLuceneField::~QCLuceneField() +{ + delete reader; +} + +QString QCLuceneField::name() const +{ + return TCharToQString(d->field->name()); +} + +QString QCLuceneField::stringValue() const +{ + return TCharToQString((const TCHAR*)d->field->stringValue()); +} + +QCLuceneReader* QCLuceneField::readerValue() const +{ + return reader; +} + +bool QCLuceneField::isStored() const +{ + return d->field->isStored(); +} + +bool QCLuceneField::isIndexed() const +{ + return d->field->isIndexed(); +} + +bool QCLuceneField::isTokenized() const +{ + return d->field->isTokenized(); +} + +bool QCLuceneField::isCompressed() const +{ + return d->field->isCompressed(); +} + +void QCLuceneField::setConfig(int termVector) +{ + d->field->setConfig(termVector); +} + +bool QCLuceneField::isTermVectorStored() const +{ + return d->field->isTermVectorStored(); +} + +bool QCLuceneField::isStoreOffsetWithTermVector() const +{ + return d->field->isStoreOffsetWithTermVector(); +} + +bool QCLuceneField::isStorePositionWithTermVector() const +{ + return d->field->isStorePositionWithTermVector(); +} + +qreal QCLuceneField::getBoost() const +{ + return qreal(d->field->getBoost()); +} + +void QCLuceneField::setBoost(qreal value) +{ + d->field->setBoost(qreal(value)); +} + +bool QCLuceneField::isBinary() const +{ + return d->field->isBinary(); +} + +bool QCLuceneField::getOmitNorms() const +{ + return d->field->getOmitNorms(); +} + +void QCLuceneField::setOmitNorms(bool omitNorms) +{ + d->field->setOmitNorms(omitNorms); +} + +QString QCLuceneField::toString() const +{ + return TCharToQString(d->field->toString()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qfield_p.h b/src/assistant/clucene/qfield_p.h new file mode 100644 index 000000000..39f2ff308 --- /dev/null +++ b/src/assistant/clucene/qfield_p.h @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QFIELD_P_H +#define QFIELD_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qclucene_global_p.h" + +#include +#include +#include + +CL_NS_DEF(document) + class Field; +CL_NS_END +CL_NS_USE(document) + +QT_BEGIN_NAMESPACE + +class QCLuceneReader; +class QCLuceneDocument; + +class QHELP_EXPORT QCLuceneFieldPrivate : public QSharedData +{ +public: + QCLuceneFieldPrivate(); + QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other); + + ~QCLuceneFieldPrivate(); + + Field *field; + bool deleteCLuceneField; + +private: + QCLuceneFieldPrivate &operator=(const QCLuceneFieldPrivate &other); +}; + +class QHELP_EXPORT QCLuceneField +{ +public: + enum Store { + STORE_YES = 1, + STORE_NO = 2, + STORE_COMPRESS = 4 + }; + + enum Index { + INDEX_NO = 16, + INDEX_TOKENIZED = 32, + INDEX_UNTOKENIZED = 64, + INDEX_NONORMS = 128 + }; + + enum TermVector { + TERMVECTOR_NO = 256, + TERMVECTOR_YES = 512, + TERMVECTOR_WITH_POSITIONS = 1024, + TERMVECTOR_WITH_OFFSETS = 2048 + }; + + QCLuceneField(const QString &name, const QString &value, int configs); + QCLuceneField(const QString &name, QCLuceneReader *reader, int configs); + ~QCLuceneField(); + + QString name() const; + QString stringValue() const; + QCLuceneReader* readerValue() const; + bool isStored() const; + bool isIndexed() const; + bool isTokenized() const; + bool isCompressed() const; + void setConfig(int termVector); + bool isTermVectorStored() const; + bool isStoreOffsetWithTermVector() const; + bool isStorePositionWithTermVector() const; + qreal getBoost() const; + void setBoost(qreal value); + bool isBinary() const; + bool getOmitNorms() const; + void setOmitNorms(bool omitNorms); + QString toString() const; + +protected: + QCLuceneField(); + friend class QCLuceneDocument; + QSharedDataPointer d; + +private: + QCLuceneReader* reader; +}; + +QT_END_NAMESPACE + +#endif // QFIELD_P_H diff --git a/src/assistant/clucene/qfilter.cpp b/src/assistant/clucene/qfilter.cpp new file mode 100644 index 000000000..4807193ff --- /dev/null +++ b/src/assistant/clucene/qfilter.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qfilter_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneFilterPrivate::QCLuceneFilterPrivate() + : QSharedData() +{ + filter = 0; + deleteCLuceneFilter = true; +} + +QCLuceneFilterPrivate::QCLuceneFilterPrivate(const QCLuceneFilterPrivate &other) + : QSharedData() +{ + filter = _CL_POINTER(other.filter); + deleteCLuceneFilter = other.deleteCLuceneFilter; +} + +QCLuceneFilterPrivate::~QCLuceneFilterPrivate () +{ + if (deleteCLuceneFilter) + _CLDECDELETE(filter); +} + + +QCLuceneFilter::QCLuceneFilter() + : d(new QCLuceneFilterPrivate()) +{ + // nothing todo +} + +QCLuceneFilter::~QCLuceneFilter() +{ + // nothing todo +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qfilter_p.h b/src/assistant/clucene/qfilter_p.h new file mode 100644 index 000000000..67f6615b1 --- /dev/null +++ b/src/assistant/clucene/qfilter_p.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QFilter_P_H +#define QFilter_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qclucene_global_p.h" + +#include +#include + +CL_NS_DEF(search) + class Filter; +CL_NS_END +CL_NS_USE(search) + +QT_BEGIN_NAMESPACE + +class QCLuceneHits; +class QCLuceneSearcher; + +class QHELP_EXPORT QCLuceneFilterPrivate : public QSharedData +{ +public: + QCLuceneFilterPrivate(); + QCLuceneFilterPrivate(const QCLuceneFilterPrivate &other); + + ~QCLuceneFilterPrivate (); + + Filter *filter; + bool deleteCLuceneFilter; + +private: + QCLuceneFilterPrivate &operator=(const QCLuceneFilterPrivate &other); +}; + +class QHELP_EXPORT QCLuceneFilter +{ + QCLuceneFilter(); + virtual ~QCLuceneFilter(); + +protected: + friend class QCLuceneHits; + friend class QCLuceneSearcher; + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +#endif // QFilter_P_H diff --git a/src/assistant/clucene/qhits.cpp b/src/assistant/clucene/qhits.cpp new file mode 100644 index 000000000..5223a743d --- /dev/null +++ b/src/assistant/clucene/qhits.cpp @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qhits_p.h" +#include "qsearchable_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneHitsPrivate::QCLuceneHitsPrivate() + : QSharedData() +{ + hits = 0; + deleteCLuceneHits = true; +} + +QCLuceneHitsPrivate::QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other) + : QSharedData() +{ + hits = _CL_POINTER(other.hits); + deleteCLuceneHits = other.deleteCLuceneHits; +} + +QCLuceneHitsPrivate::~QCLuceneHitsPrivate() +{ + if (deleteCLuceneHits) + _CLDECDELETE(hits); +} + + +QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, + const QCLuceneQuery &query, const QCLuceneFilter &filter) + : d(new QCLuceneHitsPrivate()) +{ + d->hits = new lucene::search::Hits(searcher.d->searchable, query.d->query, + filter.d->filter); +} + +QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, + const QCLuceneFilter &filter, const QCLuceneSort &sort) + : d(new QCLuceneHitsPrivate()) +{ + d->hits = new lucene::search::Hits(searcher.d->searchable, query.d->query, + filter.d->filter, sort.d->sort); +} + +QCLuceneHits::~QCLuceneHits() +{ + // nothing todo +} + +QCLuceneDocument QCLuceneHits::document(const qint32 index) +{ + // TODO: check this + QCLuceneDocument document; + document.d->deleteCLuceneDocument = false; + lucene::document::Document &doc = d->hits->doc(int32_t(index)); + document.d->document = &doc; + + return document; +} + +qint32 QCLuceneHits::length() const +{ + return qint32(d->hits->length()); +} + +qint32 QCLuceneHits::id(const qint32 index) +{ + return qint32(d->hits->id(int32_t(index))); +} + +qreal QCLuceneHits::score(const qint32 index) +{ + return qreal(d->hits->score(int32_t(index))); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qhits_p.h b/src/assistant/clucene/qhits_p.h new file mode 100644 index 000000000..98cd7021a --- /dev/null +++ b/src/assistant/clucene/qhits_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QHITS_P_H +#define QHITS_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qsort_p.h" +#include "qquery_p.h" +#include "qfilter_p.h" +#include "qdocument_p.h" +#include "qclucene_global_p.h" + +#include +#include + +CL_NS_DEF(search) + class Hits; +CL_NS_END +CL_NS_USE(search) + +QT_BEGIN_NAMESPACE + +class QCLuceneSearcher; + +class QHELP_EXPORT QCLuceneHitsPrivate : public QSharedData +{ +public: + QCLuceneHitsPrivate(); + QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other); + + ~QCLuceneHitsPrivate(); + + Hits *hits; + bool deleteCLuceneHits; + +private: + QCLuceneHitsPrivate &operator=(const QCLuceneHitsPrivate &other); +}; + +class QHELP_EXPORT QCLuceneHits +{ +public: + QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, + const QCLuceneFilter &filter); + QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, + const QCLuceneFilter &filter, const QCLuceneSort &sort); + virtual ~QCLuceneHits(); + + QCLuceneDocument document(const qint32 index); + qint32 length() const; + qint32 id (const qint32 index); + qreal score(const qint32 index); + +protected: + friend class QCLuceneSearcher; + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +#endif // QHITS_P_H diff --git a/src/assistant/clucene/qindexreader.cpp b/src/assistant/clucene/qindexreader.cpp new file mode 100644 index 000000000..285a96334 --- /dev/null +++ b/src/assistant/clucene/qindexreader.cpp @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qindexreader_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneIndexReaderPrivate::QCLuceneIndexReaderPrivate() + : QSharedData() +{ + reader = 0; + deleteCLuceneIndexReader = true; +} + +QCLuceneIndexReaderPrivate::QCLuceneIndexReaderPrivate(const QCLuceneIndexReaderPrivate &other) + : QSharedData() +{ + reader = _CL_POINTER(other.reader); + deleteCLuceneIndexReader = other.deleteCLuceneIndexReader; +} + +QCLuceneIndexReaderPrivate::~QCLuceneIndexReaderPrivate() +{ + if (deleteCLuceneIndexReader) + _CLDECDELETE(reader); +} + + +QCLuceneIndexReader::QCLuceneIndexReader() + : d(new QCLuceneIndexReaderPrivate()) +{ + // nothing todo, private +} + +QCLuceneIndexReader::~QCLuceneIndexReader() +{ + // nothing todo +} + +bool QCLuceneIndexReader::isLuceneFile(const QString &filename) +{ + using namespace lucene::index; + + return IndexReader::isLuceneFile(filename); +} + +bool QCLuceneIndexReader::indexExists(const QString &directory) +{ + using namespace lucene::index; + return IndexReader::indexExists(directory); +} + +QCLuceneIndexReader QCLuceneIndexReader::open(const QString &path) +{ + using namespace lucene::index; + + QCLuceneIndexReader indexReader; + indexReader.d->reader = IndexReader::open(path); + + return indexReader; +} + +void QCLuceneIndexReader::unlock(const QString &path) +{ + using namespace lucene::index; + IndexReader::unlock(path); +} + +bool QCLuceneIndexReader::isLocked(const QString &directory) +{ + using namespace lucene::index; + return IndexReader::isLocked(directory); +} + +quint64 QCLuceneIndexReader::lastModified(const QString &directory) +{ + using namespace lucene::index; + return quint64(IndexReader::lastModified(directory)); +} + +qint64 QCLuceneIndexReader::getCurrentVersion(const QString &directory) +{ + using namespace lucene::index; + return qint64(IndexReader::getCurrentVersion(directory)); +} + +void QCLuceneIndexReader::close() +{ + d->reader->close(); +} + +bool QCLuceneIndexReader::isCurrent() +{ + return d->reader->isCurrent(); +} + +void QCLuceneIndexReader::undeleteAll() +{ + d->reader->undeleteAll(); +} + +qint64 QCLuceneIndexReader::getVersion() +{ + return qint64(d->reader->getVersion()); +} + +void QCLuceneIndexReader::deleteDocument(qint32 docNum) +{ + d->reader->deleteDocument(int32_t(docNum)); +} + +bool QCLuceneIndexReader::hasNorms(const QString &field) +{ + TCHAR *fieldName = QStringToTChar(field); + bool retValue = d->reader->hasNorms(fieldName); + delete [] fieldName; + + return retValue; +} + +qint32 QCLuceneIndexReader::deleteDocuments(const QCLuceneTerm &term) +{ + return d->reader->deleteDocuments(term.d->term); +} + +bool QCLuceneIndexReader::document(qint32 index, QCLuceneDocument &document) +{ + if (!document.d->document) + document.d->document = new lucene::document::Document(); + + if (d->reader->document(int32_t(index), document.d->document)) + return true; + + return false; +} + +void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, qreal value) +{ + TCHAR *fieldName = QStringToTChar(field); + d->reader->setNorm(int32_t(doc), fieldName, qreal(value)); + delete [] fieldName; +} + +void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, quint8 value) +{ + TCHAR *fieldName = QStringToTChar(field); + d->reader->setNorm(int32_t(doc), fieldName, uint8_t(value)); + delete [] fieldName; +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qindexreader_p.h b/src/assistant/clucene/qindexreader_p.h new file mode 100644 index 000000000..7421daa17 --- /dev/null +++ b/src/assistant/clucene/qindexreader_p.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QINDEXREADER_P_H +#define QINDEXREADER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qterm_p.h" +#include "qdocument_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include +#include + +CL_NS_DEF(index) + class IndexReader; +CL_NS_END +CL_NS_USE(index) + +QT_BEGIN_NAMESPACE + +class QCLuceneIndexWriter; +class QCLuceneIndexSearcher; + +class QHELP_EXPORT QCLuceneIndexReaderPrivate : public QSharedData +{ +public: + QCLuceneIndexReaderPrivate(); + QCLuceneIndexReaderPrivate(const QCLuceneIndexReaderPrivate &other); + + ~QCLuceneIndexReaderPrivate(); + + IndexReader *reader; + bool deleteCLuceneIndexReader; + +private: + QCLuceneIndexReaderPrivate &operator=(const QCLuceneIndexReaderPrivate &other); +}; + +class QHELP_EXPORT QCLuceneIndexReader +{ +public: + enum FieldOption { + ALL = 1, + INDEXED = 2, + UNINDEXED = 4, + INDEXED_WITH_TERMVECTOR = 8, + INDEXED_NO_TERMVECTOR = 16, + TERMVECTOR = 32, + TERMVECTOR_WITH_POSITION = 64, + TERMVECTOR_WITH_OFFSET = 128, + TERMVECTOR_WITH_POSITION_OFFSET = 256 + }; + + virtual ~QCLuceneIndexReader(); + + static bool isLuceneFile(const QString &filename); + static bool indexExists(const QString &directory); + static QCLuceneIndexReader open(const QString &path); + + static void unlock(const QString &path); + static bool isLocked(const QString &directory); + + static quint64 lastModified(const QString &directory); + static qint64 getCurrentVersion(const QString &directory); + + void close(); + bool isCurrent(); + void undeleteAll(); + qint64 getVersion(); + void deleteDocument(qint32 docNum); + bool hasNorms(const QString &field); + qint32 deleteDocuments(const QCLuceneTerm &term); + bool document(qint32 index, QCLuceneDocument &document); + void setNorm(qint32 doc, const QString &field, qreal value); + void setNorm(qint32 doc, const QString &field, quint8 value); + +protected: + friend class QCLuceneIndexWriter; + friend class QCLuceneIndexSearcher; + QSharedDataPointer d; + +private: + QCLuceneIndexReader(); +}; + +QT_END_NAMESPACE + +#endif // QINDEXREADER_P_H diff --git a/src/assistant/clucene/qindexwriter.cpp b/src/assistant/clucene/qindexwriter.cpp new file mode 100644 index 000000000..1f579eb65 --- /dev/null +++ b/src/assistant/clucene/qindexwriter.cpp @@ -0,0 +1,191 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qindexwriter_p.h" +#include "qindexreader_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneIndexWriterPrivate::QCLuceneIndexWriterPrivate() + : QSharedData() +{ + writer = 0; + deleteCLuceneIndexWriter = true; +} + +QCLuceneIndexWriterPrivate::QCLuceneIndexWriterPrivate(const QCLuceneIndexWriterPrivate &other) + : QSharedData() +{ + writer = _CL_POINTER(other.writer); + deleteCLuceneIndexWriter = other.deleteCLuceneIndexWriter; +} + +QCLuceneIndexWriterPrivate::~QCLuceneIndexWriterPrivate() +{ + if (deleteCLuceneIndexWriter) + _CLDECDELETE(writer); +} + + +QCLuceneIndexWriter::QCLuceneIndexWriter(const QString &path, + QCLuceneAnalyzer &analyzer, + bool create, bool closeDir) + : d(new QCLuceneIndexWriterPrivate()) + , analyzer(analyzer) +{ + d->writer = new lucene::index::IndexWriter(path, + analyzer.d->analyzer, create, closeDir); +} + +QCLuceneIndexWriter::~QCLuceneIndexWriter() +{ + // nothing todo +} + +void QCLuceneIndexWriter::close() +{ + d->writer->close(); +} + +void QCLuceneIndexWriter::optimize() +{ + d->writer->optimize(); +} + +qint32 QCLuceneIndexWriter::docCount() +{ + return qint32(d->writer->docCount()); +} + +QCLuceneAnalyzer QCLuceneIndexWriter::getAnalyzer() +{ + return analyzer; +} + +void QCLuceneIndexWriter::addIndexes(const QList &readers) +{ + using namespace lucene::index; + IndexReader** readerArray = new IndexReader*[readers.count()]; + + for (int i = 0; i < readers.count(); ++i) + readerArray[i] = (readers.at(i))->d->reader; + + d->writer->addIndexes(readerArray); + delete [] readerArray; +} + +void QCLuceneIndexWriter::addDocument(QCLuceneDocument &doc, + QCLuceneAnalyzer &analyzer) +{ + if (doc.d->document) + d->writer->addDocument(doc.d->document, analyzer.d->analyzer); +} + +qint32 QCLuceneIndexWriter::getMaxFieldLength() const +{ + return qint32(d->writer->getMaxFieldLength()); +} + +void QCLuceneIndexWriter::setMaxFieldLength(qint32 value) +{ + d->writer->setMaxFieldLength(int32_t(value)); +} + +qint32 QCLuceneIndexWriter::getMaxBufferedDocs() const +{ + return qint32(d->writer->getMaxBufferedDocs()); +} + +void QCLuceneIndexWriter::setMaxBufferedDocs(qint32 value) +{ + d->writer->setMaxBufferedDocs(int32_t(value)); +} + +qint64 QCLuceneIndexWriter::getWriteLockTimeout() const +{ + return qint64(d->writer->getWriteLockTimeout()); +} + +void QCLuceneIndexWriter::setWriteLockTimeout(qint64 writeLockTimeout) +{ + d->writer->setWriteLockTimeout(int64_t(writeLockTimeout)); +} + +qint64 QCLuceneIndexWriter::getCommitLockTimeout() const +{ + return qint64(d->writer->getCommitLockTimeout()); +} + +void QCLuceneIndexWriter::setCommitLockTimeout(qint64 commitLockTimeout) +{ + d->writer->setCommitLockTimeout(int64_t(commitLockTimeout)); +} + +qint32 QCLuceneIndexWriter::getMergeFactor() const +{ + return qint32(d->writer->getMergeFactor()); +} + +void QCLuceneIndexWriter::setMergeFactor(qint32 value) +{ + d->writer->setMergeFactor(int32_t(value)); +} + +qint32 QCLuceneIndexWriter::getTermIndexInterval() const +{ + return qint32(d->writer->getTermIndexInterval()); +} + +void QCLuceneIndexWriter::setTermIndexInterval(qint32 interval) +{ + d->writer->setTermIndexInterval(int32_t(interval)); +} + +qint32 QCLuceneIndexWriter::getMinMergeDocs() const +{ + return qint32(d->writer->getMinMergeDocs()); +} + +void QCLuceneIndexWriter::setMinMergeDocs(qint32 value) +{ + d->writer->setMinMergeDocs(int32_t(value)); +} + +qint32 QCLuceneIndexWriter::getMaxMergeDocs() const +{ + return qint32(d->writer->getMaxMergeDocs()); +} + +void QCLuceneIndexWriter::setMaxMergeDocs(qint32 value) +{ + d->writer->setMaxMergeDocs(int32_t(value)); +} + +bool QCLuceneIndexWriter::getUseCompoundFile() const +{ + return d->writer->getUseCompoundFile(); +} + +void QCLuceneIndexWriter::setUseCompoundFile(bool value) +{ + d->writer->setUseCompoundFile(value); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qindexwriter_p.h b/src/assistant/clucene/qindexwriter_p.h new file mode 100644 index 000000000..1f9c86115 --- /dev/null +++ b/src/assistant/clucene/qindexwriter_p.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QINDEXWRITER_P_H +#define QINDEXWRITER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qanalyzer_p.h" +#include "qdocument_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include + +CL_NS_DEF(index) + class IndexWriter; +CL_NS_END +CL_NS_USE(index) + +QT_BEGIN_NAMESPACE + +class QCLuceneIndexReader; + +class QHELP_EXPORT QCLuceneIndexWriterPrivate : public QSharedData +{ +public: + QCLuceneIndexWriterPrivate(); + QCLuceneIndexWriterPrivate(const QCLuceneIndexWriterPrivate &other); + + ~QCLuceneIndexWriterPrivate(); + + IndexWriter *writer; + bool deleteCLuceneIndexWriter; + +private: + QCLuceneIndexWriterPrivate &operator=(const QCLuceneIndexWriterPrivate &other); +}; + +class QHELP_EXPORT QCLuceneIndexWriter +{ +public: + enum { + DEFAULT_MERGE_FACTOR = 10, + COMMIT_LOCK_TIMEOUT = 10000, + DEFAULT_MAX_BUFFERED_DOCS = 10, + DEFAULT_MAX_FIELD_LENGTH = 10000, + DEFAULT_TERM_INDEX_INTERVAL = 128, + DEFAULT_MAX_MERGE_DOCS = 0x7FFFFFFFL + }; + + QCLuceneIndexWriter(const QString &path, QCLuceneAnalyzer &analyzer, + bool create, bool closeDir = true); + virtual ~QCLuceneIndexWriter(); + + void close(); + void optimize(); + qint32 docCount(); + QCLuceneAnalyzer getAnalyzer(); + + void addIndexes(const QList &readers); + void addDocument(QCLuceneDocument &doc, QCLuceneAnalyzer &analyzer); + + qint32 getMaxFieldLength() const; + void setMaxFieldLength(qint32 value); + + qint32 getMaxBufferedDocs() const; + void setMaxBufferedDocs(qint32 value); + + qint64 getWriteLockTimeout() const; + void setWriteLockTimeout(qint64 writeLockTimeout); + + qint64 getCommitLockTimeout() const; + void setCommitLockTimeout(qint64 commitLockTimeout); + + qint32 getMergeFactor() const; + void setMergeFactor(qint32 value); + + qint32 getTermIndexInterval() const; + void setTermIndexInterval(qint32 interval); + + qint32 getMinMergeDocs() const; + void setMinMergeDocs(qint32 value); + + qint32 getMaxMergeDocs() const; + void setMaxMergeDocs(qint32 value); + + bool getUseCompoundFile() const; + void setUseCompoundFile(bool value); + +protected: + QSharedDataPointer d; + +private: + QCLuceneAnalyzer analyzer; +}; + +QT_END_NAMESPACE + +#endif // QINDEXWRITER_P_H diff --git a/src/assistant/clucene/qquery.cpp b/src/assistant/clucene/qquery.cpp new file mode 100644 index 000000000..170341cdd --- /dev/null +++ b/src/assistant/clucene/qquery.cpp @@ -0,0 +1,358 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qquery_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneQueryPrivate::QCLuceneQueryPrivate() + : QSharedData() +{ + query = 0; + deleteCLuceneQuery = true; +} + +QCLuceneQueryPrivate::QCLuceneQueryPrivate(const QCLuceneQueryPrivate &other) + : QSharedData() +{ + query = _CL_POINTER(other.query); + deleteCLuceneQuery = other.deleteCLuceneQuery; +} + +QCLuceneQueryPrivate::~QCLuceneQueryPrivate() +{ + if (deleteCLuceneQuery) + _CLDECDELETE(query); +} + + +QCLuceneQuery::QCLuceneQuery() + : d(new QCLuceneQueryPrivate()) +{ + // nothing todo, private +} + +QCLuceneQuery::~QCLuceneQuery() +{ + // nothing todo +} + +void QCLuceneQuery::setBoost(qreal boost) +{ + d->query->setBoost(qreal(boost)); +} + +qreal QCLuceneQuery::getBoost() const +{ + return qreal(d->query->getBoost()); +} + +QString QCLuceneQuery::getQueryName() const +{ + return TCharToQString(d->query->getQueryName()); +} + +bool QCLuceneQuery::instanceOf(const QString &other) const +{ + if (other == getQueryName()) + return true; + + return false; +} + +QString QCLuceneQuery::toString(const QString &field) const +{ + TCHAR *fieldName = QStringToTChar(field); + QString retValue = TCharToQString(d->query->toString(fieldName)); + delete [] fieldName; + + return retValue; +} + +quint32 QCLuceneQuery::hashCode() const +{ + return quint32(d->query->hashCode()); +} + +QString QCLuceneQuery::toString() const +{ + return TCharToQString(d->query->toString()); +} + +bool QCLuceneQuery::equals(const QCLuceneQuery &other) const +{ + return d->query->equals(other.d->query); +} + + +QCLucenePrefixQuery::QCLucenePrefixQuery(const QCLuceneTerm &prefix) + : QCLuceneQuery() + , prefix(prefix) +{ + d->query = new lucene::search::PrefixQuery(prefix.d->term); +} + +QCLucenePrefixQuery::~QCLucenePrefixQuery() +{ + // nothing todo +} + +QString QCLucenePrefixQuery::getClassName() +{ + return TCharToQString(lucene::search::PrefixQuery::getClassName()); +} + +QCLuceneTerm QCLucenePrefixQuery::getPrefix() const +{ + return prefix; +} + + +QCLuceneRangeQuery::QCLuceneRangeQuery(const QCLuceneTerm &lowerTerm, + const QCLuceneTerm &upperTerm, + bool inclusive) + : QCLuceneQuery() + , lowerTerm(lowerTerm) + , upperTerm(upperTerm) +{ + d->query = new lucene::search::RangeQuery(lowerTerm.d->term, + upperTerm.d->term, inclusive); +} + +QCLuceneRangeQuery::~QCLuceneRangeQuery() +{ + // nothing todo +} + +QString QCLuceneRangeQuery::getClassName() +{ + return TCharToQString(lucene::search::RangeQuery::getClassName()); +} + +QCLuceneTerm QCLuceneRangeQuery::getLowerTerm() const +{ + return lowerTerm; +} + +QCLuceneTerm QCLuceneRangeQuery::getUpperTerm() const +{ + return upperTerm; +} + +bool QCLuceneRangeQuery::isInclusive() const +{ + lucene::search::RangeQuery *query = + static_cast (d->query); + + if (query == 0) + return false; + + return query->isInclusive(); +} + +QString QCLuceneRangeQuery::getField() const +{ + lucene::search::RangeQuery *query = + static_cast (d->query); + + if (query == 0) + return QString(); + + return TCharToQString(query->getField()); +} + + +QCLuceneTermQuery::QCLuceneTermQuery(const QCLuceneTerm &term) + : QCLuceneQuery() + , term(term) +{ + d->query = new lucene::search::TermQuery(term.d->term); +} + +QCLuceneTermQuery::~QCLuceneTermQuery() +{ + // nothing todo +} + +QString QCLuceneTermQuery::getClassName() +{ + return TCharToQString(lucene::search::TermQuery::getClassName()); +} + +QCLuceneTerm QCLuceneTermQuery::getTerm() const +{ + return term; +} + + +QCLuceneBooleanQuery::QCLuceneBooleanQuery() + : QCLuceneQuery() +{ + d->query = new lucene::search::BooleanQuery(); +} + +QCLuceneBooleanQuery::~QCLuceneBooleanQuery() +{ + qDeleteAll(queries); +} + +QString QCLuceneBooleanQuery::getClassName() +{ + return TCharToQString(lucene::search::BooleanQuery::getClassName()); +} + +quint32 QCLuceneBooleanQuery::getClauseCount() const +{ + lucene::search::BooleanQuery *query = + static_cast (d->query); + + if (query == 0) + return 1024; + + return quint32(query->getClauseCount()); +} + +quint32 QCLuceneBooleanQuery::getMaxClauseCount() const +{ + lucene::search::BooleanQuery *query = + static_cast (d->query); + + if (query == 0) + return 1024; + + return quint32(query->getMaxClauseCount()); +} + +void QCLuceneBooleanQuery::setMaxClauseCount(quint32 maxClauseCount) +{ + lucene::search::BooleanQuery *query = + static_cast (d->query); + + if (query == 0) + return; + + query->setMaxClauseCount(size_t(maxClauseCount)); +} + +void QCLuceneBooleanQuery::add(QCLuceneQuery *query, bool required, bool prohibited) +{ + add(query, false, required, prohibited); +} + +void QCLuceneBooleanQuery::add(QCLuceneQuery *query, bool delQuery, + bool required, bool prohibited) +{ + lucene::search::BooleanQuery *booleanQuery = + static_cast (d->query); + + if (booleanQuery == 0) + return; + + booleanQuery->add(query->d->query, delQuery, required, prohibited); + + if (delQuery) { + queries.append(query); + query->d->deleteCLuceneQuery = false; + } +} + + +QCLucenePhraseQuery::QCLucenePhraseQuery() + : QCLuceneQuery() +{ + d->query = new lucene::search::PhraseQuery(); +} + +QCLucenePhraseQuery::~QCLucenePhraseQuery() +{ + termList.clear(); +} + +QString QCLucenePhraseQuery::getClassName() +{ + return TCharToQString(lucene::search::RangeQuery::getClassName()); +} + +qint32 QCLucenePhraseQuery::getSlop() const +{ + lucene::search::PhraseQuery *phraseQuery = + static_cast (d->query); + + if (phraseQuery == 0) + return 0; + + return qint32(phraseQuery->getSlop()); +} + +void QCLucenePhraseQuery::setSlop(const qint32 slop) +{ + lucene::search::PhraseQuery *phraseQuery = + static_cast (d->query); + + if (phraseQuery == 0) + return; + + phraseQuery->setSlop(int32_t(slop)); +} + +void QCLucenePhraseQuery::addTerm(const QCLuceneTerm &term) +{ + lucene::search::PhraseQuery *phraseQuery = + static_cast (d->query); + + if (phraseQuery == 0) + return; + + termList.append(term); + phraseQuery->add(term.d->term); +} + +void QCLucenePhraseQuery::addTerm(const QCLuceneTerm &term, qint32 position) +{ + lucene::search::PhraseQuery *phraseQuery = + static_cast (d->query); + + if (phraseQuery == 0) + return; + + termList.insert(position, term); + phraseQuery->add(term.d->term, int32_t(position)); + +} + +QString QCLucenePhraseQuery::getFieldName() const +{ + lucene::search::PhraseQuery *phraseQuery = + static_cast (d->query); + + if (phraseQuery == 0) + return QString(); + + return TCharToQString(phraseQuery->getFieldName()); +} + +QList QCLucenePhraseQuery::getTerms() const +{ + return termList; +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qquery_p.h b/src/assistant/clucene/qquery_p.h new file mode 100644 index 000000000..3268b7c42 --- /dev/null +++ b/src/assistant/clucene/qquery_p.h @@ -0,0 +1,188 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QQUERY_P_H +#define QQUERY_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qterm_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include +#include + +CL_NS_DEF(search) + class Query; +CL_NS_END +CL_NS_USE(search) + +QT_BEGIN_NAMESPACE + +class QCLuceneHits; +class QCLuceneTermQuery; +class QCLuceneRangeQuery; +class QCLuceneQueryParser; +class QCLucenePrefixQuery; +class QCLuceneBooleanQuery; +class QCLucenePhraseQuery; + +class QHELP_EXPORT QCLuceneQueryPrivate : public QSharedData +{ +public: + QCLuceneQueryPrivate(); + QCLuceneQueryPrivate(const QCLuceneQueryPrivate &other); + + ~QCLuceneQueryPrivate(); + + Query *query; + bool deleteCLuceneQuery; + +private: + QCLuceneQueryPrivate &operator=(const QCLuceneQueryPrivate &other); +}; + +class QHELP_EXPORT QCLuceneQuery +{ +public: + virtual ~QCLuceneQuery(); + + void setBoost(qreal boost); + qreal getBoost() const; + QString getQueryName() const; + bool instanceOf(const QString &other) const; + QString toString(const QString &field) const; + quint32 hashCode() const; + QString toString() const; + bool equals(const QCLuceneQuery &other) const; + +protected: + friend class QCLuceneHits; + friend class QCLuceneTermQuery; + friend class QCLuceneRangeQuery; + friend class QCLucenePrefixQuery; + friend class QCLuceneQueryParser; + friend class QCLuceneBooleanQuery; + friend class QCLucenePhraseQuery; + QSharedDataPointer d; + +private: + QCLuceneQuery(); +}; + +class QHELP_EXPORT QCLucenePrefixQuery : public QCLuceneQuery +{ +public: + QCLucenePrefixQuery(const QCLuceneTerm &prefix); + ~QCLucenePrefixQuery(); + + static QString getClassName(); + + QCLuceneTerm getPrefix() const; + +private: + QCLuceneTerm prefix; +}; + +class QHELP_EXPORT QCLuceneRangeQuery : public QCLuceneQuery +{ +public: + QCLuceneRangeQuery(const QCLuceneTerm &lowerTerm, + const QCLuceneTerm &upperTerm, bool inclusive); + ~QCLuceneRangeQuery(); + + static QString getClassName(); + + QCLuceneTerm getLowerTerm() const; + QCLuceneTerm getUpperTerm() const; + + bool isInclusive() const; + QString getField() const; + +private: + QCLuceneTerm lowerTerm; + QCLuceneTerm upperTerm; +}; + +class QHELP_EXPORT QCLuceneTermQuery : public QCLuceneQuery +{ +public: + QCLuceneTermQuery(const QCLuceneTerm &term); + ~QCLuceneTermQuery(); + + static QString getClassName(); + + QCLuceneTerm getTerm() const; + +private: + QCLuceneTerm term; +}; + +class QHELP_EXPORT QCLuceneBooleanQuery : public QCLuceneQuery +{ +public: + QCLuceneBooleanQuery(); + ~QCLuceneBooleanQuery(); + + static QString getClassName(); + + quint32 getClauseCount() const; + quint32 getMaxClauseCount() const; + void setMaxClauseCount(quint32 maxClauseCount); + + void add(QCLuceneQuery *query, bool required, bool prohibited); + void add(QCLuceneQuery *query, bool delQuery, bool required, bool prohibited); + +private: + QList queries; +}; + +class QHELP_EXPORT QCLucenePhraseQuery : public QCLuceneQuery +{ +public: + QCLucenePhraseQuery(); + ~QCLucenePhraseQuery(); + + static QString getClassName(); + + qint32 getSlop() const; + void setSlop(const qint32 slop); + + void addTerm(const QCLuceneTerm &term); + void addTerm(const QCLuceneTerm &term, qint32 position); + + QString getFieldName() const; + QList getTerms() const; + +private: + QList termList; +}; + +QT_END_NAMESPACE + +#endif // QQUERY_P_H diff --git a/src/assistant/clucene/qqueryparser.cpp b/src/assistant/clucene/qqueryparser.cpp new file mode 100644 index 000000000..f306a041b --- /dev/null +++ b/src/assistant/clucene/qqueryparser.cpp @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qqueryparser_p.h" +#include "qquery_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneQueryParserPrivate::QCLuceneQueryParserPrivate() + : QSharedData() +{ + queryParser = 0; + deleteCLuceneQueryParser = true; +} + +QCLuceneQueryParserPrivate::QCLuceneQueryParserPrivate(const QCLuceneQueryParserPrivate &other) + : QSharedData() +{ + queryParser = _CL_POINTER(other.queryParser); + deleteCLuceneQueryParser = other.deleteCLuceneQueryParser; +} + +QCLuceneQueryParserPrivate::~QCLuceneQueryParserPrivate() +{ + if (deleteCLuceneQueryParser) + _CLDECDELETE(queryParser); +} + + +QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, + QCLuceneAnalyzer &analyzer) + : d(new QCLuceneQueryParserPrivate()) + , field(field) + , analyzer(analyzer) +{ + TCHAR *fieldName = QStringToTChar(field); + + d->queryParser = new lucene::queryParser::QueryParser(fieldName, + analyzer.d->analyzer); + + delete [] fieldName; +} + +QCLuceneQueryParser::~QCLuceneQueryParser() +{ + // nothing todo +} + +QCLuceneQuery* QCLuceneQueryParser::parse(const QString &query) +{ + TCHAR *string = QStringToTChar(query); + + QCLuceneQuery *retValue = 0; + lucene::search::Query* q = d->queryParser->parse(string); + if (q) { + retValue = new QCLuceneQuery(); + retValue->d->query = q; + } + + delete [] string; + return retValue; +} + +QCLuceneQuery* QCLuceneQueryParser::parse(QCLuceneReader &reader) +{ + QCLuceneQuery *retValue = 0; + lucene::search::Query* q = d->queryParser->parse(reader.d->reader); + if (q) { + retValue = new QCLuceneQuery(); + retValue->d->query = q; + } + + return retValue; +} + +QCLuceneQuery* QCLuceneQueryParser::parse(const QString &query, const QString &field, + QCLuceneAnalyzer &analyzer) +{ + QCLuceneQueryParser parser(field, analyzer); + return parser.parse(query); +} + +QCLuceneAnalyzer QCLuceneQueryParser::getAnalyzer() +{ + return analyzer; +} + +QString QCLuceneQueryParser::getField() +{ + return field; +} + + +QCLuceneMultiFieldQueryParser::QCLuceneMultiFieldQueryParser( + const QStringList &fieldList, QCLuceneAnalyzer &analyzer) + : QCLuceneQueryParser(QLatin1String(""), analyzer) +{ + Q_UNUSED(fieldList) +} + +QCLuceneMultiFieldQueryParser::~QCLuceneMultiFieldQueryParser() +{ + // nothing todo +} + +QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, + const QStringList &fieldList, + QCLuceneAnalyzer &analyzer) +{ + QCLuceneBooleanQuery *retValue = new QCLuceneBooleanQuery(); + foreach (const QString &field, fieldList) { + QCLuceneQuery *q = QCLuceneQueryParser::parse(query, field, analyzer); + if (!q) { + delete retValue; + retValue = 0; break; + } else { + retValue->add(q, true, false, false); + } + } + + return retValue; +} + +QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, + const QStringList &fieldList, + QList flags, + QCLuceneAnalyzer &analyzer) +{ + QCLuceneBooleanQuery *retValue = new QCLuceneBooleanQuery(); + qint32 i = 0; + foreach (const QString &field, fieldList) { + QCLuceneQuery *q = QCLuceneQueryParser::parse(query, field, analyzer); + if (q) { + qint32 flag = flags.at(i); + switch (flag) { + case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: { + retValue->add(q, true, true, false); + } break; + + case QCLuceneMultiFieldQueryParser::PROHIBITED_FIELD: { + retValue->add(q, true, false, true); + } break; + + default: { + retValue->add(q, true, false, false); + } break; + } + + ++i; + } else { + delete retValue; + retValue = 0; break; + } + } + return retValue; +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qqueryparser_p.h b/src/assistant/clucene/qqueryparser_p.h new file mode 100644 index 000000000..e1b8c74eb --- /dev/null +++ b/src/assistant/clucene/qqueryparser_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QQUERYPARSER_P_H +#define QQUERYPARSER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qreader_p.h" +#include "qanalyzer_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include +#include + +CL_NS_DEF(queryParser) + class QueryParser; +CL_NS_END +CL_NS_USE(queryParser) + +QT_BEGIN_NAMESPACE + +class QCLuceneQuery; +class QCLuceneMultiFieldQueryParser; + +class QHELP_EXPORT QCLuceneQueryParserPrivate : public QSharedData +{ +public: + QCLuceneQueryParserPrivate(); + QCLuceneQueryParserPrivate(const QCLuceneQueryParserPrivate &other); + + ~QCLuceneQueryParserPrivate(); + + QueryParser *queryParser; + bool deleteCLuceneQueryParser; + +private: + QCLuceneQueryParserPrivate &operator=(const QCLuceneQueryParserPrivate &other); +}; + +class QHELP_EXPORT QCLuceneQueryParser +{ +public: + QCLuceneQueryParser(const QString &field, QCLuceneAnalyzer &analyzer); + virtual ~QCLuceneQueryParser(); + + QCLuceneQuery* parse(const QString &query); + QCLuceneQuery* parse(QCLuceneReader &reader); + static QCLuceneQuery* parse(const QString &query, const QString &field, + QCLuceneAnalyzer &analyzer); + QCLuceneAnalyzer getAnalyzer(); + QString getField(); + +protected: + friend class QCLuceneMultiFieldQueryParser; + QSharedDataPointer d; + +private: + QString field; + QCLuceneAnalyzer analyzer; +}; + +class QHELP_EXPORT QCLuceneMultiFieldQueryParser : public QCLuceneQueryParser +{ +public: + enum FieldFlags { + NORMAL_FIELD = 0, + REQUIRED_FIELD = 1, + PROHIBITED_FIELD = 2 + }; + + QCLuceneMultiFieldQueryParser(const QStringList &fieldList, + QCLuceneAnalyzer &analyzer); + ~QCLuceneMultiFieldQueryParser(); + + static QCLuceneQuery *parse(const QString &query, const QStringList &fieldList, + QCLuceneAnalyzer &analyzer); + static QCLuceneQuery *parse(const QString &query, const QStringList &fieldList, + QList flags, QCLuceneAnalyzer &analyzer); +}; + +QT_END_NAMESPACE + +#endif // QQUERYPARSER_P_H diff --git a/src/assistant/clucene/qreader.cpp b/src/assistant/clucene/qreader.cpp new file mode 100644 index 000000000..0a8b7accf --- /dev/null +++ b/src/assistant/clucene/qreader.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qreader_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneReaderPrivate::QCLuceneReaderPrivate() + : QSharedData() +{ + reader = 0; + deleteCLuceneReader = true; +} + +QCLuceneReaderPrivate::QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other) + : QSharedData() +{ + reader = _CL_POINTER(other.reader); + deleteCLuceneReader = other.deleteCLuceneReader; +} + +QCLuceneReaderPrivate::~QCLuceneReaderPrivate() +{ + if (deleteCLuceneReader) + _CLDECDELETE(reader); +} + +QCLuceneReader::QCLuceneReader() + : d(new QCLuceneReaderPrivate()) +{ + // nothing todo +} + +QCLuceneReader::~QCLuceneReader() +{ + // nothing todo +} + + +QCLuceneStringReader::QCLuceneStringReader(const QString &value) + : QCLuceneReader() + , string(QStringToTChar(value)) +{ + d->reader = new lucene::util::StringReader(string); +} + +QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length) + : QCLuceneReader() + , string(QStringToTChar(value)) +{ + d->reader = new lucene::util::StringReader(string, int32_t(length)); +} + +QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, + bool copyData) + : QCLuceneReader() + , string(QStringToTChar(value)) +{ + d->reader = new lucene::util::StringReader(string, int32_t(length), copyData); +} + +QCLuceneStringReader::~QCLuceneStringReader() +{ + delete [] string; +} + + +QCLuceneFileReader::QCLuceneFileReader(const QString &path, const QString &encoding, + qint32 cacheLength, qint32 cacheBuffer) + : QCLuceneReader() +{ + const QByteArray tmpPath = path.toLocal8Bit(); + const QByteArray tmpEncoding = encoding.toAscii(); + d->reader = new lucene::util::FileReader(tmpPath.constData(), + tmpEncoding.constData(), int32_t(cacheLength), int32_t(cacheBuffer)); +} + +QCLuceneFileReader::~QCLuceneFileReader() +{ + // nothing todo +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qreader_p.h b/src/assistant/clucene/qreader_p.h new file mode 100644 index 000000000..e24e9d836 --- /dev/null +++ b/src/assistant/clucene/qreader_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QREADER_P_H +#define QREADER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qclucene_global_p.h" + +#include +#include +#include + +CL_NS_DEF(util) + class Reader; +CL_NS_END +CL_NS_USE(util) + +QT_BEGIN_NAMESPACE + +class QCLuceneField; +class QCLuceneAnalyzer; +class QCLuceneDocument; +class QCLuceneQueryParser; +class QCLuceneStandardTokenizer; + +class QHELP_EXPORT QCLuceneReaderPrivate : public QSharedData +{ +public: + QCLuceneReaderPrivate(); + QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other); + + ~QCLuceneReaderPrivate(); + + Reader* reader; + bool deleteCLuceneReader; + +private: + QCLuceneReaderPrivate &operator=(const QCLuceneReaderPrivate &other); +}; + +class QHELP_EXPORT QCLuceneReader +{ +public: + QCLuceneReader(); + virtual ~QCLuceneReader(); + +protected: + friend class QCLuceneField; + friend class QCLuceneAnalyzer; + friend class QCLuceneDocument; + friend class QCLuceneQueryParser; + friend class QCLuceneStandardTokenizer; + QSharedDataPointer d; +}; + +class QCLuceneStringReader : public QCLuceneReader +{ +public: + QCLuceneStringReader(const QString &value); + QCLuceneStringReader(const QString &value, qint32 length); + QCLuceneStringReader(const QString &value, qint32 length, bool copyData); + + ~QCLuceneStringReader(); + +private: + TCHAR *string; +}; + +class QHELP_EXPORT QCLuceneFileReader : public QCLuceneReader +{ +public: + QCLuceneFileReader(const QString &path, const QString &encoding, + qint32 cacheLength = 13, qint32 cacheBuffer = 14); + ~QCLuceneFileReader(); +}; + +QT_END_NAMESPACE + +#endif // QREADER_P_H diff --git a/src/assistant/clucene/qsearchable.cpp b/src/assistant/clucene/qsearchable.cpp new file mode 100644 index 000000000..508fc05f6 --- /dev/null +++ b/src/assistant/clucene/qsearchable.cpp @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qsearchable_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneSearchablePrivate::QCLuceneSearchablePrivate() + : QSharedData() +{ + searchable = 0; + deleteCLuceneSearchable = true; +} + +QCLuceneSearchablePrivate::QCLuceneSearchablePrivate(const QCLuceneSearchablePrivate &other) + : QSharedData() +{ + searchable = _CL_POINTER(other.searchable); + deleteCLuceneSearchable = other.deleteCLuceneSearchable; +} + +QCLuceneSearchablePrivate::~QCLuceneSearchablePrivate() +{ + if (deleteCLuceneSearchable) + _CLDECDELETE(searchable); +} + + +QCLuceneSearchable::QCLuceneSearchable() + : d(new QCLuceneSearchablePrivate()) +{ + // nothing todo +} + +QCLuceneSearchable::~QCLuceneSearchable() +{ + // nothing todo +} + + +QCLuceneSearcher::QCLuceneSearcher() + : QCLuceneSearchable() +{ + // nothing todo +} + +QCLuceneSearcher::~QCLuceneSearcher() +{ + // nothing todo; +} + +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query) +{ + return search(query, QCLuceneFilter()); +} + +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, + const QCLuceneFilter &filter) +{ + return QCLuceneHits(*this, query, filter); +} + +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, + const QCLuceneSort &sort) +{ + return QCLuceneHits(*this, query, QCLuceneFilter(), sort); +} + +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, + const QCLuceneFilter &filter, + const QCLuceneSort &sort) +{ + return QCLuceneHits(*this, query, filter, sort); +} + + +QCLuceneIndexSearcher::QCLuceneIndexSearcher(const QString &path) + : QCLuceneSearcher() +{ + lucene::search::IndexSearcher *searcher = + new lucene::search::IndexSearcher(path); + + reader.d->reader = searcher->getReader(); + reader.d->deleteCLuceneIndexReader = false; + + d->searchable = searcher; +} + +QCLuceneIndexSearcher::QCLuceneIndexSearcher(const QCLuceneIndexReader &reader) + : QCLuceneSearcher() + , reader(reader) +{ + d->searchable = new lucene::search::IndexSearcher(reader.d->reader); +} + +QCLuceneIndexSearcher::~QCLuceneIndexSearcher() +{ + // nothing todo +} + +void QCLuceneIndexSearcher::close() +{ + d->searchable->close(); +} + +qint32 QCLuceneIndexSearcher::maxDoc() const +{ + return qint32(d->searchable->maxDoc()); +} + +QCLuceneIndexReader QCLuceneIndexSearcher::getReader() +{ + return reader; +} + +bool QCLuceneIndexSearcher::doc(qint32 i, QCLuceneDocument &document) +{ + return d->searchable->doc(int32_t(i), document.d->document); +} + + +QCLuceneMultiSearcher::QCLuceneMultiSearcher(const QList searchables) +: QCLuceneSearcher() +{ + lucene::search::Searchable** list= + _CL_NEWARRAY(lucene::search::Searchable*, searchables.count()); + + d->searchable = new lucene::search::MultiSearcher(list); + + _CLDELETE_ARRAY(list); +} + +QCLuceneMultiSearcher::~QCLuceneMultiSearcher() +{ + // nothing todo +} + +void QCLuceneMultiSearcher::close() +{ + d->searchable->close(); +} + +qint32 QCLuceneMultiSearcher::maxDoc() const +{ + return qint32(d->searchable->maxDoc()); +} + +qint32 QCLuceneMultiSearcher::subDoc(qint32 index) const +{ + lucene::search::MultiSearcher *searcher = + static_cast (d->searchable); + + if (searcher == 0) + return 0; + + return qint32(searcher->subDoc(int32_t(index))); +} + +qint32 QCLuceneMultiSearcher::subSearcher(qint32 index) const +{ + lucene::search::MultiSearcher *searcher = + static_cast (d->searchable); + + if (searcher == 0) + return 0; + + return qint32(searcher->subSearcher(int32_t(index))); +} + +qint32 QCLuceneMultiSearcher::searcherIndex(qint32 index) const +{ + lucene::search::MultiSearcher *searcher = + static_cast (d->searchable); + + if (searcher == 0) + return 0; + + return qint32(searcher->searcherIndex(int32_t(index))); +} + +bool QCLuceneMultiSearcher::doc(qint32 i, QCLuceneDocument &document) +{ + return d->searchable->doc(int32_t(i), document.d->document); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qsearchable_p.h b/src/assistant/clucene/qsearchable_p.h new file mode 100644 index 000000000..149cfb049 --- /dev/null +++ b/src/assistant/clucene/qsearchable_p.h @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QSEARCHABLE_P_H +#define QSEARCHABLE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhits_p.h" +#include "qsort_p.h" +#include "qquery_p.h" +#include "qfilter_p.h" +#include "qdocument_p.h" +#include "qindexreader_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include +#include + +CL_NS_DEF(search) + class Searcher; +CL_NS_END +CL_NS_USE(search) + +QT_BEGIN_NAMESPACE + +class QCLuceneHits; +class QCLuceneSearcher; +class QCLuceneIndexSearcher; +class QCLuceneMultiSearcher; + +class QHELP_EXPORT QCLuceneSearchablePrivate : public QSharedData +{ +public: + QCLuceneSearchablePrivate(); + QCLuceneSearchablePrivate(const QCLuceneSearchablePrivate &other); + + ~QCLuceneSearchablePrivate(); + + Searcher *searchable; + bool deleteCLuceneSearchable; + +private: + QCLuceneSearchablePrivate &operator=(const QCLuceneSearchablePrivate &other); +}; + +class QHELP_EXPORT QCLuceneSearchable +{ +public: + virtual ~QCLuceneSearchable(); + +protected: + friend class QCLuceneSearcher; + friend class QCLuceneIndexSearcher; + friend class QCLuceneMultiSearcher; + QSharedDataPointer d; + +private: + QCLuceneSearchable(); +}; + +class QHELP_EXPORT QCLuceneSearcher : public QCLuceneSearchable +{ +public: + QCLuceneSearcher(); + virtual ~QCLuceneSearcher(); + + QCLuceneHits search(const QCLuceneQuery &query); + QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneFilter &filter); + QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneSort &sort); + QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneFilter &filter, + const QCLuceneSort &sort); + +protected: + friend class QCLuceneHits; +}; + +class QHELP_EXPORT QCLuceneIndexSearcher : public QCLuceneSearcher +{ +public: + QCLuceneIndexSearcher(const QString &path); + QCLuceneIndexSearcher(const QCLuceneIndexReader &reader); + ~QCLuceneIndexSearcher(); + + void close(); + qint32 maxDoc() const; + QCLuceneIndexReader getReader(); + bool doc(qint32 i, QCLuceneDocument &document); + +private: + QCLuceneIndexReader reader; +}; + +class QHELP_EXPORT QCLuceneMultiSearcher : public QCLuceneSearcher +{ +public: + QCLuceneMultiSearcher(const QList searchables); + ~QCLuceneMultiSearcher(); + + void close(); + qint32 maxDoc() const; + qint32 subDoc(qint32 index) const; + qint32 subSearcher(qint32 index) const; + qint32 searcherIndex(qint32 index) const; + bool doc(qint32 i, QCLuceneDocument &document); +}; + +QT_END_NAMESPACE + +#endif // QSEARCHABLE_P_H diff --git a/src/assistant/clucene/qsort.cpp b/src/assistant/clucene/qsort.cpp new file mode 100644 index 000000000..4dface005 --- /dev/null +++ b/src/assistant/clucene/qsort.cpp @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qsort_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneSortPrivate::QCLuceneSortPrivate() + : QSharedData() +{ + sort = 0; + deleteCLuceneSort = true; +} + +QCLuceneSortPrivate::QCLuceneSortPrivate (const QCLuceneSortPrivate &other) + : QSharedData() +{ + sort = _CL_POINTER(other.sort); + deleteCLuceneSort = other.deleteCLuceneSort; +} + +QCLuceneSortPrivate::~QCLuceneSortPrivate() +{ + if (deleteCLuceneSort) + _CLDECDELETE(sort); +} + + +QCLuceneSort::QCLuceneSort() + : d(new QCLuceneSortPrivate()) +{ + d->sort = new lucene::search::Sort(); +} + +QCLuceneSort::QCLuceneSort(const QStringList &fieldNames) + : d(new QCLuceneSortPrivate()) +{ + d->sort = new lucene::search::Sort(); + setSort(fieldNames); +} + +QCLuceneSort::QCLuceneSort(const QString &field, bool reverse) + : d(new QCLuceneSortPrivate()) +{ + d->sort = new lucene::search::Sort(); + setSort(field, reverse); +} + +QCLuceneSort::~QCLuceneSort() +{ + // nothing todo +} + +QString QCLuceneSort::toString() const +{ + return TCharToQString(d->sort->toString()); +} + +void QCLuceneSort::setSort(const QStringList &fieldNames) +{ + TCHAR **nameArray = new TCHAR*[fieldNames.count()]; + for (int i = 0; i < fieldNames.count(); ++i) + nameArray[i] = QStringToTChar(fieldNames.at(i)); + + d->sort->setSort((const TCHAR**)nameArray); + + for (int i = 0; i < fieldNames.count(); ++i) + delete [] nameArray[i]; + delete [] nameArray; +} + +void QCLuceneSort::setSort(const QString &field, bool reverse) +{ + TCHAR *name = QStringToTChar(field); + d->sort->setSort(name, reverse); + delete [] name; +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qsort_p.h b/src/assistant/clucene/qsort_p.h new file mode 100644 index 000000000..5d9372b11 --- /dev/null +++ b/src/assistant/clucene/qsort_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QSORT_P_H +#define QSORT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qclucene_global_p.h" + +#include +#include +#include +#include + +CL_NS_DEF(search) + class Sort; +CL_NS_END +CL_NS_USE(search) + +QT_BEGIN_NAMESPACE + +class QCLuceneHits; +class QCLuceneField; + +class QHELP_EXPORT QCLuceneSortPrivate : public QSharedData +{ +public: + QCLuceneSortPrivate(); + QCLuceneSortPrivate (const QCLuceneSortPrivate &other); + + ~QCLuceneSortPrivate(); + + Sort *sort; + bool deleteCLuceneSort; + +private: + QCLuceneSortPrivate &operator=(const QCLuceneSortPrivate &other); +}; + +class QHELP_EXPORT QCLuceneSort +{ +public: + QCLuceneSort(); + explicit QCLuceneSort(const QStringList &fieldNames); + explicit QCLuceneSort(const QString &field, bool reverse = false); + + virtual ~QCLuceneSort(); + + QString toString() const; + void setSort(const QStringList &fieldNames); + void setSort(const QString &field, bool reverse = false); + +protected: + friend class QCLuceneHits; + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +#endif // QSORT_P_H diff --git a/src/assistant/clucene/qterm.cpp b/src/assistant/clucene/qterm.cpp new file mode 100644 index 000000000..eeebf53c8 --- /dev/null +++ b/src/assistant/clucene/qterm.cpp @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qterm_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneTermPrivate::QCLuceneTermPrivate() + : QSharedData() +{ + term = 0; + deleteCLuceneTerm = true; +} + +QCLuceneTermPrivate::QCLuceneTermPrivate(const QCLuceneTermPrivate &other) + : QSharedData() +{ + term = _CL_POINTER(other.term); + deleteCLuceneTerm = other.deleteCLuceneTerm; +} + +QCLuceneTermPrivate::~QCLuceneTermPrivate() +{ + if (deleteCLuceneTerm) + _CLDECDELETE(term); +} + + +QCLuceneTerm::QCLuceneTerm() + : d(new QCLuceneTermPrivate()) +{ + d->term = new lucene::index::Term(); +} + +QCLuceneTerm::QCLuceneTerm(const QString &field, const QString &text) + : d(new QCLuceneTermPrivate()) +{ + TCHAR *fieldName = QStringToTChar(field); + TCHAR *termText = QStringToTChar(text); + + d->term = new lucene::index::Term(fieldName, termText); + + delete [] fieldName; + delete [] termText; +} + +QCLuceneTerm::QCLuceneTerm(const QCLuceneTerm &fieldTerm, const QString &text) + : d(new QCLuceneTermPrivate()) +{ + TCHAR *termText = QStringToTChar(text); + d->term = new lucene::index::Term(fieldTerm.d->term, termText); + delete [] termText; +} + +QCLuceneTerm::~QCLuceneTerm() +{ + // nothing todo +} + +QString QCLuceneTerm::field() const +{ + return TCharToQString(d->term->field()); +} + +QString QCLuceneTerm::text() const +{ + return TCharToQString(d->term->text()); +} + +void QCLuceneTerm::set(const QString &field, const QString &text) +{ + set(field, text, true); +} + +void QCLuceneTerm::set(const QCLuceneTerm &fieldTerm, const QString &text) +{ + set(fieldTerm.field(), text, false); +} + +void QCLuceneTerm::set(const QString &field, const QString &text, bool internField) +{ + TCHAR *fieldName = QStringToTChar(field); + TCHAR *termText = QStringToTChar(text); + + d->term->set(fieldName, termText, internField); + + delete [] fieldName; + delete [] termText; +} + +bool QCLuceneTerm::equals(const QCLuceneTerm &other) const +{ + return d->term->equals(other.d->term); +} + +qint32 QCLuceneTerm::compareTo(const QCLuceneTerm &other) const +{ + return quint32(d->term->compareTo(other.d->term)); +} + +QString QCLuceneTerm::toString() const +{ + return TCharToQString(d->term->toString()); +} + +quint32 QCLuceneTerm::hashCode() const +{ + return quint32(d->term->hashCode()); +} + +quint32 QCLuceneTerm::textLength() const +{ + return quint32(d->term->textLength()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qterm_p.h b/src/assistant/clucene/qterm_p.h new file mode 100644 index 000000000..5b981dc53 --- /dev/null +++ b/src/assistant/clucene/qterm_p.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QTERM_P_H +#define QTERM_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qclucene_global_p.h" + +#include +#include +#include + +CL_NS_DEF(index) + class Term; +CL_NS_END +CL_NS_USE(index) + +QT_BEGIN_NAMESPACE + +class QCLuceneTermQuery; +class QCLuceneRangeQuery; +class QCLucenePrefixQuery; +class QCLuceneIndexReader; +class QCLucenePhraseQuery; + +class QHELP_EXPORT QCLuceneTermPrivate : public QSharedData +{ +public: + QCLuceneTermPrivate(); + QCLuceneTermPrivate(const QCLuceneTermPrivate &other); + + ~QCLuceneTermPrivate(); + + Term *term; + bool deleteCLuceneTerm; + +private: + QCLuceneTermPrivate &operator=(const QCLuceneTermPrivate &other); +}; + +class QHELP_EXPORT QCLuceneTerm +{ +public: + QCLuceneTerm(); + QCLuceneTerm(const QString &field, const QString &text); + QCLuceneTerm(const QCLuceneTerm &fieldTerm, const QString &text); + + virtual ~QCLuceneTerm(); + + QString field() const; + QString text() const; + + void set(const QString &field, const QString &text); + void set(const QCLuceneTerm &fieldTerm, const QString &text); + void set(const QString &field, const QString &text, bool internField); + + bool equals(const QCLuceneTerm &other) const; + qint32 compareTo(const QCLuceneTerm &other) const; + + QString toString() const; + quint32 hashCode() const; + quint32 textLength() const; + +protected: + friend class QCLuceneTermQuery; + friend class QCLuceneRangeQuery; + friend class QCLucenePrefixQuery; + friend class QCLuceneIndexReader; + friend class QCLucenePhraseQuery; + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +#endif // QTERM_P_H diff --git a/src/assistant/clucene/qtoken.cpp b/src/assistant/clucene/qtoken.cpp new file mode 100644 index 000000000..537d9e675 --- /dev/null +++ b/src/assistant/clucene/qtoken.cpp @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qtoken_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneTokenPrivate::QCLuceneTokenPrivate() + : QSharedData() +{ + token = 0; + deleteCLuceneToken = true; +} + +QCLuceneTokenPrivate::QCLuceneTokenPrivate(const QCLuceneTokenPrivate &other) + : QSharedData() +{ + token = _CL_POINTER(other.token); + deleteCLuceneToken = other.deleteCLuceneToken; +} + +QCLuceneTokenPrivate::~QCLuceneTokenPrivate() +{ + if (deleteCLuceneToken) + _CLDECDELETE(token); +} + + +QCLuceneToken::QCLuceneToken() + : d(new QCLuceneTokenPrivate()) + , tokenText(0) + , tokenType(0) +{ + d->token = new lucene::analysis::Token(); +} + +QCLuceneToken::QCLuceneToken(const QString &text, qint32 startOffset, + qint32 endOffset, const QString &defaultTyp) + : d(new QCLuceneTokenPrivate()) + , tokenText(QStringToTChar(text)) + , tokenType(QStringToTChar(defaultTyp)) +{ + d->token = new lucene::analysis::Token(tokenText, int32_t(startOffset), + int32_t(endOffset), tokenType); +} + +QCLuceneToken::~QCLuceneToken() +{ + delete [] tokenText; + delete [] tokenType; +} + +quint32 QCLuceneToken::bufferLength() const +{ + return quint32(d->token->bufferLength()); +} + +void QCLuceneToken::growBuffer(quint32 size) +{ + d->token->growBuffer(size_t(size)); +} + +qint32 QCLuceneToken::positionIncrement() const +{ + return qint32(d->token->getPositionIncrement()); +} + +void QCLuceneToken::setPositionIncrement(qint32 positionIncrement) +{ + d->token->setPositionIncrement(int32_t(positionIncrement)); +} + +QString QCLuceneToken::termText() const +{ + return TCharToQString(d->token->termText()); +} + +void QCLuceneToken::setTermText(const QString &text) +{ + delete [] tokenText; + tokenText = QStringToTChar(text); + d->token->setText(tokenText); +} + +quint32 QCLuceneToken::termTextLength() const +{ + return quint32(d->token->termTextLength()); +} + +void QCLuceneToken::resetTermTextLength() const +{ + d->token->resetTermTextLen(); +} + +qint32 QCLuceneToken::startOffset() const +{ + return quint32(d->token->startOffset()); +} + +void QCLuceneToken::setStartOffset(qint32 value) +{ + d->token->setStartOffset(int32_t(value)); +} + +qint32 QCLuceneToken::endOffset() const +{ + return quint32(d->token->endOffset()); +} + +void QCLuceneToken::setEndOffset(qint32 value) +{ + d->token->setEndOffset(int32_t(value)); +} + +QString QCLuceneToken::type() const +{ + return TCharToQString(d->token->type()); +} + +void QCLuceneToken::setType(const QString &type) +{ + delete [] tokenType; + tokenType = QStringToTChar(type); + d->token->setType(tokenType); +} + +QString QCLuceneToken::toString() const +{ + return TCharToQString(d->token->toString()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qtoken_p.h b/src/assistant/clucene/qtoken_p.h new file mode 100644 index 000000000..f3d25c4ff --- /dev/null +++ b/src/assistant/clucene/qtoken_p.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QTOKEN_P_H +#define QTOKEN_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qclucene_global_p.h" + +#include +#include +#include + +CL_NS_DEF(analysis) + class Token; +CL_NS_END +CL_NS_USE(analysis) + +QT_BEGIN_NAMESPACE + +class QCLuceneTokenizer; +class QCLuceneTokenStream; +class QCLuceneStandardTokenizer; + +class QHELP_EXPORT QCLuceneTokenPrivate : public QSharedData +{ +public: + QCLuceneTokenPrivate(); + QCLuceneTokenPrivate(const QCLuceneTokenPrivate &other); + + ~QCLuceneTokenPrivate(); + + Token *token; + bool deleteCLuceneToken; + +private: + QCLuceneTokenPrivate &operator=(const QCLuceneTokenPrivate &other); +}; + +class QHELP_EXPORT QCLuceneToken +{ +public: + QCLuceneToken(); + QCLuceneToken(const QString &text, qint32 startOffset, + qint32 endOffset, const QString &defaultTyp = QLatin1String("word")); + + virtual ~QCLuceneToken(); + + void set(const QString &text, qint32 startOffset, + qint32 endOffset, const QString &defaultTyp = QLatin1String("word")); + + quint32 bufferLength() const; + void growBuffer(quint32 size); + + qint32 positionIncrement() const; + void setPositionIncrement(qint32 positionIncrement); + + QString termText() const; + void setTermText(const QString &text); + + quint32 termTextLength() const; + void resetTermTextLength() const; + + qint32 startOffset() const; + void setStartOffset(qint32 value); + + qint32 endOffset() const; + void setEndOffset(qint32 value); + + QString type() const; + void setType(const QString &type); + + QString toString() const; + +protected: + friend class QCLuceneTokenizer; + friend class QCLuceneTokenStream; + friend class QCLuceneStandardTokenizer; + QSharedDataPointer d; + +private: + TCHAR *tokenText; + TCHAR *tokenType; +}; + +QT_END_NAMESPACE + +#endif // QTOKEN_P_H diff --git a/src/assistant/clucene/qtokenizer.cpp b/src/assistant/clucene/qtokenizer.cpp new file mode 100644 index 000000000..8a79b21e6 --- /dev/null +++ b/src/assistant/clucene/qtokenizer.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qtokenizer_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneTokenizer::QCLuceneTokenizer() + : QCLuceneTokenStream() +{ + // nothing todo +} + +QCLuceneTokenizer::QCLuceneTokenizer(const QCLuceneReader &reader) + : QCLuceneTokenStream() + , reader(reader) +{ + // nothing todo +} + +QCLuceneTokenizer::~QCLuceneTokenizer() +{ + close(); +} + +void QCLuceneTokenizer::close() +{ + d->tokenStream->close(); +} + +bool QCLuceneTokenizer::next(QCLuceneToken &token) +{ + return d->tokenStream->next(token.d->token); +} + + +QCLuceneStandardTokenizer::QCLuceneStandardTokenizer(const QCLuceneReader &reader) + : QCLuceneTokenizer(reader) +{ + d->tokenStream = + new lucene::analysis::standard::StandardTokenizer(reader.d->reader); +} + +QCLuceneStandardTokenizer::~QCLuceneStandardTokenizer() +{ + // nothing todo +} + +bool QCLuceneStandardTokenizer::readApostrophe(const QString &string, + QCLuceneToken &token) +{ + lucene::analysis::standard::StandardTokenizer *stdTokenizer = + static_cast (d->tokenStream); + + if (stdTokenizer == 0) + return false; + + TCHAR* value = QStringToTChar(string); + lucene::util::StringBuffer buffer(value); + bool retValue = stdTokenizer->ReadApostrophe(&buffer, token.d->token); + delete [] value; + + return retValue; +} + +bool QCLuceneStandardTokenizer::readAt(const QString &string, QCLuceneToken &token) +{ + lucene::analysis::standard::StandardTokenizer *stdTokenizer = + static_cast (d->tokenStream); + + if (stdTokenizer == 0) + return false; + + TCHAR* value = QStringToTChar(string); + lucene::util::StringBuffer buffer(value); + bool retValue = stdTokenizer->ReadAt(&buffer, token.d->token); + delete [] value; + + return retValue; +} + +bool QCLuceneStandardTokenizer::readCompany(const QString &string, + QCLuceneToken &token) +{ + lucene::analysis::standard::StandardTokenizer *stdTokenizer = + static_cast (d->tokenStream); + + if (stdTokenizer == 0) + return false; + + TCHAR* value = QStringToTChar(string); + lucene::util::StringBuffer buffer(value); + bool retValue = stdTokenizer->ReadCompany(&buffer, token.d->token); + delete [] value; + + return retValue; +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qtokenizer_p.h b/src/assistant/clucene/qtokenizer_p.h new file mode 100644 index 000000000..0c6e8ea1d --- /dev/null +++ b/src/assistant/clucene/qtokenizer_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QTOKENIZER_P_H +#define QTOKENIZER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qtoken_p.h" +#include "qreader_p.h" +#include "qtokenstream_p.h" +#include "qclucene_global_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +class QHELP_EXPORT QCLuceneTokenizer : public QCLuceneTokenStream +{ +public: + QCLuceneTokenizer(const QCLuceneReader &reader); + virtual ~QCLuceneTokenizer(); + + void close(); + bool next(QCLuceneToken &token); + +protected: + friend class QCLuceneStandardTokenizer; + +private: + QCLuceneTokenizer(); + QCLuceneReader reader; +}; + +class QHELP_EXPORT QCLuceneStandardTokenizer : public QCLuceneTokenizer +{ +public: + QCLuceneStandardTokenizer(const QCLuceneReader &reader); + ~QCLuceneStandardTokenizer(); + + bool readApostrophe(const QString &string, QCLuceneToken &token); + bool readAt(const QString &string, QCLuceneToken &token); + bool readCompany(const QString &string, QCLuceneToken &token); +}; + +class QCLuceneCharTokenizer : public QCLuceneTokenizer +{ + +}; + +class QCLuceneLetterTokenizer : public QCLuceneCharTokenizer +{ + +}; + +class QCLuceneLowerCaseTokenizer : public QCLuceneLetterTokenizer +{ + +}; + +class QCLuceneWhitespaceTokenizer : public QCLuceneCharTokenizer +{ + +}; + +class QCLuceneKeywordTokenizer : public QCLuceneTokenizer +{ + +}; + +QT_END_NAMESPACE + +#endif // QTOKENIZER_P_H diff --git a/src/assistant/clucene/qtokenstream.cpp b/src/assistant/clucene/qtokenstream.cpp new file mode 100644 index 000000000..337ebf1e3 --- /dev/null +++ b/src/assistant/clucene/qtokenstream.cpp @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#include "qtokenstream_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +QCLuceneTokenStreamPrivate::QCLuceneTokenStreamPrivate() + : QSharedData() +{ + tokenStream = 0; + deleteCLuceneTokenStream = true; +} + +QCLuceneTokenStreamPrivate::QCLuceneTokenStreamPrivate(const QCLuceneTokenStreamPrivate &other) + : QSharedData() +{ + tokenStream = _CL_POINTER(other.tokenStream); + deleteCLuceneTokenStream = other.deleteCLuceneTokenStream; +} + +QCLuceneTokenStreamPrivate::~QCLuceneTokenStreamPrivate() +{ + if (deleteCLuceneTokenStream) + _CLDECDELETE(tokenStream); +} + + +QCLuceneTokenStream::QCLuceneTokenStream() + : d(new QCLuceneTokenStreamPrivate()) +{ + // nothing todo +} + +QCLuceneTokenStream::~QCLuceneTokenStream() +{ + // nothing todo +} + +void QCLuceneTokenStream::close() +{ + d->tokenStream->close(); +} + +bool QCLuceneTokenStream::next(QCLuceneToken &token) +{ + return d->tokenStream->next(token.d->token); +} + +QT_END_NAMESPACE diff --git a/src/assistant/clucene/qtokenstream_p.h b/src/assistant/clucene/qtokenstream_p.h new file mode 100644 index 000000000..8f4b9d06a --- /dev/null +++ b/src/assistant/clucene/qtokenstream_p.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. +** +** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. +** +****************************************************************************/ + +#ifndef QTOKENSTREAM_P_H +#define QTOKENSTREAM_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qtoken_p.h" +#include "qclucene_global_p.h" + +#include +#include +#include + +CL_NS_DEF(analysis) + class TokenStream; +CL_NS_END +CL_NS_USE(analysis) + +QT_BEGIN_NAMESPACE + +class QCLuceneAnalyzer; +class QCLuceneTokenizer; +class QCLuceneStopAnalyzer; +class QCLuceneSimpleAnalyzer; +class QCLuceneKeywordAnalyzer; +class QCLuceneStandardAnalyzer; +class QCLuceneWhitespaceAnalyzer; +class QCLucenePerFieldAnalyzerWrapper; + +class QHELP_EXPORT QCLuceneTokenStreamPrivate : public QSharedData +{ +public: + QCLuceneTokenStreamPrivate(); + QCLuceneTokenStreamPrivate(const QCLuceneTokenStreamPrivate &other); + + ~QCLuceneTokenStreamPrivate(); + + TokenStream *tokenStream; + bool deleteCLuceneTokenStream; + +private: + QCLuceneTokenStreamPrivate &operator=(const QCLuceneTokenStreamPrivate &other); +}; + +class QHELP_EXPORT QCLuceneTokenStream +{ +public: + virtual ~QCLuceneTokenStream(); + + void close(); + bool next(QCLuceneToken &token); + +protected: + friend class QCLuceneAnalyzer; + friend class QCLuceneTokenizer; + friend class QCLuceneStopAnalyzer; + friend class QCLuceneSimpleAnalyzer; + friend class QCLuceneKeywordAnalyzer; + friend class QCLuceneStandardAnalyzer; + friend class QCLuceneWhitespaceAnalyzer; + friend class QCLucenePerFieldAnalyzerWrapper; + QSharedDataPointer d; + +private: + QCLuceneTokenStream(); +}; + +QT_END_NAMESPACE + +#endif // QTOKENSTREAM_P_H diff --git a/src/assistant/help/help.pro b/src/assistant/help/help.pro new file mode 100644 index 000000000..2aa30992e --- /dev/null +++ b/src/assistant/help/help.pro @@ -0,0 +1,72 @@ +load(qt_module) + +TARGET = QtHelp +QPRO_PWD = $$PWD +QT += widgets sql network core-private clucene clucene-private + +CONFIG += module +MODULE_PRI += ../../../modules/qt_help.pri + +DEFINES += QHELP_LIB QT_CLUCENE_SUPPORT + +load(qt_module_config) + +HEADERS += qthelpversion.h + +DEFINES -= QT_ASCII_CAST_WARNINGS + +qclucene = QtCLucene$${QT_LIBINFIX} +if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { + mac:qclucene = $${qclucene}_debug + win32:qclucene = $${qclucene}d +} +linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene +unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtCore QtNetwork QtSql + +LIBS_PRIVATE += -l$$qclucene +RESOURCES += helpsystem.qrc +SOURCES += qhelpenginecore.cpp \ + qhelpengine.cpp \ + qhelpdbreader.cpp \ + qhelpcontentwidget.cpp \ + qhelpindexwidget.cpp \ + qhelpgenerator.cpp \ + qhelpdatainterface.cpp \ + qhelpprojectdata.cpp \ + qhelpcollectionhandler.cpp \ + qhelpsearchengine.cpp \ + qhelpsearchquerywidget.cpp \ + qhelpsearchresultwidget.cpp \ + qhelpsearchindex_default.cpp \ + qhelpsearchindexwriter_default.cpp \ + qhelpsearchindexreader_default.cpp \ + qhelpsearchindexreader.cpp \ + qclucenefieldnames.cpp \ + qhelp_global.cpp + +# access to clucene +SOURCES += qhelpsearchindexwriter_clucene.cpp \ + qhelpsearchindexreader_clucene.cpp +HEADERS += qhelpenginecore.h \ + qhelpengine.h \ + qhelpengine_p.h \ + qhelp_global.h \ + qhelpdbreader_p.h \ + qhelpcontentwidget.h \ + qhelpindexwidget.h \ + qhelpgenerator_p.h \ + qhelpdatainterface_p.h \ + qhelpprojectdata_p.h \ + qhelpcollectionhandler_p.h \ + qhelpsearchengine.h \ + qhelpsearchquerywidget.h \ + qhelpsearchresultwidget.h \ + qhelpsearchindex_default_p.h \ + qhelpsearchindexwriter_default_p.h \ + qhelpsearchindexreader_default_p.h \ + qhelpsearchindexreader_p.h \ + qclucenefieldnames_p.h + +# access to clucene +HEADERS += qhelpsearchindexwriter_clucene_p.h \ + qhelpsearchindexreader_clucene_p.h diff --git a/src/assistant/help/helpsystem.qrc b/src/assistant/help/helpsystem.qrc new file mode 100644 index 000000000..10efc6df1 --- /dev/null +++ b/src/assistant/help/helpsystem.qrc @@ -0,0 +1,8 @@ + + + images/1leftarrow.png + images/1rightarrow.png + images/3leftarrow.png + images/3rightarrow.png + + diff --git a/src/assistant/help/images/1leftarrow.png b/src/assistant/help/images/1leftarrow.png new file mode 100644 index 000000000..bd1a5a249 Binary files /dev/null and b/src/assistant/help/images/1leftarrow.png differ diff --git a/src/assistant/help/images/1rightarrow.png b/src/assistant/help/images/1rightarrow.png new file mode 100644 index 000000000..0c0c44ae6 Binary files /dev/null and b/src/assistant/help/images/1rightarrow.png differ diff --git a/src/assistant/help/images/3leftarrow.png b/src/assistant/help/images/3leftarrow.png new file mode 100644 index 000000000..8d38b0f57 Binary files /dev/null and b/src/assistant/help/images/3leftarrow.png differ diff --git a/src/assistant/help/images/3rightarrow.png b/src/assistant/help/images/3rightarrow.png new file mode 100644 index 000000000..c2faf501c Binary files /dev/null and b/src/assistant/help/images/3rightarrow.png differ diff --git a/src/assistant/help/qclucenefieldnames.cpp b/src/assistant/help/qclucenefieldnames.cpp new file mode 100644 index 000000000..31ef415af --- /dev/null +++ b/src/assistant/help/qclucenefieldnames.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qclucenefieldnames_p.h" + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace clucene { +const QString AttributeField(QLatin1String("attribute")); +const QString ContentField(QLatin1String("content")); +const QString NamespaceField(QLatin1String("namespace")); +const QString PathField(QLatin1String("path")); +const QString TitleField(QLatin1String("title")); +const QString TitleTokenizedField(QLatin1String("titleTokenized")); +} // namespace clucene +} // namespace fulltextsearch + +QT_END_NAMESPACE diff --git a/src/assistant/help/qclucenefieldnames_p.h b/src/assistant/help/qclucenefieldnames_p.h new file mode 100644 index 000000000..733e27121 --- /dev/null +++ b/src/assistant/help/qclucenefieldnames_p.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCLUCENEFIELDNAMES_P_H +#define QCLUCENEFIELDNAMES_P_H + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace clucene { + extern const QString AttributeField; + extern const QString ContentField; + extern const QString NamespaceField; + extern const QString PathField; + extern const QString TitleField; + extern const QString TitleTokenizedField; +} // namespace clucene +} // namespace fulltextsearch + +QT_END_NAMESPACE + +#endif // QCLUCENEFIELDNAMES_P_H diff --git a/src/assistant/help/qhelp_global.cpp b/src/assistant/help/qhelp_global.cpp new file mode 100644 index 000000000..2c7ca6214 --- /dev/null +++ b/src/assistant/help/qhelp_global.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +#include "qhelp_global.h" + +QString QHelpGlobal::uniquifyConnectionName(const QString &name, void *pointer) +{ + static int counter = 0; + static QMutex mutex; + + QMutexLocker locker(&mutex); + if (++counter > 1000) + counter = 0; + + return QString::fromLatin1("%1-%2-%3"). + arg(name).arg(quintptr(pointer)).arg(counter); +} + +QString QHelpGlobal::documentTitle(const QString &content) +{ + QString title = QCoreApplication::translate("QHelp", "Untitled"); + if (!content.isEmpty()) { + int start = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; + int end = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); + if ((end - start) > 0) { + title = content.mid(start, end - start); + if (Qt::mightBeRichText(title) || title.contains(QLatin1Char('&'))) { + QTextDocument doc; + doc.setHtml(title); + title = doc.toPlainText(); + } + } + } + return title; +} + +QString QHelpGlobal::codecFromData(const QByteArray &data) +{ + QString codec = codecFromXmlData(data); + if (codec.isEmpty()) + codec = codecFromHtmlData(data); + return codec.isEmpty() ? QLatin1String("utf-8") : codec; +} + +QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) +{ + QString head = QString::fromUtf8(data.constData(), qMin(1000, data.size())); + int start = head.indexOf(QLatin1String(" 0) { + QRegExp r(QLatin1String("charset=([^\"\\s]+)")); + while (start != -1) { + const int end = head.indexOf(QLatin1Char('>'), start) + 1; + if (end <= start) + break; + const QString &meta = head.mid(start, end - start).toLower(); + if (r.indexIn(meta) != -1) + return r.cap(1); + start = head.indexOf(QLatin1String(".*")); + return encodingExp.exactMatch(head) ? encodingExp.cap(1) : QString(); +} diff --git a/src/assistant/help/qhelp_global.h b/src/assistant/help/qhelp_global.h new file mode 100644 index 000000000..182298fc2 --- /dev/null +++ b/src/assistant/help/qhelp_global.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELP_GLOBAL_H +#define QHELP_GLOBAL_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +#if !defined(QT_SHARED) && !defined(QT_DLL) +# define QHELP_EXPORT +#elif defined(QHELP_LIB) +# define QHELP_EXPORT Q_DECL_EXPORT +#else +# define QHELP_EXPORT Q_DECL_IMPORT +#endif + +class QHelpGlobal { +public: + static QString uniquifyConnectionName(const QString &name, void *pointer); + static QString documentTitle(const QString &content); + static QString codecFromData(const QByteArray &data); + +private: + static QString codecFromHtmlData(const QByteArray &data); + static QString codecFromXmlData(const QByteArray &data); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QHELP_GLOBAL_H diff --git a/src/assistant/help/qhelpcollectionhandler.cpp b/src/assistant/help/qhelpcollectionhandler.cpp new file mode 100644 index 000000000..169d37e05 --- /dev/null +++ b/src/assistant/help/qhelpcollectionhandler.cpp @@ -0,0 +1,603 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpcollectionhandler_p.h" +#include "qhelp_global.h" +#include "qhelpdbreader_p.h" + +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +QHelpCollectionHandler::QHelpCollectionHandler(const QString &collectionFile, QObject *parent) + : QObject(parent) + , m_dbOpened(false) + , m_collectionFile(collectionFile) + , m_connectionName(QString()) +{ + QFileInfo fi(m_collectionFile); + if (!fi.isAbsolute()) + m_collectionFile = fi.absoluteFilePath(); + m_query.clear(); +} + +QHelpCollectionHandler::~QHelpCollectionHandler() +{ + m_query.clear(); + if (m_dbOpened) + QSqlDatabase::removeDatabase(m_connectionName); +} + +bool QHelpCollectionHandler::isDBOpened() +{ + if (m_dbOpened) + return true; + emit error(tr("The collection file '%1' is not set up yet!"). + arg(m_collectionFile)); + return false; +} + +QString QHelpCollectionHandler::collectionFile() const +{ + return m_collectionFile; +} + +bool QHelpCollectionHandler::openCollectionFile() +{ + if (m_dbOpened) + return m_dbOpened; + + m_connectionName = QHelpGlobal::uniquifyConnectionName( + QLatin1String("QHelpCollectionHandler"), this); + bool openingOk = true; + { + QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), + m_connectionName); + if (db.driver() + && db.driver()->lastError().type() == QSqlError::ConnectionError) { + emit error(tr("Cannot load sqlite database driver!")); + return false; + } + + db.setDatabaseName(collectionFile()); + openingOk = db.open(); + if (openingOk) + m_query = QSqlQuery(db); + } + if (!openingOk) { + QSqlDatabase::removeDatabase(m_connectionName); + emit error(tr("Cannot open collection file: %1").arg(collectionFile())); + return false; + } + + m_query.exec(QLatin1String("PRAGMA synchronous=OFF")); + m_query.exec(QLatin1String("PRAGMA cache_size=3000")); + + m_query.exec(QLatin1String("SELECT COUNT(*) FROM sqlite_master WHERE TYPE=\'table\'" + "AND Name=\'NamespaceTable\'")); + m_query.next(); + if (m_query.value(0).toInt() < 1) { + if (!createTables(&m_query)) { + emit error(tr("Cannot create tables in file %1!").arg(collectionFile())); + return false; + } + } + + m_dbOpened = true; + return m_dbOpened; +} + +bool QHelpCollectionHandler::copyCollectionFile(const QString &fileName) +{ + if (!m_dbOpened) + return false; + + QFileInfo fi(fileName); + if (fi.exists()) { + emit error(tr("The collection file '%1' already exists!"). + arg(fileName)); + return false; + } + + if (!fi.absoluteDir().exists() && !QDir().mkpath(fi.absolutePath())) { + emit error(tr("Cannot create directory: %1").arg(fi.absolutePath())); + return false; + } + + QString colFile = fi.absoluteFilePath(); + QString connectionName = QHelpGlobal::uniquifyConnectionName( + QLatin1String("QHelpCollectionHandlerCopy"), this); + QSqlQuery *copyQuery = 0; + bool openingOk = true; + { + QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), connectionName); + db.setDatabaseName(colFile); + openingOk = db.open(); + if (openingOk) + copyQuery = new QSqlQuery(db); + } + + if (!openingOk) { + emit error(tr("Cannot open collection file: %1").arg(colFile)); + return false; + } + + copyQuery->exec(QLatin1String("PRAGMA synchronous=OFF")); + copyQuery->exec(QLatin1String("PRAGMA cache_size=3000")); + + if (!createTables(copyQuery)) { + emit error(tr("Cannot copy collection file: %1").arg(colFile)); + return false; + } + + QString oldBaseDir = QFileInfo(collectionFile()).absolutePath(); + QString oldFilePath; + QFileInfo newColFi(colFile); + m_query.exec(QLatin1String("SELECT Name, FilePath FROM NamespaceTable")); + while (m_query.next()) { + copyQuery->prepare(QLatin1String("INSERT INTO NamespaceTable VALUES(NULL, ?, ?)")); + copyQuery->bindValue(0, m_query.value(0).toString()); + oldFilePath = m_query.value(1).toString(); + if (!QDir::isAbsolutePath(oldFilePath)) + oldFilePath = oldBaseDir + QDir::separator() + oldFilePath; + copyQuery->bindValue(1, newColFi.absoluteDir().relativeFilePath(oldFilePath)); + copyQuery->exec(); + } + + m_query.exec(QLatin1String("SELECT NamespaceId, Name FROM FolderTable")); + while (m_query.next()) { + copyQuery->prepare(QLatin1String("INSERT INTO FolderTable VALUES(NULL, ?, ?)")); + copyQuery->bindValue(0, m_query.value(0).toString()); + copyQuery->bindValue(1, m_query.value(1).toString()); + copyQuery->exec(); + } + + m_query.exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); + while (m_query.next()) { + copyQuery->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); + copyQuery->bindValue(0, m_query.value(0).toString()); + copyQuery->exec(); + } + + m_query.exec(QLatin1String("SELECT Name FROM FilterNameTable")); + while (m_query.next()) { + copyQuery->prepare(QLatin1String("INSERT INTO FilterNameTable VALUES(NULL, ?)")); + copyQuery->bindValue(0, m_query.value(0).toString()); + copyQuery->exec(); + } + + m_query.exec(QLatin1String("SELECT NameId, FilterAttributeId FROM FilterTable")); + while (m_query.next()) { + copyQuery->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); + copyQuery->bindValue(0, m_query.value(0).toInt()); + copyQuery->bindValue(1, m_query.value(1).toInt()); + copyQuery->exec(); + } + + m_query.exec(QLatin1String("SELECT Key, Value FROM SettingsTable")); + while (m_query.next()) { + if (m_query.value(0).toString() == QLatin1String("CluceneSearchNamespaces")) + continue; + copyQuery->prepare(QLatin1String("INSERT INTO SettingsTable VALUES(?, ?)")); + copyQuery->bindValue(0, m_query.value(0).toString()); + copyQuery->bindValue(1, m_query.value(1)); + copyQuery->exec(); + } + + copyQuery->clear(); + delete copyQuery; + QSqlDatabase::removeDatabase(connectionName); + return true; +} + +bool QHelpCollectionHandler::createTables(QSqlQuery *query) +{ + QStringList tables; + tables << QLatin1String("CREATE TABLE NamespaceTable (" + "Id INTEGER PRIMARY KEY, " + "Name TEXT, " + "FilePath TEXT )") + << QLatin1String("CREATE TABLE FolderTable (" + "Id INTEGER PRIMARY KEY, " + "NamespaceId INTEGER, " + "Name TEXT )") + << QLatin1String("CREATE TABLE FilterAttributeTable (" + "Id INTEGER PRIMARY KEY, " + "Name TEXT )") + << QLatin1String("CREATE TABLE FilterNameTable (" + "Id INTEGER PRIMARY KEY, " + "Name TEXT )") + << QLatin1String("CREATE TABLE FilterTable (" + "NameId INTEGER, " + "FilterAttributeId INTEGER )") + << QLatin1String("CREATE TABLE SettingsTable (" + "Key TEXT PRIMARY KEY, " + "Value BLOB )"); + + foreach (const QString &q, tables) { + if (!query->exec(q)) + return false; + } + return true; +} + +QStringList QHelpCollectionHandler::customFilters() const +{ + QStringList list; + if (m_dbOpened) { + m_query.exec(QLatin1String("SELECT Name FROM FilterNameTable")); + while (m_query.next()) + list.append(m_query.value(0).toString()); + } + return list; +} + +bool QHelpCollectionHandler::removeCustomFilter(const QString &filterName) +{ + if (!isDBOpened() || filterName.isEmpty()) + return false; + + int filterNameId = -1; + m_query.prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); + m_query.bindValue(0, filterName); + m_query.exec(); + if (m_query.next()) + filterNameId = m_query.value(0).toInt(); + + if (filterNameId < 0) { + emit error(tr("Unknown filter '%1'!").arg(filterName)); + return false; + } + + m_query.prepare(QLatin1String("DELETE FROM FilterTable WHERE NameId=?")); + m_query.bindValue(0, filterNameId); + m_query.exec(); + + m_query.prepare(QLatin1String("DELETE FROM FilterNameTable WHERE Id=?")); + m_query.bindValue(0, filterNameId); + m_query.exec(); + + return true; +} + +bool QHelpCollectionHandler::addCustomFilter(const QString &filterName, + const QStringList &attributes) +{ + if (!isDBOpened() || filterName.isEmpty()) + return false; + + int nameId = -1; + m_query.prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); + m_query.bindValue(0, filterName); + m_query.exec(); + if (m_query.next()) + nameId = m_query.value(0).toInt(); + + m_query.exec(QLatin1String("SELECT Id, Name FROM FilterAttributeTable")); + QStringList idsToInsert = attributes; + QMap attributeMap; + while (m_query.next()) { + attributeMap.insert(m_query.value(1).toString(), + m_query.value(0).toInt()); + if (idsToInsert.contains(m_query.value(1).toString())) + idsToInsert.removeAll(m_query.value(1).toString()); + } + + foreach (const QString &id, idsToInsert) { + m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); + m_query.bindValue(0, id); + m_query.exec(); + attributeMap.insert(id, m_query.lastInsertId().toInt()); + } + + if (nameId < 0) { + m_query.prepare(QLatin1String("INSERT INTO FilterNameTable VALUES(NULL, ?)")); + m_query.bindValue(0, filterName); + if (m_query.exec()) + nameId = m_query.lastInsertId().toInt(); + } + + if (nameId < 0) { + emit error(tr("Cannot register filter %1!").arg(filterName)); + return false; + } + + m_query.prepare(QLatin1String("DELETE FROM FilterTable WHERE NameId=?")); + m_query.bindValue(0, nameId); + m_query.exec(); + + foreach (const QString &att, attributes) { + m_query.prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); + m_query.bindValue(0, nameId); + m_query.bindValue(1, attributeMap[att]); + if (!m_query.exec()) + return false; + } + return true; +} + +QHelpCollectionHandler::DocInfoList QHelpCollectionHandler::registeredDocumentations() const +{ + DocInfoList list; + if (m_dbOpened) { + m_query.exec(QLatin1String("SELECT a.Name, a.FilePath, b.Name " + "FROM NamespaceTable a, FolderTable b WHERE a.Id=b.NamespaceId")); + + while (m_query.next()) { + DocInfo info; + info.fileName = m_query.value(1).toString(); + info.folderName = m_query.value(2).toString(); + info.namespaceName = m_query.value(0).toString(); + list.append(info); + } + } + return list; +} + +bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) +{ + if (!isDBOpened()) + return false; + + QHelpDBReader reader(fileName, QHelpGlobal::uniquifyConnectionName( + QLatin1String("QHelpCollectionHandler"), this), 0); + if (!reader.init()) { + emit error(tr("Cannot open documentation file %1!").arg(fileName)); + return false; + } + + QString ns = reader.namespaceName(); + if (ns.isEmpty()) { + emit error(tr("Invalid documentation file '%1'!").arg(fileName)); + return false; + } + + int nsId = registerNamespace(ns, fileName); + if (nsId < 1) + return false; + + if (!registerVirtualFolder(reader.virtualFolder(), nsId)) + return false; + + addFilterAttributes(reader.filterAttributes()); + foreach (const QString &filterName, reader.customFilters()) + addCustomFilter(filterName, reader.filterAttributes(filterName)); + + optimizeDatabase(fileName); + + return true; +} + +bool QHelpCollectionHandler::unregisterDocumentation(const QString &namespaceName) +{ + if (!isDBOpened()) + return false; + + m_query.prepare(QLatin1String("SELECT Id FROM NamespaceTable WHERE Name=?")); + m_query.bindValue(0, namespaceName); + m_query.exec(); + + int nsId = -1; + if (m_query.next()) + nsId = m_query.value(0).toInt(); + + if (nsId < 0) { + emit error(tr("The namespace %1 was not registered!").arg(namespaceName)); + return false; + } + + m_query.prepare(QLatin1String("DELETE FROM NamespaceTable WHERE Id=?")); + m_query.bindValue(0, nsId); + m_query.exec(); + + m_query.prepare(QLatin1String("DELETE FROM FolderTable WHERE NamespaceId=?")); + m_query.bindValue(0, nsId); + return m_query.exec(); +} + +bool QHelpCollectionHandler::removeCustomValue(const QString &key) +{ + if (!isDBOpened()) + return false; + + m_query.prepare(QLatin1String("DELETE FROM SettingsTable WHERE Key=?")); + m_query.bindValue(0, key); + return m_query.exec(); +} + +QVariant QHelpCollectionHandler::customValue(const QString &key, + const QVariant &defaultValue) const +{ + QVariant value = defaultValue; + if (m_dbOpened) { + m_query.prepare(QLatin1String("SELECT COUNT(Key) FROM SettingsTable WHERE Key=?")); + m_query.bindValue(0, key); + if (!m_query.exec() || !m_query.next() || !m_query.value(0).toInt()) { + m_query.clear(); + return defaultValue; + } + + m_query.clear(); + m_query.prepare(QLatin1String("SELECT Value FROM SettingsTable WHERE Key=?")); + m_query.bindValue(0, key); + if (m_query.exec() && m_query.next()) + value = m_query.value(0); + m_query.clear(); + } + return value; +} + +bool QHelpCollectionHandler::setCustomValue(const QString &key, + const QVariant &value) +{ + if (!isDBOpened()) + return false; + + m_query.prepare(QLatin1String("SELECT Value FROM SettingsTable WHERE Key=?")); + m_query.bindValue(0, key); + m_query.exec(); + if (m_query.next()) { + m_query.prepare(QLatin1String("UPDATE SettingsTable SET Value=? where Key=?")); + m_query.bindValue(0, value); + m_query.bindValue(1, key); + } + else { + m_query.prepare(QLatin1String("INSERT INTO SettingsTable VALUES(?, ?)")); + m_query.bindValue(0, key); + m_query.bindValue(1, value); + } + return m_query.exec(); +} + +bool QHelpCollectionHandler::addFilterAttributes(const QStringList &attributes) +{ + if (!isDBOpened()) + return false; + + m_query.exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); + QSet atts; + while (m_query.next()) + atts.insert(m_query.value(0).toString()); + + foreach (const QString &s, attributes) { + if (!atts.contains(s)) { + m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); + m_query.bindValue(0, s); + m_query.exec(); + } + } + return true; +} + +QStringList QHelpCollectionHandler::filterAttributes() const +{ + QStringList list; + if (m_dbOpened) { + m_query.exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); + while (m_query.next()) + list.append(m_query.value(0).toString()); + } + return list; +} + +QStringList QHelpCollectionHandler::filterAttributes(const QString &filterName) const +{ + QStringList list; + if (m_dbOpened) { + m_query.prepare(QLatin1String("SELECT a.Name FROM FilterAttributeTable a, " + "FilterTable b, FilterNameTable c WHERE a.Id=b.FilterAttributeId " + "AND b.NameId=c.Id AND c.Name=?")); + m_query.bindValue(0, filterName); + m_query.exec(); + while (m_query.next()) + list.append(m_query.value(0).toString()); + } + return list; +} + +int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QString &fileName) +{ + m_query.prepare(QLatin1String("SELECT COUNT(Id) FROM NamespaceTable WHERE Name=?")); + m_query.bindValue(0, nspace); + m_query.exec(); + while (m_query.next()) { + if (m_query.value(0).toInt() > 0) { + emit error(tr("Namespace %1 already exists!").arg(nspace)); + return -1; + } + } + + QFileInfo fi(m_collectionFile); + m_query.prepare(QLatin1String("INSERT INTO NamespaceTable VALUES(NULL, ?, ?)")); + m_query.bindValue(0, nspace); + m_query.bindValue(1, fi.absoluteDir().relativeFilePath(fileName)); + int namespaceId = -1; + if (m_query.exec()) + namespaceId = m_query.lastInsertId().toInt(); + if (namespaceId < 1) { + emit error(tr("Cannot register namespace '%1'!").arg(nspace)); + return -1; + } + return namespaceId; +} + +bool QHelpCollectionHandler::registerVirtualFolder(const QString &folderName, int namespaceId) +{ + m_query.prepare(QLatin1String("INSERT INTO FolderTable VALUES(NULL, ?, ?)")); + m_query.bindValue(0, namespaceId); + m_query.bindValue(1, folderName); + return m_query.exec(); +} + +void QHelpCollectionHandler::optimizeDatabase(const QString &fileName) +{ + if (!QFile::exists(fileName)) + return; + + { // according to removeDatabase() documentation + QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), QLatin1String("optimize")); + db.setDatabaseName(fileName); + if (!db.open()) { + QSqlDatabase::removeDatabase(QLatin1String("optimize")); + emit error(tr("Cannot open database '%1' to optimize!").arg(fileName)); + return; + } + + QSqlQuery query(db); + db.exec(QLatin1String("PRAGMA synchronous=OFF")); + db.exec(QLatin1String("PRAGMA cache_size=3000")); + db.exec(QLatin1String("CREATE INDEX IF NOT EXISTS NameIndex ON IndexTable(Name)")); + db.exec(QLatin1String("CREATE INDEX IF NOT EXISTS FileNameIndex ON FileNameTable(Name)")); + db.exec(QLatin1String("CREATE INDEX IF NOT EXISTS FileIdIndex ON FileNameTable(FileId)")); + + db.close(); + } + + QSqlDatabase::removeDatabase(QLatin1String("optimize")); +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpcollectionhandler_p.h b/src/assistant/help/qhelpcollectionhandler_p.h new file mode 100644 index 000000000..a97af8fa9 --- /dev/null +++ b/src/assistant/help/qhelpcollectionhandler_p.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPCOLLECTIONHANDLER_H +#define QHELPCOLLECTIONHANDLER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +class QHelpCollectionHandler : public QObject +{ + Q_OBJECT + +public: + struct DocInfo + { + QString fileName; + QString folderName; + QString namespaceName; + }; + typedef QList DocInfoList; + + explicit QHelpCollectionHandler(const QString &collectionFile, + QObject *parent = 0); + ~QHelpCollectionHandler(); + + QString collectionFile() const; + + bool openCollectionFile(); + bool copyCollectionFile(const QString &fileName); + + QStringList customFilters() const; + bool removeCustomFilter(const QString &filterName); + bool addCustomFilter(const QString &filterName, + const QStringList &attributes); + + DocInfoList registeredDocumentations() const; + bool registerDocumentation(const QString &fileName); + bool unregisterDocumentation(const QString &namespaceName); + + bool removeCustomValue(const QString &key); + QVariant customValue(const QString &key, const QVariant &defaultValue) const; + bool setCustomValue(const QString &key, const QVariant &value); + + bool addFilterAttributes(const QStringList &attributes); + QStringList filterAttributes() const; + QStringList filterAttributes(const QString &filterName) const; + + int registerNamespace(const QString &nspace, const QString &fileName); + bool registerVirtualFolder(const QString &folderName, int namespaceId); + void optimizeDatabase(const QString &fileName); + +signals: + void error(const QString &msg); + +private: + bool isDBOpened(); + bool createTables(QSqlQuery *query); + + bool m_dbOpened; + QString m_collectionFile; + QString m_connectionName; + mutable QSqlQuery m_query; +}; + +QT_END_NAMESPACE + +#endif //QHELPCOLLECTIONHANDLER_H diff --git a/src/assistant/help/qhelpcontentwidget.cpp b/src/assistant/help/qhelpcontentwidget.cpp new file mode 100644 index 000000000..7e3cb93d1 --- /dev/null +++ b/src/assistant/help/qhelpcontentwidget.cpp @@ -0,0 +1,586 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpcontentwidget.h" +#include "qhelpenginecore.h" +#include "qhelpengine_p.h" +#include "qhelpdbreader_p.h" + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpContentItemPrivate +{ +public: + QHelpContentItemPrivate(const QString &t, const QString &l, + QHelpDBReader *r, QHelpContentItem *p) + { + parent = p; + title = t; + link = l; + helpDBReader = r; + } + + QList childItems; + QHelpContentItem *parent; + QString title; + QString link; + QHelpDBReader *helpDBReader; +}; + +class QHelpContentProvider : public QThread +{ +public: + QHelpContentProvider(QHelpEnginePrivate *helpEngine); + ~QHelpContentProvider(); + void collectContents(const QString &customFilterName); + void stopCollecting(); + QHelpContentItem *rootItem(); + int nextChildCount() const; + +private: + void run(); + + QHelpEnginePrivate *m_helpEngine; + QHelpContentItem *m_rootItem; + QStringList m_filterAttributes; + QQueue m_rootItems; + QMutex m_mutex; + bool m_abort; +}; + +class QHelpContentModelPrivate +{ +public: + QHelpContentItem *rootItem; + QHelpContentProvider *qhelpContentProvider; +}; + + + +/*! + \class QHelpContentItem + \inmodule QtHelp + \brief The QHelpContentItem class provides an item for use with QHelpContentModel. + \since 4.4 +*/ + +QHelpContentItem::QHelpContentItem(const QString &name, const QString &link, + QHelpDBReader *reader, QHelpContentItem *parent) +{ + d = new QHelpContentItemPrivate(name, link, reader, parent); +} + +/*! + Destroys the help content item. +*/ +QHelpContentItem::~QHelpContentItem() +{ + qDeleteAll(d->childItems); + delete d; +} + +void QHelpContentItem::appendChild(QHelpContentItem *item) +{ + d->childItems.append(item); +} + +/*! + Returns the child of the content item in the give \a row. + + \sa parent() +*/ +QHelpContentItem *QHelpContentItem::child(int row) const +{ + if (row >= childCount()) + return 0; + return d->childItems.value(row); +} + +/*! + Returns the number of child items. +*/ +int QHelpContentItem::childCount() const +{ + return d->childItems.count(); +} + +/*! + Returns the row of this item from its parents view. +*/ +int QHelpContentItem::row() const +{ + if (d->parent) + return d->parent->d->childItems.indexOf(const_cast(this)); + return 0; +} + +/*! + Returns the title of the content item. +*/ +QString QHelpContentItem::title() const +{ + return d->title; +} + +/*! + Returns the URL of this content item. +*/ +QUrl QHelpContentItem::url() const +{ + return d->helpDBReader->urlOfPath(d->link); +} + +/*! + Returns the parent content item. +*/ +QHelpContentItem *QHelpContentItem::parent() const +{ + return d->parent; +} + +/*! + Returns the position of a given \a child. +*/ +int QHelpContentItem::childPosition(QHelpContentItem *child) const +{ + return d->childItems.indexOf(child); +} + + + +QHelpContentProvider::QHelpContentProvider(QHelpEnginePrivate *helpEngine) + : QThread(helpEngine) +{ + m_helpEngine = helpEngine; + m_rootItem = 0; + m_abort = false; +} + +QHelpContentProvider::~QHelpContentProvider() +{ + stopCollecting(); +} + +void QHelpContentProvider::collectContents(const QString &customFilterName) +{ + m_mutex.lock(); + m_filterAttributes = m_helpEngine->q->filterAttributes(customFilterName); + m_mutex.unlock(); + if (!isRunning()) { + start(LowPriority); + } else { + stopCollecting(); + start(LowPriority); + } +} + +void QHelpContentProvider::stopCollecting() +{ + if (!isRunning()) + return; + m_mutex.lock(); + m_abort = true; + m_mutex.unlock(); + wait(); +} + +QHelpContentItem *QHelpContentProvider::rootItem() +{ + QMutexLocker locker(&m_mutex); + return m_rootItems.dequeue(); +} + +int QHelpContentProvider::nextChildCount() const +{ + return m_rootItems.head()->childCount(); +} + +void QHelpContentProvider::run() +{ + QString title; + QString link; + int depth = 0; + QHelpContentItem *item = 0; + + m_mutex.lock(); + m_rootItem = new QHelpContentItem(QString(), QString(), 0); + m_rootItems.enqueue(m_rootItem); + QStringList atts = m_filterAttributes; + const QStringList fileNames = m_helpEngine->orderedFileNameList; + m_mutex.unlock(); + + foreach (const QString &dbFileName, fileNames) { + m_mutex.lock(); + if (m_abort) { + m_abort = false; + m_mutex.unlock(); + break; + } + m_mutex.unlock(); + QHelpDBReader reader(dbFileName, + QHelpGlobal::uniquifyConnectionName(dbFileName + + QLatin1String("FromQHelpContentProvider"), + QThread::currentThread()), 0); + if (!reader.init()) + continue; + foreach (const QByteArray& ba, reader.contentsForFilter(atts)) { + if (ba.size() < 1) + continue; + + int _depth = 0; + bool _root = false; + QStack stack; + + QDataStream s(ba); + for (;;) { + s >> depth; + s >> link; + s >> title; + if (title.isEmpty()) + break; +CHECK_DEPTH: + if (depth == 0) { + m_mutex.lock(); + item = new QHelpContentItem(title, link, + m_helpEngine->fileNameReaderMap.value(dbFileName), m_rootItem); + m_rootItem->appendChild(item); + m_mutex.unlock(); + stack.push(item); + _depth = 1; + _root = true; + } else { + if (depth > _depth && _root) { + _depth = depth; + stack.push(item); + } + if (depth == _depth) { + item = new QHelpContentItem(title, link, + m_helpEngine->fileNameReaderMap.value(dbFileName), stack.top()); + stack.top()->appendChild(item); + } else if (depth < _depth) { + stack.pop(); + --_depth; + goto CHECK_DEPTH; + } + } + } + } + } + m_mutex.lock(); + m_abort = false; + m_mutex.unlock(); +} + + + +/*! + \class QHelpContentModel + \inmodule QtHelp + \brief The QHelpContentModel class provides a model that supplies content to views. + \since 4.4 +*/ + +/*! + \fn void QHelpContentModel::contentsCreationStarted() + + This signal is emitted when the creation of the contents has + started. The current contents are invalid from this point on + until the signal contentsCreated() is emitted. + + \sa isCreatingContents() +*/ + +/*! + \fn void QHelpContentModel::contentsCreated() + + This signal is emitted when the contents have been created. +*/ + +QHelpContentModel::QHelpContentModel(QHelpEnginePrivate *helpEngine) + : QAbstractItemModel(helpEngine) +{ + d = new QHelpContentModelPrivate(); + d->rootItem = 0; + d->qhelpContentProvider = new QHelpContentProvider(helpEngine); + + connect(d->qhelpContentProvider, SIGNAL(finished()), + this, SLOT(insertContents()), Qt::QueuedConnection); + connect(helpEngine->q, SIGNAL(setupStarted()), this, SLOT(invalidateContents())); +} + +/*! + Destroys the help content model. +*/ +QHelpContentModel::~QHelpContentModel() +{ + delete d->rootItem; + delete d; +} + +void QHelpContentModel::invalidateContents(bool onShutDown) +{ + if (onShutDown) + disconnect(this, SLOT(insertContents())); + d->qhelpContentProvider->stopCollecting(); + if (d->rootItem) { + delete d->rootItem; + d->rootItem = 0; + } + if (!onShutDown) + reset(); +} + +/*! + Creates new contents by querying the help system + for contents specified for the \a customFilterName. +*/ +void QHelpContentModel::createContents(const QString &customFilterName) +{ + d->qhelpContentProvider->collectContents(customFilterName); + emit contentsCreationStarted(); +} + +void QHelpContentModel::insertContents() +{ + int count; + if (d->rootItem) { + count = d->rootItem->childCount() - 1; + beginRemoveRows(QModelIndex(), 0, count > 0 ? count : 0); + delete d->rootItem; + d->rootItem = 0; + endRemoveRows(); + } + + count = d->qhelpContentProvider->nextChildCount() - 1; + beginInsertRows(QModelIndex(), 0, count > 0 ? count : 0); + d->rootItem = d->qhelpContentProvider->rootItem(); + endInsertRows(); + reset(); + emit contentsCreated(); +} + +/*! + Returns true if the contents are currently rebuilt, otherwise + false. +*/ +bool QHelpContentModel::isCreatingContents() const +{ + return d->qhelpContentProvider->isRunning(); +} + +/*! + Returns the help content item at the model index position + \a index. +*/ +QHelpContentItem *QHelpContentModel::contentItemAt(const QModelIndex &index) const +{ + if (index.isValid()) + return static_cast(index.internalPointer()); + else + return d->rootItem; +} + +/*! + Returns the index of the item in the model specified by + the given \a row, \a column and \a parent index. +*/ +QModelIndex QHelpContentModel::index(int row, int column, const QModelIndex &parent) const +{ + if (!d->rootItem) + return QModelIndex(); + + QHelpContentItem *parentItem = contentItemAt(parent); + QHelpContentItem *item = parentItem->child(row); + if (!item) + return QModelIndex(); + return createIndex(row, column, item); +} + +/*! + Returns the parent of the model item with the given + \a index, or QModelIndex() if it has no parent. +*/ +QModelIndex QHelpContentModel::parent(const QModelIndex &index) const +{ + QHelpContentItem *item = contentItemAt(index); + if (!item) + return QModelIndex(); + + QHelpContentItem *parentItem = static_cast(item->parent()); + if (!parentItem) + return QModelIndex(); + + QHelpContentItem *grandparentItem = static_cast(parentItem->parent()); + if (!grandparentItem) + return QModelIndex(); + + int row = grandparentItem->childPosition(parentItem); + return createIndex(row, index.column(), parentItem); +} + +/*! + Returns the number of rows under the given \a parent. +*/ +int QHelpContentModel::rowCount(const QModelIndex &parent) const +{ + QHelpContentItem *parentItem = contentItemAt(parent); + if (!parentItem) + return 0; + return parentItem->childCount(); +} + +/*! + Returns the number of columns under the given \a parent. Currently returns always 1. +*/ +int QHelpContentModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + + return 1; +} + +/*! + Returns the data stored under the given \a role for + the item referred to by the \a index. +*/ +QVariant QHelpContentModel::data(const QModelIndex &index, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + QHelpContentItem *item = contentItemAt(index); + if (!item) + return QVariant(); + return item->title(); +} + + + +/*! + \class QHelpContentWidget + \inmodule QtHelp + \brief The QHelpContentWidget class provides a tree view for displaying help content model items. + \since 4.4 +*/ + +/*! + \fn void QHelpContentWidget::linkActivated(const QUrl &link) + + This signal is emitted when a content item is activated and + its associated \a link should be shown. +*/ + +QHelpContentWidget::QHelpContentWidget() + : QTreeView(0) +{ + header()->hide(); + setUniformRowHeights(true); + connect(this, SIGNAL(activated(QModelIndex)), + this, SLOT(showLink(QModelIndex))); +} + +/*! + Returns the index of the content item with the \a link. + An invalid index is returned if no such an item exists. +*/ +QModelIndex QHelpContentWidget::indexOf(const QUrl &link) +{ + QHelpContentModel *contentModel = + qobject_cast(model()); + if (!contentModel || link.scheme() != QLatin1String("qthelp")) + return QModelIndex(); + + m_syncIndex = QModelIndex(); + for (int i=0; irowCount(); ++i) { + QHelpContentItem *itm = + contentModel->contentItemAt(contentModel->index(i, 0)); + if (itm && itm->url().host() == link.host()) { + QString path = link.path(); + if (path.startsWith(QLatin1Char('/'))) + path = path.mid(1); + if (searchContentItem(contentModel, contentModel->index(i, 0), path)) { + return m_syncIndex; + } + } + } + return QModelIndex(); +} + +bool QHelpContentWidget::searchContentItem(QHelpContentModel *model, + const QModelIndex &parent, const QString &path) +{ + QHelpContentItem *parentItem = model->contentItemAt(parent); + if (!parentItem) + return false; + + if (QDir::cleanPath(parentItem->url().path()) == path) { + m_syncIndex = parent; + return true; + } + + for (int i=0; ichildCount(); ++i) { + if (searchContentItem(model, model->index(i, 0, parent), path)) + return true; + } + return false; +} + +void QHelpContentWidget::showLink(const QModelIndex &index) +{ + QHelpContentModel *contentModel = qobject_cast(model()); + if (!contentModel) + return; + + QHelpContentItem *item = contentModel->contentItemAt(index); + if (!item) + return; + QUrl url = item->url(); + if (url.isValid()) + emit linkActivated(url); +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpcontentwidget.h b/src/assistant/help/qhelpcontentwidget.h new file mode 100644 index 000000000..ab7d80a43 --- /dev/null +++ b/src/assistant/help/qhelpcontentwidget.h @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPCONTENTWIDGET_H +#define QHELPCONTENTWIDGET_H + +#include + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QHelpEnginePrivate; +class QHelpDBReader; +class QHelpContentItemPrivate; +class QHelpContentModelPrivate; +class QHelpEngine; +class QHelpContentProvider; + +class QHELP_EXPORT QHelpContentItem +{ +public: + ~QHelpContentItem(); + + QHelpContentItem *child(int row) const; + int childCount() const; + QString title() const; + QUrl url() const; + int row() const; + QHelpContentItem *parent() const; + int childPosition(QHelpContentItem *child) const; + +private: + QHelpContentItem(const QString &name, const QString &link, + QHelpDBReader *reader, QHelpContentItem *parent = 0); + void appendChild(QHelpContentItem *child); + + QHelpContentItemPrivate *d; + friend class QHelpContentProvider; +}; + +class QHELP_EXPORT QHelpContentModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + ~QHelpContentModel(); + + void createContents(const QString &customFilterName); + QHelpContentItem *contentItemAt(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &index) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + bool isCreatingContents() const; + +Q_SIGNALS: + void contentsCreationStarted(); + void contentsCreated(); + +private Q_SLOTS: + void insertContents(); + void invalidateContents(bool onShutDown = false); + +private: + QHelpContentModel(QHelpEnginePrivate *helpEngine); + QHelpContentModelPrivate *d; + friend class QHelpEnginePrivate; +}; + +class QHELP_EXPORT QHelpContentWidget : public QTreeView +{ + Q_OBJECT + +public: + QModelIndex indexOf(const QUrl &link); + +Q_SIGNALS: + void linkActivated(const QUrl &link); + +private Q_SLOTS: + void showLink(const QModelIndex &index); + +private: + bool searchContentItem(QHelpContentModel *model, + const QModelIndex &parent, const QString &path); + QModelIndex m_syncIndex; + +private: + QHelpContentWidget(); + friend class QHelpEngine; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif + diff --git a/src/assistant/help/qhelpdatainterface.cpp b/src/assistant/help/qhelpdatainterface.cpp new file mode 100644 index 000000000..d3f07c756 --- /dev/null +++ b/src/assistant/help/qhelpdatainterface.cpp @@ -0,0 +1,273 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpdatainterface_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \internal + \class QHelpDataContentItem + \since 4.4 + \brief The QHelpDataContentItem class provides an item which represents + a topic or section of the contents. + + Every item holds several pieces of information, most notably the title + which can later be displayed in a contents overview. The reference is used + to store a relative file link to the corresponding section in the + documentation. +*/ + +/*! + Constructs a new content item with \a parent as parent item. + The constucted item has the title \a title and links to the + location specified by \a reference. +*/ +QHelpDataContentItem::QHelpDataContentItem(QHelpDataContentItem *parent, + const QString &title, const QString &reference) + : m_title(title), m_reference(reference) +{ + if (parent) + parent->m_children.append(this); +} + +/*! + Destructs the item and its children. +*/ +QHelpDataContentItem::~QHelpDataContentItem() +{ + qDeleteAll(m_children); +} + +/*! + Returns the title of the item. +*/ +QString QHelpDataContentItem::title() const +{ + return m_title; +} + +/*! + Returns the file reference of the item. +*/ +QString QHelpDataContentItem::reference() const +{ + return m_reference; +} + +/*! + Returns a list of all its child items. +*/ +QList QHelpDataContentItem::children() const +{ + return m_children; +} + +bool QHelpDataIndexItem::operator==(const QHelpDataIndexItem & other) const +{ + return (other.name == name) + && (other.reference == reference); +} + + + +/*! + \internal + \class QHelpDataFilterSection + \since 4.4 +*/ + +/*! + Constructs a help data filter section. +*/ +QHelpDataFilterSection::QHelpDataFilterSection() +{ + d = new QHelpDataFilterSectionData(); +} + +/*! + Adds the filter attribute \a filter to the filter attributes of + this section. +*/ +void QHelpDataFilterSection::addFilterAttribute(const QString &filter) +{ + d->filterAttributes.append(filter); +} + +/*! + Returns a list of all filter attributes defined for this section. +*/ +QStringList QHelpDataFilterSection::filterAttributes() const +{ + return d->filterAttributes; +} + +/*! + Adds the index item \a index to the list of indices. +*/ +void QHelpDataFilterSection::addIndex(const QHelpDataIndexItem &index) +{ + d->indices.append(index); +} + +/*! + Sets the filter sections list of indices to \a indices. +*/ +void QHelpDataFilterSection::setIndices(const QList &indices) +{ + d->indices = indices; +} + +/*! + Returns the list of indices. +*/ +QList QHelpDataFilterSection::indices() const +{ + return d->indices; +} + +/*! + Adds the top level content item \a content to the filter section. +*/ +void QHelpDataFilterSection::addContent(QHelpDataContentItem *content) +{ + d->contents.append(content); +} + +/*! + Sets the list of top level content items of the filter section to + \a contents. +*/ +void QHelpDataFilterSection::setContents(const QList &contents) +{ + qDeleteAll(d->contents); + d->contents = contents; +} + +/*! + Returns a list of top level content items. +*/ +QList QHelpDataFilterSection::contents() const +{ + return d->contents; +} + +/*! + Adds the file \a file to the filter section. +*/ +void QHelpDataFilterSection::addFile(const QString &file) +{ + d->files.append(file); +} + +/*! + Set the list of files to \a files. +*/ +void QHelpDataFilterSection::setFiles(const QStringList &files) +{ + d->files = files; +} + +/*! + Returns the list of files. +*/ +QStringList QHelpDataFilterSection::files() const +{ + return d->files; +} + +/*! + \internal + \class QHelpDataInterface + \since 4.4 +*/ + +/*! + \fn QHelpDataInterface::QHelpDataInterface() + + Constructs a new help data interface. +*/ + +/*! + \fn QHelpDataInterface::~QHelpDataInterface() + + Destroys the help data interface. +*/ + +/*! + \fn QString QHelpDataInterface::namespaceName() const = 0 + + Returns the namespace name of the help data set. +*/ + +/*! + \fn QString QHelpDataInterface::virtualFolder() const = 0 + + Returns the virtual folder of the help data set. +*/ + +/*! + \fn QList QHelpDataInterface::customFilters () const = 0 + + Returns a list of custom filters. Defining custom filters is optional. +*/ + +/*! + \fn QList QHelpDataInterface::filterSections() const = 0 + + Returns a list of filter sections. +*/ + +/*! + \fn QMap QHelpDataInterface::metaData() const = 0 + + Returns a map of meta data. A meta data item can hold almost any data + and is identified by its name. +*/ + +/*! + \fn QString QHelpDataInterface::rootPath() const = 0 + + Returns the root file path of the documentation data. All referenced file + path or links of content items are relative to this path. +*/ + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpdatainterface_p.h b/src/assistant/help/qhelpdatainterface_p.h new file mode 100644 index 000000000..886d68650 --- /dev/null +++ b/src/assistant/help/qhelpdatainterface_p.h @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPDATAINTERFACE_H +#define QHELPDATAINTERFACE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelp_global.h" + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QHELP_EXPORT QHelpDataContentItem +{ +public: + QHelpDataContentItem(QHelpDataContentItem *parent, const QString &title, + const QString &reference); + ~QHelpDataContentItem(); + + QString title() const; + QString reference() const; + QList children() const; + +private: + QString m_title; + QString m_reference; + QList m_children; +}; + +struct QHELP_EXPORT QHelpDataIndexItem { + QHelpDataIndexItem() {} + QHelpDataIndexItem(const QString &n, const QString &id, const QString &r) + : name(n), identifier(id), reference(r) {} + + QString name; + QString identifier; + QString reference; + + bool operator==(const QHelpDataIndexItem & other) const; +}; + +class QHelpDataFilterSectionData : public QSharedData +{ +public: + ~QHelpDataFilterSectionData() + { + qDeleteAll(contents); + } + + QStringList filterAttributes; + QList indices; + QList contents; + QStringList files; +}; + +class QHELP_EXPORT QHelpDataFilterSection +{ +public: + QHelpDataFilterSection(); + + void addFilterAttribute(const QString &filter); + QStringList filterAttributes() const; + + void addIndex(const QHelpDataIndexItem &index); + void setIndices(const QList &indices); + QList indices() const; + + void addContent(QHelpDataContentItem *content); + void setContents(const QList &contents); + QList contents() const; + + void addFile(const QString &file); + void setFiles(const QStringList &files); + QStringList files() const; + +private: + QSharedDataPointer d; +}; + +struct QHELP_EXPORT QHelpDataCustomFilter { + QStringList filterAttributes; + QString name; +}; + +class QHELP_EXPORT QHelpDataInterface +{ +public: + QHelpDataInterface() {} + virtual ~QHelpDataInterface() {} + + virtual QString namespaceName() const = 0; + virtual QString virtualFolder() const = 0; + virtual QList customFilters() const = 0; + virtual QList filterSections() const = 0; + virtual QMap metaData() const = 0; + virtual QString rootPath() const = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QHELPDATAINTERFACE_H diff --git a/src/assistant/help/qhelpdbreader.cpp b/src/assistant/help/qhelpdbreader.cpp new file mode 100644 index 000000000..c4735f8b8 --- /dev/null +++ b/src/assistant/help/qhelpdbreader.cpp @@ -0,0 +1,583 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpdbreader_p.h" +#include "qhelp_global.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QHelpDBReader::QHelpDBReader(const QString &dbName) + : QObject(0) +{ + initObject(dbName, + QHelpGlobal::uniquifyConnectionName(QLatin1String("QHelpDBReader"), + this)); +} + +QHelpDBReader::QHelpDBReader(const QString &dbName, const QString &uniqueId, + QObject *parent) + : QObject(parent) +{ + initObject(dbName, uniqueId); +} + +void QHelpDBReader::initObject(const QString &dbName, const QString &uniqueId) +{ + m_dbName = dbName; + m_uniqueId = uniqueId; + m_initDone = false; + m_query = 0; + m_useAttributesCache = false; +} + +QHelpDBReader::~QHelpDBReader() +{ + if (m_initDone) { + delete m_query; + QSqlDatabase::removeDatabase(m_uniqueId); + } +} + +bool QHelpDBReader::init() +{ + if (m_initDone) + return true; + + if (!QFile::exists(m_dbName)) + return false; + + QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId); + db.setDatabaseName(m_dbName); + if (!db.open()) { + /*: The placeholders are: %1 - The name of the database which cannot be opened + %2 - The unique id for the connection + %3 - The actual error string */ + m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text()); + QSqlDatabase::removeDatabase(m_uniqueId); + return false; + } + + m_initDone = true; + m_query = new QSqlQuery(db); + + return true; +} + +QString QHelpDBReader::databaseName() const +{ + return m_dbName; +} + +QString QHelpDBReader::errorMessage() const +{ + return m_error; +} + +QString QHelpDBReader::namespaceName() const +{ + if (!m_namespace.isEmpty()) + return m_namespace; + if (m_query) { + m_query->exec(QLatin1String("SELECT Name FROM NamespaceTable")); + if (m_query->next()) + m_namespace = m_query->value(0).toString(); + } + return m_namespace; +} + +QString QHelpDBReader::virtualFolder() const +{ + if (m_query) { + m_query->exec(QLatin1String("SELECT Name FROM FolderTable WHERE Id=1")); + if (m_query->next()) + return m_query->value(0).toString(); + } + return QString(); +} + +QList QHelpDBReader::filterAttributeSets() const +{ + QList result; + if (m_query) { + m_query->exec(QLatin1String("SELECT a.Id, b.Name FROM FileAttributeSetTable a, " + "FilterAttributeTable b WHERE a.FilterAttributeId=b.Id ORDER BY a.Id")); + int oldId = -1; + while (m_query->next()) { + int id = m_query->value(0).toInt(); + if (id != oldId) { + result.append(QStringList()); + oldId = id; + } + result.last().append(m_query->value(1).toString()); + } + } + return result; +} + +bool QHelpDBReader::fileExists(const QString &virtualFolder, + const QString &filePath, + const QStringList &filterAttributes) const +{ + if (virtualFolder.isEmpty() || filePath.isEmpty() || !m_query) + return false; + +//SELECT COUNT(a.Name) FROM FileNameTable a, FolderTable b, FileFilterTable c, FilterAttributeTable d WHERE a.FolderId=b.Id AND b.Name='qtdoc' AND a.Name='qstring.html' AND a.FileId=c.FileId AND c.FilterAttributeId=d.Id AND d.Name='qtrefdoc' + + QString query; + namespaceName(); + if (filterAttributes.isEmpty()) { + query = QString(QLatin1String("SELECT COUNT(a.Name) FROM FileNameTable a, FolderTable b " + "WHERE a.FolderId=b.Id AND b.Name=\'%1\' AND a.Name=\'%2\'")).arg(quote(virtualFolder)).arg(quote(filePath)); + } else { + query = QString(QLatin1String("SELECT COUNT(a.Name) FROM FileNameTable a, FolderTable b, " + "FileFilterTable c, FilterAttributeTable d WHERE a.FolderId=b.Id " + "AND b.Name=\'%1\' AND a.Name=\'%2\' AND a.FileId=c.FileId AND " + "c.FilterAttributeId=d.Id AND d.Name=\'%3\'")) + .arg(quote(virtualFolder)).arg(quote(filePath)) + .arg(quote(filterAttributes.first())); + for (int i=1; iexec(query); + if (m_query->next() && m_query->isValid() && m_query->value(0).toInt()) + return true; + return false; +} + +QByteArray QHelpDBReader::fileData(const QString &virtualFolder, + const QString &filePath) const +{ + QByteArray ba; + if (virtualFolder.isEmpty() || filePath.isEmpty() || !m_query) + return ba; + + namespaceName(); + m_query->prepare(QLatin1String("SELECT a.Data FROM FileDataTable a, FileNameTable b, FolderTable c, " + "NamespaceTable d WHERE a.Id=b.FileId AND (b.Name=? OR b.Name=?) AND b.FolderId=c.Id " + "AND c.Name=? AND c.NamespaceId=d.Id AND d.Name=?")); + m_query->bindValue(0, filePath); + m_query->bindValue(1, QString(QLatin1String("./") + filePath)); + m_query->bindValue(2, virtualFolder); + m_query->bindValue(3, m_namespace); + m_query->exec(); + if (m_query->next() && m_query->isValid()) + ba = qUncompress(m_query->value(0).toByteArray()); + return ba; +} + +QStringList QHelpDBReader::customFilters() const +{ + QStringList lst; + if (m_query) { + m_query->exec(QLatin1String("SELECT Name FROM FilterNameTable")); + while (m_query->next()) + lst.append(m_query->value(0).toString()); + } + return lst; +} + +QStringList QHelpDBReader::filterAttributes(const QString &filterName) const +{ + QStringList lst; + if (m_query) { + if (filterName.isEmpty()) { + m_query->prepare(QLatin1String("SELECT Name FROM FilterAttributeTable")); + } else { + m_query->prepare(QLatin1String("SELECT a.Name FROM FilterAttributeTable a, " + "FilterTable b, FilterNameTable c WHERE c.Name=? " + "AND c.Id=b.NameId AND b.FilterAttributeId=a.Id")); + m_query->bindValue(0, filterName); + } + m_query->exec(); + while (m_query->next()) + lst.append(m_query->value(0).toString()); + } + return lst; +} + +QStringList QHelpDBReader::indicesForFilter(const QStringList &filterAttributes) const +{ + QStringList indices; + if (!m_query) + return indices; + + //SELECT DISTINCT a.Name FROM IndexTable a, IndexFilterTable b, FilterAttributeTable c WHERE a.Id=b.IndexId AND b.FilterAttributeId=c.Id AND c.Name in ('4.2.3', 'qt') + + QString query; + if (filterAttributes.isEmpty()) { + query = QLatin1String("SELECT DISTINCT Name FROM IndexTable"); + } else { + query = QString(QLatin1String("SELECT DISTINCT a.Name FROM IndexTable a, " + "IndexFilterTable b, FilterAttributeTable c WHERE a.Id=b.IndexId " + "AND b.FilterAttributeId=c.Id AND c.Name='%1'")).arg(quote(filterAttributes.first())); + for (int i=1; iexec(query); + while (m_query->next()) { + if (!m_query->value(0).toString().isEmpty()) + indices.append(m_query->value(0).toString()); + } + return indices; +} + +void QHelpDBReader::linksForKeyword(const QString &keyword, const QStringList &filterAttributes, + QMap &linkMap) const +{ + if (!m_query) + return; + + QString query; + if (filterAttributes.isEmpty()) { + query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " + "FROM IndexTable a, FileNameTable d, " + "FolderTable e, NamespaceTable f WHERE " + "a.FileId=d.FileId AND d.FolderId=e.Id AND a.NamespaceId=f.Id " + "AND a.Name='%1'")).arg(quote(keyword)); + } else if (m_useAttributesCache) { + query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor, a.Id " + "FROM IndexTable a, " + "FileNameTable d, FolderTable e, NamespaceTable f WHERE " + "a.FileId=d.FileId AND d.FolderId=e.Id " + "AND a.NamespaceId=f.Id AND a.Name='%1'")) + .arg(quote(keyword)); + m_query->exec(query); + while (m_query->next()) { + if (m_indicesCache.contains(m_query->value(5).toInt())) { + linkMap.insertMulti(m_query->value(0).toString(), buildQUrl(m_query->value(1).toString(), + m_query->value(2).toString(), m_query->value(3).toString(), + m_query->value(4).toString())); + } + } + return; + } else { + query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " + "FROM IndexTable a, IndexFilterTable b, FilterAttributeTable c, " + "FileNameTable d, FolderTable e, NamespaceTable f " + "WHERE a.FileId=d.FileId AND d.FolderId=e.Id " + "AND a.NamespaceId=f.Id AND b.IndexId=a.Id AND b.FilterAttributeId=c.Id " + "AND a.Name='%1' AND c.Name='%2'")).arg(quote(keyword)) + .arg(quote(filterAttributes.first())); + for (int i=1; iexec(query); + while (m_query->next()) { + title = m_query->value(0).toString(); + if (title.isEmpty()) // generate a title + corresponding path + title = keyword + QLatin1String(" : ") + m_query->value(3).toString(); + linkMap.insertMulti(title, buildQUrl(m_query->value(1).toString(), + m_query->value(2).toString(), m_query->value(3).toString(), + m_query->value(4).toString())); + } +} + +void QHelpDBReader::linksForIdentifier(const QString &id, + const QStringList &filterAttributes, + QMap &linkMap) const +{ + if (!m_query) + return; + + QString query; + if (filterAttributes.isEmpty()) { + query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " + "FROM IndexTable a, FileNameTable d, FolderTable e, " + "NamespaceTable f WHERE a.FileId=d.FileId AND " + "d.FolderId=e.Id AND a.NamespaceId=f.Id AND a.Identifier='%1'")) + .arg(quote(id)); + } else if (m_useAttributesCache) { + query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor, a.Id " + "FROM IndexTable a," + "FileNameTable d, FolderTable e, NamespaceTable f WHERE " + "a.FileId=d.FileId AND d.FolderId=e.Id " + "AND a.NamespaceId=f.Id AND a.Identifier='%1'")) + .arg(quote(id)); + m_query->exec(query); + while (m_query->next()) { + if (m_indicesCache.contains(m_query->value(5).toInt())) { + linkMap.insertMulti(m_query->value(0).toString(), buildQUrl(m_query->value(1).toString(), + m_query->value(2).toString(), m_query->value(3).toString(), + m_query->value(4).toString())); + } + } + return; + } else { + query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " + "FROM IndexTable a, IndexFilterTable b, FilterAttributeTable c, " + "FileNameTable d, FolderTable e, NamespaceTable f " + "WHERE a.FileId=d.FileId AND d.FolderId=e.Id " + "AND a.NamespaceId=f.Id AND b.IndexId=a.Id AND b.FilterAttributeId=c.Id " + "AND a.Identifier='%1' AND c.Name='%2'")).arg(quote(id)) + .arg(quote(filterAttributes.first())); + for (int i=0; iexec(query); + while (m_query->next()) { + linkMap.insertMulti(m_query->value(0).toString(), buildQUrl(m_query->value(1).toString(), + m_query->value(2).toString(), m_query->value(3).toString(), + m_query->value(4).toString())); + } +} + +QUrl QHelpDBReader::buildQUrl(const QString &ns, const QString &folder, + const QString &relFileName, const QString &anchor) const +{ + QUrl url; + url.setScheme(QLatin1String("qthelp")); + url.setAuthority(ns); + url.setPath(folder + QLatin1Char('/') + relFileName); + url.setFragment(anchor); + return url; +} + +QList QHelpDBReader::contentsForFilter(const QStringList &filterAttributes) const +{ + QList contents; + if (!m_query) + return contents; + + //SELECT DISTINCT a.Data FROM ContentsTable a, ContentsFilterTable b, FilterAttributeTable c WHERE a.Id=b.ContentsId AND b.FilterAttributeId=c.Id AND c.Name='qt' INTERSECT SELECT DISTINCT a.Data FROM ContentsTable a, ContentsFilterTable b, FilterAttributeTable c WHERE a.Id=b.ContentsId AND b.FilterAttributeId=c.Id AND c.Name='3.3.8'; + + QString query; + if (filterAttributes.isEmpty()) { + query = QLatin1String("SELECT Data from ContentsTable"); + } else { + query = QString(QLatin1String("SELECT a.Data FROM ContentsTable a, " + "ContentsFilterTable b, FilterAttributeTable c " + "WHERE a.Id=b.ContentsId AND b.FilterAttributeId=c.Id " + "AND c.Name='%1'")).arg(quote(filterAttributes.first())); + for (int i=1; iexec(query); + while (m_query->next()) { + contents.append(m_query->value(0).toByteArray()); + } + return contents; +} + +QUrl QHelpDBReader::urlOfPath(const QString &relativePath) const +{ + QUrl url; + if (!m_query) + return url; + + m_query->exec(QLatin1String("SELECT a.Name, b.Name FROM NamespaceTable a, " + "FolderTable b WHERE a.id=b.NamespaceId and a.Id=1")); + if (m_query->next()) { + QString rp = relativePath; + QString anchor; + int i = rp.indexOf(QLatin1Char('#')); + if (i > -1) { + rp = relativePath.left(i); + anchor = relativePath.mid(i+1); + } + url = buildQUrl(m_query->value(0).toString(), + m_query->value(1).toString(), rp, anchor); + } + return url; +} + +QStringList QHelpDBReader::files(const QStringList &filterAttributes, + const QString &extensionFilter) const +{ + QStringList lst; + if (!m_query) + return lst; + + QString query; + QString extension; + if (!extensionFilter.isEmpty()) + extension = QString(QLatin1String("AND b.Name like \'%.%1\'")).arg(extensionFilter); + + if (filterAttributes.isEmpty()) { + query = QString(QLatin1String("SELECT a.Name, b.Name FROM FolderTable a, " + "FileNameTable b WHERE b.FolderId=a.Id %1")) + .arg(extension); + } else { + query = QString(QLatin1String("SELECT a.Name, b.Name FROM FolderTable a, " + "FileNameTable b, FileFilterTable c, FilterAttributeTable d " + "WHERE b.FolderId=a.Id AND b.FileId=c.FileId " + "AND c.FilterAttributeId=d.Id AND d.Name=\'%1\' %2")) + .arg(quote(filterAttributes.first())).arg(extension); + for (int i=1; iexec(query); + while (m_query->next()) { + lst.append(m_query->value(0).toString() + QLatin1Char('/') + + m_query->value(1).toString()); + } + + return lst; +} + +QVariant QHelpDBReader::metaData(const QString &name) const +{ + QVariant v; + if (!m_query) + return v; + + m_query->prepare(QLatin1String("SELECT COUNT(Value), Value FROM MetaDataTable " + "WHERE Name=?")); + m_query->bindValue(0, name); + if (m_query->exec() && m_query->next() + && m_query->value(0).toInt() == 1) + v = m_query->value(1); + return v; +} + +QString QHelpDBReader::mergeList(const QStringList &list) const +{ + QString str; + foreach (const QString &s, list) + str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', ")); + if (str.endsWith(QLatin1String(", "))) + str = str.left(str.length()-2); + return str; +} + +QString QHelpDBReader::quote(const QString &string) const +{ + QString s = string; + s.replace(QLatin1Char('\''), QLatin1String("\'\'")); + return s; +} + +QSet QHelpDBReader::indexIds(const QStringList &attributes) const +{ + QSet ids; + + if (attributes.isEmpty()) + return ids; + + QString query = QString(QLatin1String("SELECT a.IndexId FROM IndexFilterTable a, " + "FilterAttributeTable b WHERE a.FilterAttributeId=b.Id " + "AND b.Name='%1'")).arg(attributes.first()); + for (int i=0; iexec(query)) + return ids; + + while (m_query->next()) + ids.insert(m_query->value(0).toInt()); + + return ids; +} + +bool QHelpDBReader::createAttributesCache(const QStringList &attributes, + const QSet &indexIds) +{ + m_useAttributesCache = false; + + if (attributes.count() < 2) { + m_viewAttributes.clear(); + return true; + } + + bool needUpdate = !m_viewAttributes.count(); + + foreach (const QString &s, attributes) + m_viewAttributes.remove(s); + + if (m_viewAttributes.count() || needUpdate) { + m_viewAttributes.clear(); + m_indicesCache = indexIds; + } + foreach (const QString &s, attributes) + m_viewAttributes.insert(s); + m_useAttributesCache = true; + return true; +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpdbreader_p.h b/src/assistant/help/qhelpdbreader_p.h new file mode 100644 index 000000000..5fdf2e90b --- /dev/null +++ b/src/assistant/help/qhelpdbreader_p.h @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPDBREADER_H +#define QHELPDBREADER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QSqlQuery; + +class QHelpDBReader : public QObject +{ + Q_OBJECT + +public: + QHelpDBReader(const QString &dbName); + QHelpDBReader(const QString &dbName, const QString &uniqueId, + QObject *parent); + ~QHelpDBReader(); + + bool init(); + + QString errorMessage() const; + + QString databaseName() const; + QString namespaceName() const; + QString virtualFolder() const; + QList filterAttributeSets() const; + QStringList files(const QStringList &filterAttributes, + const QString &extensionFilter = QString()) const; + bool fileExists(const QString &virtualFolder, const QString &filePath, + const QStringList &filterAttributes = QStringList()) const; + QByteArray fileData(const QString &virtualFolder, + const QString &filePath) const; + + QStringList customFilters() const; + QStringList filterAttributes(const QString &filterName = QString()) const; + QStringList indicesForFilter(const QStringList &filterAttributes) const; + void linksForKeyword(const QString &keyword, const QStringList &filterAttributes, + QMap &linkMap) const; + + void linksForIdentifier(const QString &id, const QStringList &filterAttributes, + QMap &linkMap) const; + + QList contentsForFilter(const QStringList &filterAttributes) const; + QUrl urlOfPath(const QString &relativePath) const; + + QSet indexIds(const QStringList &attributes) const; + bool createAttributesCache(const QStringList &attributes, + const QSet &indexIds); + QVariant metaData(const QString &name) const; + +private: + void initObject(const QString &dbName, const QString &uniqueId); + QUrl buildQUrl(const QString &ns, const QString &folder, + const QString &relFileName, const QString &anchor) const; + QString mergeList(const QStringList &list) const; + QString quote(const QString &string) const; + + bool m_initDone; + QString m_dbName; + QString m_uniqueId; + QString m_error; + QSqlQuery *m_query; + mutable QString m_namespace; + QSet m_viewAttributes; + bool m_useAttributesCache; + QSet m_indicesCache; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/help/qhelpengine.cpp b/src/assistant/help/qhelpengine.cpp new file mode 100644 index 000000000..007cc84a9 --- /dev/null +++ b/src/assistant/help/qhelpengine.cpp @@ -0,0 +1,213 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpengine.h" +#include "qhelpengine_p.h" +#include "qhelpdbreader_p.h" +#include "qhelpcontentwidget.h" +#include "qhelpindexwidget.h" +#include "qhelpsearchengine.h" +#include "qhelpcollectionhandler_p.h" + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QHelpEnginePrivate::QHelpEnginePrivate() + : QHelpEngineCorePrivate() + , contentModel(0) + , contentWidget(0) + , indexModel(0) + , indexWidget(0) + , searchEngine(0) +{ +} + +QHelpEnginePrivate::~QHelpEnginePrivate() +{ +} + +void QHelpEnginePrivate::init(const QString &collectionFile, + QHelpEngineCore *helpEngineCore) +{ + QHelpEngineCorePrivate::init(collectionFile, helpEngineCore); + + if (!contentModel) + contentModel = new QHelpContentModel(this); + if (!indexModel) + indexModel = new QHelpIndexModel(this); + + connect(helpEngineCore, SIGNAL(setupFinished()), this, + SLOT(applyCurrentFilter())); + connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)), this, + SLOT(applyCurrentFilter())); +} + +void QHelpEnginePrivate::applyCurrentFilter() +{ + if (!error.isEmpty()) + return; + contentModel->createContents(currentFilter); + indexModel->createIndex(currentFilter); +} + +void QHelpEnginePrivate::setContentsWidgetBusy() +{ + contentWidget->setCursor(Qt::WaitCursor); +} + +void QHelpEnginePrivate::unsetContentsWidgetBusy() +{ + contentWidget->unsetCursor(); +} + +void QHelpEnginePrivate::setIndexWidgetBusy() +{ + indexWidget->setCursor(Qt::WaitCursor); +} + +void QHelpEnginePrivate::unsetIndexWidgetBusy() +{ + indexWidget->unsetCursor(); +} + +void QHelpEnginePrivate::stopDataCollection() +{ + contentModel->invalidateContents(true); + indexModel->invalidateIndex(true); +} + + + +/*! + \class QHelpEngine + \since 4.4 + \inmodule QtHelp + \brief The QHelpEngine class provides access to contents and + indices of the help engine. + + +*/ + +/*! + Constructs a new help engine with the given \a parent. The help + engine uses the information stored in the \a collectionFile for + providing help. If the collection file does not already exist, + it will be created. +*/ +QHelpEngine::QHelpEngine(const QString &collectionFile, QObject *parent) + : QHelpEngineCore(d = new QHelpEnginePrivate(), parent) +{ + d->init(collectionFile, this); +} + +/*! + Destroys the help engine object. +*/ +QHelpEngine::~QHelpEngine() +{ + d->stopDataCollection(); +} + +/*! + Returns the content model. +*/ +QHelpContentModel *QHelpEngine::contentModel() const +{ + return d->contentModel; +} + +/*! + Returns the index model. +*/ +QHelpIndexModel *QHelpEngine::indexModel() const +{ + return d->indexModel; +} + +/*! + Returns the content widget. +*/ +QHelpContentWidget *QHelpEngine::contentWidget() +{ + if (!d->contentWidget) { + d->contentWidget = new QHelpContentWidget(); + d->contentWidget->setModel(d->contentModel); + connect(d->contentModel, SIGNAL(contentsCreationStarted()), + d, SLOT(setContentsWidgetBusy())); + connect(d->contentModel, SIGNAL(contentsCreated()), + d, SLOT(unsetContentsWidgetBusy())); + } + return d->contentWidget; +} + +/*! + Returns the index widget. +*/ +QHelpIndexWidget *QHelpEngine::indexWidget() +{ + if (!d->indexWidget) { + d->indexWidget = new QHelpIndexWidget(); + d->indexWidget->setModel(d->indexModel); + connect(d->indexModel, SIGNAL(indexCreationStarted()), + d, SLOT(setIndexWidgetBusy())); + connect(d->indexModel, SIGNAL(indexCreated()), + d, SLOT(unsetIndexWidgetBusy())); + } + return d->indexWidget; +} + +/*! + Returns the default search engine. +*/ +QHelpSearchEngine* QHelpEngine::searchEngine() +{ + if (!d->searchEngine) + d->searchEngine = new QHelpSearchEngine(this, this); + return d->searchEngine; +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpengine.h b/src/assistant/help/qhelpengine.h new file mode 100644 index 000000000..cc0bca299 --- /dev/null +++ b/src/assistant/help/qhelpengine.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPENGINE_H +#define QHELPENGINE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QHelpContentModel; +class QHelpContentWidget; +class QHelpIndexModel; +class QHelpIndexWidget; +class QHelpEnginePrivate; +class QHelpSearchEngine; + +class QHELP_EXPORT QHelpEngine : public QHelpEngineCore +{ + Q_OBJECT + +public: + explicit QHelpEngine(const QString &collectionFile, QObject *parent = 0); + ~QHelpEngine(); + + QHelpContentModel *contentModel() const; + QHelpIndexModel *indexModel() const; + + QHelpContentWidget *contentWidget(); + QHelpIndexWidget *indexWidget(); + + QHelpSearchEngine *searchEngine(); + +private: + QHelpEnginePrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/assistant/help/qhelpengine_p.h b/src/assistant/help/qhelpengine_p.h new file mode 100644 index 000000000..5a7c30184 --- /dev/null +++ b/src/assistant/help/qhelpengine_p.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPENGINE_P_H +#define QHELPENGINE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QSqlQuery; + +class QHelpEngineCore; +class QHelpDBReader; +class QHelpContentModel; +class QHelpContentWidget; +class QHelpIndexModel; +class QHelpIndexWidget; +class QHelpSearchEngine; +class QHelpCollectionHandler; + +class QHelpEngineCorePrivate : public QObject +{ + Q_OBJECT + +public: + QHelpEngineCorePrivate(); + virtual ~QHelpEngineCorePrivate(); + + virtual void init(const QString &collectionFile, + QHelpEngineCore *helpEngineCore); + + void clearMaps(); + bool setup(); + + QMap readerMap; + QMap fileNameReaderMap; + QMultiMap virtualFolderMap; + QStringList orderedFileNameList; + + QHelpCollectionHandler *collectionHandler; + QString currentFilter; + QString error; + bool needsSetup; + bool autoSaveFilter; + +protected: + QHelpEngineCore *q; + +private slots: + void errorReceived(const QString &msg); +}; + + +class QHelpEnginePrivate : public QHelpEngineCorePrivate +{ + Q_OBJECT + +public: + QHelpEnginePrivate(); + ~QHelpEnginePrivate(); + + void init(const QString &collectionFile, + QHelpEngineCore *helpEngineCore); + + QHelpContentModel *contentModel; + QHelpContentWidget *contentWidget; + + QHelpIndexModel *indexModel; + QHelpIndexWidget *indexWidget; + + QHelpSearchEngine *searchEngine; + + void stopDataCollection(); + + friend class QHelpContentProvider; + friend class QHelpContentModel; + friend class QHelpIndexProvider; + friend class QHelpIndexModel; + +public slots: + void setContentsWidgetBusy(); + void unsetContentsWidgetBusy(); + void setIndexWidgetBusy(); + void unsetIndexWidgetBusy(); + +private slots: + void applyCurrentFilter(); +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/help/qhelpenginecore.cpp b/src/assistant/help/qhelpenginecore.cpp new file mode 100644 index 000000000..178e11ee6 --- /dev/null +++ b/src/assistant/help/qhelpenginecore.cpp @@ -0,0 +1,737 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpenginecore.h" +#include "qhelpengine_p.h" +#include "qhelpdbreader_p.h" +#include "qhelpcollectionhandler_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +QHelpEngineCorePrivate::QHelpEngineCorePrivate() +{ + QHelpGlobal::uniquifyConnectionName(QString(), this); + autoSaveFilter = true; +} + +void QHelpEngineCorePrivate::init(const QString &collectionFile, + QHelpEngineCore *helpEngineCore) +{ + q = helpEngineCore; + collectionHandler = new QHelpCollectionHandler(collectionFile, helpEngineCore); + connect(collectionHandler, SIGNAL(error(QString)), + this, SLOT(errorReceived(QString))); + needsSetup = true; +} + +QHelpEngineCorePrivate::~QHelpEngineCorePrivate() +{ + delete collectionHandler; + clearMaps(); +} + +void QHelpEngineCorePrivate::clearMaps() +{ + QMap::iterator it = readerMap.begin(); + while (it != readerMap.end()) { + delete it.value(); + ++it; + } + readerMap.clear(); + fileNameReaderMap.clear(); + virtualFolderMap.clear(); + orderedFileNameList.clear(); +} + +bool QHelpEngineCorePrivate::setup() +{ + error.clear(); + if (!needsSetup) + return true; + + needsSetup = false; + emit q->setupStarted(); + clearMaps(); + + if (!collectionHandler->openCollectionFile()) { + emit q->setupFinished(); + return false; + } + + const QHelpCollectionHandler::DocInfoList docList = + collectionHandler->registeredDocumentations(); + QFileInfo fi(collectionHandler->collectionFile()); + QString absFileName; + foreach(const QHelpCollectionHandler::DocInfo &info, docList) { + if (QDir::isAbsolutePath(info.fileName)) { + absFileName = info.fileName; + } else { + absFileName = QFileInfo(fi.absolutePath() + QDir::separator() + info.fileName) + .absoluteFilePath(); + } + QHelpDBReader *reader = new QHelpDBReader(absFileName, + QHelpGlobal::uniquifyConnectionName(info.fileName, this), this); + if (!reader->init()) { + emit q->warning(QHelpEngineCore::tr("Cannot open documentation file %1: %2!") + .arg(absFileName, reader->errorMessage())); + continue; + } + + readerMap.insert(info.namespaceName, reader); + fileNameReaderMap.insert(absFileName, reader); + virtualFolderMap.insert(info.folderName, reader); + orderedFileNameList.append(absFileName); + } + q->currentFilter(); + emit q->setupFinished(); + return true; +} + +void QHelpEngineCorePrivate::errorReceived(const QString &msg) +{ + error = msg; +} + + + +/*! + \class QHelpEngineCore + \since 4.4 + \inmodule QtHelp + \brief The QHelpEngineCore class provides the core functionality + of the help system. + + Before the help engine can be used, it must be initialized by + calling setupData(). At the beginning of the setup process the + signal setupStarted() is emitted. From this point on until + the signal setupFinished() is emitted, is the help data in an + undefined meaning unusable state. + + The core help engine can be used to perform different tasks. + By calling linksForIdentifier() the engine returns + urls specifying the file locations inside the help system. The + actual file data can then be retrived by calling fileData(). In + contrast to all other functions in this class, linksForIdentifier() + depends on the currently set custom filter. Depending on the filter, + the function may return different hits. + + Every help engine can contain any number of custom filters. A custom + filter is defined by a name and set of filter attributes and can be + added to the help engine by calling addCustomFilter(). Analogous, + it is removed by calling removeCustomFilter(). customFilters() returns + all defined filters. + + The help engine also offers the possibility to set and read values + in a persistant way comparable to ini files or Windows registry + entries. For more information see setValue() or value(). + + This class does not offer any GUI components or functionality for + indices or contents. If you need one of those use QHelpEngine + instead. + + When creating a custom help viewer the viewer can be + configured by writing a custom collection file which could contain various + keywords to be used to configure the help engine. These keywords and values + and their meaning can be found in the help information for + \l{assistant-custom-help-viewer.html#creating-a-custom-help-collection-file} + {creating a custom help collection file} for Assistant. +*/ + +/*! + \fn void QHelpEngineCore::setupStarted() + + This signal is emitted when setup is started. +*/ + +/*! + \fn void QHelpEngineCore::setupFinished() + + This signal is emitted when the setup is complete. +*/ + +/*! + \fn void QHelpEngineCore::currentFilterChanged(const QString &newFilter) + + This signal is emitted when the current filter is changed to + \a newFilter. +*/ + +/*! + \fn void QHelpEngineCore::warning(const QString &msg) + + This signal is emitted when a non critical error occurs. + The warning message is stored in \a msg. +*/ + +/*! + Constructs a new core help engine with a \a parent. The help engine + uses the information stored in the \a collectionFile to provide help. + If the collection file does not exist yet, it'll be created. +*/ +QHelpEngineCore::QHelpEngineCore(const QString &collectionFile, QObject *parent) + : QObject(parent) +{ + d = new QHelpEngineCorePrivate(); + d->init(collectionFile, this); +} + +/*! + \internal +*/ +QHelpEngineCore::QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate, + QObject *parent) + : QObject(parent) +{ + d = helpEngineCorePrivate; +} + +/*! + Destructs the help engine. +*/ +QHelpEngineCore::~QHelpEngineCore() +{ + delete d; +} + +/*! + \property QHelpEngineCore::collectionFile + \brief the absolute file name of the collection file currently used. + \since 4.5 + + Setting this property leaves the help engine in an invalid state. It is + important to invoke setupData() or any getter function in order to setup + the help engine again. +*/ +QString QHelpEngineCore::collectionFile() const +{ + return d->collectionHandler->collectionFile(); +} + +void QHelpEngineCore::setCollectionFile(const QString &fileName) +{ + if (fileName == collectionFile()) + return; + + if (d->collectionHandler) { + delete d->collectionHandler; + d->collectionHandler = 0; + d->clearMaps(); + } + d->init(fileName, this); + d->needsSetup = true; +} + +/*! + Sets up the help engine by processing the information found + in the collection file and returns true if successful; otherwise + returns false. + + By calling the function, the help + engine is forced to initialize itself immediately. Most of + the times, this function does not have to be called + explicitly because getter functions which depend on a correctly + set up help engine do that themselves. + + \note \c{qsqlite4.dll} needs to be deployed with the application as the + help system uses the sqlite driver when loading help collections. +*/ +bool QHelpEngineCore::setupData() +{ + d->needsSetup = true; + return d->setup(); +} + +/*! + Creates the file \a fileName and copies all contents from + the current collection file into the newly created file, + and returns true if successful; otherwise returns false. + + The copying process makes sure that file references to Qt + Collection files (\c{.qch}) files are updated accordingly. +*/ +bool QHelpEngineCore::copyCollectionFile(const QString &fileName) +{ + if (!d->setup()) + return false; + return d->collectionHandler->copyCollectionFile(fileName); +} + +/*! + Returns the namespace name defined for the Qt compressed help file (.qch) + specified by its \a documentationFileName. If the file is not valid, an + empty string is returned. + + \sa documentationFileName() +*/ +QString QHelpEngineCore::namespaceName(const QString &documentationFileName) +{ + QHelpDBReader reader(documentationFileName, + QHelpGlobal::uniquifyConnectionName(QLatin1String("GetNamespaceName"), + QThread::currentThread()), 0); + if (reader.init()) + return reader.namespaceName(); + return QString(); +} + +/*! + Registers the Qt compressed help file (.qch) contained in the file + \a documentationFileName. One compressed help file, uniquely + identified by its namespace can only be registered once. + True is returned if the registration was successful, otherwise + false. + + \sa unregisterDocumentation(), error() +*/ +bool QHelpEngineCore::registerDocumentation(const QString &documentationFileName) +{ + d->error.clear(); + d->needsSetup = true; + return d->collectionHandler->registerDocumentation(documentationFileName); +} + +/*! + Unregisters the Qt compressed help file (.qch) identified by its + \a namespaceName from the help collection. Returns true + on success, otherwise false. + + \sa registerDocumentation(), error() +*/ +bool QHelpEngineCore::unregisterDocumentation(const QString &namespaceName) +{ + d->error.clear(); + d->needsSetup = true; + return d->collectionHandler->unregisterDocumentation(namespaceName); +} + +/*! + Returns the absolute file name of the Qt compressed help file (.qch) + identified by the \a namespaceName. If there is no Qt compressed help file + with the specified namespace registered, an empty string is returned. + + \sa namespaceName() +*/ +QString QHelpEngineCore::documentationFileName(const QString &namespaceName) +{ + if (d->setup()) { + const QHelpCollectionHandler::DocInfoList docList = + d->collectionHandler->registeredDocumentations(); + foreach(const QHelpCollectionHandler::DocInfo &info, docList) { + if (info.namespaceName == namespaceName) { + if (QDir::isAbsolutePath(info.fileName)) + return QDir::cleanPath(info.fileName); + + QFileInfo fi(d->collectionHandler->collectionFile()); + fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName); + return QDir::cleanPath(fi.absoluteFilePath()); + } + } + } + return QString(); +} + +/*! + Returns a list of all registered Qt compressed help files of the current collection file. + The returned names are the namespaces of the registered Qt compressed help files (.qch). +*/ +QStringList QHelpEngineCore::registeredDocumentations() const +{ + QStringList list; + if (!d->setup()) + return list; + const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations(); + foreach(const QHelpCollectionHandler::DocInfo &info, docList) { + list.append(info.namespaceName); + } + return list; +} + +/*! + Returns a list of custom filters. + + \sa addCustomFilter(), removeCustomFilter() +*/ +QStringList QHelpEngineCore::customFilters() const +{ + if (!d->setup()) + return QStringList(); + return d->collectionHandler->customFilters(); +} + +/*! + Adds the new custom filter \a filterName. The filter attributes + are specified by \a attributes. If the filter already exists, + its attribute set is replaced. The function returns true if + the operation succeeded, otherwise it returns false. + + \sa customFilters(), removeCustomFilter() +*/ +bool QHelpEngineCore::addCustomFilter(const QString &filterName, + const QStringList &attributes) +{ + d->error.clear(); + d->needsSetup = true; + return d->collectionHandler->addCustomFilter(filterName, + attributes); +} + +/*! + Returns true if the filter \a filterName was removed successfully, + otherwise false. + + \sa addCustomFilter(), customFilters() +*/ +bool QHelpEngineCore::removeCustomFilter(const QString &filterName) +{ + d->error.clear(); + d->needsSetup = true; + return d->collectionHandler->removeCustomFilter(filterName); +} + +/*! + Returns a list of all defined filter attributes. +*/ +QStringList QHelpEngineCore::filterAttributes() const +{ + if (!d->setup()) + return QStringList(); + return d->collectionHandler->filterAttributes(); +} + +/*! + Returns a list of filter attributes used by the custom + filter \a filterName. +*/ +QStringList QHelpEngineCore::filterAttributes(const QString &filterName) const +{ + if (!d->setup()) + return QStringList(); + return d->collectionHandler->filterAttributes(filterName); +} + +/*! + \property QHelpEngineCore::currentFilter + \brief the name of the custom filter currently applied. + \since 4.5 + + Setting this property will save the new custom filter permanently in the + help collection file. To set a custom filter without saving it + permanently, disable the auto save filter mode. + + \sa autoSaveFilter() +*/ +QString QHelpEngineCore::currentFilter() const +{ + if (!d->setup()) + return QString(); + + if (d->currentFilter.isEmpty()) { + QString filter = + d->collectionHandler->customValue(QLatin1String("CurrentFilter"), + QString()).toString(); + if (!filter.isEmpty() + && d->collectionHandler->customFilters().contains(filter)) + d->currentFilter = filter; + } + return d->currentFilter; +} + +void QHelpEngineCore::setCurrentFilter(const QString &filterName) +{ + if (!d->setup() || filterName == d->currentFilter) + return; + d->currentFilter = filterName; + if (d->autoSaveFilter) { + d->collectionHandler->setCustomValue(QLatin1String("CurrentFilter"), + d->currentFilter); + } + emit currentFilterChanged(d->currentFilter); +} + +/*! + Returns a list of filter attributes for the different filter sections + defined in the Qt compressed help file with the given namespace + \a namespaceName. +*/ +QList QHelpEngineCore::filterAttributeSets(const QString &namespaceName) const +{ + if (d->setup()) { + QHelpDBReader *reader = d->readerMap.value(namespaceName); + if (reader) + return reader->filterAttributeSets(); + } + return QList(); +} + +/*! + Returns a list of files contained in the Qt compressed help file \a + namespaceName. The files can be filtered by \a filterAttributes as + well as by their extension \a extensionFilter (e.g. 'html'). +*/ +QList QHelpEngineCore::files(const QString namespaceName, + const QStringList &filterAttributes, + const QString &extensionFilter) +{ + QList res; + if (!d->setup()) + return res; + QHelpDBReader *reader = d->readerMap.value(namespaceName); + if (!reader) { + d->error = tr("The specified namespace does not exist!"); + return res; + } + + QUrl url; + url.setScheme(QLatin1String("qthelp")); + url.setAuthority(namespaceName); + + const QStringList files = reader->files(filterAttributes, extensionFilter); + foreach (const QString &file, files) { + url.setPath(QLatin1String("/") + file); + res.append(url); + } + return res; +} + +/*! + Returns an invalid URL if the file \a url cannot be found. + If the file exists, either the same url is returned or a + different url if the file is located in a different namespace + which is merged via a common virtual folder. +*/ +QUrl QHelpEngineCore::findFile(const QUrl &url) const +{ + QUrl res; + if (!d->setup() || !url.isValid() || url.toString().count(QLatin1Char('/')) < 4 + || url.scheme() != QLatin1String("qthelp")) + return res; + + QString ns = url.authority(); + QString filePath = QDir::cleanPath(url.path()); + if (filePath.startsWith(QLatin1Char('/'))) + filePath = filePath.mid(1); + QString virtualFolder = filePath.mid(0, filePath.indexOf(QLatin1Char('/'), 1)); + filePath = filePath.mid(virtualFolder.length()+1); + + QHelpDBReader *defaultReader = 0; + if (d->readerMap.contains(ns)) { + defaultReader = d->readerMap.value(ns); + if (defaultReader->fileExists(virtualFolder, filePath)) + return url; + } + + QStringList filterAtts = filterAttributes(currentFilter()); + foreach (QHelpDBReader *reader, d->virtualFolderMap.values(virtualFolder)) { + if (reader == defaultReader) + continue; + if (reader->fileExists(virtualFolder, filePath, filterAtts)) { + res = url; + res.setAuthority(reader->namespaceName()); + return res; + } + } + + foreach (QHelpDBReader *reader, d->virtualFolderMap.values(virtualFolder)) { + if (reader == defaultReader) + continue; + if (reader->fileExists(virtualFolder, filePath)) { + res = url; + res.setAuthority(reader->namespaceName()); + break; + } + } + + return res; +} + +/*! + Returns the data of the file specified by \a url. If the + file does not exist, an empty QByteArray is returned. + + \sa findFile() +*/ +QByteArray QHelpEngineCore::fileData(const QUrl &url) const +{ + if (!d->setup() || !url.isValid() || url.toString().count(QLatin1Char('/')) < 4 + || url.scheme() != QLatin1String("qthelp")) + return QByteArray(); + + QString ns = url.authority(); + QString filePath = QDir::cleanPath(url.path()); + if (filePath.startsWith(QLatin1Char('/'))) + filePath = filePath.mid(1); + QString virtualFolder = filePath.mid(0, filePath.indexOf(QLatin1Char('/'), 1)); + filePath = filePath.mid(virtualFolder.length()+1); + + QByteArray ba; + QHelpDBReader *defaultReader = 0; + if (d->readerMap.contains(ns)) { + defaultReader = d->readerMap.value(ns); + ba = defaultReader->fileData(virtualFolder, filePath); + } + + if (ba.isEmpty()) { + foreach (QHelpDBReader *reader, d->virtualFolderMap.values(virtualFolder)) { + if (reader == defaultReader) + continue; + ba = reader->fileData(virtualFolder, filePath); + if (!ba.isEmpty()) + return ba; + } + } + return ba; +} + +/*! + Returns a map of hits found for the \a id. A hit contains the + title of the document and the url where the keyword is located. + The result depends on the current filter, meaning only the keywords + registered for the current filter will be returned. +*/ +QMap QHelpEngineCore::linksForIdentifier(const QString &id) const +{ + QMap linkMap; + if (!d->setup()) + return linkMap; + + QStringList atts = filterAttributes(d->currentFilter); + foreach (QHelpDBReader *reader, d->readerMap) + reader->linksForIdentifier(id, atts, linkMap); + + return linkMap; +} + +/*! + Removes the \a key from the settings section in the + collection file. Returns true if the value was removed + successfully, otherwise false. + + \sa customValue(), setCustomValue() +*/ +bool QHelpEngineCore::removeCustomValue(const QString &key) +{ + d->error.clear(); + return d->collectionHandler->removeCustomValue(key); +} + +/*! + Returns the value assigned to the \a key. If the requested + key does not exist, the specified \a defaultValue is + returned. + + \sa setCustomValue(), removeCustomValue() +*/ +QVariant QHelpEngineCore::customValue(const QString &key, const QVariant &defaultValue) const +{ + if (!d->setup()) + return QVariant(); + return d->collectionHandler->customValue(key, defaultValue); +} + +/*! + Save the \a value under the \a key. If the key already exist, + the value will be overwritten. Returns true if the value was + saved successfully, otherwise false. + + \sa customValue(), removeCustomValue() +*/ +bool QHelpEngineCore::setCustomValue(const QString &key, const QVariant &value) +{ + d->error.clear(); + return d->collectionHandler->setCustomValue(key, value); +} + +/*! + Returns the meta data for the Qt compressed help file \a + documentationFileName. If there is no data available for + \a name, an invalid QVariant() is returned. The meta + data is defined when creating the Qt compressed help file and + cannot be modified later. Common meta data includes e.g. + the author of the documentation. +*/ +QVariant QHelpEngineCore::metaData(const QString &documentationFileName, + const QString &name) +{ + QHelpDBReader reader(documentationFileName, QLatin1String("GetMetaData"), 0); + + if (reader.init()) + return reader.metaData(name); + return QVariant(); +} + +/*! + Returns a description of the last error that occurred. +*/ +QString QHelpEngineCore::error() const +{ + return d->error; +} + +/*! + \property QHelpEngineCore::autoSaveFilter + \brief whether QHelpEngineCore is in auto save filter mode or not. + \since 4.5 + + If QHelpEngineCore is in auto save filter mode, the current filter is + automatically saved when it is changed by the setCurrentFilter() + function. The filter is saved persistently in the help collection file. + + By default, this mode is on. +*/ +void QHelpEngineCore::setAutoSaveFilter(bool save) +{ + d->autoSaveFilter = save; +} + +bool QHelpEngineCore::autoSaveFilter() const +{ + return d->autoSaveFilter; +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpenginecore.h b/src/assistant/help/qhelpenginecore.h new file mode 100644 index 000000000..fbfb8a0e8 --- /dev/null +++ b/src/assistant/help/qhelpenginecore.h @@ -0,0 +1,136 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPENGINECORE_H +#define QHELPENGINECORE_H + +#include + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QHelpEngineCorePrivate; + +class QHELP_EXPORT QHelpEngineCore : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool autoSaveFilter READ autoSaveFilter WRITE setAutoSaveFilter) + Q_PROPERTY(QString collectionFile READ collectionFile WRITE setCollectionFile) + Q_PROPERTY(QString currentFilter READ currentFilter WRITE setCurrentFilter) + +public: + explicit QHelpEngineCore(const QString &collectionFile, QObject *parent = 0); + virtual ~QHelpEngineCore(); + + bool setupData(); + + QString collectionFile() const; + void setCollectionFile(const QString &fileName); + + bool copyCollectionFile(const QString &fileName); + + static QString namespaceName(const QString &documentationFileName); + bool registerDocumentation(const QString &documentationFileName); + bool unregisterDocumentation(const QString &namespaceName); + QString documentationFileName(const QString &namespaceName); + + QStringList customFilters() const; + bool removeCustomFilter(const QString &filterName); + bool addCustomFilter(const QString &filterName, + const QStringList &attributes); + + QStringList filterAttributes() const; + QStringList filterAttributes(const QString &filterName) const; + + QString currentFilter() const; + void setCurrentFilter(const QString &filterName); + + QStringList registeredDocumentations() const; + QList filterAttributeSets(const QString &namespaceName) const; + QList files(const QString namespaceName, + const QStringList &filterAttributes, + const QString &extensionFilter = QString()); + QUrl findFile(const QUrl &url) const; + QByteArray fileData(const QUrl &url) const; + + QMap linksForIdentifier(const QString &id) const; + + bool removeCustomValue(const QString &key); + QVariant customValue(const QString &key, + const QVariant &defaultValue = QVariant()) const; + bool setCustomValue(const QString &key, const QVariant &value); + + static QVariant metaData(const QString &documentationFileName, + const QString &name); + + QString error() const; + + void setAutoSaveFilter(bool save); + bool autoSaveFilter() const; + +Q_SIGNALS: + void setupStarted(); + void setupFinished(); + void currentFilterChanged(const QString &newFilter); + void warning(const QString &msg); + +protected: + QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate, + QObject *parent); + +private: + QHelpEngineCorePrivate *d; + friend class QHelpEngineCorePrivate; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QHELPENGINECORE_H diff --git a/src/assistant/help/qhelpgenerator.cpp b/src/assistant/help/qhelpgenerator.cpp new file mode 100644 index 000000000..ce9c8562d --- /dev/null +++ b/src/assistant/help/qhelpgenerator.cpp @@ -0,0 +1,909 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpgenerator_p.h" +#include "qhelpdatainterface_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpGeneratorPrivate +{ +public: + QHelpGeneratorPrivate(); + ~QHelpGeneratorPrivate(); + + QString error; + QSqlQuery *query; + + int namespaceId; + int virtualFolderId; + + QMap fileMap; + QMap > fileFilterMap; + + double progress; + double oldProgress; + double contentStep; + double fileStep; + double indexStep; +}; + +QHelpGeneratorPrivate::QHelpGeneratorPrivate() +{ + query = 0; + namespaceId = -1; + virtualFolderId = -1; +} + +QHelpGeneratorPrivate::~QHelpGeneratorPrivate() +{ +} + + + +/*! + \internal + \class QHelpGenerator + \since 4.4 + \brief The QHelpGenerator class generates a new + Qt compressed help file (.qch). + + The help generator takes a help data structure as + input for generating a new Qt compressed help files. Since + the generation may takes some time, the generator emits + various signals to inform about its current state. +*/ + +/*! + \fn void QHelpGenerator::statusChanged(const QString &msg) + + This signal is emitted when the generation status changes. + The status is basically a specific task like inserting + files or building up the keyword index. The parameter + \a msg contains the detailed status description. +*/ + +/*! + \fn void QHelpGenerator::progressChanged(double progress) + + This signal is emitted when the progress changes. The + \a progress ranges from 0 to 100. +*/ + +/*! + \fn void QHelpGenerator::warning(const QString &msg) + + This signal is emitted when a non critical error occurs, + e.g. when a referenced file cannot be found. \a msg + contains the exact warning message. +*/ + +/*! + Constructs a new help generator with the give \a parent. +*/ +QHelpGenerator::QHelpGenerator(QObject *parent) + : QObject(parent) +{ + d = new QHelpGeneratorPrivate; +} + +/*! + Destructs the help generator. +*/ +QHelpGenerator::~QHelpGenerator() +{ + delete d; +} + +/*! + Takes the \a helpData and generates a new documentation + set from it. The Qt compressed help file is written to \a + outputFileName. Returns true on success, otherwise false. +*/ +bool QHelpGenerator::generate(QHelpDataInterface *helpData, + const QString &outputFileName) +{ + emit progressChanged(0); + d->error.clear(); + if (!helpData || helpData->namespaceName().isEmpty()) { + d->error = tr("Invalid help data!"); + return false; + } + + QString outFileName = outputFileName; + if (outFileName.isEmpty()) { + d->error = tr("No output file name specified!"); + return false; + } + + QFileInfo fi(outFileName); + if (fi.exists()) { + if (!fi.dir().remove(fi.fileName())) { + d->error = tr("The file %1 cannot be overwritten!").arg(outFileName); + return false; + } + } + + setupProgress(helpData); + + emit statusChanged(tr("Building up file structure...")); + bool openingOk = true; + { + QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), QLatin1String("builder")); + db.setDatabaseName(outFileName); + openingOk = db.open(); + if (openingOk) + d->query = new QSqlQuery(db); + } + + if (!openingOk) { + d->error = tr("Cannot open data base file %1!").arg(outFileName); + cleanupDB(); + return false; + } + + d->query->exec(QLatin1String("PRAGMA synchronous=OFF")); + d->query->exec(QLatin1String("PRAGMA cache_size=3000")); + + addProgress(1.0); + createTables(); + insertFileNotFoundFile(); + insertMetaData(helpData->metaData()); + + if (!registerVirtualFolder(helpData->virtualFolder(), helpData->namespaceName())) { + d->error = tr("Cannot register namespace %1!").arg(helpData->namespaceName()); + cleanupDB(); + return false; + } + addProgress(1.0); + + emit statusChanged(tr("Insert custom filters...")); + foreach (const QHelpDataCustomFilter &f, helpData->customFilters()) { + if (!registerCustomFilter(f.name, f.filterAttributes, true)) { + cleanupDB(); + return false; + } + } + addProgress(1.0); + + int i = 1; + QList::const_iterator it = helpData->filterSections().constBegin(); + while (it != helpData->filterSections().constEnd()) { + emit statusChanged(tr("Insert help data for filter section (%1 of %2)...") + .arg(i++).arg(helpData->filterSections().count())); + insertFilterAttributes((*it).filterAttributes()); + QByteArray ba; + QDataStream s(&ba, QIODevice::WriteOnly); + foreach (QHelpDataContentItem *itm, (*it).contents()) + writeTree(s, itm, 0); + if (!insertFiles((*it).files(), helpData->rootPath(), (*it).filterAttributes()) + || !insertContents(ba, (*it).filterAttributes()) + || !insertKeywords((*it).indices(), (*it).filterAttributes())) { + cleanupDB(); + return false; + } + ++it; + } + + cleanupDB(); + emit progressChanged(100); + emit statusChanged(tr("Documentation successfully generated.")); + return true; +} + +void QHelpGenerator::setupProgress(QHelpDataInterface *helpData) +{ + d->progress = 0; + d->oldProgress = 0; + + int numberOfFiles = 0; + int numberOfIndices = 0; + QList::const_iterator it = helpData->filterSections().constBegin(); + while (it != helpData->filterSections().constEnd()) { + numberOfFiles += (*it).files().count(); + numberOfIndices += (*it).indices().count(); + ++it; + } + // init 2% + // filters 1% + // contents 10% + // files 60% + // indices 27% + d->contentStep = 10.0/(double)helpData->customFilters().count(); + d->fileStep = 60.0/(double)numberOfFiles; + d->indexStep = 27.0/(double)numberOfIndices; +} + +void QHelpGenerator::addProgress(double step) +{ + d->progress += step; + if ((d->progress-d->oldProgress) >= 1.0 && d->progress <= 100.0) { + d->oldProgress = d->progress; + emit progressChanged(ceil(d->progress)); + } +} + +void QHelpGenerator::cleanupDB() +{ + if (d->query) { + d->query->clear(); + delete d->query; + d->query = 0; + } + QSqlDatabase::removeDatabase(QLatin1String("builder")); +} + +void QHelpGenerator::writeTree(QDataStream &s, QHelpDataContentItem *item, int depth) +{ + QString fReference = QDir::cleanPath(item->reference()); + if (fReference.startsWith(QLatin1String("./"))) + fReference = fReference.mid(2); + + s << depth; + s << fReference; + s << item->title(); + foreach (QHelpDataContentItem *i, item->children()) + writeTree(s, i, depth+1); +} + +/*! + Returns the last error message. +*/ +QString QHelpGenerator::error() const +{ + return d->error; +} + +bool QHelpGenerator::createTables() +{ + if (!d->query) + return false; + + d->query->exec(QLatin1String("SELECT COUNT(*) FROM sqlite_master WHERE TYPE=\'table\'" + "AND Name=\'NamespaceTable\'")); + d->query->next(); + if (d->query->value(0).toInt() > 0) { + d->error = tr("Some tables already exist!"); + return false; + } + + QStringList tables; + tables << QLatin1String("CREATE TABLE NamespaceTable (" + "Id INTEGER PRIMARY KEY," + "Name TEXT )") + << QLatin1String("CREATE TABLE FilterAttributeTable (" + "Id INTEGER PRIMARY KEY, " + "Name TEXT )") + << QLatin1String("CREATE TABLE FilterNameTable (" + "Id INTEGER PRIMARY KEY, " + "Name TEXT )") + << QLatin1String("CREATE TABLE FilterTable (" + "NameId INTEGER, " + "FilterAttributeId INTEGER )") + << QLatin1String("CREATE TABLE IndexTable (" + "Id INTEGER PRIMARY KEY, " + "Name TEXT, " + "Identifier TEXT, " + "NamespaceId INTEGER, " + "FileId INTEGER, " + "Anchor TEXT )") + << QLatin1String("CREATE TABLE IndexItemTable (" + "Id INTEGER, " + "IndexId INTEGER )") + << QLatin1String("CREATE TABLE IndexFilterTable (" + "FilterAttributeId INTEGER, " + "IndexId INTEGER )") + << QLatin1String("CREATE TABLE ContentsTable (" + "Id INTEGER PRIMARY KEY, " + "NamespaceId INTEGER, " + "Data BLOB )") + << QLatin1String("CREATE TABLE ContentsFilterTable (" + "FilterAttributeId INTEGER, " + "ContentsId INTEGER )") + << QLatin1String("CREATE TABLE FileAttributeSetTable (" + "Id INTEGER, " + "FilterAttributeId INTEGER )") + << QLatin1String("CREATE TABLE FileDataTable (" + "Id INTEGER PRIMARY KEY, " + "Data BLOB )") + << QLatin1String("CREATE TABLE FileFilterTable (" + "FilterAttributeId INTEGER, " + "FileId INTEGER )") + << QLatin1String("CREATE TABLE FileNameTable (" + "FolderId INTEGER, " + "Name TEXT, " + "FileId INTEGER, " + "Title TEXT )") + << QLatin1String("CREATE TABLE FolderTable(" + "Id INTEGER PRIMARY KEY, " + "Name Text, " + "NamespaceID INTEGER )") + << QLatin1String("CREATE TABLE MetaDataTable(" + "Name Text, " + "Value BLOB )"); + + foreach (const QString &q, tables) { + if (!d->query->exec(q)) { + d->error = tr("Cannot create tables!"); + return false; + } + } + + d->query->exec(QLatin1String("INSERT INTO MetaDataTable VALUES('qchVersion', '1.0')")); + + d->query->prepare(QLatin1String("INSERT INTO MetaDataTable VALUES('CreationDate', ?)")); + d->query->bindValue(0, QDateTime::currentDateTime().toString(Qt::ISODate)); + d->query->exec(); + + return true; +} + +bool QHelpGenerator::insertFileNotFoundFile() +{ + if (!d->query) + return false; + + d->query->exec(QLatin1String("SELECT id FROM FileNameTable WHERE Name=\'\'")); + if (d->query->next() && d->query->isValid()) + return true; + + d->query->prepare(QLatin1String("INSERT INTO FileDataTable VALUES (Null, ?)")); + d->query->bindValue(0, QByteArray()); + if (!d->query->exec()) + return false; + + int fileId = d->query->lastInsertId().toInt(); + d->query->prepare(QLatin1String("INSERT INTO FileNameTable (FolderId, Name, FileId, Title) " + " VALUES (0, '', ?, '')")); + d->query->bindValue(0, fileId); + if (fileId > -1 && d->query->exec()) { + d->fileMap.insert(QString(), fileId); + return true; + } + return false; +} + +bool QHelpGenerator::registerVirtualFolder(const QString &folderName, const QString &ns) +{ + if (!d->query || folderName.isEmpty() || ns.isEmpty()) + return false; + + d->query->prepare(QLatin1String("SELECT Id FROM FolderTable WHERE Name=?")); + d->query->bindValue(0, folderName); + d->query->exec(); + d->query->next(); + if (d->query->isValid() && d->query->value(0).toInt() > 0) + return true; + + d->namespaceId = -1; + d->query->prepare(QLatin1String("SELECT Id FROM NamespaceTable WHERE Name=?")); + d->query->bindValue(0, ns); + d->query->exec(); + while (d->query->next()) { + d->namespaceId = d->query->value(0).toInt(); + break; + } + + if (d->namespaceId < 0) { + d->query->prepare(QLatin1String("INSERT INTO NamespaceTable VALUES(NULL, ?)")); + d->query->bindValue(0, ns); + if (d->query->exec()) + d->namespaceId = d->query->lastInsertId().toInt(); + } + + if (d->namespaceId > 0) { + d->query->prepare(QLatin1String("SELECT Id FROM FolderTable WHERE Name=?")); + d->query->bindValue(0, folderName); + d->query->exec(); + while (d->query->next()) + d->virtualFolderId = d->query->value(0).toInt(); + + if (d->virtualFolderId > 0) + return true; + + d->query->prepare(QLatin1String("INSERT INTO FolderTable (NamespaceId, Name) " + "VALUES (?, ?)")); + d->query->bindValue(0, d->namespaceId); + d->query->bindValue(1, folderName); + if (d->query->exec()) { + d->virtualFolderId = d->query->lastInsertId().toInt(); + return d->virtualFolderId > 0; + } + } + d->error = tr("Cannot register virtual folder!"); + return false; +} + +bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPath, + const QStringList &filterAttributes) +{ + if (!d->query) + return false; + + emit statusChanged(tr("Insert files...")); + QList filterAtts; + foreach (const QString &filterAtt, filterAttributes) { + d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable " + "WHERE Name=?")); + d->query->bindValue(0, filterAtt); + d->query->exec(); + if (d->query->next()) + filterAtts.append(d->query->value(0).toInt()); + } + + int filterSetId = -1; + d->query->exec(QLatin1String("SELECT MAX(Id) FROM FileAttributeSetTable")); + if (d->query->next()) + filterSetId = d->query->value(0).toInt(); + if (filterSetId < 0) + return false; + ++filterSetId; + foreach (const int &attId, filterAtts) { + d->query->prepare(QLatin1String("INSERT INTO FileAttributeSetTable " + "VALUES(?, ?)")); + d->query->bindValue(0, filterSetId); + d->query->bindValue(1, attId); + d->query->exec(); + } + + int tableFileId = 1; + d->query->exec(QLatin1String("SELECT MAX(Id) FROM FileDataTable")); + if (d->query->next()) + tableFileId = d->query->value(0).toInt() + 1; + + QString title; + QString charSet; + FileNameTableData fileNameData; + QList fileDataList; + QMap > tmpFileFilterMap; + QList fileNameDataList; + + int i = 0; + foreach (const QString &file, files) { + const QString fileName = QDir::cleanPath(file); + if (fileName.startsWith(QLatin1String("../"))) { + emit warning(tr("The referenced file %1 must be inside or within a " + "subdirectory of (%2). Skipping it.").arg(fileName).arg(rootPath)); + continue; + } + + QFile fi(rootPath + QDir::separator() + fileName); + if (!fi.exists()) { + emit warning(tr("The file %1 does not exist! Skipping it.") + .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName))); + continue; + } + + if (!fi.open(QIODevice::ReadOnly)) { + emit warning(tr("Cannot open file %1! Skipping it.") + .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName))); + continue; + } + + QByteArray data = fi.readAll(); + if (fileName.endsWith(QLatin1String(".html")) + || fileName.endsWith(QLatin1String(".htm"))) { + charSet = QHelpGlobal::codecFromData(data); + QTextStream stream(&data); + stream.setCodec(QTextCodec::codecForName(charSet.toLatin1().constData())); + title = QHelpGlobal::documentTitle(stream.readAll()); + } else { + title = fileName.mid(fileName.lastIndexOf(QLatin1Char('/')) + 1); + } + + int fileId = -1; + QMap::Iterator fileMapIt = d->fileMap.find(fileName); + if (fileMapIt == d->fileMap.end()) { + fileDataList.append(qCompress(data)); + + fileNameData.name = fileName; + fileNameData.fileId = tableFileId; + fileNameData.title = title; + fileNameDataList.append(fileNameData); + + d->fileMap.insert(fileName, tableFileId); + d->fileFilterMap.insert(tableFileId, filterAtts.toSet()); + tmpFileFilterMap.insert(tableFileId, filterAtts.toSet()); + + ++tableFileId; + } else { + fileId = fileMapIt.value(); + QSet &fileFilterSet = d->fileFilterMap[fileId]; + QSet &tmpFileFilterSet = tmpFileFilterMap[fileId]; + foreach (const int &filter, filterAtts) { + if (!fileFilterSet.contains(filter) + && !tmpFileFilterSet.contains(filter)) { + fileFilterSet.insert(filter); + tmpFileFilterSet.insert(filter); + } + } + } + } + + if (!tmpFileFilterMap.isEmpty()) { + d->query->exec(QLatin1String("BEGIN")); + QMap >::const_iterator it = tmpFileFilterMap.constBegin(); + while (it != tmpFileFilterMap.constEnd()) { + QSet::const_iterator si = it.value().constBegin(); + while (si != it.value().constEnd()) { + d->query->prepare(QLatin1String("INSERT INTO FileFilterTable " + "VALUES(?, ?)")); + d->query->bindValue(0, *si); + d->query->bindValue(1, it.key()); + d->query->exec(); + ++si; + } + ++it; + } + + QList::const_iterator fileIt = fileDataList.constBegin(); + while (fileIt != fileDataList.constEnd()) { + d->query->prepare(QLatin1String("INSERT INTO FileDataTable VALUES " + "(Null, ?)")); + d->query->bindValue(0, *fileIt); + d->query->exec(); + ++fileIt; + if (++i%20 == 0) + addProgress(d->fileStep*20.0); + } + + QList::const_iterator fileNameIt = + fileNameDataList.constBegin(); + while (fileNameIt != fileNameDataList.constEnd()) { + d->query->prepare(QLatin1String("INSERT INTO FileNameTable " + "(FolderId, Name, FileId, Title) VALUES (?, ?, ?, ?)")); + d->query->bindValue(0, 1); + d->query->bindValue(1, (*fileNameIt).name); + d->query->bindValue(2, (*fileNameIt).fileId); + d->query->bindValue(3, (*fileNameIt).title); + d->query->exec(); + ++fileNameIt; + } + d->query->exec(QLatin1String("COMMIT")); + } + + d->query->exec(QLatin1String("SELECT MAX(Id) FROM FileDataTable")); + if (d->query->next() + && d->query->value(0).toInt() == tableFileId-1) { + addProgress(d->fileStep*(i%20)); + return true; + } + return false; +} + +bool QHelpGenerator::registerCustomFilter(const QString &filterName, + const QStringList &filterAttribs, bool forceUpdate) +{ + if (!d->query) + return false; + + d->query->exec(QLatin1String("SELECT Id, Name FROM FilterAttributeTable")); + QStringList idsToInsert = filterAttribs; + QMap attributeMap; + while (d->query->next()) { + attributeMap.insert(d->query->value(1).toString(), + d->query->value(0).toInt()); + idsToInsert.removeAll(d->query->value(1).toString()); + } + + foreach (const QString &id, idsToInsert) { + d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); + d->query->bindValue(0, id); + d->query->exec(); + attributeMap.insert(id, d->query->lastInsertId().toInt()); + } + + int nameId = -1; + d->query->prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); + d->query->bindValue(0, filterName); + d->query->exec(); + while (d->query->next()) { + nameId = d->query->value(0).toInt(); + break; + } + + if (nameId < 0) { + d->query->prepare(QLatin1String("INSERT INTO FilterNameTable VALUES(NULL, ?)")); + d->query->bindValue(0, filterName); + if (d->query->exec()) + nameId = d->query->lastInsertId().toInt(); + } else if (!forceUpdate) { + d->error = tr("The filter %1 is already registered!").arg(filterName); + return false; + } + + if (nameId < 0) { + d->error = tr("Cannot register filter %1!").arg(filterName); + return false; + } + + d->query->prepare(QLatin1String("DELETE FROM FilterTable WHERE NameId=?")); + d->query->bindValue(0, nameId); + d->query->exec(); + + foreach (const QString &att, filterAttribs) { + d->query->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); + d->query->bindValue(0, nameId); + d->query->bindValue(1, attributeMap[att]); + if (!d->query->exec()) + return false; + } + return true; +} + +bool QHelpGenerator::insertKeywords(const QList &keywords, + const QStringList &filterAttributes) +{ + if (!d->query) + return false; + + emit statusChanged(tr("Insert indices...")); + int indexId = 1; + d->query->exec(QLatin1String("SELECT MAX(Id) FROM IndexTable")); + if (d->query->next()) + indexId = d->query->value(0).toInt() + 1; + + QList filterAtts; + foreach (const QString &filterAtt, filterAttributes) { + d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?")); + d->query->bindValue(0, filterAtt); + d->query->exec(); + if (d->query->next()) + filterAtts.append(d->query->value(0).toInt()); + } + + int pos = -1; + QString fileName; + QString anchor; + QString fName; + int fileId = 1; + QList indexFilterTable; + + int i = 0; + d->query->exec(QLatin1String("BEGIN")); + QSet indices; + foreach (const QHelpDataIndexItem &itm, keywords) { + // Identical ids make no sense and just confuse the Assistant user, + // so we ignore all repetitions. + if (indices.contains(itm.identifier)) + continue; + + // Still empty ids should be ignored, as otherwise we will include only + // the first keyword with an empty id. + if (!itm.identifier.isEmpty()) + indices.insert(itm.identifier); + + pos = itm.reference.indexOf(QLatin1Char('#')); + fileName = itm.reference.left(pos); + if (pos > -1) + anchor = itm.reference.mid(pos+1); + else + anchor.clear(); + + fName = QDir::cleanPath(fileName); + if (fName.startsWith(QLatin1String("./"))) + fName = fName.mid(2); + + QMap::ConstIterator it = d->fileMap.find(fName); + if (it != d->fileMap.end()) + fileId = it.value(); + else + fileId = 1; + + d->query->prepare(QLatin1String("INSERT INTO IndexTable (Name, Identifier, NamespaceId, FileId, Anchor) " + "VALUES(?, ?, ?, ?, ?)")); + d->query->bindValue(0, itm.name); + d->query->bindValue(1, itm.identifier); + d->query->bindValue(2, d->namespaceId); + d->query->bindValue(3, fileId); + d->query->bindValue(4, anchor); + d->query->exec(); + + indexFilterTable.append(indexId++); + if (++i%100 == 0) + addProgress(d->indexStep*100.0); + } + d->query->exec(QLatin1String("COMMIT")); + + d->query->exec(QLatin1String("BEGIN")); + foreach (int idx, indexFilterTable) { + foreach (int a, filterAtts) { + d->query->prepare(QLatin1String("INSERT INTO IndexFilterTable (FilterAttributeId, IndexId) " + "VALUES(?, ?)")); + d->query->bindValue(0, a); + d->query->bindValue(1, idx); + d->query->exec(); + } + } + d->query->exec(QLatin1String("COMMIT")); + + d->query->exec(QLatin1String("SELECT COUNT(Id) FROM IndexTable")); + if (d->query->next() && d->query->value(0).toInt() >= indices.count()) + return true; + return false; +} + +bool QHelpGenerator::insertContents(const QByteArray &ba, + const QStringList &filterAttributes) +{ + if (!d->query) + return false; + + emit statusChanged(tr("Insert contents...")); + d->query->prepare(QLatin1String("INSERT INTO ContentsTable (NamespaceId, Data) " + "VALUES(?, ?)")); + d->query->bindValue(0, d->namespaceId); + d->query->bindValue(1, ba); + d->query->exec(); + int contentId = d->query->lastInsertId().toInt(); + if (contentId < 1) { + d->error = tr("Cannot insert contents!"); + return false; + } + + // associate the filter attributes + foreach (const QString &filterAtt, filterAttributes) { + d->query->prepare(QLatin1String("INSERT INTO ContentsFilterTable (FilterAttributeId, ContentsId) " + "SELECT Id, ? FROM FilterAttributeTable WHERE Name=?")); + d->query->bindValue(0, contentId); + d->query->bindValue(1, filterAtt); + d->query->exec(); + if (!d->query->isActive()) { + d->error = tr("Cannot register contents!"); + return false; + } + } + addProgress(d->contentStep); + return true; +} + +bool QHelpGenerator::insertFilterAttributes(const QStringList &attributes) +{ + if (!d->query) + return false; + + d->query->exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); + QSet atts; + while (d->query->next()) + atts.insert(d->query->value(0).toString()); + + foreach (const QString &s, attributes) { + if (!atts.contains(s)) { + d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); + d->query->bindValue(0, s); + d->query->exec(); + } + } + return true; +} + +bool QHelpGenerator::insertMetaData(const QMap &metaData) +{ + if (!d->query) + return false; + + QMap::const_iterator it = metaData.constBegin(); + while (it != metaData.constEnd()) { + d->query->prepare(QLatin1String("INSERT INTO MetaDataTable VALUES(?, ?)")); + d->query->bindValue(0, it.key()); + d->query->bindValue(1, it.value()); + d->query->exec(); + ++it; + } + return true; +} + +bool QHelpGenerator::checkLinks(const QHelpDataInterface &helpData) +{ + /* + * Step 1: Gather the canoncal file paths of all files in the project. + * We use a set, because there will be a lot of look-ups. + */ + QSet files; + foreach (const QHelpDataFilterSection &filterSection, helpData.filterSections()) { + foreach (const QString &file, filterSection.files()) { + QFileInfo fileInfo(helpData.rootPath() + QDir::separator() + file); + const QString &canonicalFileName = fileInfo.canonicalFilePath(); + if (!fileInfo.exists()) + emit warning(tr("File '%1' does not exist.").arg(file)); + else + files.insert(canonicalFileName); + } + } + + /* + * Step 2: Check the hypertext and image references of all HTML files. + * Note that we don't parse the files, but simply grep for the + * respective HTML elements. Therefore. contents that are e.g. + * commented out can cause false warning. + */ + bool allLinksOk = true; + foreach (const QString &fileName, files) { + if (!fileName.endsWith(QLatin1String("html")) + && !fileName.endsWith(QLatin1String("htm"))) + continue; + QFile htmlFile(fileName); + if (!htmlFile.open(QIODevice::ReadOnly)) { + emit warning(tr("File '%1' cannot be opened.").arg(fileName)); + continue; + } + const QRegExp linkPattern(QLatin1String("<(?:a href|img src)=\"?([^#\">]+)[#\">]")); + QTextStream stream(&htmlFile); + const QString codec = QHelpGlobal::codecFromData(htmlFile.read(1000)); + stream.setCodec(QTextCodec::codecForName(codec.toLatin1().constData())); + const QString &content = stream.readAll(); + QStringList invalidLinks; + for (int pos = linkPattern.indexIn(content); pos != -1; + pos = linkPattern.indexIn(content, pos + 1)) { + const QString& linkedFileName = linkPattern.cap(1); + if (linkedFileName.contains(QLatin1String("://"))) + continue; + const QString curDir = QFileInfo(fileName).dir().path(); + const QString &canonicalLinkedFileName = + QFileInfo(curDir + QDir::separator() + linkedFileName).canonicalFilePath(); + if (!files.contains(canonicalLinkedFileName) + && !invalidLinks.contains(canonicalLinkedFileName)) { + emit warning(tr("File '%1' contains an invalid link to file '%2'"). + arg(fileName).arg(linkedFileName)); + allLinksOk = false; + invalidLinks.append(canonicalLinkedFileName); + } + } + } + + if (!allLinksOk) + d->error = tr("Invalid links in HTML files."); + return allLinksOk; +} + +QT_END_NAMESPACE + diff --git a/src/assistant/help/qhelpgenerator_p.h b/src/assistant/help/qhelpgenerator_p.h new file mode 100644 index 000000000..ad32c05de --- /dev/null +++ b/src/assistant/help/qhelpgenerator_p.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPGENERATOR_H +#define QHELPGENERATOR_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelp_global.h" +#include "qhelpdatainterface_p.h" + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QHelpGeneratorPrivate; + +class QHELP_EXPORT QHelpGenerator : public QObject +{ + Q_OBJECT + +public: + QHelpGenerator(QObject *parent = 0); + ~QHelpGenerator(); + + bool generate(QHelpDataInterface *helpData, + const QString &outputFileName); + bool checkLinks(const QHelpDataInterface &helpData); + QString error() const; + +Q_SIGNALS: + void statusChanged(const QString &msg); + void progressChanged(double progress); + void warning(const QString &msg); + +private: + struct FileNameTableData + { + QString name; + int fileId; + QString title; + }; + + void writeTree(QDataStream &s, QHelpDataContentItem *item, int depth); + bool createTables(); + bool insertFileNotFoundFile(); + bool registerCustomFilter(const QString &filterName, + const QStringList &filterAttribs, bool forceUpdate = false); + bool registerVirtualFolder(const QString &folderName, const QString &ns); + bool insertFilterAttributes(const QStringList &attributes); + bool insertKeywords(const QList &keywords, + const QStringList &filterAttributes); + bool insertFiles(const QStringList &files, const QString &rootPath, + const QStringList &filterAttributes); + bool insertContents(const QByteArray &ba, + const QStringList &filterAttributes); + bool insertMetaData(const QMap &metaData); + void cleanupDB(); + void setupProgress(QHelpDataInterface *helpData); + void addProgress(double step); + + QHelpGeneratorPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/assistant/help/qhelpindexwidget.cpp b/src/assistant/help/qhelpindexwidget.cpp new file mode 100644 index 000000000..1b34ca0aa --- /dev/null +++ b/src/assistant/help/qhelpindexwidget.cpp @@ -0,0 +1,444 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpindexwidget.h" +#include "qhelpenginecore.h" +#include "qhelpengine_p.h" +#include "qhelpdbreader_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpIndexProvider : public QThread +{ +public: + QHelpIndexProvider(QHelpEnginePrivate *helpEngine); + ~QHelpIndexProvider(); + void collectIndices(const QString &customFilterName); + void stopCollecting(); + QStringList indices() const; + QList activeReaders() const; + QSet indexIds(QHelpDBReader *reader) const; + +private: + void run(); + + QHelpEnginePrivate *m_helpEngine; + QStringList m_indices; + QList m_activeReaders; + QMap > m_indexIds; + QStringList m_filterAttributes; + mutable QMutex m_mutex; + bool m_abort; +}; + +class QHelpIndexModelPrivate +{ +public: + QHelpIndexModelPrivate(QHelpEnginePrivate *hE) + { + helpEngine = hE; + indexProvider = new QHelpIndexProvider(helpEngine); + insertedRows = 0; + } + + QHelpEnginePrivate *helpEngine; + QHelpIndexProvider *indexProvider; + QStringList indices; + int insertedRows; + QString currentFilter; + QList activeReaders; +}; + +static bool caseInsensitiveLessThan(const QString &as, const QString &bs) +{ + return QString::compare(as, bs, Qt::CaseInsensitive) < 0; +} + +QHelpIndexProvider::QHelpIndexProvider(QHelpEnginePrivate *helpEngine) + : QThread(helpEngine) +{ + m_helpEngine = helpEngine; + m_abort = false; +} + +QHelpIndexProvider::~QHelpIndexProvider() +{ + stopCollecting(); +} + +void QHelpIndexProvider::collectIndices(const QString &customFilterName) +{ + m_mutex.lock(); + m_filterAttributes = m_helpEngine->q->filterAttributes(customFilterName); + m_mutex.unlock(); + if (!isRunning()) { + start(LowPriority); + } else { + stopCollecting(); + start(LowPriority); + } +} + +void QHelpIndexProvider::stopCollecting() +{ + if (!isRunning()) + return; + m_mutex.lock(); + m_abort = true; + m_mutex.unlock(); + wait(); + m_abort = false; +} + +QStringList QHelpIndexProvider::indices() const +{ + QMutexLocker lck(&m_mutex); + return m_indices; +} + +QList QHelpIndexProvider::activeReaders() const +{ + QMutexLocker lck(&m_mutex); + return m_activeReaders; +} + +QSet QHelpIndexProvider::indexIds(QHelpDBReader *reader) const +{ + QMutexLocker lck(&m_mutex); + if (m_indexIds.contains(reader)) + return m_indexIds.value(reader); + return QSet(); +} + +void QHelpIndexProvider::run() +{ + m_mutex.lock(); + QStringList atts = m_filterAttributes; + m_indices.clear(); + m_activeReaders.clear(); + QSet indicesSet; + m_mutex.unlock(); + + foreach (const QString &dbFileName, m_helpEngine->fileNameReaderMap.keys()) { + m_mutex.lock(); + if (m_abort) { + m_mutex.unlock(); + return; + } + m_mutex.unlock(); + QHelpDBReader reader(dbFileName, + QHelpGlobal::uniquifyConnectionName(dbFileName + + QLatin1String("FromIndexProvider"), + QThread::currentThread()), 0); + if (!reader.init()) + continue; + QStringList lst = reader.indicesForFilter(atts); + if (!lst.isEmpty()) { + m_mutex.lock(); + foreach (const QString &s, lst) + indicesSet.insert(s); + if (m_abort) { + m_mutex.unlock(); + return; + } + QHelpDBReader *orgReader = m_helpEngine->fileNameReaderMap.value(dbFileName); + m_indexIds.insert(orgReader, reader.indexIds(atts)); + m_activeReaders.append(orgReader); + m_mutex.unlock(); + } + } + m_mutex.lock(); + m_indices = indicesSet.values(); + qSort(m_indices.begin(), m_indices.end(), caseInsensitiveLessThan); + m_mutex.unlock(); +} + + + +/*! + \class QHelpIndexModel + \since 4.4 + \inmodule QtHelp + \brief The QHelpIndexModel class provides a model that + supplies index keywords to views. + + +*/ + +/*! + \fn void QHelpIndexModel::indexCreationStarted() + + This signal is emitted when the creation of a new index + has started. The current index is invalid from this + point on until the signal indexCreated() is emitted. + + \sa isCreatingIndex() +*/ + +/*! + \fn void QHelpIndexModel::indexCreated() + + This signal is emitted when the index has been created. +*/ + +QHelpIndexModel::QHelpIndexModel(QHelpEnginePrivate *helpEngine) + : QStringListModel(helpEngine) +{ + d = new QHelpIndexModelPrivate(helpEngine); + + connect(d->indexProvider, SIGNAL(finished()), this, SLOT(insertIndices())); + connect(helpEngine->q, SIGNAL(setupStarted()), this, SLOT(invalidateIndex())); +} + +QHelpIndexModel::~QHelpIndexModel() +{ + delete d; +} + +void QHelpIndexModel::invalidateIndex(bool onShutDown) +{ + if (onShutDown) + disconnect(this, SLOT(insertIndices())); + d->indexProvider->stopCollecting(); + d->indices.clear(); + if (!onShutDown) + filter(QString()); +} + +/*! + Creates a new index by querying the help system for + keywords for the specified \a customFilterName. +*/ +void QHelpIndexModel::createIndex(const QString &customFilterName) +{ + d->currentFilter = customFilterName; + d->indexProvider->collectIndices(customFilterName); + emit indexCreationStarted(); +} + +void QHelpIndexModel::insertIndices() +{ + d->indices = d->indexProvider->indices(); + d->activeReaders = d->indexProvider->activeReaders(); + QStringList attributes = d->helpEngine->q->filterAttributes(d->currentFilter); + if (attributes.count() > 1) { + foreach (QHelpDBReader *r, d->activeReaders) + r->createAttributesCache(attributes, d->indexProvider->indexIds(r)); + } + filter(QString()); + emit indexCreated(); +} + +/*! + Returns true if the index is currently built up, otherwise + false. +*/ +bool QHelpIndexModel::isCreatingIndex() const +{ + return d->indexProvider->isRunning(); +} + +/*! + Returns all hits found for the \a keyword. A hit consists of + the URL and the document title. +*/ +QMap QHelpIndexModel::linksForKeyword(const QString &keyword) const +{ + QMap linkMap; + QStringList filterAttributes = d->helpEngine->q->filterAttributes(d->currentFilter); + foreach (QHelpDBReader *reader, d->activeReaders) + reader->linksForKeyword(keyword, filterAttributes, linkMap); + return linkMap; +} + +/*! + Filters the indices and returns the model index of the best + matching keyword. In a first step, only the keywords containing + \a filter are kept in the model's index list. Analogously, if + \a wildcard is not empty, only the keywords matched are left + in the index list. In a second step, the best match is + determined and its index model returned. When specifying a + wildcard expression, the \a filter string is used to + search for the best match. +*/ +QModelIndex QHelpIndexModel::filter(const QString &filter, const QString &wildcard) +{ + if (filter.isEmpty()) { + setStringList(d->indices); + return index(-1, 0, QModelIndex()); + } + + QStringList lst; + int goodMatch = -1; + int perfectMatch = -1; + + if (!wildcard.isEmpty()) { + QRegExp regExp(wildcard, Qt::CaseInsensitive); + regExp.setPatternSyntax(QRegExp::Wildcard); + foreach (const QString &index, d->indices) { + if (index.contains(regExp)) { + lst.append(index); + if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { + if (goodMatch == -1) + goodMatch = lst.count()-1; + if (filter.length() == index.length()){ + perfectMatch = lst.count()-1; + } + } else if (perfectMatch > -1 && index == filter) { + perfectMatch = lst.count()-1; + } + } + } + } else { + foreach (const QString &index, d->indices) { + if (index.contains(filter, Qt::CaseInsensitive)) { + lst.append(index); + if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { + if (goodMatch == -1) + goodMatch = lst.count()-1; + if (filter.length() == index.length()){ + perfectMatch = lst.count()-1; + } + } else if (perfectMatch > -1 && index == filter) { + perfectMatch = lst.count()-1; + } + } + } + + } + + if (perfectMatch == -1) + perfectMatch = qMax(0, goodMatch); + + setStringList(lst); + return index(perfectMatch, 0, QModelIndex()); +} + + + +/*! + \class QHelpIndexWidget + \inmodule QtHelp + \since 4.4 + \brief The QHelpIndexWidget class provides a list view + displaying the QHelpIndexModel. +*/ + +/*! + \fn void QHelpIndexWidget::linkActivated(const QUrl &link, + const QString &keyword) + + This signal is emitted when an item is activated and its + associated \a link should be shown. To know where the link + belongs to, the \a keyword is given as a second paremeter. +*/ + +/*! + \fn void QHelpIndexWidget::linksActivated(const QMap &links, + const QString &keyword) + + This signal is emitted when the item representing the \a keyword + is activated and the item has more than one link associated. + The \a links consist of the document title and their URL. +*/ + +QHelpIndexWidget::QHelpIndexWidget() + : QListView(0) +{ + setEditTriggers(QAbstractItemView::NoEditTriggers); + setUniformItemSizes(true); + connect(this, SIGNAL(activated(QModelIndex)), + this, SLOT(showLink(QModelIndex))); +} + +void QHelpIndexWidget::showLink(const QModelIndex &index) +{ + if (!index.isValid()) + return; + + QHelpIndexModel *indexModel = qobject_cast(model()); + if (!indexModel) + return; + QVariant v = indexModel->data(index, Qt::DisplayRole); + QString name; + if (v.isValid()) + name = v.toString(); + + QMap links = indexModel->linksForKeyword(name); + if (links.count() == 1) { + emit linkActivated(links.constBegin().value(), name); + } else if (links.count() > 1) { + emit linksActivated(links, name); + } +} + +/*! + Activates the current item which will result eventually in + the emitting of a linkActivated() or linksActivated() + signal. +*/ +void QHelpIndexWidget::activateCurrentItem() +{ + showLink(currentIndex()); +} + +/*! + Filters the indices according to \a filter or \a wildcard. + The item with the best match is set as current item. + + \sa QHelpIndexModel::filter() +*/ +void QHelpIndexWidget::filterIndices(const QString &filter, const QString &wildcard) +{ + QHelpIndexModel *indexModel = qobject_cast(model()); + if (!indexModel) + return; + QModelIndex idx = indexModel->filter(filter, wildcard); + if (idx.isValid()) + setCurrentIndex(idx); +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpindexwidget.h b/src/assistant/help/qhelpindexwidget.h new file mode 100644 index 000000000..41e66f647 --- /dev/null +++ b/src/assistant/help/qhelpindexwidget.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPINDEXWIDGET_H +#define QHELPINDEXWIDGET_H + +#include + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QHelpEnginePrivate; +class QHelpIndexModelPrivate; + +class QHELP_EXPORT QHelpIndexModel : public QStringListModel +{ + Q_OBJECT + +public: + void createIndex(const QString &customFilterName); + QModelIndex filter(const QString &filter, + const QString &wildcard = QString()); + + QMap linksForKeyword(const QString &keyword) const; + bool isCreatingIndex() const; + +Q_SIGNALS: + void indexCreationStarted(); + void indexCreated(); + +private Q_SLOTS: + void insertIndices(); + void invalidateIndex(bool onShutDown = false); + +private: + QHelpIndexModel(QHelpEnginePrivate *helpEngine); + ~QHelpIndexModel(); + + QHelpIndexModelPrivate *d; + friend class QHelpEnginePrivate; +}; + +class QHELP_EXPORT QHelpIndexWidget : public QListView +{ + Q_OBJECT + +Q_SIGNALS: + void linkActivated(const QUrl &link, const QString &keyword); + void linksActivated(const QMap &links, + const QString &keyword); + +public Q_SLOTS: + void filterIndices(const QString &filter, + const QString &wildcard = QString()); + void activateCurrentItem(); + +private Q_SLOTS: + void showLink(const QModelIndex &index); + +private: + QHelpIndexWidget(); + friend class QHelpEngine; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/assistant/help/qhelpprojectdata.cpp b/src/assistant/help/qhelpprojectdata.cpp new file mode 100644 index 000000000..ce0ddd720 --- /dev/null +++ b/src/assistant/help/qhelpprojectdata.cpp @@ -0,0 +1,450 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpprojectdata_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpProjectDataPrivate : public QXmlStreamReader +{ +public: + void readData(const QByteArray &contents); + + QString virtualFolder; + QString namespaceName; + QString rootPath; + + QStringList fileList; + QList customFilterList; + QList filterSectionList; + QMap metaData; + + QString errorMsg; + +private: + void readProject(); + void readCustomFilter(); + void readFilterSection(); + void readTOC(); + void readKeywords(); + void readFiles(); + void raiseUnknownTokenError(); + void addMatchingFiles(const QString &pattern); + bool hasValidSyntax(const QString &nameSpace, const QString &vFolder) const; + + QMap dirEntriesCache; +}; + +void QHelpProjectDataPrivate::raiseUnknownTokenError() +{ + raiseError(QCoreApplication::translate("QHelpProject", "Unknown token.")); +} + +void QHelpProjectDataPrivate::readData(const QByteArray &contents) +{ + addData(contents); + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("QtHelpProject") + && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) + readProject(); + else + raiseError(QCoreApplication::translate("QHelpProject", + "Unknown token. Expected \"QtHelpProject\"!")); + } + } + + if (hasError()) { + raiseError(QCoreApplication::translate("QHelpProject", + "Error in line %1: %2").arg(lineNumber()) + .arg(errorString())); + } +} + +void QHelpProjectDataPrivate::readProject() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("virtualFolder")) { + virtualFolder = readElementText(); + if (!hasValidSyntax(QLatin1String("test"), virtualFolder)) + raiseError(QCoreApplication::translate("QHelpProject", + "Virtual folder has invalid syntax.")); + } else if (name() == QLatin1String("namespace")) { + namespaceName = readElementText(); + if (!hasValidSyntax(namespaceName, QLatin1String("test"))) + raiseError(QCoreApplication::translate("QHelpProject", + "Namespace has invalid syntax.")); + } else if (name() == QLatin1String("customFilter")) { + readCustomFilter(); + } else if (name() == QLatin1String("filterSection")) { + readFilterSection(); + } else if (name() == QLatin1String("metaData")) { + QString n = attributes().value(QLatin1String("name")).toString(); + if (!metaData.contains(n)) + metaData[n] + = attributes().value(QLatin1String("value")).toString(); + else + metaData.insert(n, attributes(). + value(QLatin1String("value")).toString()); + } else { + raiseUnknownTokenError(); + } + } else if (isEndElement() && name() == QLatin1String("QtHelpProject")) { + if (namespaceName.isEmpty()) + raiseError(QCoreApplication::translate("QHelpProject", + "Missing namespace in QtHelpProject.")); + else if (virtualFolder.isEmpty()) + raiseError(QCoreApplication::translate("QHelpProject", + "Missing virtual folder in QtHelpProject")); + break; + } + } +} + +void QHelpProjectDataPrivate::readCustomFilter() +{ + QHelpDataCustomFilter filter; + filter.name = attributes().value(QLatin1String("name")).toString(); + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("filterAttribute")) + filter.filterAttributes.append(readElementText()); + else + raiseUnknownTokenError(); + } else if (isEndElement() && name() == QLatin1String("customFilter")) { + break; + } + } + customFilterList.append(filter); +} + +void QHelpProjectDataPrivate::readFilterSection() +{ + filterSectionList.append(QHelpDataFilterSection()); + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("filterAttribute")) + filterSectionList.last().addFilterAttribute(readElementText()); + else if (name() == QLatin1String("toc")) + readTOC(); + else if (name() == QLatin1String("keywords")) + readKeywords(); + else if (name() == QLatin1String("files")) + readFiles(); + else + raiseUnknownTokenError(); + } else if (isEndElement() && name() == QLatin1String("filterSection")) { + break; + } + } +} + +void QHelpProjectDataPrivate::readTOC() +{ + QStack contentStack; + QHelpDataContentItem *itm = 0; + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("section")) { + QString title = attributes().value(QLatin1String("title")).toString(); + QString ref = attributes().value(QLatin1String("ref")).toString(); + if (contentStack.isEmpty()) { + itm = new QHelpDataContentItem(0, title, ref); + filterSectionList.last().addContent(itm); + } else { + itm = new QHelpDataContentItem(contentStack.top(), title, ref); + } + contentStack.push(itm); + } else { + raiseUnknownTokenError(); + } + } else if (isEndElement()) { + if (name() == QLatin1String("section")) { + contentStack.pop(); + continue; + } else if (name() == QLatin1String("toc") && contentStack.isEmpty()) { + break; + } else { + raiseUnknownTokenError(); + } + } + } +} + +void QHelpProjectDataPrivate::readKeywords() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("keyword")) { + if (attributes().value(QLatin1String("ref")).toString().isEmpty() + || (attributes().value(QLatin1String("name")).toString().isEmpty() + && attributes().value(QLatin1String("id")).toString().isEmpty())) + raiseError(QCoreApplication::translate("QHelpProject", + "Missing attribute in keyword at line %1.") + .arg(lineNumber())); + filterSectionList.last() + .addIndex(QHelpDataIndexItem(attributes(). + value(QLatin1String("name")).toString(), + attributes().value(QLatin1String("id")).toString(), + attributes().value(QLatin1String("ref")).toString())); + } else { + raiseUnknownTokenError(); + } + } else if (isEndElement()) { + if (name() == QLatin1String("keyword")) + continue; + else if (name() == QLatin1String("keywords")) + break; + else + raiseUnknownTokenError(); + } + } +} + +void QHelpProjectDataPrivate::readFiles() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("file")) + addMatchingFiles(readElementText()); + else + raiseUnknownTokenError(); + } else if (isEndElement()) { + if (name() == QLatin1String("file")) + continue; + else if (name() == QLatin1String("files")) + break; + else + raiseUnknownTokenError(); + } + } +} + +// Expand file pattern and add matches into list. If the pattern does not match +// any files, insert the pattern itself so the QHelpGenerator will emit a +// meaningful warning later. +void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern) +{ + // The pattern matching is expensive, so we skip it if no + // wildcard symbols occur in the string. + if (!pattern.contains('?') && !pattern.contains('*') + && !pattern.contains('[') && !pattern.contains(']')) { + filterSectionList.last().addFile(pattern); + return; + } + + QFileInfo fileInfo(rootPath + '/' + pattern); + const QDir &dir = fileInfo.dir(); + const QString &path = dir.canonicalPath(); + + // QDir::entryList() is expensive, so we cache the results. + QMap::ConstIterator it = dirEntriesCache.find(path); + const QStringList &entries = it != dirEntriesCache.constEnd() ? + it.value() : dir.entryList(QDir::Files); + if (it == dirEntriesCache.constEnd()) + dirEntriesCache.insert(path, entries); + + bool matchFound = false; +#ifdef Q_OS_WIN + Qt::CaseSensitivity cs = Qt::CaseInsensitive; +#else + Qt::CaseSensitivity cs = Qt::CaseSensitive; +#endif + QRegExp regExp(fileInfo.fileName(), cs, QRegExp::Wildcard); + foreach (const QString &file, entries) { + if (regExp.exactMatch(file)) { + matchFound = true; + filterSectionList.last(). + addFile(QFileInfo(pattern).dir().path() + '/' + file); + } + } + if (!matchFound) + filterSectionList.last().addFile(pattern); +} + +bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace, + const QString &vFolder) const +{ + const QLatin1Char slash('/'); + if (nameSpace.contains(slash) || vFolder.contains(slash)) + return false; + QUrl url; + const QLatin1String scheme("qthelp"); + url.setScheme(scheme); + const QString canonicalNamespace = nameSpace.toLower(); + url.setHost(canonicalNamespace); + url.setPath(vFolder); + + const QString expectedUrl(scheme + QLatin1String("://") + + canonicalNamespace + slash + vFolder); + return url.isValid() && url.toString() == expectedUrl; +} + +/*! + \internal + \class QHelpProjectData + \since 4.4 + \brief The QHelpProjectData class stores all information found + in a Qt help project file. + + The structure is filled with data by calling readData(). The + specified file has to have the Qt help project file format in + order to be read successfully. Possible reading errors can be + retrieved by calling errorMessage(). +*/ + +/*! + Constructs a Qt help project data structure. +*/ +QHelpProjectData::QHelpProjectData() +{ + d = new QHelpProjectDataPrivate; +} + +/*! + Destroys the help project data. +*/ +QHelpProjectData::~QHelpProjectData() +{ + delete d; +} + +/*! + Reads the file \a fileName and stores the help data. The file has to + have the Qt help project file format. Returns true if the file + was successfully read, otherwise false. + + \sa errorMessage() +*/ +bool QHelpProjectData::readData(const QString &fileName) +{ + d->rootPath = QFileInfo(fileName).absolutePath(); + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly)) { + d->errorMsg = QCoreApplication::translate("QHelpProject", + "The input file %1 could not be opened!").arg(fileName); + return false; + } + + d->readData(file.readAll()); + return !d->hasError(); +} + +/*! + Returns an error message if the reading of the Qt help project + file failed. Otherwise, an empty QString is returned. + + \sa readData() +*/ +QString QHelpProjectData::errorMessage() const +{ + if (d->hasError()) + return d->errorString(); + return d->errorMsg; +} + +/*! + \internal +*/ +QString QHelpProjectData::namespaceName() const +{ + return d->namespaceName; +} + +/*! + \internal +*/ +QString QHelpProjectData::virtualFolder() const +{ + return d->virtualFolder; +} + +/*! + \internal +*/ +QList QHelpProjectData::customFilters() const +{ + return d->customFilterList; +} + +/*! + \internal +*/ +QList QHelpProjectData::filterSections() const +{ + return d->filterSectionList; +} + +/*! + \internal +*/ +QMap QHelpProjectData::metaData() const +{ + return d->metaData; +} + +/*! + \internal +*/ +QString QHelpProjectData::rootPath() const +{ + return d->rootPath; +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpprojectdata_p.h b/src/assistant/help/qhelpprojectdata_p.h new file mode 100644 index 000000000..64ae32505 --- /dev/null +++ b/src/assistant/help/qhelpprojectdata_p.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPPROJECTDATA_H +#define QHELPPROJECTDATA_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelp_global.h" +#include "qhelpdatainterface_p.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QHelpProjectDataPrivate; + +class QHELP_EXPORT QHelpProjectData : public QHelpDataInterface +{ +public: + QHelpProjectData(); + ~QHelpProjectData(); + + bool readData(const QString &fileName); + QString errorMessage() const; + + QString namespaceName() const; + QString virtualFolder() const; + QList customFilters() const; + QList filterSections() const; + QMap metaData() const; + QString rootPath() const; + +private: + QHelpProjectDataPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/assistant/help/qhelpsearchengine.cpp b/src/assistant/help/qhelpsearchengine.cpp new file mode 100644 index 000000000..f8f8acf44 --- /dev/null +++ b/src/assistant/help/qhelpsearchengine.cpp @@ -0,0 +1,450 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpenginecore.h" +#include "qhelpsearchengine.h" +#include "qhelpsearchquerywidget.h" +#include "qhelpsearchresultwidget.h" + +#include "qhelpsearchindexreader_p.h" +#if defined(QT_CLUCENE_SUPPORT) +# include "qhelpsearchindexreader_clucene_p.h" +# include "qhelpsearchindexwriter_clucene_p.h" +#else +# include "qhelpsearchindexreader_default_p.h" +# include "qhelpsearchindexwriter_default_p.h" +#endif + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#if defined(QT_CLUCENE_SUPPORT) + using namespace fulltextsearch::clucene; +#else + using namespace fulltextsearch::std; +#endif + +class QHelpSearchEnginePrivate : public QObject +{ + Q_OBJECT + +signals: + void indexingStarted(); + void indexingFinished(); + + void searchingStarted(); + void searchingFinished(int hits); + +private: + QHelpSearchEnginePrivate(QHelpEngineCore *helpEngine) + : queryWidget(0) + , resultWidget(0) + , helpEngine(helpEngine) + { + indexReader = 0; + indexWriter = 0; + } + + ~QHelpSearchEnginePrivate() + { + delete indexReader; + delete indexWriter; + } + + int hitCount() const + { + int count = 0; + if (indexReader) + count = indexReader->hitCount(); + + return count; + } + + QList hits(int start, int end) const + { + return indexReader ? + indexReader->hits(start, end) : + QList(); + } + + void updateIndex(bool reindex = false) + { + if (helpEngine.isNull()) + return; + + if (!QFile::exists(QFileInfo(helpEngine->collectionFile()).path())) + return; + + if (!indexWriter) { + indexWriter = new QHelpSearchIndexWriter(); + + connect(indexWriter, SIGNAL(indexingStarted()), this, SIGNAL(indexingStarted())); + connect(indexWriter, SIGNAL(indexingFinished()), this, SIGNAL(indexingFinished())); + connect(indexWriter, SIGNAL(indexingFinished()), this, SLOT(optimizeIndex())); + } + + indexWriter->cancelIndexing(); + indexWriter->updateIndex(helpEngine->collectionFile(), + indexFilesFolder(), reindex); + } + + void cancelIndexing() + { + if (indexWriter) + indexWriter->cancelIndexing(); + } + + void search(const QList &queryList) + { + if (helpEngine.isNull()) + return; + + if (!QFile::exists(QFileInfo(helpEngine->collectionFile()).path())) + return; + + if (!indexReader) { +#if defined(QT_CLUCENE_SUPPORT) + indexReader = new QHelpSearchIndexReaderClucene(); +#else + indexReader = new QHelpSearchIndexReaderDefault(); +#endif // QT_CLUCENE_SUPPORT + connect(indexReader, SIGNAL(searchingStarted()), this, SIGNAL(searchingStarted())); + connect(indexReader, SIGNAL(searchingFinished(int)), this, SIGNAL(searchingFinished(int))); + } + + m_queryList = queryList; + indexReader->cancelSearching(); + indexReader->search(helpEngine->collectionFile(), indexFilesFolder(), queryList); + } + + void cancelSearching() + { + if (indexReader) + indexReader->cancelSearching(); + } + + QString indexFilesFolder() const + { + QString indexFilesFolder = QLatin1String(".fulltextsearch"); + if (helpEngine && !helpEngine->collectionFile().isEmpty()) { + QFileInfo fi(helpEngine->collectionFile()); + indexFilesFolder = fi.absolutePath() + QDir::separator() + + QLatin1Char('.') + + fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc"))); + } + return indexFilesFolder; + } + +private slots: + void optimizeIndex() + { +#if defined(QT_CLUCENE_SUPPORT) + if (indexWriter && !helpEngine.isNull()) { + indexWriter->optimizeIndex(); + } +#endif + } + +private: + friend class QHelpSearchEngine; + + QHelpSearchQueryWidget *queryWidget; + QHelpSearchResultWidget *resultWidget; + + fulltextsearch::QHelpSearchIndexReader *indexReader; + QHelpSearchIndexWriter *indexWriter; + + QPointer helpEngine; + + QList m_queryList; +}; + +#include "qhelpsearchengine.moc" + + +/*! + \class QHelpSearchQuery + \since 4.4 + \inmodule QtHelp + \brief The QHelpSearchQuery class contains the field name and the associated + search term + + The QHelpSearchQuery class contains the field name and the associated search + term. Depending on the field the search term might get split up into separate + terms to be parsed differently by the search engine. + + \sa QHelpSearchQueryWidget +*/ + +/*! + \fn QHelpSearchQuery::QHelpSearchQuery() + + Constructs a new empty QHelpSearchQuery. +*/ + +/*! + \fn QHelpSearchQuery::QHelpSearchQuery(FieldName field, const QStringList &wordList) + + Constructs a new QHelpSearchQuery and initializes it with the given \a field and \a wordList. +*/ + +/*! + \enum QHelpSearchQuery::FieldName + This enum type specifies the field names that are handled by the search engine. + + \value DEFAULT the default field provided by the search widget, several terms should be + split and stored in the word list except search terms enclosed in quotes. + \value FUZZY a field only provided in use with clucene. Terms should be split in separate + words and passed to the search engine. + \value WITHOUT a field only provided in use with clucene. Terms should be split in separate + words and passed to the search engine. + \value PHRASE a field only provided in use with clucene. Terms should not be split in separate + words. + \value ALL a field only provided in use with clucene. Terms should be split in separate + words and passed to the search engine + \value ATLEAST a field only provided in use with clucene. Terms should be split in separate + words and passed to the search engine +*/ + +/*! + \class QHelpSearchEngine + \since 4.4 + \inmodule QtHelp + \brief The QHelpSearchEngine class provides access to widgets reusable + to integrate fulltext search as well as to index and search documentation. + + Before the search engine can be used, one has to instantiate at least a + QHelpEngineCore object that needs to be passed to the search engines constructor. + This is required as the search engine needs to be connected to the help + engines setupFinished() signal to know when it can start to index documentation. + + After starting the indexing process the signal indexingStarted() is emitted and + on the end of the indexing process the indexingFinished() is emitted. To stop + the indexing one can call cancelIndexing(). + + While the indexing process has finished, the search engine can now be used to search + thru its index for a given term. To do this one may use the possibility of creating the + QHelpSearchQuery list by self or reuse the QHelpSearchQueryWidget which has the inbuild + functionality to set up a proper search queries list that get's passed to the search engines + search() function. + + After the list of querys has been passed to the search engine, the signal searchingStarted() + is emitted and after the search has finished the searchingFinished() signal is emitted. The + search process can be stopped by calling cancelSearching(). + + If the search succeeds, the searchingFinished() will be called with the search hits count, + which can be reused to fetch the search hits from the search engine. Calling the hits() + function with the range of hits you would like to get will return a list of the requested + SearchHits. They basically constist at the moment of a pair of strings where the values + of that pair are the documentation file path and the page title. + + To display the given hits use the QHelpSearchResultWidget or build up your own one if you need + more advanced functionality. Note that the QHelpSearchResultWidget can not be instantiated + directly, you must retrieve the widget from the search engine in use as all connections will be + established for you by the widget itself. +*/ + +/*! + \fn void QHelpSearchEngine::indexingStarted() + + This signal is emitted when indexing process is started. +*/ + +/*! + \fn void QHelpSearchEngine::indexingFinished() + + This signal is emitted when the indexing process is complete. +*/ + +/*! + \fn void QHelpSearchEngine::searchingStarted() + + This signal is emitted when the search process is started. +*/ + +/*! + \fn void QHelpSearchEngine::searchingFinished(int hits) + + This signal is emitted when the search process is complete. + The hit count is stored in \a hits. +*/ + +/*! + Constructs a new search engine with the given \a parent. The search engine + uses the given \a helpEngine to access the documentation that needs to be indexed. + The QHelpEngine's setupFinished() signal is automatically connected to the + QHelpSearchEngine's indexing function, so that new documentation will be indexed + after the signal is emitted. +*/ +QHelpSearchEngine::QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent) + : QObject(parent) +{ + d = new QHelpSearchEnginePrivate(helpEngine); + + connect(helpEngine, SIGNAL(setupFinished()), this, SLOT(indexDocumentation())); + + connect(d, SIGNAL(indexingStarted()), this, SIGNAL(indexingStarted())); + connect(d, SIGNAL(indexingFinished()), this, SIGNAL(indexingFinished())); + connect(d, SIGNAL(searchingStarted()), this, SIGNAL(searchingStarted())); + connect(d, SIGNAL(searchingFinished(int)), this, SIGNAL(searchingFinished(int))); +} + +/*! + Destructs the search engine. +*/ +QHelpSearchEngine::~QHelpSearchEngine() +{ + delete d; +} + +/*! + Returns a widget to use as input widget. Depending on your search engine + configuration you will get a different widget with more or less subwidgets. +*/ +QHelpSearchQueryWidget* QHelpSearchEngine::queryWidget() +{ + if (!d->queryWidget) + d->queryWidget = new QHelpSearchQueryWidget(); + + return d->queryWidget; +} + +/*! + Returns a widget that can hold and display the search results. +*/ +QHelpSearchResultWidget* QHelpSearchEngine::resultWidget() +{ + if (!d->resultWidget) + d->resultWidget = new QHelpSearchResultWidget(this); + + return d->resultWidget; +} + +/*! + \obsolete + Returns the amount of hits the search engine found. + \sa hitCount() +*/ +int QHelpSearchEngine::hitsCount() const +{ + return d->hitCount(); +} + +/*! + \since 4.6 + Returns the amount of hits the search engine found. +*/ +int QHelpSearchEngine::hitCount() const +{ + return d->hitCount(); +} + +/*! + \typedef QHelpSearchEngine::SearchHit + + Typedef for QPair. + The values of that pair are the documentation file path and the page title. + + \sa hits() +*/ + +/*! + Returns a list of search hits within the range of \a start \a end. +*/ +QList QHelpSearchEngine::hits(int start, int end) const +{ + return d->hits(start, end); +} + +/*! + Returns the list of queries last searched for. + \since 4.5 +*/ +QList QHelpSearchEngine::query() const +{ + return d->m_queryList; +} + +/*! + Forces the search engine to reindex all documentation files. +*/ +void QHelpSearchEngine::reindexDocumentation() +{ + d->updateIndex(true); +} + +/*! + Stops the indexing process. +*/ +void QHelpSearchEngine::cancelIndexing() +{ + d->cancelIndexing(); +} + +/*! + Stops the search process. +*/ +void QHelpSearchEngine::cancelSearching() +{ + d->cancelSearching(); +} + +/*! + Starts the search process using the given list of queries \a queryList + build by the search field name and the values to search for. +*/ +void QHelpSearchEngine::search(const QList &queryList) +{ + d->search(queryList); +} + +void QHelpSearchEngine::indexDocumentation() +{ + d->updateIndex(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchengine.h b/src/assistant/help/qhelpsearchengine.h new file mode 100644 index 000000000..baceb7057 --- /dev/null +++ b/src/assistant/help/qhelpsearchengine.h @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHENGINE_H +#define QHELPSEARCHENGINE_H + +#include + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QHelpEngineCore; +class QHelpSearchQueryWidget; +class QHelpSearchResultWidget; +class QHelpSearchEnginePrivate; + +class QHELP_EXPORT QHelpSearchQuery +{ +public: + enum FieldName { DEFAULT = 0, FUZZY, WITHOUT, PHRASE, ALL, ATLEAST }; + + QHelpSearchQuery() + : fieldName(DEFAULT) { wordList.clear(); } + QHelpSearchQuery(FieldName field, const QStringList &wordList) + : fieldName(field), wordList(wordList) {} + + FieldName fieldName; + QStringList wordList; +}; + +class QHELP_EXPORT QHelpSearchEngine : public QObject +{ + Q_OBJECT + +public: + explicit QHelpSearchEngine(QHelpEngineCore *helpEngine, + QObject *parent = 0); + ~QHelpSearchEngine(); + + QHelpSearchQueryWidget* queryWidget(); + QHelpSearchResultWidget* resultWidget(); + +#ifdef QT_DEPRECATED + QT_DEPRECATED int hitsCount() const; +#endif + int hitCount() const; + + typedef QPair SearchHit; + QList hits(int start, int end) const; + + QList query() const; + +public Q_SLOTS: + void reindexDocumentation(); + void cancelIndexing(); + + void search(const QList &queryList); + void cancelSearching(); + +Q_SIGNALS: + void indexingStarted(); + void indexingFinished(); + + void searchingStarted(); + void searchingFinished(int hits); + +private Q_SLOTS: + void indexDocumentation(); + +private: + QHelpSearchEnginePrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QHELPSEARCHENGINE_H diff --git a/src/assistant/help/qhelpsearchindex_default.cpp b/src/assistant/help/qhelpsearchindex_default.cpp new file mode 100644 index 000000000..9974f618d --- /dev/null +++ b/src/assistant/help/qhelpsearchindex_default.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpsearchindex_default_p.h" + +QT_BEGIN_NAMESPACE + +QDataStream &operator>>(QDataStream &s, Document &l) +{ + s >> l.docNumber; + s >> l.frequency; + return s; +} + +QDataStream &operator<<(QDataStream &s, const Document &l) +{ + s << qint16(l.docNumber); + s << qint16(l.frequency); + return s; +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchindex_default_p.h b/src/assistant/help/qhelpsearchindex_default_p.h new file mode 100644 index 000000000..868609960 --- /dev/null +++ b/src/assistant/help/qhelpsearchindex_default_p.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHINDEXDEFAULT_H +#define QHELPSEARCHINDEXDEFAULT_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace QtHelpInternal { + +struct Document { + Document(qint16 d, qint16 f) + : docNumber(d), frequency(f) {} + + Document() + : docNumber(-1), frequency(0) {} + + bool operator==(const Document &doc) const { + return docNumber == doc.docNumber; + } + bool operator<(const Document &doc) const { + return frequency > doc.frequency; + } + bool operator<=(const Document &doc) const { + return frequency >= doc.frequency; + } + bool operator>(const Document &doc) const { + return frequency < doc.frequency; + } + + qint16 docNumber; + qint16 frequency; +}; + +struct DocumentInfo : public Document { + DocumentInfo() + : Document(-1, 0), documentTitle(QString()), documentUrl(QString()) {} + + DocumentInfo(qint16 d, qint16 f, const QString &title, const QString &url) + : Document(d, f), documentTitle(title), documentUrl(url) {} + + DocumentInfo(const Document &document, const QString &title, const QString &url) + : Document(document.docNumber, document.frequency), documentTitle(title), documentUrl(url) {} + + QString documentTitle; + QString documentUrl; +}; + +struct Entry { + Entry(qint16 d) { documents.append(Document(d, 1)); } + Entry(QVector l) : documents(l) {} + + QVector documents; +}; + +struct PosEntry { + PosEntry(int p) { positions.append(p); } + QList positions; +}; + +struct Term { + Term() : frequency(-1) {} + Term(const QString &t, int f, QVector l) : term(t), frequency(f), documents(l) {} + QString term; + int frequency; + QVectordocuments; + bool operator<(const Term &i2) const { return frequency < i2.frequency; } +}; + +struct TermInfo { + TermInfo() : frequency(-1) {} + TermInfo(const QString &t, int f, QVector l) + : term(t), frequency(f), documents(l) {} + + bool operator<(const TermInfo &i2) const { return frequency < i2.frequency; } + + QString term; + int frequency; + QVectordocuments; +}; + +} // namespace QtHelpInternal + +using QtHelpInternal::Document; +using QtHelpInternal::DocumentInfo; +using QtHelpInternal::Entry; +using QtHelpInternal::PosEntry; +using QtHelpInternal::Term; +using QtHelpInternal::TermInfo; + +QDataStream &operator>>(QDataStream &s, Document &l); +QDataStream &operator<<(QDataStream &s, const Document &l); + +QT_END_NAMESPACE + +#endif // QHELPSEARCHINDEXDEFAULT_H diff --git a/src/assistant/help/qhelpsearchindexreader.cpp b/src/assistant/help/qhelpsearchindexreader.cpp new file mode 100644 index 000000000..1ee356d2f --- /dev/null +++ b/src/assistant/help/qhelpsearchindexreader.cpp @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpsearchindexreader_p.h" + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { + +QHelpSearchIndexReader::QHelpSearchIndexReader() + : QThread() + , m_cancel(false) +{ + // nothing todo +} + +QHelpSearchIndexReader::~QHelpSearchIndexReader() +{ + mutex.lock(); + this->m_cancel = true; + mutex.unlock(); + + wait(); +} + +void QHelpSearchIndexReader::cancelSearching() +{ + mutex.lock(); + this->m_cancel = true; + mutex.unlock(); +} + +void QHelpSearchIndexReader::search(const QString &collectionFile, const QString &indexFilesFolder, + const QList &queryList) +{ + wait(); + + this->hitList.clear(); + this->m_cancel = false; + this->m_query = queryList; + this->m_collectionFile = collectionFile; + this->m_indexFilesFolder = indexFilesFolder; + + start(QThread::NormalPriority); +} + +int QHelpSearchIndexReader::hitCount() const +{ + QMutexLocker lock(&mutex); + return hitList.count(); +} + +QList QHelpSearchIndexReader::hits(int start, + int end) const +{ + QList hits; + QMutexLocker lock(&mutex); + for (int i = start; i < end && i < hitList.count(); ++i) + hits.append(hitList.at(i)); + return hits; +} + + +} // namespace fulltextsearch + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchindexreader_clucene.cpp b/src/assistant/help/qhelpsearchindexreader_clucene.cpp new file mode 100644 index 000000000..b67898f8a --- /dev/null +++ b/src/assistant/help/qhelpsearchindexreader_clucene.cpp @@ -0,0 +1,481 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qindexreader_p.h" +#include "private/qqueryparser_p.h" +#include "private/qsearchable_p.h" +#include "qclucenefieldnames_p.h" +#include "qhelpenginecore.h" + +#include "qhelpsearchindexreader_clucene_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace clucene { + +QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() + : QHelpSearchIndexReader() +{ + // nothing todo +} + +QHelpSearchIndexReaderClucene::~QHelpSearchIndexReaderClucene() +{ +} + + +void QHelpSearchIndexReaderClucene::run() +{ + mutex.lock(); + + if (m_cancel) { + mutex.unlock(); + return; + } + + const QString collectionFile(this->m_collectionFile); + const QList &queryList = this->m_query; + const QString indexPath(m_indexFilesFolder); + + mutex.unlock(); + + QHelpEngineCore engine(collectionFile, 0); + if (!engine.setupData()) + return; + + QFileInfo fInfo(indexPath); + if (fInfo.exists() && !fInfo.isWritable()) { + qWarning("Full Text Search, could not read index (missing permissions)."); + return; + } + + if(QCLuceneIndexReader::indexExists(indexPath)) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + return; + } + mutex.unlock(); + + emit searchingStarted(); + +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + QCLuceneBooleanQuery booleanQueryTitle; + QCLuceneBooleanQuery booleanQueryContent; + QCLuceneStandardAnalyzer analyzer; + const QStringList& attribList = + engine.filterAttributes(engine.currentFilter()); + bool titleQueryIsValid = buildQuery(queryList, TitleTokenizedField, + attribList, booleanQueryTitle, analyzer); + bool contentQueryIsValid = buildQuery(queryList, ContentField, + attribList, booleanQueryContent, analyzer); + if (!titleQueryIsValid && !contentQueryIsValid) { + emit searchingFinished(0); + return; + } + + QCLuceneIndexSearcher indexSearcher(indexPath); + + // QCLuceneHits object must be allocated on the heap, because + // there is no default constructor. + QSharedPointer titleHits; + QSharedPointer contentHits; + if (titleQueryIsValid) { + titleHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryTitle))); + } + if (contentQueryIsValid) { + contentHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryContent))); + } + bool boost = true; + if ((titleHits.isNull() || titleHits->length() == 0) + && (contentHits.isNull() || contentHits->length() == 0)) { + booleanQueryTitle = QCLuceneBooleanQuery(); + booleanQueryContent = QCLuceneBooleanQuery(); + titleQueryIsValid = + buildTryHarderQuery(queryList, TitleTokenizedField, + attribList, booleanQueryTitle, analyzer); + contentQueryIsValid = + buildTryHarderQuery(queryList, ContentField, attribList, + booleanQueryContent, analyzer); + if (!titleQueryIsValid && !contentQueryIsValid) { + emit searchingFinished(0); + return; + } + if (titleQueryIsValid) { + titleHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryTitle))); + } + if (contentQueryIsValid) { + contentHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryContent))); + } + boost = false; + } + QList > cluceneHitsList; + if (!titleHits.isNull()) + cluceneHitsList.append(titleHits); + if (!contentHits.isNull()) + cluceneHitsList.append(contentHits); + + QSet pathSet; + QCLuceneDocument document; + const QStringList namespaceList = engine.registeredDocumentations(); + + foreach (const QSharedPointer &hits, cluceneHitsList) { + for (qint32 i = 0; i < hits->length(); i++) { + document = hits->document(i); + const QString path = document.get(PathField); + if (!pathSet.contains(path) && namespaceList.contains( + document.get(NamespaceField), Qt::CaseInsensitive)) { + pathSet.insert(path); + hitList.append(qMakePair(path, document.get(TitleField))); + } + document.clear(); + + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + emit searchingFinished(0); + return; + } + mutex.unlock(); + } + } + + indexSearcher.close(); + const int count = hitList.count(); + if ((count > 0) && boost) + boostSearchHits(engine, hitList, queryList); + emit searchingFinished(hitList.count()); + +#if !defined(QT_NO_EXCEPTIONS) + } catch(...) { + mutex.lock(); + hitList.clear(); + mutex.unlock(); + emit searchingFinished(0); + } +#endif + } +} + +bool QHelpSearchIndexReaderClucene::buildQuery( + const QList &queries, const QString &fieldName, + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + foreach (const QHelpSearchQuery &query, queries) { + if (fieldName != ContentField && isNegativeQuery(query)) { + queryIsValid = false; + break; + } + switch (query.fieldName) { + case QHelpSearchQuery::FUZZY: + if (addFuzzyQuery(query, fieldName, booleanQuery, analyzer)) + queryIsValid = true; + break; + case QHelpSearchQuery::WITHOUT: + if (fieldName != ContentField) + return false; + if (addWithoutQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::PHRASE: + if (addPhraseQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::ALL: + if (addAllQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::DEFAULT: + if (addDefaultQuery(query, fieldName, true, booleanQuery, analyzer)) + queryIsValid = true; + break; + case QHelpSearchQuery::ATLEAST: + if (addAtLeastQuery(query, fieldName, booleanQuery, analyzer)) + queryIsValid = true; + break; + default: + Q_ASSERT(!"Invalid field name"); + } + } + + if (queryIsValid && !filterAttributes.isEmpty()) { + queryIsValid = + addAttributesQuery(filterAttributes, booleanQuery, analyzer); + } + + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::buildTryHarderQuery( + const QList &queries, const QString &fieldName, + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + if (queries.isEmpty()) + return false; + const QHelpSearchQuery &query = queries.front(); + if (query.fieldName != QHelpSearchQuery::DEFAULT) + return false; + if (isNegativeQuery(query)) + return false; + if (!addDefaultQuery(query, fieldName, false, booleanQuery, analyzer)) + return false; + if (filterAttributes.isEmpty()) + return true; + return addAttributesQuery(filterAttributes, booleanQuery, analyzer); +} + +bool QHelpSearchIndexReaderClucene::isNegativeQuery(const QHelpSearchQuery &query) const +{ + const QString &search = query.wordList.join(" "); + return search.contains('!') || search.contains('-') + || search.contains(QLatin1String(" NOT ")); +} + +bool QHelpSearchIndexReaderClucene::addFuzzyQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + const QLatin1String fuzzy("~"); + foreach (const QString &term, query.wordList) { + if (!term.isEmpty()) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term + fuzzy, fieldName, analyzer); + if (lQuery != 0) { + booleanQuery.add(lQuery, true, false, false); + queryIsValid = true; + } + } + } + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addWithoutQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, query.wordList) { + if (stopWords.contains(term, Qt::CaseInsensitive)) + continue; + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, false, true); + queryIsValid = true; + } + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addPhraseQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QString &term = query.wordList.at(0).toLower(); + if (term.contains(QLatin1Char(' '))) { + const QStringList termList = term.split(QLatin1String(" ")); + QCLucenePhraseQuery *q = new QCLucenePhraseQuery(); + const QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, termList) { + if (!stopWords.contains(term, Qt::CaseInsensitive)) + q->addTerm(QCLuceneTerm(fieldName, term.toLower())); + } + if (!q->getTerms().isEmpty()) { + booleanQuery.add(q, true, true, false); + queryIsValid = true; + } + } else { + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, true, false); + queryIsValid = true; + } + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addAllQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, query.wordList) { + if (stopWords.contains(term, Qt::CaseInsensitive)) + continue; + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, true, false); + queryIsValid = true; + } + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addDefaultQuery(const QHelpSearchQuery &query, + const QString &fieldName, bool allTermsRequired, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + foreach (const QString &term, query.wordList) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term.toLower(), fieldName, analyzer); + if (lQuery) { + booleanQuery.add(lQuery, true, allTermsRequired, false); + queryIsValid = true; + } + } + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addAtLeastQuery( + const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + foreach (const QString &term, query.wordList) { + if (!term.isEmpty()) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term, fieldName, analyzer); + if (lQuery) { + booleanQuery.add(lQuery, true, false, false); + queryIsValid = true; + } + } + } + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addAttributesQuery( + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + QCLuceneQuery* lQuery = QCLuceneQueryParser::parse(QLatin1String("+") + + filterAttributes.join(QLatin1String(" +")), AttributeField, analyzer); + if (!lQuery) + return false; + booleanQuery.add(lQuery, true, true, false); + return true; +} + +void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine, + QList &hitList, const QList &queryList) +{ + foreach (const QHelpSearchQuery &query, queryList) { + if (query.fieldName != QHelpSearchQuery::DEFAULT) + continue; + + QString joinedQuery = query.wordList.join(QLatin1String(" ")); + + QCLuceneStandardAnalyzer analyzer; + QCLuceneQuery *parsedQuery = QCLuceneQueryParser::parse( + joinedQuery, ContentField, analyzer); + + if (parsedQuery) { + joinedQuery = parsedQuery->toString(); + delete parsedQuery; + } + + const QString contentString(ContentField + QLatin1String(":")); + int length = contentString.length(); + int index = joinedQuery.indexOf(contentString); + + QString term; + int nextIndex = 0; + QStringList searchTerms; + while (index != -1) { + nextIndex = joinedQuery.indexOf(contentString, index + 1); + term = joinedQuery.mid(index + length, nextIndex - (length + index)).simplified(); + if (term.startsWith(QLatin1String("\"")) + && term.endsWith(QLatin1String("\""))) { + searchTerms.append(term.remove(QLatin1String("\""))); + } else { + searchTerms += term.split(QLatin1Char(' ')); + } + index = nextIndex; + } + searchTerms.removeDuplicates(); + + int count = qMin(75, hitList.count()); + QMap hitMap; + for (int i = 0; i < count; ++i) { + const QHelpSearchEngine::SearchHit &hit = hitList.at(i); + QString data = QString::fromUtf8(engine.fileData(hit.first)); + + int counter = 0; + foreach (const QString &term, searchTerms) + counter += data.count(term, Qt::CaseInsensitive); + hitMap.insertMulti(counter, hit); + } + + QList boostedList; + QMap::const_iterator it = hitMap.constEnd(); + do { + --it; + boostedList.append(it.value()); + } while (it != hitMap.constBegin()); + boostedList += hitList.mid(count, hitList.count()); + mutex.lock(); + hitList = boostedList; + mutex.unlock(); + } +} + +} // namespace clucene +} // namespace fulltextsearch + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchindexreader_clucene_p.h b/src/assistant/help/qhelpsearchindexreader_clucene_p.h new file mode 100644 index 000000000..1e3d199ed --- /dev/null +++ b/src/assistant/help/qhelpsearchindexreader_clucene_p.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHINDEXREADERCLUCENE_H +#define QHELPSEARCHINDEXREADERCLUCENE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +#include "private/qanalyzer_p.h" +#include "private/qquery_p.h" +#include "qhelpsearchindexreader_p.h" + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace clucene { + +class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader +{ + Q_OBJECT + +public: + QHelpSearchIndexReaderClucene(); + ~QHelpSearchIndexReaderClucene(); + +private: + void run(); + void boostSearchHits(const QHelpEngineCore &engine, QList &hitList, + const QList &queryList); + bool buildQuery(const QList &queries, + const QString &fieldName, + const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool buildTryHarderQuery(const QList &queries, + const QString &fieldName, + const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool addFuzzyQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool addWithoutQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addPhraseQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addAllQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addDefaultQuery(const QHelpSearchQuery &query, const QString &fieldName, + bool allTermsRequired, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool addAtLeastQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool addAttributesQuery(const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool isNegativeQuery(const QHelpSearchQuery &query) const; +}; + +} // namespace clucene +} // namespace fulltextsearch + +QT_END_NAMESPACE + +#endif // QHELPSEARCHINDEXREADERCLUCENE_H diff --git a/src/assistant/help/qhelpsearchindexreader_default.cpp b/src/assistant/help/qhelpsearchindexreader_default.cpp new file mode 100644 index 000000000..e49fdfcbd --- /dev/null +++ b/src/assistant/help/qhelpsearchindexreader_default.cpp @@ -0,0 +1,612 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpenginecore.h" +#include "qhelpsearchindexreader_default_p.h" + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace std { + +namespace { + QStringList split( const QString &str ) + { + QStringList lst; + int j = 0; + int i = str.indexOf(QLatin1Char('*'), j ); + + if (str.startsWith(QLatin1String("*"))) + lst << QLatin1String("*"); + + while ( i != -1 ) { + if ( i > j && i <= (int)str.length() ) { + lst << str.mid( j, i - j ); + lst << QLatin1String("*"); + } + j = i + 1; + i = str.indexOf(QLatin1Char('*'), j ); + } + + int l = str.length() - 1; + if ( str.mid( j, l - j + 1 ).length() > 0 ) + lst << str.mid( j, l - j + 1 ); + + return lst; + } +} + + +Reader::Reader() + : indexPath(QString()) + , indexFile(QString()) + , documentFile(QString()) +{ + termList.clear(); + indexTable.clear(); + searchIndexTable.clear(); +} + +Reader::~Reader() +{ + reset(); + searchIndexTable.clear(); +} + +bool Reader::readIndex() +{ + if (indexTable.contains(indexFile)) + return true; + + QFile idxFile(indexFile); + if (!idxFile.open(QFile::ReadOnly)) + return false; + + QString key; + int numOfDocs; + EntryTable entryTable; + QVector docs; + QDataStream dictStream(&idxFile); + while (!dictStream.atEnd()) { + dictStream >> key; + dictStream >> numOfDocs; + docs.resize(numOfDocs); + dictStream >> docs; + entryTable.insert(key, new Entry(docs)); + } + idxFile.close(); + + if (entryTable.isEmpty()) + return false; + + QFile docFile(documentFile); + if (!docFile.open(QFile::ReadOnly)) + return false; + + QString title, url; + DocumentList documentList; + QDataStream docStream(&docFile); + while (!docStream.atEnd()) { + docStream >> title; + docStream >> url; + documentList.append(QStringList(title) << url); + } + docFile.close(); + + if (documentList.isEmpty()) { + cleanupIndex(entryTable); + return false; + } + + indexTable.insert(indexFile, Index(entryTable, documentList)); + return true; +} + +bool Reader::initCheck() const +{ + return !searchIndexTable.isEmpty(); +} + +void Reader::setIndexPath(const QString &path) +{ + indexPath = path; +} + +void Reader::filterFilesForAttributes(const QStringList &attributes) +{ + searchIndexTable.clear(); + for(IndexTable::ConstIterator it = indexTable.begin(); it != indexTable.end(); ++it) { + const QString fileName = it.key(); + bool containsAll = true; + QStringList split = fileName.split(QLatin1String("@")); + foreach (const QString &attribute, attributes) { + if (!split.contains(attribute, Qt::CaseInsensitive)) { + containsAll = false; + break; + } + } + + if (containsAll) + searchIndexTable.insert(fileName, it.value()); + } +} + +void Reader::setIndexFile(const QString &namespaceName, const QString &attributes) +{ + QString extension = namespaceName + QLatin1String("@") + attributes; + indexFile = indexPath + QLatin1String("/indexdb40.") + extension; + documentFile = indexPath + QLatin1String("/indexdoc40.") + extension; +} + +bool Reader::splitSearchTerm(const QString &searchTerm, QStringList *terms, + QStringList *termSeq, QStringList *seqWords) +{ + QString term = searchTerm; + + term = term.simplified(); + term = term.replace(QLatin1String("\'"), QLatin1String("\"")); + term = term.replace(QLatin1String("`"), QLatin1String("\"")); + term = term.replace(QLatin1String("-"), QLatin1String(" ")); + term = term.replace(QRegExp(QLatin1String("\\s[\\S]?\\s")), QLatin1String(" ")); + + *terms = term.split(QLatin1Char(' ')); + QStringList::iterator it = terms->begin(); + for (; it != terms->end(); ++it) { + (*it) = (*it).simplified(); + (*it) = (*it).toLower(); + (*it) = (*it).replace(QLatin1String("\""), QLatin1String("")); + } + + if (term.contains(QLatin1Char('\"'))) { + if ((term.count(QLatin1Char('\"')))%2 == 0) { + int beg = 0; + int end = 0; + QString s; + beg = term.indexOf(QLatin1Char('\"'), beg); + while (beg != -1) { + beg++; + end = term.indexOf(QLatin1Char('\"'), beg); + s = term.mid(beg, end - beg); + s = s.toLower(); + s = s.simplified(); + if (s.contains(QLatin1Char('*'))) { + qWarning("Full Text Search, using a wildcard within phrases is not allowed."); + return false; + } + *seqWords += s.split(QLatin1Char(' ')); + *termSeq << s; + beg = term.indexOf(QLatin1Char('\"'), end + 1); + } + } else { + qWarning("Full Text Search, the closing quotation mark is missing."); + return false; + } + } + + return true; +} + +void Reader::searchInIndex(const QStringList &terms) +{ + foreach (const QString &term, terms) { + QVector documents; + + for(IndexTable::ConstIterator it = searchIndexTable.begin(); + it != searchIndexTable.end(); ++it) { + EntryTable entryTable = it.value().first; + DocumentList documentList = it.value().second; + + if (term.contains(QLatin1Char('*'))) + documents = setupDummyTerm(getWildcardTerms(term, entryTable), entryTable); + else if (entryTable.value(term)) + documents = entryTable.value(term)->documents; + else + continue; + + if (!documents.isEmpty()) { + DocumentInfo info; + QString title, url; + QVector documentsInfo; + foreach(const Document &doc, documents) { + info.docNumber = doc.docNumber; + info.frequency = doc.frequency; + info.documentUrl = documentList.at(doc.docNumber).at(1); + info.documentTitle = documentList.at(doc.docNumber).at(0); + documentsInfo.append(info); + } + + bool found = false; + for(QList::Iterator tit = termList.begin(); + tit != termList.end(); ++tit) { + TermInfo *t = &(*tit); + if(t->term == term) { + t->documents += documentsInfo; + t->frequency += documentsInfo.count(); + found = true; break; + } + } + if (!found) + termList.append(TermInfo(term, documentsInfo.count(), documentsInfo)); + } + } + } + qSort(termList); +} + +QVector Reader::hits() +{ + QVector documents; + if (!termList.count()) + return documents; + + documents = termList.takeFirst().documents; + for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { + TermInfo *t = &(*it); + QVector docs = t->documents; + for(QVector::Iterator minDoc_it = documents.begin(); + minDoc_it != documents.end(); ) { + bool found = false; + for (QVector::ConstIterator doc_it = docs.constBegin(); + doc_it != docs.constEnd(); ++doc_it ) { + if ( (*minDoc_it).docNumber == (*doc_it).docNumber ) { + (*minDoc_it).frequency += (*doc_it).frequency; + found = true; + break; + } + } + if (!found) + minDoc_it = documents.erase(minDoc_it); + else + ++minDoc_it; + } + } + + qSort(documents); + return documents; +} + +bool Reader::searchForPattern(const QStringList &patterns, const QStringList &words, + const QByteArray &data) +{ + if (data.isEmpty()) + return false; + + for(QHash::ConstIterator mit = + miniIndex.begin(); mit != miniIndex.end(); ++mit) { + delete mit.value(); + } + miniIndex.clear(); + + wordNum = 3; + QStringList::ConstIterator cIt = words.begin(); + for ( ; cIt != words.end(); ++cIt ) + miniIndex.insert(*cIt, new PosEntry(0)); + + QTextStream s(data); + QString text = s.readAll(); + bool valid = true; + const QChar *buf = text.unicode(); + QChar str[64]; + QChar c = buf[0]; + int j = 0; + int i = 0; + while ( j < text.length() ) { + if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { + valid = false; + if ( i > 1 ) + buildMiniIndex( QString(str,i) ); + i = 0; + c = buf[++j]; + continue; + } + if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { + valid = true; + c = buf[++j]; + continue; + } + if ( !valid ) { + c = buf[++j]; + continue; + } + if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { + str[i] = c.toLower(); + ++i; + } else { + if ( i > 1 ) + buildMiniIndex( QString(str,i) ); + i = 0; + } + c = buf[++j]; + } + if ( i > 1 ) + buildMiniIndex( QString(str,i) ); + + QStringList::ConstIterator patIt = patterns.begin(); + QStringList wordLst; + QList a, b; + QList::iterator aIt; + for ( ; patIt != patterns.end(); ++patIt ) { + wordLst = (*patIt).split(QLatin1Char(' ')); + a = miniIndex[ wordLst[0] ]->positions; + for ( int j = 1; j < (int)wordLst.count(); ++j ) { + b = miniIndex[ wordLst[j] ]->positions; + aIt = a.begin(); + while ( aIt != a.end() ) { + if ( b.contains( *aIt + 1 )) { + (*aIt)++; + ++aIt; + } else { + aIt = a.erase( aIt ); + } + } + } + } + if ( a.count() ) + return true; + return false; +} + +QVector Reader::setupDummyTerm(const QStringList &terms, + const EntryTable &entryTable) +{ + QList termList; + for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) { + if (entryTable.value(*it)) { + Entry *e = entryTable.value(*it); + termList.append(Term(*it, e->documents.count(), e->documents ) ); + } + } + QVector maxList(0); + if ( !termList.count() ) + return maxList; + qSort(termList); + + maxList = termList.takeLast().documents; + for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { + Term *t = &(*it); + QVector docs = t->documents; + for (QVector::iterator docIt = docs.begin(); docIt != docs.end(); ++docIt ) { + if ( maxList.indexOf( *docIt ) == -1 ) + maxList.append( *docIt ); + } + } + return maxList; +} + +QStringList Reader::getWildcardTerms(const QString &term, + const EntryTable &entryTable) +{ + QStringList lst; + QStringList terms = split(term); + QStringList::Iterator iter; + + for(EntryTable::ConstIterator it = entryTable.begin(); + it != entryTable.end(); ++it) { + int index = 0; + bool found = false; + QString text( it.key() ); + for ( iter = terms.begin(); iter != terms.end(); ++iter ) { + if ( *iter == QLatin1String("*") ) { + found = true; + continue; + } + if ( iter == terms.begin() && (*iter)[0] != text[0] ) { + found = false; + break; + } + index = text.indexOf( *iter, index ); + if ( *iter == terms.last() && index != (int)text.length()-1 ) { + index = text.lastIndexOf( *iter ); + if ( index != (int)text.length() - (int)(*iter).length() ) { + found = false; + break; + } + } + if ( index != -1 ) { + found = true; + index += (*iter).length(); + continue; + } else { + found = false; + break; + } + } + if (found) + lst << text; + } + + return lst; +} + +void Reader::buildMiniIndex(const QString &string) +{ + if (miniIndex[string]) + miniIndex[string]->positions.append(wordNum); + ++wordNum; +} + +void Reader::reset() +{ + for(IndexTable::Iterator it = indexTable.begin(); + it != indexTable.end(); ++it) { + cleanupIndex(it.value().first); + it.value().second.clear(); + } +} + +void Reader::cleanupIndex(EntryTable &entryTable) +{ + for(EntryTable::ConstIterator it = + entryTable.begin(); it != entryTable.end(); ++it) { + delete it.value(); + } + + entryTable.clear(); +} + + +QHelpSearchIndexReaderDefault::QHelpSearchIndexReaderDefault() + : QHelpSearchIndexReader() +{ + // nothing todo +} + +QHelpSearchIndexReaderDefault::~QHelpSearchIndexReaderDefault() +{ +} + +void QHelpSearchIndexReaderDefault::run() +{ + mutex.lock(); + + if (m_cancel) { + mutex.unlock(); + return; + } + + const QList &queryList = this->m_query; + const QLatin1String key("DefaultSearchNamespaces"); + const QString collectionFile(this->m_collectionFile); + const QString indexPath = m_indexFilesFolder; + + mutex.unlock(); + + QString queryTerm; + foreach (const QHelpSearchQuery &query, queryList) { + if (query.fieldName == QHelpSearchQuery::DEFAULT) { + queryTerm = query.wordList.at(0); + break; + } + } + + if (queryTerm.isEmpty()) + return; + + QHelpEngineCore engine(collectionFile, 0); + if (!engine.setupData()) + return; + + const QStringList registeredDocs = engine.registeredDocumentations(); + const QStringList indexedNamespaces = engine.customValue(key).toString(). + split(QLatin1String("|"), QString::SkipEmptyParts); + + emit searchingStarted(); + + // setup the reader + m_reader.setIndexPath(indexPath); + foreach(const QString &namespaceName, registeredDocs) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + searchingFinished(0); // TODO: check this ??? + return; + } + mutex.unlock(); + + const QList attributeSets = + engine.filterAttributeSets(namespaceName); + + foreach (const QStringList &attributes, attributeSets) { + // read all index files + m_reader.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); + if (!m_reader.readIndex()) { + qWarning("Full Text Search, could not read file for namespace: %s.", + namespaceName.toUtf8().constData()); + } + } + } + + // get the current filter attributes and minimize the index files table + m_reader.filterFilesForAttributes(engine.filterAttributes(engine.currentFilter())); + + hitList.clear(); + QStringList terms, termSeq, seqWords; + if (m_reader.initCheck() && // check if we could read anything + m_reader.splitSearchTerm(queryTerm, &terms, &termSeq, &seqWords) ) { + + // search for term(s) + m_reader.searchInIndex(terms); // TODO: should this be interruptible as well ??? + + QVector hits = m_reader.hits(); + if (!hits.isEmpty()) { + if (termSeq.isEmpty()) { + foreach (const DocumentInfo &docInfo, hits) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + searchingFinished(0); // TODO: check this, speed issue while locking??? + return; + } + mutex.unlock(); + hitList.append(qMakePair(docInfo.documentTitle, docInfo.documentUrl)); + } + } else { + foreach (const DocumentInfo &docInfo, hits) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + searchingFinished(0); // TODO: check this, speed issue while locking??? + return; + } + mutex.unlock(); + + if (m_reader.searchForPattern(termSeq, seqWords, engine.fileData(docInfo.documentUrl))) // TODO: should this be interruptible as well ??? + hitList.append(qMakePair(docInfo.documentTitle, docInfo.documentUrl)); + } + } + } + } + + emit searchingFinished(hitList.count()); +} + +} // namespace std +} // namespace fulltextsearch + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchindexreader_default_p.h b/src/assistant/help/qhelpsearchindexreader_default_p.h new file mode 100644 index 000000000..30dfe1ed6 --- /dev/null +++ b/src/assistant/help/qhelpsearchindexreader_default_p.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHINDEXREADERDEFAULT_H +#define QHELPSEARCHINDEXREADERDEFAULT_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelpsearchindex_default_p.h" +#include "qhelpsearchindexreader_p.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace std { + +class Reader +{ + typedef QList DocumentList; + typedef QHash EntryTable; + typedef QPair Index; + typedef QHash IndexTable; + +public: + Reader(); + ~Reader(); + + bool readIndex(); + bool initCheck() const; + void setIndexPath(const QString &path); + void filterFilesForAttributes(const QStringList &attributes); + void setIndexFile(const QString &namespaceName, const QString &attributes); + bool splitSearchTerm(const QString &searchTerm, QStringList *terms, + QStringList *termSeq, QStringList *seqWords); + + void searchInIndex(const QStringList &terms); + QVector hits(); + bool searchForPattern(const QStringList &patterns, + const QStringList &words, const QByteArray &data); + +private: + QVector setupDummyTerm(const QStringList &terms, const EntryTable &entryTable); + QStringList getWildcardTerms(const QString &term, const EntryTable &entryTable); + void buildMiniIndex(const QString &string); + void reset(); + void cleanupIndex(EntryTable &entryTable); + +private: + uint wordNum; + QString indexPath; + QString indexFile; + QString documentFile; + + IndexTable indexTable; + QList termList; + IndexTable searchIndexTable; + QHash miniIndex; +}; + + +class QHelpSearchIndexReaderDefault : public QHelpSearchIndexReader +{ + Q_OBJECT + +public: + QHelpSearchIndexReaderDefault(); + ~QHelpSearchIndexReaderDefault(); + +private: + void run(); + +private: + Reader m_reader; +}; + +} // namespace std +} // namespace fulltextsearch + +QT_END_NAMESPACE + +#endif // QHELPSEARCHINDEXREADERDEFAULT_H diff --git a/src/assistant/help/qhelpsearchindexreader_p.h b/src/assistant/help/qhelpsearchindexreader_p.h new file mode 100644 index 000000000..0d7518a6e --- /dev/null +++ b/src/assistant/help/qhelpsearchindexreader_p.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHINDEXREADER_H +#define QHELPSEARCHINDEXREADER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelpsearchengine.h" + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpEngineCore; + +namespace fulltextsearch { + +class QHelpSearchIndexReader : public QThread +{ + Q_OBJECT + +public: + QHelpSearchIndexReader(); + ~QHelpSearchIndexReader(); + + void cancelSearching(); + void search(const QString &collectionFile, + const QString &indexFilesFolder, + const QList &queryList); + int hitCount() const; + QList hits(int start, int end) const; + +signals: + void searchingStarted(); + void searchingFinished(int hits); + +protected: + mutable QMutex mutex; + QList hitList; + bool m_cancel; + QString m_collectionFile; + QList m_query; + QString m_indexFilesFolder; + +private: + virtual void run()=0; +}; + +} // namespace fulltextsearch + +QT_END_NAMESPACE + +#endif // QHELPSEARCHINDEXREADER_H diff --git a/src/assistant/help/qhelpsearchindexwriter_clucene.cpp b/src/assistant/help/qhelpsearchindexwriter_clucene.cpp new file mode 100644 index 000000000..287151338 --- /dev/null +++ b/src/assistant/help/qhelpsearchindexwriter_clucene.cpp @@ -0,0 +1,898 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qclucenefieldnames_p.h" +#include "qhelpenginecore.h" +#include "qhelp_global.h" +#include "private/qhits_p.h" +#include "private/qquery_p.h" +#include "private/qanalyzer_p.h" +#include "private/qdocument_p.h" +#include "private/qsearchable_p.h" +#include "private/qindexreader_p.h" +#include "private/qindexwriter_p.h" +#include "qhelpsearchindexwriter_clucene_p.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include "private/qfunctions_p.h" + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace clucene { + +// taken from qtexthtmlparser +static const struct QTextHtmlEntity +{ + const char *name; + quint16 code; +} entities[] = { + { "AElig", 0x00c6 }, + { "AMP", 38 }, + { "Aacute", 0x00c1 }, + { "Acirc", 0x00c2 }, + { "Agrave", 0x00c0 }, + { "Alpha", 0x0391 }, + { "Aring", 0x00c5 }, + { "Atilde", 0x00c3 }, + { "Auml", 0x00c4 }, + { "Beta", 0x0392 }, + { "Ccedil", 0x00c7 }, + { "Chi", 0x03a7 }, + { "Dagger", 0x2021 }, + { "Delta", 0x0394 }, + { "ETH", 0x00d0 }, + { "Eacute", 0x00c9 }, + { "Ecirc", 0x00ca }, + { "Egrave", 0x00c8 }, + { "Epsilon", 0x0395 }, + { "Eta", 0x0397 }, + { "Euml", 0x00cb }, + { "GT", 62 }, + { "Gamma", 0x0393 }, + { "Iacute", 0x00cd }, + { "Icirc", 0x00ce }, + { "Igrave", 0x00cc }, + { "Iota", 0x0399 }, + { "Iuml", 0x00cf }, + { "Kappa", 0x039a }, + { "LT", 60 }, + { "Lambda", 0x039b }, + { "Mu", 0x039c }, + { "Ntilde", 0x00d1 }, + { "Nu", 0x039d }, + { "OElig", 0x0152 }, + { "Oacute", 0x00d3 }, + { "Ocirc", 0x00d4 }, + { "Ograve", 0x00d2 }, + { "Omega", 0x03a9 }, + { "Omicron", 0x039f }, + { "Oslash", 0x00d8 }, + { "Otilde", 0x00d5 }, + { "Ouml", 0x00d6 }, + { "Phi", 0x03a6 }, + { "Pi", 0x03a0 }, + { "Prime", 0x2033 }, + { "Psi", 0x03a8 }, + { "QUOT", 34 }, + { "Rho", 0x03a1 }, + { "Scaron", 0x0160 }, + { "Sigma", 0x03a3 }, + { "THORN", 0x00de }, + { "Tau", 0x03a4 }, + { "Theta", 0x0398 }, + { "Uacute", 0x00da }, + { "Ucirc", 0x00db }, + { "Ugrave", 0x00d9 }, + { "Upsilon", 0x03a5 }, + { "Uuml", 0x00dc }, + { "Xi", 0x039e }, + { "Yacute", 0x00dd }, + { "Yuml", 0x0178 }, + { "Zeta", 0x0396 }, + { "aacute", 0x00e1 }, + { "acirc", 0x00e2 }, + { "acute", 0x00b4 }, + { "aelig", 0x00e6 }, + { "agrave", 0x00e0 }, + { "alefsym", 0x2135 }, + { "alpha", 0x03b1 }, + { "amp", 38 }, + { "and", 0x22a5 }, + { "ang", 0x2220 }, + { "apos", 0x0027 }, + { "aring", 0x00e5 }, + { "asymp", 0x2248 }, + { "atilde", 0x00e3 }, + { "auml", 0x00e4 }, + { "bdquo", 0x201e }, + { "beta", 0x03b2 }, + { "brvbar", 0x00a6 }, + { "bull", 0x2022 }, + { "cap", 0x2229 }, + { "ccedil", 0x00e7 }, + { "cedil", 0x00b8 }, + { "cent", 0x00a2 }, + { "chi", 0x03c7 }, + { "circ", 0x02c6 }, + { "clubs", 0x2663 }, + { "cong", 0x2245 }, + { "copy", 0x00a9 }, + { "crarr", 0x21b5 }, + { "cup", 0x222a }, + { "curren", 0x00a4 }, + { "dArr", 0x21d3 }, + { "dagger", 0x2020 }, + { "darr", 0x2193 }, + { "deg", 0x00b0 }, + { "delta", 0x03b4 }, + { "diams", 0x2666 }, + { "divide", 0x00f7 }, + { "eacute", 0x00e9 }, + { "ecirc", 0x00ea }, + { "egrave", 0x00e8 }, + { "empty", 0x2205 }, + { "emsp", 0x2003 }, + { "ensp", 0x2002 }, + { "epsilon", 0x03b5 }, + { "equiv", 0x2261 }, + { "eta", 0x03b7 }, + { "eth", 0x00f0 }, + { "euml", 0x00eb }, + { "euro", 0x20ac }, + { "exist", 0x2203 }, + { "fnof", 0x0192 }, + { "forall", 0x2200 }, + { "frac12", 0x00bd }, + { "frac14", 0x00bc }, + { "frac34", 0x00be }, + { "frasl", 0x2044 }, + { "gamma", 0x03b3 }, + { "ge", 0x2265 }, + { "gt", 62 }, + { "hArr", 0x21d4 }, + { "harr", 0x2194 }, + { "hearts", 0x2665 }, + { "hellip", 0x2026 }, + { "iacute", 0x00ed }, + { "icirc", 0x00ee }, + { "iexcl", 0x00a1 }, + { "igrave", 0x00ec }, + { "image", 0x2111 }, + { "infin", 0x221e }, + { "int", 0x222b }, + { "iota", 0x03b9 }, + { "iquest", 0x00bf }, + { "isin", 0x2208 }, + { "iuml", 0x00ef }, + { "kappa", 0x03ba }, + { "lArr", 0x21d0 }, + { "lambda", 0x03bb }, + { "lang", 0x2329 }, + { "laquo", 0x00ab }, + { "larr", 0x2190 }, + { "lceil", 0x2308 }, + { "ldquo", 0x201c }, + { "le", 0x2264 }, + { "lfloor", 0x230a }, + { "lowast", 0x2217 }, + { "loz", 0x25ca }, + { "lrm", 0x200e }, + { "lsaquo", 0x2039 }, + { "lsquo", 0x2018 }, + { "lt", 60 }, + { "macr", 0x00af }, + { "mdash", 0x2014 }, + { "micro", 0x00b5 }, + { "middot", 0x00b7 }, + { "minus", 0x2212 }, + { "mu", 0x03bc }, + { "nabla", 0x2207 }, + { "nbsp", 0x00a0 }, + { "ndash", 0x2013 }, + { "ne", 0x2260 }, + { "ni", 0x220b }, + { "not", 0x00ac }, + { "notin", 0x2209 }, + { "nsub", 0x2284 }, + { "ntilde", 0x00f1 }, + { "nu", 0x03bd }, + { "oacute", 0x00f3 }, + { "ocirc", 0x00f4 }, + { "oelig", 0x0153 }, + { "ograve", 0x00f2 }, + { "oline", 0x203e }, + { "omega", 0x03c9 }, + { "omicron", 0x03bf }, + { "oplus", 0x2295 }, + { "or", 0x22a6 }, + { "ordf", 0x00aa }, + { "ordm", 0x00ba }, + { "oslash", 0x00f8 }, + { "otilde", 0x00f5 }, + { "otimes", 0x2297 }, + { "ouml", 0x00f6 }, + { "para", 0x00b6 }, + { "part", 0x2202 }, + { "percnt", 0x0025 }, + { "permil", 0x2030 }, + { "perp", 0x22a5 }, + { "phi", 0x03c6 }, + { "pi", 0x03c0 }, + { "piv", 0x03d6 }, + { "plusmn", 0x00b1 }, + { "pound", 0x00a3 }, + { "prime", 0x2032 }, + { "prod", 0x220f }, + { "prop", 0x221d }, + { "psi", 0x03c8 }, + { "quot", 34 }, + { "rArr", 0x21d2 }, + { "radic", 0x221a }, + { "rang", 0x232a }, + { "raquo", 0x00bb }, + { "rarr", 0x2192 }, + { "rceil", 0x2309 }, + { "rdquo", 0x201d }, + { "real", 0x211c }, + { "reg", 0x00ae }, + { "rfloor", 0x230b }, + { "rho", 0x03c1 }, + { "rlm", 0x200f }, + { "rsaquo", 0x203a }, + { "rsquo", 0x2019 }, + { "sbquo", 0x201a }, + { "scaron", 0x0161 }, + { "sdot", 0x22c5 }, + { "sect", 0x00a7 }, + { "shy", 0x00ad }, + { "sigma", 0x03c3 }, + { "sigmaf", 0x03c2 }, + { "sim", 0x223c }, + { "spades", 0x2660 }, + { "sub", 0x2282 }, + { "sube", 0x2286 }, + { "sum", 0x2211 }, + { "sup", 0x2283 }, + { "sup1", 0x00b9 }, + { "sup2", 0x00b2 }, + { "sup3", 0x00b3 }, + { "supe", 0x2287 }, + { "szlig", 0x00df }, + { "tau", 0x03c4 }, + { "there4", 0x2234 }, + { "theta", 0x03b8 }, + { "thetasym", 0x03d1 }, + { "thinsp", 0x2009 }, + { "thorn", 0x00fe }, + { "tilde", 0x02dc }, + { "times", 0x00d7 }, + { "trade", 0x2122 }, + { "uArr", 0x21d1 }, + { "uacute", 0x00fa }, + { "uarr", 0x2191 }, + { "ucirc", 0x00fb }, + { "ugrave", 0x00f9 }, + { "uml", 0x00a8 }, + { "upsih", 0x03d2 }, + { "upsilon", 0x03c5 }, + { "uuml", 0x00fc }, + { "weierp", 0x2118 }, + { "xi", 0x03be }, + { "yacute", 0x00fd }, + { "yen", 0x00a5 }, + { "yuml", 0x00ff }, + { "zeta", 0x03b6 }, + { "zwj", 0x200d }, + { "zwnj", 0x200c } +}; + +Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &entityStr, const QTextHtmlEntity &entity) +{ + return entityStr < QLatin1String(entity.name); +} + +Q_STATIC_GLOBAL_OPERATOR bool operator<(const QTextHtmlEntity &entity, const QString &entityStr) +{ + return QLatin1String(entity.name) < entityStr; +} + +static QChar resolveEntity(const QString &entity) +{ + const QTextHtmlEntity *start = &entities[0]; + const QTextHtmlEntity *end = &entities[(sizeof(entities) / sizeof(entities[0]))]; + const QTextHtmlEntity *e = qBinaryFind(start, end, entity); + if (e == end) + return QChar(); + return e->code; +} + +static const uint latin1Extended[0xA0 - 0x80] = { + 0x20ac, // 0x80 + 0x0081, // 0x81 direct mapping + 0x201a, // 0x82 + 0x0192, // 0x83 + 0x201e, // 0x84 + 0x2026, // 0x85 + 0x2020, // 0x86 + 0x2021, // 0x87 + 0x02C6, // 0x88 + 0x2030, // 0x89 + 0x0160, // 0x8A + 0x2039, // 0x8B + 0x0152, // 0x8C + 0x008D, // 0x8D direct mapping + 0x017D, // 0x8E + 0x008F, // 0x8F directmapping + 0x0090, // 0x90 directmapping + 0x2018, // 0x91 + 0x2019, // 0x92 + 0x201C, // 0x93 + 0X201D, // 0x94 + 0x2022, // 0x95 + 0x2013, // 0x96 + 0x2014, // 0x97 + 0x02DC, // 0x98 + 0x2122, // 0x99 + 0x0161, // 0x9A + 0x203A, // 0x9B + 0x0153, // 0x9C + 0x009D, // 0x9D direct mapping + 0x017E, // 0x9E + 0x0178 // 0x9F +}; +// end taken from qtexthtmlparser + +class DocumentHelper +{ +public: + DocumentHelper(const QString &fileName, const QByteArray &data) + : fileName(fileName) , data(readData(data)) {} + ~DocumentHelper() {} + + bool addFieldsToDocument(QCLuceneDocument *document, + const QString &namespaceName, const QString &attributes = QString()) + { + if (!document) + return false; + + if(!data.isEmpty()) { + QString parsedData = parseData(); + QString parsedTitle = QHelpGlobal::documentTitle(data); + + if(!parsedData.isEmpty()) { + document->add(new QCLuceneField(ContentField, + parsedData,QCLuceneField::INDEX_TOKENIZED)); + document->add(new QCLuceneField(PathField, fileName, + QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); + document->add(new QCLuceneField(TitleField, parsedTitle, + QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); + document->add(new QCLuceneField(TitleTokenizedField, parsedTitle, + QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); + document->add(new QCLuceneField(NamespaceField, namespaceName, + QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); + document->add(new QCLuceneField(AttributeField, attributes, + QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); + return true; + } + } + + return false; + } + +private: + QString readData(const QByteArray &data) + { + QTextStream textStream(data); + const QByteArray &codec = QHelpGlobal::codecFromData(data).toLatin1(); + textStream.setCodec(QTextCodec::codecForName(codec.constData())); + + QString stream = textStream.readAll(); + if (stream.isNull() || stream.isEmpty()) + return QString(); + + return stream; + } + + QString parseData() const + { + const int length = data.length(); + const QChar *buf = data.unicode(); + + QString parsedContent; + parsedContent.reserve(length); + + bool valid = true; + int j = 0, count = 0; + + QChar c; + while (j < length) { + c = buf[j++]; + if (c == QLatin1Char('<') || c == QLatin1Char('&')) { + if (count > 1 && c != QLatin1Char('&')) + parsedContent.append(QLatin1Char(' ')); + else if (c == QLatin1Char('&')) { + // Note: this will modify the counter j, in case we sucessful parsed the entity + // we will have modified the counter to stay 1 before the closing ';', so + // the following if condition will be met with if (c == QLatin1Char(';')) + parsedContent.append(parseEntity(length, buf, j)); + } + + count = 0; + valid = false; + continue; + } + if ((c == QLatin1Char('>') || c == QLatin1Char(';')) && !valid) { + valid = true; + continue; + } + if (!valid) + continue; + + if (c.isLetterOrNumber() || c.isPrint()) { + ++count; + parsedContent.append(c.toLower()); + } else { + if (count > 1) + parsedContent.append(QLatin1Char(' ')); + count = 0; + } + } + + return parsedContent; + } + + // taken from qtexthtmlparser + // parses an entity after "&", and returns it + QString parseEntity(int len, const QChar *buf, int &pos) const + { + int recover = pos; + QString entity; + while (pos < len) { + QChar c = buf[pos++]; + if (c.isSpace() || pos - recover > 9) { + goto error; + } + if (c == QLatin1Char(';')) { + pos--; + break; + } + entity += c; + } + { + QChar resolved = resolveEntity(entity); + if (!resolved.isNull()) + return QString(resolved); + } + if (entity.length() > 1 && entity.at(0) == QLatin1Char('#')) { + entity.remove(0, 1); // removing leading # + + int base = 10; + bool ok = false; + + if (entity.at(0).toLower() == QLatin1Char('x')) { // hex entity? + entity.remove(0, 1); + base = 16; + } + + uint uc = entity.toUInt(&ok, base); + if (ok) { + if (uc >= 0x80 && uc < 0x80 + (sizeof(latin1Extended) / sizeof(latin1Extended[0]))) + uc = latin1Extended[uc - 0x80]; // windows latin 1 extended + QString str; + if (uc > 0xffff) { + // surrogate pair + uc -= 0x10000; + ushort high = uc/0x400 + 0xd800; + ushort low = uc%0x400 + 0xdc00; + str.append(QChar(high)); + str.append(QChar(low)); + } else { + str.append(QChar(uc)); + } + return str; + } + } + error: + pos = recover; + return QLatin1String(" "); + } + // end taken from qtexthtmlparser + +private: + QString fileName; + QString data; +}; + + +QHelpSearchIndexWriter::QHelpSearchIndexWriter() + : QThread(0) + , m_cancel(false) +{ + // nothing todo +} + +QHelpSearchIndexWriter::~QHelpSearchIndexWriter() +{ + mutex.lock(); + this->m_cancel = true; + waitCondition.wakeOne(); + mutex.unlock(); + + wait(); +} + +void QHelpSearchIndexWriter::cancelIndexing() +{ + mutex.lock(); + this->m_cancel = true; + mutex.unlock(); +} + +void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, + const QString &indexFilesFolder, bool reindex) +{ + wait(); + mutex.lock(); + this->m_cancel = false; + this->m_reindex = reindex; + this->m_collectionFile = collectionFile; + this->m_indexFilesFolder = indexFilesFolder; + mutex.unlock(); + + start(QThread::LowestPriority); +} + +void QHelpSearchIndexWriter::optimizeIndex() +{ +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) { + if (QCLuceneIndexReader::isLocked(m_indexFilesFolder)) + return; + + QCLuceneStandardAnalyzer analyzer; + QCLuceneIndexWriter writer(m_indexFilesFolder, analyzer, false); + writer.optimize(); + writer.close(); + } +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not optimize index."); + return; + } +#endif +} + +void QHelpSearchIndexWriter::run() +{ +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + QMutexLocker mutexLocker(&mutex); + + if (m_cancel) + return; + + const bool reindex = this->m_reindex; + const QString collectionFile(this->m_collectionFile); + + mutexLocker.unlock(); + + QHelpEngineCore engine(collectionFile, 0); + if (!engine.setupData()) + return; + + const QLatin1String key("CluceneIndexedNamespaces"); + if (reindex) + engine.setCustomValue(key, QLatin1String("")); + + QMap indexMap; + const QLatin1String oldKey("CluceneSearchNamespaces"); + if (!engine.customValue(oldKey, QString()).isNull()) { + // old style qhc file < 4.4.2, need to convert... + const QStringList indexedNamespaces + = engine.customValue(oldKey).toString() + .split(QLatin1String("|"), QString::SkipEmptyParts); + foreach (const QString &nameSpace, indexedNamespaces) + indexMap.insert(nameSpace, QDateTime()); + engine.removeCustomValue(oldKey); + } else { + QDataStream dataStream(engine.customValue(key).toByteArray()); + dataStream >> indexMap; + } + + QString indexPath = m_indexFilesFolder; + + QFileInfo fInfo(indexPath); + if (fInfo.exists() && !fInfo.isWritable()) { + qWarning("Full Text Search, could not create index (missing permissions for '%s').", + qPrintable(indexPath)); + return; + } + + emit indexingStarted(); + + QCLuceneIndexWriter *writer = 0; + QCLuceneStandardAnalyzer analyzer; + const QStringList registeredDocs = engine.registeredDocumentations(); + + QLocalSocket localSocket; + localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) + .arg(QLatin1String(QT_VERSION_STR))); + + QLocalServer localServer; + bool otherInstancesRunning = true; + if (!localSocket.waitForConnected()) { + otherInstancesRunning = false; + localServer.listen(QString(QLatin1String("QtAssistant%1")) + .arg(QLatin1String(QT_VERSION_STR))); + } + + // check if it's locked, and if the other instance is running + if (!otherInstancesRunning && QCLuceneIndexReader::isLocked(indexPath)) + QCLuceneIndexReader::unlock(indexPath); + + if (QCLuceneIndexReader::isLocked(indexPath)) { + // poll unless indexing finished to fake progress + while (QCLuceneIndexReader::isLocked(indexPath)) { + mutexLocker.relock(); + if (m_cancel) + break; + mutexLocker.unlock(); + this->sleep(1); + } + emit indexingFinished(); + return; + } + + if (QCLuceneIndexReader::indexExists(indexPath) && !reindex) { + foreach(const QString &namespaceName, registeredDocs) { + mutexLocker.relock(); + if (m_cancel) { + emit indexingFinished(); + return; + } + mutexLocker.unlock(); + + if (!indexMap.contains(namespaceName)) { + // make sure we remove some partly indexed stuff + removeDocuments(indexPath, namespaceName); + } else { + QString path = engine.documentationFileName(namespaceName); + if (indexMap.value(namespaceName) + < QFileInfo(path).lastModified()) { + // make sure we remove some outdated indexed stuff + indexMap.remove(namespaceName); + removeDocuments(indexPath, namespaceName); + } + + if (indexMap.contains(namespaceName)) { + // make sure we really have content indexed for namespace + QCLuceneTermQuery query(QCLuceneTerm(NamespaceField, namespaceName)); + QCLuceneIndexSearcher indexSearcher(indexPath); + QCLuceneHits hits = indexSearcher.search(query); + if (hits.length() <= 0) + indexMap.remove(namespaceName); + } + } + } + writer = new QCLuceneIndexWriter(indexPath, analyzer, false); + } else { + indexMap.clear(); + writer = new QCLuceneIndexWriter(indexPath, analyzer, true); + } + + writer->setMergeFactor(100); + writer->setMinMergeDocs(1000); + writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); + + QStringList namespaces; + foreach(const QString &namespaceName, registeredDocs) { + mutexLocker.relock(); + if (m_cancel) { + closeIndexWriter(writer); + emit indexingFinished(); + return; + } + mutexLocker.unlock(); + + namespaces.append(namespaceName); + if (indexMap.contains(namespaceName)) + continue; + + const QList attributeSets = + engine.filterAttributeSets(namespaceName); + + if (attributeSets.isEmpty()) { + const QList docFiles = indexableFiles(&engine, namespaceName, + QStringList()); + if (!addDocuments(docFiles, engine, QStringList(), namespaceName, + writer, analyzer)) + break; + } else { + bool bail = false; + foreach (const QStringList &attributes, attributeSets) { + const QList docFiles = indexableFiles(&engine, + namespaceName, attributes); + if (!addDocuments(docFiles, engine, attributes, namespaceName, + writer, analyzer)) { + bail = true; + break; + } + } + if (bail) + break; + } + + mutexLocker.relock(); + if (!m_cancel) { + QString path(engine.documentationFileName(namespaceName)); + indexMap.insert(namespaceName, QFileInfo(path).lastModified()); + writeIndexMap(engine, indexMap); + } + mutexLocker.unlock(); + } + + closeIndexWriter(writer); + + mutexLocker.relock(); + if (!m_cancel) { + mutexLocker.unlock(); + + QStringList indexedNamespaces = indexMap.keys(); + foreach(const QString &namespaceName, indexedNamespaces) { + mutexLocker.relock(); + if (m_cancel) + break; + mutexLocker.unlock(); + + if (!namespaces.contains(namespaceName)) { + indexMap.remove(namespaceName); + writeIndexMap(engine, indexMap); + removeDocuments(indexPath, namespaceName); + } + } + } + +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("%s: Failed because of CLucene exception.", Q_FUNC_INFO); + } +#endif + + emit indexingFinished(); +} + +bool QHelpSearchIndexWriter::addDocuments(const QList docFiles, + const QHelpEngineCore &engine, const QStringList &attributes, + const QString &namespaceName, QCLuceneIndexWriter *writer, + QCLuceneAnalyzer &analyzer) +{ + QMutexLocker locker(&mutex); + const QString attrList = attributes.join(QLatin1String(" ")); + + locker.unlock(); + foreach(const QUrl &url, docFiles) { + QCLuceneDocument document; + DocumentHelper helper(url.toString(), engine.fileData(url)); + if (helper.addFieldsToDocument(&document, namespaceName, attrList)) { +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + writer->addDocument(document, analyzer); +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not properly add documents."); + return false; + } +#endif + } + locker.relock(); + if (m_cancel) + return false; + locker.unlock(); + } + return true; +} + +void QHelpSearchIndexWriter::removeDocuments(const QString &indexPath, + const QString &namespaceName) +{ + if (namespaceName.isEmpty() || QCLuceneIndexReader::isLocked(indexPath)) + return; + + QCLuceneIndexReader reader = QCLuceneIndexReader::open(indexPath); + reader.deleteDocuments(QCLuceneTerm(NamespaceField, namespaceName)); + + reader.close(); +} + +bool QHelpSearchIndexWriter::writeIndexMap(QHelpEngineCore &engine, + const QMap &indexMap) +{ + QByteArray bArray; + + QDataStream data(&bArray, QIODevice::ReadWrite); + data << indexMap; + + return engine.setCustomValue(QLatin1String("CluceneIndexedNamespaces"), + bArray); +} + +QList QHelpSearchIndexWriter::indexableFiles(QHelpEngineCore *helpEngine, + const QString &namespaceName, const QStringList &attributes) const +{ + QList docFiles = helpEngine->files(namespaceName, attributes, + QLatin1String("html")); + docFiles += helpEngine->files(namespaceName, attributes, QLatin1String("htm")); + docFiles += helpEngine->files(namespaceName, attributes, QLatin1String("txt")); + + return docFiles; +} + +void QHelpSearchIndexWriter::closeIndexWriter(QCLuceneIndexWriter *writer) +{ +#if !defined(QT_NO_EXCEPTIONS) + try { +#endif + writer->close(); + delete writer; +#if !defined(QT_NO_EXCEPTIONS) + } catch (...) { + qWarning("Full Text Search, could not properly close index writer."); + } +#endif +} + +} // namespace clucene +} // namespace fulltextsearch + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchindexwriter_clucene_p.h b/src/assistant/help/qhelpsearchindexwriter_clucene_p.h new file mode 100644 index 000000000..7c9a91468 --- /dev/null +++ b/src/assistant/help/qhelpsearchindexwriter_clucene_p.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHINDEXWRITERCLUCENE_H +#define QHELPSEARCHINDEXWRITERCLUCENE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelpenginecore.h" +#include "private/qanalyzer_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QCLuceneIndexWriter; + +namespace fulltextsearch { +namespace clucene { + +class QHelpSearchIndexWriter : public QThread +{ + Q_OBJECT + +public: + QHelpSearchIndexWriter(); + ~QHelpSearchIndexWriter(); + + void cancelIndexing(); + void updateIndex(const QString &collectionFile, + const QString &indexFilesFolder, bool reindex); + void optimizeIndex(); + +signals: + void indexingStarted(); + void indexingFinished(); + +private: + void run(); + + bool addDocuments(const QList docFiles, const QHelpEngineCore &engine, + const QStringList &attributes, const QString &namespaceName, + QCLuceneIndexWriter *writer, QCLuceneAnalyzer &analyzer); + void removeDocuments(const QString &indexPath, const QString &namespaceName); + + bool writeIndexMap(QHelpEngineCore& engine, + const QMap& indexMap); + + QList indexableFiles(QHelpEngineCore *helpEngine, + const QString &namespaceName, const QStringList &attributes) const; + + void closeIndexWriter(QCLuceneIndexWriter *writer); + +private: + QMutex mutex; + QWaitCondition waitCondition; + + bool m_cancel; + bool m_reindex; + QString m_collectionFile; + QString m_indexFilesFolder; +}; + +} // namespace clucene +} // namespace fulltextsearch + + +QT_END_NAMESPACE + +#endif // QHELPSEARCHINDEXWRITERCLUCENE_H diff --git a/src/assistant/help/qhelpsearchindexwriter_default.cpp b/src/assistant/help/qhelpsearchindexwriter_default.cpp new file mode 100644 index 000000000..db7f6ba0d --- /dev/null +++ b/src/assistant/help/qhelpsearchindexwriter_default.cpp @@ -0,0 +1,384 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpsearchindexwriter_default_p.h" +#include "qhelp_global.h" +#include "qhelpenginecore.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace std { + +Writer::Writer(const QString &path) + : indexPath(path) + , indexFile(QString()) + , documentFile(QString()) +{ + // nothing todo +} + +Writer::~Writer() +{ + reset(); +} + +void Writer::reset() +{ + for(QHash::ConstIterator it = + index.begin(); it != index.end(); ++it) { + delete it.value(); + } + + index.clear(); + documentList.clear(); +} + +bool Writer::writeIndex() const +{ + bool status; + QFile idxFile(indexFile); + if (!(status = idxFile.open(QFile::WriteOnly))) + return status; + + QDataStream indexStream(&idxFile); + for(QHash::ConstIterator it = + index.begin(); it != index.end(); ++it) { + indexStream << it.key(); + indexStream << it.value()->documents.count(); + indexStream << it.value()->documents; + } + idxFile.close(); + + QFile docFile(documentFile); + if (!(status = docFile.open(QFile::WriteOnly))) + return status; + + QDataStream docStream(&docFile); + foreach(const QStringList &list, documentList) { + docStream << list.at(0); + docStream << list.at(1); + } + docFile.close(); + + return status; +} + +void Writer::removeIndex() const +{ + QFile idxFile(indexFile); + if (idxFile.exists()) + idxFile.remove(); + + QFile docFile(documentFile); + if (docFile.exists()) + docFile.remove(); +} + +void Writer::setIndexFile(const QString &namespaceName, const QString &attributes) +{ + QString extension = namespaceName + QLatin1String("@") + attributes; + indexFile = indexPath + QLatin1String("/indexdb40.") + extension; + documentFile = indexPath + QLatin1String("/indexdoc40.") + extension; +} + +void Writer::insertInIndex(const QString &string, int docNum) +{ + if (string == QLatin1String("amp") || string == QLatin1String("nbsp")) + return; + + Entry *entry = 0; + if (index.count()) + entry = index[string]; + + if (entry) { + if (entry->documents.last().docNumber != docNum) + entry->documents.append(Document(docNum, 1)); + else + entry->documents.last().frequency++; + } else { + index.insert(string, new Entry(docNum)); + } +} + +void Writer::insertInDocumentList(const QString &title, const QString &url) +{ + documentList.append(QStringList(title) << url); +} + + +QHelpSearchIndexWriter::QHelpSearchIndexWriter() + : QThread() + , m_cancel(false) +{ + // nothing todo +} + +QHelpSearchIndexWriter::~QHelpSearchIndexWriter() +{ + mutex.lock(); + this->m_cancel = true; + waitCondition.wakeOne(); + mutex.unlock(); + + wait(); +} + +void QHelpSearchIndexWriter::cancelIndexing() +{ + mutex.lock(); + this->m_cancel = true; + mutex.unlock(); +} + +void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, + const QString &indexFilesFolder, + bool reindex) +{ + wait(); + QMutexLocker lock(&mutex); + + this->m_cancel = false; + this->m_reindex = reindex; + this->m_collectionFile = collectionFile; + this->m_indexFilesFolder = indexFilesFolder; + + start(QThread::LowestPriority); +} + +void QHelpSearchIndexWriter::run() +{ + mutex.lock(); + + if (m_cancel) { + mutex.unlock(); + return; + } + + const bool reindex(this->m_reindex); + const QLatin1String key("DefaultSearchNamespaces"); + const QString collectionFile(this->m_collectionFile); + const QString indexPath = m_indexFilesFolder; + + mutex.unlock(); + + QHelpEngineCore engine(collectionFile, 0); + if (!engine.setupData()) + return; + + if (reindex) + engine.setCustomValue(key, QLatin1String("")); + + const QStringList registeredDocs = engine.registeredDocumentations(); + const QStringList indexedNamespaces = engine.customValue(key).toString(). + split(QLatin1String("|"), QString::SkipEmptyParts); + + emit indexingStarted(); + + QStringList namespaces; + Writer writer(indexPath); + foreach(const QString &namespaceName, registeredDocs) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + return; + } + mutex.unlock(); + + // if indexed, continue + namespaces.append(namespaceName); + if (indexedNamespaces.contains(namespaceName)) + continue; + + const QList attributeSets = + engine.filterAttributeSets(namespaceName); + + foreach (const QStringList &attributes, attributeSets) { + // cleanup maybe old or unfinished files + writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); + writer.removeIndex(); + + QSet documentsSet; + const QList docFiles = engine.files(namespaceName, attributes); + foreach(QUrl url, docFiles) { + if (m_cancel) + return; + + // get rid of duplicated files + if (url.hasFragment()) + url.setFragment(QString()); + + QString s = url.toString(); + if (s.endsWith(QLatin1String(".html")) + || s.endsWith(QLatin1String(".htm")) + || s.endsWith(QLatin1String(".txt"))) + documentsSet.insert(s); + } + + int docNum = 0; + const QStringList documentsList(documentsSet.toList()); + foreach(const QString &url, documentsList) { + if (m_cancel) + return; + + QByteArray data(engine.fileData(url)); + if (data.isEmpty()) + continue; + + QTextStream s(data); + QString en = QHelpGlobal::codecFromData(data); + s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); + + QString text = s.readAll(); + if (text.isNull()) + continue; + + QString title = QHelpGlobal::documentTitle(text); + + int j = 0; + int i = 0; + bool valid = true; + const QChar *buf = text.unicode(); + QChar str[64]; + QChar c = buf[0]; + + while ( j < text.length() ) { + if (m_cancel) + return; + + if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { + valid = false; + if ( i > 1 ) + writer.insertInIndex(QString(str,i), docNum); + i = 0; + c = buf[++j]; + continue; + } + if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { + valid = true; + c = buf[++j]; + continue; + } + if ( !valid ) { + c = buf[++j]; + continue; + } + if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { + str[i] = c.toLower(); + ++i; + } else { + if ( i > 1 ) + writer.insertInIndex(QString(str,i), docNum); + i = 0; + } + c = buf[++j]; + } + if ( i > 1 ) + writer.insertInIndex(QString(str,i), docNum); + + docNum++; + writer.insertInDocumentList(title, url); + } + + if (writer.writeIndex()) { + engine.setCustomValue(key, addNamespace( + engine.customValue(key).toString(), namespaceName)); + } + + writer.reset(); + } + } + + QStringListIterator qsli(indexedNamespaces); + while (qsli.hasNext()) { + const QString namespaceName = qsli.next(); + if (namespaces.contains(namespaceName)) + continue; + + const QList attributeSets = + engine.filterAttributeSets(namespaceName); + + foreach (const QStringList &attributes, attributeSets) { + writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); + writer.removeIndex(); + } + + engine.setCustomValue(key, removeNamespace( + engine.customValue(key).toString(), namespaceName)); + } + + emit indexingFinished(); +} + +QString QHelpSearchIndexWriter::addNamespace(const QString namespaces, + const QString &namespaceName) +{ + QString value = namespaces; + if (!value.contains(namespaceName)) + value.append(namespaceName).append(QLatin1String("|")); + + return value; +} + +QString QHelpSearchIndexWriter::removeNamespace(const QString namespaces, + const QString &namespaceName) +{ + QString value = namespaces; + if (value.contains(namespaceName)) + value.remove(namespaceName + QLatin1String("|")); + + return value; +} + +} // namespace std +} // namespace fulltextsearch + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchindexwriter_default_p.h b/src/assistant/help/qhelpsearchindexwriter_default_p.h new file mode 100644 index 000000000..d510fbc9d --- /dev/null +++ b/src/assistant/help/qhelpsearchindexwriter_default_p.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHINDEXWRITERDEFAULT_H +#define QHELPSEARCHINDEXWRITERDEFAULT_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the help generator tools. This header file may change from version +// to version without notice, or even be removed. +// +// We mean it. +// + +#include "qhelpsearchindex_default_p.h" + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace fulltextsearch { +namespace std { + +class Writer +{ +public: + Writer(const QString &path); + ~Writer(); + + void reset(); + bool writeIndex() const; + void removeIndex() const; + void setIndexFile(const QString &namespaceName, const QString &attributes); + void insertInIndex(const QString &string, int docNum); + void insertInDocumentList(const QString &title, const QString &url); + +private: + QString indexPath; + QString indexFile; + QString documentFile; + + QHash index; + QList documentList; +}; + + +class QHelpSearchIndexWriter : public QThread +{ + Q_OBJECT + +public: + QHelpSearchIndexWriter(); + ~QHelpSearchIndexWriter(); + + void cancelIndexing(); + void updateIndex(const QString &collectionFile, + const QString &indexFilesFolder, bool reindex); + +signals: + void indexingStarted(); + void indexingFinished(); + +private: + void run(); + QString addNamespace(const QString namespaces, const QString &namespaceName); + QString removeNamespace(const QString namespaces, const QString &namespaceName); + +private: + QMutex mutex; + QWaitCondition waitCondition; + + bool m_cancel; + bool m_reindex; + QString m_collectionFile; + QString m_indexFilesFolder; +}; + +} // namespace std +} // namespace fulltextsearch + +QT_END_NAMESPACE + +#endif // QHELPSEARCHINDEXWRITERDEFAULT_H diff --git a/src/assistant/help/qhelpsearchquerywidget.cpp b/src/assistant/help/qhelpsearchquerywidget.cpp new file mode 100644 index 000000000..55974ada5 --- /dev/null +++ b/src/assistant/help/qhelpsearchquerywidget.cpp @@ -0,0 +1,587 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpsearchquerywidget.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpSearchQueryWidgetPrivate : public QObject +{ + Q_OBJECT + +private: + struct QueryHistory { + explicit QueryHistory() : curQuery(-1) {} + QList > queries; + int curQuery; + }; + + class CompleterModel : public QAbstractListModel + { + public: + explicit CompleterModel(QObject *parent) + : QAbstractListModel(parent) {} + + int rowCount(const QModelIndex &parent = QModelIndex()) const + { + return parent.isValid() ? 0 : termList.size(); + } + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const + { + if (!index.isValid() || index.row() >= termList.count()|| + (role != Qt::EditRole && role != Qt::DisplayRole)) + return QVariant(); + return termList.at(index.row()); + } + + void addTerm(const QString &term) + { + if (!termList.contains(term)) { + termList.append(term); + reset(); + } + } + + private: + QStringList termList; + }; + + QHelpSearchQueryWidgetPrivate() + : QObject() + , simpleSearch(true) + , searchCompleter(new CompleterModel(this), this) + { + searchButton = 0; + advancedSearchWidget = 0; + showHideAdvancedSearchButton = 0; + defaultQuery = 0; + exactQuery = 0; + similarQuery = 0; + withoutQuery = 0; + allQuery = 0; + atLeastQuery = 0; + } + + ~QHelpSearchQueryWidgetPrivate() + { + // nothing todo + } + + void retranslate() + { + simpleSearchLabel->setText(QHelpSearchQueryWidget::tr("Search for:")); + prevQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Previous search")); + nextQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Next search")); + searchButton->setText(QHelpSearchQueryWidget::tr("Search")); +#ifdef QT_CLUCENE_SUPPORT + advancedSearchLabel->setText(QHelpSearchQueryWidget::tr("Advanced search")); + similarLabel->setText(QHelpSearchQueryWidget::tr("words similar to:")); + withoutLabel->setText(QHelpSearchQueryWidget::tr("without the words:")); + exactLabel->setText(QHelpSearchQueryWidget::tr("with exact phrase:")); + allLabel->setText(QHelpSearchQueryWidget::tr("with all of the words:")); + atLeastLabel->setText(QHelpSearchQueryWidget::tr("with at least one of the words:")); +#endif + } + + QStringList buildTermList(const QString query) + { + bool s = false; + QString phrase; + QStringList wordList; + QString searchTerm = query; + + for (int i = 0; i < searchTerm.length(); ++i) { + if (searchTerm[i] == QLatin1Char('\"') && !s) { + s = true; + phrase = searchTerm[i]; + continue; + } + if (searchTerm[i] != QLatin1Char('\"') && s) + phrase += searchTerm[i]; + if (searchTerm[i] == QLatin1Char('\"') && s) { + s = false; + phrase += searchTerm[i]; + wordList.append(phrase); + searchTerm.remove(phrase); + } + } + if (s) + searchTerm.replace(phrase, phrase.mid(1)); + + const QRegExp exp(QLatin1String("\\s+")); + wordList += searchTerm.split(exp, QString::SkipEmptyParts); + return wordList; + } + + void saveQuery(const QList &query, QueryHistory &queryHist) + { + // We only add the query to the list if it is different from the last one. + bool insert = false; + if (queryHist.queries.empty()) + insert = true; + else { + const QList &lastQuery = queryHist.queries.last(); + if (lastQuery.size() != query.size()) { + insert = true; + } else { + for (int i = 0; i < query.size(); ++i) { + if (query.at(i).fieldName != lastQuery.at(i).fieldName + || query.at(i).wordList != lastQuery.at(i).wordList) { + insert = true; + break; + } + } + } + } + if (insert) { + queryHist.queries.append(query); + foreach (const QHelpSearchQuery &queryPart, query) { + static_cast(searchCompleter.model())-> + addTerm(queryPart.wordList.join(" ")); + } + } + } + + void nextOrPrevQuery(int maxOrMinIndex, int addend, QToolButton *thisButton, + QToolButton *otherButton) + { + QueryHistory *queryHist; + QList lineEdits; + if (simpleSearch) { + queryHist = &simpleQueries; + lineEdits << defaultQuery; + } else { + queryHist = &complexQueries; + lineEdits << allQuery << atLeastQuery << similarQuery + << withoutQuery << exactQuery; + } + foreach (QLineEdit *lineEdit, lineEdits) + lineEdit->clear(); + + // Otherwise, the respective button would be disabled. + Q_ASSERT(queryHist->curQuery != maxOrMinIndex); + + queryHist->curQuery += addend; + const QList &query = + queryHist->queries.at(queryHist->curQuery); + foreach (const QHelpSearchQuery &queryPart, query) { + if (QLineEdit *lineEdit = lineEditFor(queryPart.fieldName)) + lineEdit->setText(queryPart.wordList.join(" ")); + } + + if (queryHist->curQuery == maxOrMinIndex) + thisButton->setEnabled(false); + otherButton->setEnabled(true); + } + + QLineEdit* lineEditFor(const QHelpSearchQuery::FieldName &fieldName) const + { + switch (fieldName) { + case QHelpSearchQuery::DEFAULT: + return defaultQuery; + case QHelpSearchQuery::ALL: + return allQuery; + case QHelpSearchQuery::ATLEAST: + return atLeastQuery; + case QHelpSearchQuery::FUZZY: + return similarQuery; + case QHelpSearchQuery::WITHOUT: + return withoutQuery; + case QHelpSearchQuery::PHRASE: + return exactQuery; + default: + Q_ASSERT(0); + } + return 0; + } + + void enableOrDisableToolButtons() + { + const QueryHistory &queryHist = simpleSearch ? simpleQueries + : complexQueries; + prevQueryButton->setEnabled(queryHist.curQuery > 0); + nextQueryButton->setEnabled(queryHist.curQuery + < queryHist.queries.size() - 1); + } + +private slots: + void showHideAdvancedSearch() + { + if (simpleSearch) { + advancedSearchWidget->show(); + showHideAdvancedSearchButton->setText((QLatin1String("-"))); + } else { + advancedSearchWidget->hide(); + showHideAdvancedSearchButton->setText((QLatin1String("+"))); + } + + simpleSearch = !simpleSearch; + defaultQuery->setEnabled(simpleSearch); + enableOrDisableToolButtons(); + } + + void searchRequested() + { + QList queryList; +#if !defined(QT_CLUCENE_SUPPORT) + queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, + QStringList(defaultQuery->text()))); + +#else + if (defaultQuery->isEnabled()) { + queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, + buildTermList(defaultQuery->text()))); + } else { + const QRegExp exp(QLatin1String("\\s+")); + QStringList lst = similarQuery->text().split(exp, + QString::SkipEmptyParts); + if (!lst.isEmpty()) { + QStringList fuzzy; + foreach (const QString &term, lst) + fuzzy += buildTermList(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, + fuzzy)); + } + + lst = withoutQuery->text().split(exp, QString::SkipEmptyParts); + if (!lst.isEmpty()) { + QStringList without; + foreach (const QString &term, lst) + without.append(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, + without)); + } + + if (!exactQuery->text().isEmpty()) { + QString phrase = exactQuery->text().remove(QLatin1Char('\"')); + phrase = phrase.simplified(); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, + QStringList(phrase))); + } + + lst = allQuery->text().split(exp, QString::SkipEmptyParts); + if (!lst.isEmpty()) { + QStringList all; + foreach (const QString &term, lst) + all.append(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); + } + + lst = atLeastQuery->text().split(exp, QString::SkipEmptyParts); + if (!lst.isEmpty()) { + QStringList atLeast; + foreach (const QString &term, lst) + atLeast += buildTermList(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, + atLeast)); + } + } +#endif + QueryHistory &queryHist = simpleSearch ? simpleQueries : complexQueries; + saveQuery(queryList, queryHist); + queryHist.curQuery = queryHist.queries.size() - 1; + if (queryHist.curQuery > 0) + prevQueryButton->setEnabled(true); + nextQueryButton->setEnabled(false); + } + + void nextQuery() + { + nextOrPrevQuery((simpleSearch ? simpleQueries + : complexQueries).queries.size() - 1, 1, nextQueryButton, + prevQueryButton); + } + + void prevQuery() + { + nextOrPrevQuery(0, -1, prevQueryButton, nextQueryButton); + } + +private: + friend class QHelpSearchQueryWidget; + + bool simpleSearch; + QLabel *simpleSearchLabel; + QLabel *advancedSearchLabel; + QLabel *similarLabel; + QLabel *withoutLabel; + QLabel *exactLabel; + QLabel *allLabel; + QLabel *atLeastLabel; + QPushButton *searchButton; + QWidget* advancedSearchWidget; + QToolButton *showHideAdvancedSearchButton; + QLineEdit *defaultQuery; + QLineEdit *exactQuery; + QLineEdit *similarQuery; + QLineEdit *withoutQuery; + QLineEdit *allQuery; + QLineEdit *atLeastQuery; + QToolButton *nextQueryButton; + QToolButton *prevQueryButton; + QueryHistory simpleQueries; + QueryHistory complexQueries; + QCompleter searchCompleter; +}; + +#include "qhelpsearchquerywidget.moc" + + +/*! + \class QHelpSearchQueryWidget + \since 4.4 + \inmodule QtHelp + \brief The QHelpSearchQueryWidget class provides a simple line edit or + an advanced widget to enable the user to input a search term in a + standardized input mask. +*/ + +/*! + \fn void QHelpSearchQueryWidget::search() + + This signal is emitted when a the user has the search button invoked. + After reciving the signal you can ask the QHelpSearchQueryWidget for the + build list of QHelpSearchQuery's that you may pass to the QHelpSearchEngine's + search() function. +*/ + +/*! + Constructs a new search query widget with the given \a parent. +*/ +QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent) + : QWidget(parent) +{ + d = new QHelpSearchQueryWidgetPrivate(); + + QVBoxLayout *vLayout = new QVBoxLayout(this); + vLayout->setMargin(0); + + QHBoxLayout* hBoxLayout = new QHBoxLayout(); + d->simpleSearchLabel = new QLabel(this); + d->defaultQuery = new QLineEdit(this); + d->defaultQuery->setCompleter(&d->searchCompleter); + d->prevQueryButton = new QToolButton(this); + d->prevQueryButton->setArrowType(Qt::LeftArrow); + d->prevQueryButton->setEnabled(false); + d->nextQueryButton = new QToolButton(this); + d->nextQueryButton->setArrowType(Qt::RightArrow); + d->nextQueryButton->setEnabled(false); + d->searchButton = new QPushButton(this); + hBoxLayout->addWidget(d->simpleSearchLabel); + hBoxLayout->addWidget(d->defaultQuery); + hBoxLayout->addWidget(d->prevQueryButton); + hBoxLayout->addWidget(d->nextQueryButton); + hBoxLayout->addWidget(d->searchButton); + + vLayout->addLayout(hBoxLayout); + + connect(d->prevQueryButton, SIGNAL(clicked()), d, SLOT(prevQuery())); + connect(d->nextQueryButton, SIGNAL(clicked()), d, SLOT(nextQuery())); + connect(d->searchButton, SIGNAL(clicked()), this, SIGNAL(search())); + connect(d->defaultQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); + +#if defined(QT_CLUCENE_SUPPORT) + hBoxLayout = new QHBoxLayout(); + d->showHideAdvancedSearchButton = new QToolButton(this); + d->showHideAdvancedSearchButton->setText(QLatin1String("+")); + d->showHideAdvancedSearchButton->setMinimumSize(25, 20); + + d->advancedSearchLabel = new QLabel(this); + QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth()); + d->advancedSearchLabel->setSizePolicy(sizePolicy); + + QFrame* hLine = new QFrame(this); + hLine->setFrameStyle(QFrame::HLine); + hBoxLayout->addWidget(d->showHideAdvancedSearchButton); + hBoxLayout->addWidget(d->advancedSearchLabel); + hBoxLayout->addWidget(hLine); + + vLayout->addLayout(hBoxLayout); + + // setup advanced search layout + d->advancedSearchWidget = new QWidget(this); + QGridLayout *gLayout = new QGridLayout(d->advancedSearchWidget); + gLayout->setMargin(0); + + d->similarLabel = new QLabel(this); + gLayout->addWidget(d->similarLabel, 0, 0); + d->similarQuery = new QLineEdit(this); + d->similarQuery->setCompleter(&d->searchCompleter); + gLayout->addWidget(d->similarQuery, 0, 1); + + d->withoutLabel = new QLabel(this); + gLayout->addWidget(d->withoutLabel, 1, 0); + d->withoutQuery = new QLineEdit(this); + d->withoutQuery->setCompleter(&d->searchCompleter); + gLayout->addWidget(d->withoutQuery, 1, 1); + + d->exactLabel = new QLabel(this); + gLayout->addWidget(d->exactLabel, 2, 0); + d->exactQuery = new QLineEdit(this); + d->exactQuery->setCompleter(&d->searchCompleter); + gLayout->addWidget(d->exactQuery, 2, 1); + + d->allLabel = new QLabel(this); + gLayout->addWidget(d->allLabel, 3, 0); + d->allQuery = new QLineEdit(this); + d->allQuery->setCompleter(&d->searchCompleter); + gLayout->addWidget(d->allQuery, 3, 1); + + d->atLeastLabel = new QLabel(this); + gLayout->addWidget(d->atLeastLabel, 4, 0); + d->atLeastQuery = new QLineEdit(this); + d->atLeastQuery->setCompleter(&d->searchCompleter); + gLayout->addWidget(d->atLeastQuery, 4, 1); + + vLayout->addWidget(d->advancedSearchWidget); + d->advancedSearchWidget->hide(); + + d->retranslate(); + + connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); + connect(d->similarQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); + connect(d->withoutQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); + connect(d->allQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); + connect(d->atLeastQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); + connect(d->showHideAdvancedSearchButton, SIGNAL(clicked()), + d, SLOT(showHideAdvancedSearch())); +#endif + connect(this, SIGNAL(search()), d, SLOT(searchRequested())); +} + +/*! + Destroys the search query widget. +*/ +QHelpSearchQueryWidget::~QHelpSearchQueryWidget() +{ + delete d; +} + +/*! + Expands the search query widget so that the extended search fields are shown. +*/ +void QHelpSearchQueryWidget::expandExtendedSearch() +{ + if (d->simpleSearch) + d->showHideAdvancedSearch(); +} + +/*! + Collapses the search query widget so that only the default search field is + shown. +*/ +void QHelpSearchQueryWidget::collapseExtendedSearch() +{ + if (!d->simpleSearch) + d->showHideAdvancedSearch(); +} + +/*! + Returns a list of queries to use in combination with the search engines + search(QList &queryList) function. +*/ +QList QHelpSearchQueryWidget::query() const +{ + const QHelpSearchQueryWidgetPrivate::QueryHistory &queryHist = + d->simpleSearch ? d->simpleQueries : d->complexQueries; + return queryHist.queries.isEmpty() ? + QList() : queryHist.queries.last(); +} + +/*! + Sets the QHelpSearchQueryWidget input fields to the values specified by + \a queryList search field name. Please note that one has to call the search + engine's search(QList &queryList) function to perform the + actual search. +*/ +void QHelpSearchQueryWidget::setQuery(const QList &queryList) +{ + QList lineEdits; + lineEdits << d->defaultQuery << d->allQuery << d->atLeastQuery + << d->similarQuery << d->withoutQuery << d->exactQuery; + foreach (QLineEdit *lineEdit, lineEdits) + lineEdit->clear(); + + const QLatin1String space(" "); + foreach (const QHelpSearchQuery &q, queryList) { + if (QLineEdit *lineEdit = d->lineEditFor(q.fieldName)) + lineEdit->setText(lineEdit->text() + q.wordList.join(space) + space); + } + d->searchRequested(); +} + +/*! + \reimp +*/ +void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent) +{ + if (focusEvent->reason() != Qt::MouseFocusReason) { + d->defaultQuery->selectAll(); + d->defaultQuery->setFocus(); + } +} + +/*! \reimp +*/ +void QHelpSearchQueryWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + d->retranslate(); + else + QWidget::changeEvent(event); +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchquerywidget.h b/src/assistant/help/qhelpsearchquerywidget.h new file mode 100644 index 000000000..e438df0b5 --- /dev/null +++ b/src/assistant/help/qhelpsearchquerywidget.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHQUERYWIDGET_H +#define QHELPSEARCHQUERYWIDGET_H + +#include +#include + +#include +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QFocusEvent; +class QHelpSearchQueryWidgetPrivate; + +class QHELP_EXPORT QHelpSearchQueryWidget : public QWidget +{ + Q_OBJECT + +public: + QHelpSearchQueryWidget(QWidget *parent = 0); + ~QHelpSearchQueryWidget(); + + void expandExtendedSearch(); + void collapseExtendedSearch(); + + QList query() const; + void setQuery(const QList &queryList); + +Q_SIGNALS: + void search(); + +private: + virtual void focusInEvent(QFocusEvent *focusEvent); + virtual void changeEvent(QEvent *event); + +private: + QHelpSearchQueryWidgetPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QHELPSEARCHQUERYWIDGET_H diff --git a/src/assistant/help/qhelpsearchresultwidget.cpp b/src/assistant/help/qhelpsearchresultwidget.cpp new file mode 100644 index 000000000..964185b5e --- /dev/null +++ b/src/assistant/help/qhelpsearchresultwidget.cpp @@ -0,0 +1,447 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qhelpsearchresultwidget.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QDefaultResultWidget : public QTreeWidget +{ + Q_OBJECT + +public: + QDefaultResultWidget(QWidget *parent = 0) + : QTreeWidget(parent) + { + header()->hide(); + connect(this, SIGNAL(itemActivated(QTreeWidgetItem*,int)), + this, SLOT(itemActivated(QTreeWidgetItem*,int))); + } + + void showResultPage(const QList hits) + { + foreach (const QHelpSearchEngine::SearchHit &hit, hits) + new QTreeWidgetItem(this, QStringList(hit.first) << hit.second); + } + +signals: + void requestShowLink(const QUrl &url); + +private slots: + void itemActivated(QTreeWidgetItem *item, int /* column */) + { + if (item) { + QString data = item->data(1, Qt::DisplayRole).toString(); + emit requestShowLink(data); + } + } +}; + + +class QCLuceneResultWidget : public QTextBrowser +{ + Q_OBJECT + +public: + QCLuceneResultWidget(QWidget *parent = 0) + : QTextBrowser(parent) + { + connect(this, SIGNAL(anchorClicked(QUrl)), + this, SIGNAL(requestShowLink(QUrl))); + setContextMenuPolicy(Qt::NoContextMenu); + } + + void showResultPage(const QList hits, bool isIndexing) + { + QString htmlFile = QString(QLatin1String("%1")) + .arg(tr("Search Results")); + + int count = hits.count(); + if (count != 0) { + if (isIndexing) + htmlFile += QString(QLatin1String("
" + "%1 " + "%2

")).arg(tr("Note:")) + .arg(tr("The search results may not be complete since the " + "documentation is still being indexed!")); + + foreach (const QHelpSearchEngine::SearchHit &hit, hits) { + htmlFile += QString(QLatin1String("
%2
%1

")) + .arg(hit.first).arg(hit.second); + } + } else { + htmlFile += QLatin1String("


") + + tr("Your search did not match any documents.") + + QLatin1String("

"); + if (isIndexing) + htmlFile += QLatin1String("

") + + tr("(The reason for this might be that the documentation " + "is still being indexed.)") + + QLatin1String("

"); + } + + htmlFile += QLatin1String(""); + + setHtml(htmlFile); + } + +signals: + void requestShowLink(const QUrl &url); + +private slots: + void setSource(const QUrl & /* name */) {} +}; + + +class QHelpSearchResultWidgetPrivate : public QObject +{ + Q_OBJECT + +private slots: + void setResults(int hitsCount) + { + if (!searchEngine.isNull()) { +#if defined(QT_CLUCENE_SUPPORT) + showFirstResultPage(); + updateNextButtonState(((hitsCount > 20) ? true : false)); +#else + resultTreeWidget->clear(); + resultTreeWidget->showResultPage(searchEngine->hits(0, hitsCount)); +#endif + } + } + + void showNextResultPage() + { + if (!searchEngine.isNull() + && resultLastToShow < searchEngine->hitCount()) { + resultLastToShow += 20; + resultFirstToShow += 20; + + resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, + resultLastToShow), isIndexing); + if (resultLastToShow >= searchEngine->hitCount()) + updateNextButtonState(false); + } + updateHitRange(); + } + + void showLastResultPage() + { + if (!searchEngine.isNull()) { + resultLastToShow = searchEngine->hitCount(); + resultFirstToShow = resultLastToShow - (resultLastToShow % 20); + + if (resultFirstToShow == resultLastToShow) + resultFirstToShow -= 20; + + resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, + resultLastToShow), isIndexing); + updateNextButtonState(false); + } + updateHitRange(); + } + + void showFirstResultPage() + { + if (!searchEngine.isNull()) { + resultLastToShow = 20; + resultFirstToShow = 0; + + resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, + resultLastToShow), isIndexing); + updatePrevButtonState(false); + } + updateHitRange(); + } + + void showPreviousResultPage() + { + if (!searchEngine.isNull()) { + int count = resultLastToShow % 20; + if (count == 0 || resultLastToShow != searchEngine->hitCount()) + count = 20; + + resultLastToShow -= count; + resultFirstToShow = resultLastToShow -20; + + resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, + resultLastToShow), isIndexing); + if (resultFirstToShow == 0) + updatePrevButtonState(false); + } + updateHitRange(); + } + + void updatePrevButtonState(bool state = true) + { + firstResultPage->setEnabled(state); + previousResultPage->setEnabled(state); + } + + void updateNextButtonState(bool state = true) + { + nextResultPage->setEnabled(state); + lastResultPage->setEnabled(state); + } + + void indexingStarted() + { + isIndexing = true; + } + + void indexingFinished() + { + isIndexing = false; + } + +private: + QHelpSearchResultWidgetPrivate(QHelpSearchEngine *engine) + : QObject() + , searchEngine(engine) + , isIndexing(false) + { + resultTreeWidget = 0; + resultTextBrowser = 0; + + resultLastToShow = 20; + resultFirstToShow = 0; + + firstResultPage = 0; + previousResultPage = 0; + hitsLabel = 0; + nextResultPage = 0; + lastResultPage = 0; + + connect(searchEngine, SIGNAL(indexingStarted()), + this, SLOT(indexingStarted())); + connect(searchEngine, SIGNAL(indexingFinished()), + this, SLOT(indexingFinished())); + } + + ~QHelpSearchResultWidgetPrivate() + { + delete searchEngine; + } + + QToolButton* setupToolButton(const QString &iconPath) + { + QToolButton *button = new QToolButton(); + button->setEnabled(false); + button->setAutoRaise(true); + button->setIcon(QIcon(iconPath)); + button->setIconSize(QSize(12, 12)); + button->setMaximumSize(QSize(16, 16)); + + return button; + } + + void updateHitRange() + { + int last = 0; + int first = 0; + int count = 0; + + if (!searchEngine.isNull()) { + count = searchEngine->hitCount(); + if (count > 0) { + first = resultFirstToShow +1; + last = resultLastToShow > count ? count : resultLastToShow; + } + } + hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %n Hits", 0, count).arg(first).arg(last)); + } + +private: + friend class QHelpSearchResultWidget; + + QPointer searchEngine; + + QDefaultResultWidget *resultTreeWidget; + QCLuceneResultWidget *resultTextBrowser; + + int resultLastToShow; + int resultFirstToShow; + bool isIndexing; + + QToolButton *firstResultPage; + QToolButton *previousResultPage; + QLabel *hitsLabel; + QToolButton *nextResultPage; + QToolButton *lastResultPage; +}; + +#include "qhelpsearchresultwidget.moc" + + +/*! + \class QHelpSearchResultWidget + \since 4.4 + \inmodule QtHelp + \brief The QHelpSearchResultWidget class provides either a tree + widget or a text browser depending on the used search engine to display + the hits found by the search. +*/ + +/*! + \fn void QHelpSearchResultWidget::requestShowLink(const QUrl &link) + + This signal is emitted when a item is activated and its associated + \a link should be shown. +*/ + +QHelpSearchResultWidget::QHelpSearchResultWidget(QHelpSearchEngine *engine) + : QWidget(0) + , d(new QHelpSearchResultWidgetPrivate(engine)) +{ + QVBoxLayout *vLayout = new QVBoxLayout(this); + vLayout->setMargin(0); + vLayout->setSpacing(0); + +#if defined(QT_CLUCENE_SUPPORT) + QHBoxLayout *hBoxLayout = new QHBoxLayout(); +#ifndef Q_OS_MAC + hBoxLayout->setMargin(0); + hBoxLayout->setSpacing(0); +#endif + hBoxLayout->addWidget(d->firstResultPage = d->setupToolButton( + QString::fromUtf8(":/trolltech/assistant/images/3leftarrow.png"))); + + hBoxLayout->addWidget(d->previousResultPage = d->setupToolButton( + QString::fromUtf8(":/trolltech/assistant/images/1leftarrow.png"))); + + d->hitsLabel = new QLabel(tr("0 - 0 of 0 Hits"), this); + d->hitsLabel->setEnabled(false); + hBoxLayout->addWidget(d->hitsLabel); + d->hitsLabel->setAlignment(Qt::AlignCenter); + d->hitsLabel->setMinimumSize(QSize(150, d->hitsLabel->height())); + + hBoxLayout->addWidget(d->nextResultPage = d->setupToolButton( + QString::fromUtf8(":/trolltech/assistant/images/1rightarrow.png"))); + + hBoxLayout->addWidget(d->lastResultPage = d->setupToolButton( + QString::fromUtf8(":/trolltech/assistant/images/3rightarrow.png"))); + + QSpacerItem *spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + hBoxLayout->addItem(spacer); + + vLayout->addLayout(hBoxLayout); + + d->resultTextBrowser = new QCLuceneResultWidget(this); + vLayout->addWidget(d->resultTextBrowser); + + connect(d->resultTextBrowser, SIGNAL(requestShowLink(QUrl)), this, + SIGNAL(requestShowLink(QUrl))); + + connect(d->nextResultPage, SIGNAL(clicked()), d, SLOT(showNextResultPage())); + connect(d->lastResultPage, SIGNAL(clicked()), d, SLOT(showLastResultPage())); + connect(d->firstResultPage, SIGNAL(clicked()), d, SLOT(showFirstResultPage())); + connect(d->previousResultPage, SIGNAL(clicked()), d, SLOT(showPreviousResultPage())); + + connect(d->firstResultPage, SIGNAL(clicked()), d, SLOT(updateNextButtonState())); + connect(d->previousResultPage, SIGNAL(clicked()), d, SLOT(updateNextButtonState())); + connect(d->nextResultPage, SIGNAL(clicked()), d, SLOT(updatePrevButtonState())); + connect(d->lastResultPage, SIGNAL(clicked()), d, SLOT(updatePrevButtonState())); + +#else + d->resultTreeWidget = new QDefaultResultWidget(this); + vLayout->addWidget(d->resultTreeWidget); + connect(d->resultTreeWidget, SIGNAL(requestShowLink(QUrl)), this, + SIGNAL(requestShowLink(QUrl))); +#endif + + connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int))); +} + +/*! \reimp +*/ +void QHelpSearchResultWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + d->setResults(d->searchEngine->hitCount()); +} + +/*! + Destroys the search result widget. +*/ +QHelpSearchResultWidget::~QHelpSearchResultWidget() +{ + delete d; +} + +/*! + Returns a reference of the URL that the item at \a point owns, or an + empty URL if no item exists at that point. +*/ +QUrl QHelpSearchResultWidget::linkAt(const QPoint &point) +{ + QUrl url; +#if defined(QT_CLUCENE_SUPPORT) + if (d->resultTextBrowser) + url = d->resultTextBrowser->anchorAt(point); +#else + if (d->resultTreeWidget) { + QTreeWidgetItem *item = d->resultTreeWidget->itemAt(point); + if (item) + url = item->data(1, Qt::DisplayRole).toString(); + } +#endif + return url; +} + +QT_END_NAMESPACE diff --git a/src/assistant/help/qhelpsearchresultwidget.h b/src/assistant/help/qhelpsearchresultwidget.h new file mode 100644 index 000000000..f9300e979 --- /dev/null +++ b/src/assistant/help/qhelpsearchresultwidget.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHELPSEARCHRESULTWIDGET_H +#define QHELPSEARCHRESULTWIDGET_H + +#include +#include + +#include +#include +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Help) + +class QHelpSearchResultWidgetPrivate; + +class QHELP_EXPORT QHelpSearchResultWidget : public QWidget +{ + Q_OBJECT + +public: + ~QHelpSearchResultWidget(); + QUrl linkAt(const QPoint &point); + +Q_SIGNALS: + void requestShowLink(const QUrl &url); + +private: + friend class QHelpSearchEngine; + + QHelpSearchResultWidgetPrivate *d; + QHelpSearchResultWidget(QHelpSearchEngine *engine); + virtual void changeEvent(QEvent *event); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QHELPSEARCHRESULTWIDGET_H diff --git a/src/assistant/lib/fulltextsearch/fulltextsearch.pri b/src/assistant/lib/fulltextsearch/fulltextsearch.pri deleted file mode 100644 index aac2ec6eb..000000000 --- a/src/assistant/lib/fulltextsearch/fulltextsearch.pri +++ /dev/null @@ -1,161 +0,0 @@ -DEFINES += _BUILD_FOR_QT_ LUCENE_DISABLE_MEMTRACKING -win32:DEFINES += _CRT_SECURE_NO_DEPRECATE _MT - -CLUCENEDIR = ../../../../3rdparty/clucene/src/CLucene - -INCLUDEPATH += . .. \ - $$CLUCENEDIR \ - $$CLUCENEDIR/../ \ - $$CLUCENEDIR/analysis \ - $$CLUCENEDIR/analysis/standard \ - $$CLUCENEDIR/config \ - $$CLUCENEDIR/debug \ - $$CLUCENEDIR/document \ - $$CLUCENEDIR/index \ - $$CLUCENEDIR/queryParser \ - $$CLUCENEDIR/search \ - $$CLUCENEDIR/store \ - $$CLUCENEDIR/util - - -SOURCES += $$CLUCENEDIR/StdHeader.cpp \ - $$CLUCENEDIR/analysis/AnalysisHeader.cpp \ - $$CLUCENEDIR/analysis/Analyzers.cpp \ - $$CLUCENEDIR/config/gunichartables.cpp \ - $$CLUCENEDIR/config/repl_lltot.cpp \ - $$CLUCENEDIR/config/repl_tcscasecmp.cpp \ - $$CLUCENEDIR/config/repl_tcslwr.cpp \ - $$CLUCENEDIR/config/repl_tcstod.cpp \ - $$CLUCENEDIR/config/repl_tcstoll.cpp \ - $$CLUCENEDIR/config/repl_tprintf.cpp \ - $$CLUCENEDIR/config/threads.cpp \ - $$CLUCENEDIR/config/utf8.cpp \ - $$CLUCENEDIR/debug/condition.cpp \ - $$CLUCENEDIR/debug/error.cpp \ - $$CLUCENEDIR/debug/memtracking.cpp \ - $$CLUCENEDIR/document/DateField.cpp \ - $$CLUCENEDIR/document/Document.cpp \ - $$CLUCENEDIR/document/Field.cpp \ - $$CLUCENEDIR/index/CompoundFile.cpp \ - $$CLUCENEDIR/index/DocumentWriter.cpp \ - $$CLUCENEDIR/index/FieldInfos.cpp \ - $$CLUCENEDIR/index/FieldsReader.cpp \ - $$CLUCENEDIR/index/FieldsWriter.cpp \ - $$CLUCENEDIR/index/IndexModifier.cpp \ - $$CLUCENEDIR/index/IndexReader.cpp \ - $$CLUCENEDIR/index/IndexWriter.cpp \ - $$CLUCENEDIR/index/MultiReader.cpp \ - $$CLUCENEDIR/index/SegmentInfos.cpp \ - $$CLUCENEDIR/index/SegmentMergeInfo.cpp \ - $$CLUCENEDIR/index/SegmentMergeQueue.cpp \ - $$CLUCENEDIR/index/SegmentMerger.cpp \ - $$CLUCENEDIR/index/SegmentReader.cpp \ - $$CLUCENEDIR/index/SegmentTermDocs.cpp \ - $$CLUCENEDIR/index/SegmentTermEnum.cpp \ - $$CLUCENEDIR/index/SegmentTermPositions.cpp \ - $$CLUCENEDIR/index/SegmentTermVector.cpp \ - $$CLUCENEDIR/index/Term.cpp \ - $$CLUCENEDIR/index/TermInfo.cpp \ - $$CLUCENEDIR/index/TermInfosReader.cpp \ - $$CLUCENEDIR/index/TermInfosWriter.cpp \ - $$CLUCENEDIR/index/TermVectorReader.cpp \ - $$CLUCENEDIR/index/TermVectorWriter.cpp \ - $$CLUCENEDIR/queryParser/Lexer.cpp \ - $$CLUCENEDIR/queryParser/MultiFieldQueryParser.cpp \ - $$CLUCENEDIR/queryParser/QueryParser.cpp \ - $$CLUCENEDIR/queryParser/QueryParserBase.cpp \ - $$CLUCENEDIR/queryParser/QueryToken.cpp \ - $$CLUCENEDIR/queryParser/TokenList.cpp \ - $$CLUCENEDIR/search/BooleanQuery.cpp \ - $$CLUCENEDIR/search/BooleanScorer.cpp \ - $$CLUCENEDIR/search/CachingWrapperFilter.cpp \ - $$CLUCENEDIR/search/ChainedFilter.cpp \ - $$CLUCENEDIR/search/ConjunctionScorer.cpp \ - $$CLUCENEDIR/search/DateFilter.cpp \ - $$CLUCENEDIR/search/ExactPhraseScorer.cpp \ - $$CLUCENEDIR/search/Explanation.cpp \ - $$CLUCENEDIR/search/FieldCache.cpp \ - $$CLUCENEDIR/search/FieldCacheImpl.cpp \ - $$CLUCENEDIR/search/FieldDocSortedHitQueue.cpp \ - $$CLUCENEDIR/search/FieldSortedHitQueue.cpp \ - $$CLUCENEDIR/search/FilteredTermEnum.cpp \ - $$CLUCENEDIR/search/FuzzyQuery.cpp \ - $$CLUCENEDIR/search/HitQueue.cpp \ - $$CLUCENEDIR/search/Hits.cpp \ - $$CLUCENEDIR/search/IndexSearcher.cpp \ - $$CLUCENEDIR/search/MultiSearcher.cpp \ - $$CLUCENEDIR/search/MultiTermQuery.cpp \ - $$CLUCENEDIR/search/PhrasePositions.cpp \ - $$CLUCENEDIR/search/PhraseQuery.cpp \ - $$CLUCENEDIR/search/PhraseScorer.cpp \ - $$CLUCENEDIR/search/PrefixQuery.cpp \ - $$CLUCENEDIR/search/QueryFilter.cpp \ - $$CLUCENEDIR/search/RangeFilter.cpp \ - $$CLUCENEDIR/search/RangeQuery.cpp \ - $$CLUCENEDIR/search/SearchHeader.cpp \ - $$CLUCENEDIR/search/Similarity.cpp \ - $$CLUCENEDIR/search/SloppyPhraseScorer.cpp \ - $$CLUCENEDIR/search/Sort.cpp \ - $$CLUCENEDIR/search/TermQuery.cpp \ - $$CLUCENEDIR/search/TermScorer.cpp \ - $$CLUCENEDIR/search/WildcardQuery.cpp \ - $$CLUCENEDIR/search/WildcardTermEnum.cpp \ - $$CLUCENEDIR/store/FSDirectory.cpp \ - $$CLUCENEDIR/store/IndexInput.cpp \ - $$CLUCENEDIR/store/IndexOutput.cpp \ - $$CLUCENEDIR/store/Lock.cpp \ - $$CLUCENEDIR/store/MMapInput.cpp \ - $$CLUCENEDIR/store/RAMDirectory.cpp \ - $$CLUCENEDIR/store/TransactionalRAMDirectory.cpp \ - $$CLUCENEDIR/util/BitSet.cpp \ - $$CLUCENEDIR/util/Equators.cpp \ - $$CLUCENEDIR/util/FastCharStream.cpp \ - $$CLUCENEDIR/util/fileinputstream.cpp \ - $$CLUCENEDIR/util/Misc.cpp \ - $$CLUCENEDIR/util/Reader.cpp \ - $$CLUCENEDIR/util/StringBuffer.cpp \ - $$CLUCENEDIR/util/StringIntern.cpp \ - $$CLUCENEDIR/util/ThreadLocal.cpp \ - $$CLUCENEDIR/analysis/standard/StandardAnalyzer.cpp \ - $$CLUCENEDIR/analysis/standard/StandardFilter.cpp \ - $$CLUCENEDIR/analysis/standard/StandardTokenizer.cpp - - -#Header files -HEADERS += qclucene_global_p.h \ - qclucene-config_p.h \ - qanalyzer_p.h \ - qtokenizer_p.h \ - qtoken_p.h \ - qtokenstream_p.h \ - qdocument_p.h \ - qfield_p.h \ - qindexreader_p.h \ - qindexwriter_p.h \ - qterm_p.h \ - qqueryparser_p.h \ - qfilter_p.h \ - qhits_p.h \ - qsearchable_p.h \ - qsort_p.h \ - qquery_p.h \ - qreader_p.h - - -#Source files -SOURCES += qanalyzer.cpp \ - qtokenizer.cpp \ - qtoken.cpp \ - qtokenstream.cpp \ - qdocument.cpp \ - qfield.cpp \ - qindexreader.cpp \ - qindexwriter.cpp \ - qterm.cpp \ - qqueryparser.cpp \ - qfilter.cpp \ - qhits.cpp \ - qsearchable.cpp \ - qsort.cpp \ - qquery.cpp \ - qreader.cpp diff --git a/src/assistant/lib/fulltextsearch/fulltextsearch.pro b/src/assistant/lib/fulltextsearch/fulltextsearch.pro deleted file mode 100644 index 8733e57d7..000000000 --- a/src/assistant/lib/fulltextsearch/fulltextsearch.pro +++ /dev/null @@ -1,54 +0,0 @@ -load(qt_module) - -QMAKE_TARGET_PRODUCT = QtCLucene -QMAKE_TARGET_DESCRIPTION = QtCLucene full text search library wrapper. -#if qt is built with frameworks in debug, we must build QtCLucene in debug and release -#that's a similar logic as in qbase.pri -mac:!static:contains(QT_CONFIG, qt_framework) { - CONFIG(debug, debug|release) { - !build_pass:CONFIG += build_all - } -} -QT_CONFIG -= qt_framework -QT -= gui -TEMPLATE = lib -TARGET = QtCLucene -DEFINES += QHELP_LIB -include($$QT_SOURCE_TREE/src/qbase.pri) - -HEADERS += qtcluceneversion.h - -include(fulltextsearch.pri) - -CONFIG += qt warn_off -contains(QT_CONFIG, reduce_exports) { - CONFIG += hide_symbols - # workaround for compiler errors on Ubuntu - linux*-g++*:DEFINES += _GLIBCXX_EXTERN_TEMPLATE=0 -} - -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES = QtCore - -# impossible to disable exceptions in clucene atm -CONFIG(exceptions_off) { - CONFIG -= exceptions_off - CONFIG += exceptions - !win32|win32-g++* { - QMAKE_CFLAGS -= -fno-exceptions - QMAKE_CXXFLAGS -= -fno-exceptions - QMAKE_LFLAGS -= -fno-exceptions - QMAKE_CFLAGS += -fexceptions - QMAKE_CXXFLAGS += -fexceptions - QMAKE_LFLAGS += -fexceptions - } -} - -win32-msvc.net | win32-msvc2* { - QMAKE_CFLAGS_RELEASE -= -O2 - QMAKE_CXXFLAGS_RELEASE -= -O2 -} - -# the following define could be set globally in case we need it elsewhere -solaris* { - DEFINES += Q_SOLARIS_VERSION=$$system(uname -r | sed -e 's/5\\.//') -} diff --git a/src/assistant/lib/fulltextsearch/license.txt b/src/assistant/lib/fulltextsearch/license.txt deleted file mode 100644 index 9ef3d701d..000000000 --- a/src/assistant/lib/fulltextsearch/license.txt +++ /dev/null @@ -1,503 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - diff --git a/src/assistant/lib/fulltextsearch/qanalyzer.cpp b/src/assistant/lib/fulltextsearch/qanalyzer.cpp deleted file mode 100644 index 71dd2c972..000000000 --- a/src/assistant/lib/fulltextsearch/qanalyzer.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qanalyzer_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneAnalyzerPrivate::QCLuceneAnalyzerPrivate() - : QSharedData() -{ - analyzer = 0; - deleteCLuceneAnalyzer = true; -} - -QCLuceneAnalyzerPrivate::QCLuceneAnalyzerPrivate(const QCLuceneAnalyzerPrivate &other) - : QSharedData() -{ - analyzer = _CL_POINTER(other.analyzer); - deleteCLuceneAnalyzer = other.deleteCLuceneAnalyzer; -} - -QCLuceneAnalyzerPrivate::~QCLuceneAnalyzerPrivate() -{ - if (deleteCLuceneAnalyzer) - _CLDECDELETE(analyzer); -} - - -QCLuceneAnalyzer::QCLuceneAnalyzer() - : d(new QCLuceneAnalyzerPrivate()) -{ - //nothing todo, private -} - -QCLuceneAnalyzer::~QCLuceneAnalyzer() -{ - // nothing todo -} - -qint32 QCLuceneAnalyzer::positionIncrementGap(const QString &fieldName) const -{ - Q_UNUSED(fieldName); - return 0; -} - -QCLuceneTokenStream QCLuceneAnalyzer::tokenStream(const QString &fieldName, - const QCLuceneReader &reader) const -{ - TCHAR *fName = QStringToTChar(fieldName); - QCLuceneTokenStream tokenStream; - tokenStream.d->tokenStream = d->analyzer->tokenStream(fName, reader.d->reader); - delete [] fName; - - return tokenStream; -} - - -QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer() - : QCLuceneAnalyzer() -{ - d->analyzer = new lucene::analysis::standard::StandardAnalyzer(); -} - -QCLuceneStandardAnalyzer::~QCLuceneStandardAnalyzer() -{ - // nothing todo -} - -QCLuceneStandardAnalyzer::QCLuceneStandardAnalyzer(const QStringList &stopWords) -{ - const TCHAR **tArray = new const TCHAR*[stopWords.count() +1]; - - for(int i = 0; i < stopWords.count(); ++i) { - TCHAR *stopWord = QStringToTChar(stopWords.at(i)); - tArray[i] = STRDUP_TtoT(stopWord); - delete [] stopWord; - } - tArray[stopWords.count()] = 0; - - d->analyzer = new lucene::analysis::standard::StandardAnalyzer(tArray); - - for (int i = 0; i < stopWords.count(); ++i) - delete [] tArray[i]; - - delete [] tArray; -} - - -QCLuceneWhitespaceAnalyzer::QCLuceneWhitespaceAnalyzer() - : QCLuceneAnalyzer() -{ - d->analyzer = new lucene::analysis::WhitespaceAnalyzer(); -} - -QCLuceneWhitespaceAnalyzer::~QCLuceneWhitespaceAnalyzer() -{ - // nothing todo -} - - -QCLuceneSimpleAnalyzer::QCLuceneSimpleAnalyzer() - : QCLuceneAnalyzer() -{ - d->analyzer = new lucene::analysis::SimpleAnalyzer(); -} - -QCLuceneSimpleAnalyzer::~QCLuceneSimpleAnalyzer() -{ - // nothing todo -} - - -QCLuceneStopAnalyzer::QCLuceneStopAnalyzer() - : QCLuceneAnalyzer() -{ - d->analyzer = new lucene::analysis::StopAnalyzer(); -} - -QCLuceneStopAnalyzer::~QCLuceneStopAnalyzer() -{ - // nothing todo -} - -QCLuceneStopAnalyzer::QCLuceneStopAnalyzer(const QStringList &stopWords) - : QCLuceneAnalyzer() -{ - const TCHAR **tArray = new const TCHAR*[stopWords.count() +1]; - - for(int i = 0; i < stopWords.count(); ++i) { - TCHAR *stopWord = QStringToTChar(stopWords.at(i)); - tArray[i] = STRDUP_TtoT(stopWord); - delete [] stopWord; - } - tArray[stopWords.count()] = 0; - - d->analyzer = new lucene::analysis::StopAnalyzer(tArray); - - for (int i = 0; i < stopWords.count(); ++i) - delete [] tArray[i]; - - delete [] tArray; -} - -QStringList QCLuceneStopAnalyzer::englishStopWords() const -{ - QStringList stopWordList; - - const TCHAR** stopWords = lucene::analysis::StopAnalyzer::ENGLISH_STOP_WORDS; - for (qint32 i = 0; stopWords[i] != 0; ++i) - stopWordList.append(TCharToQString(stopWords[i])); - - return stopWordList; -} - - -QCLuceneKeywordAnalyzer::QCLuceneKeywordAnalyzer() - : QCLuceneAnalyzer() -{ - d->analyzer = new lucene::analysis::KeywordAnalyzer(); -} - -QCLuceneKeywordAnalyzer::~QCLuceneKeywordAnalyzer() -{ - // nothing todo -} - - -QCLucenePerFieldAnalyzerWrapper::QCLucenePerFieldAnalyzerWrapper( - QCLuceneAnalyzer *defaultAnalyzer) - : QCLuceneAnalyzer() -{ - d->analyzer = new - lucene::analysis::PerFieldAnalyzerWrapper(defaultAnalyzer->d->analyzer); - - analyzers.append(defaultAnalyzer); - defaultAnalyzer->d->deleteCLuceneAnalyzer = false; -} - -QCLucenePerFieldAnalyzerWrapper::~QCLucenePerFieldAnalyzerWrapper() -{ - qDeleteAll(analyzers); -} - -void QCLucenePerFieldAnalyzerWrapper::addAnalyzer(const QString &fieldName, - QCLuceneAnalyzer *analyzer) -{ - lucene::analysis::PerFieldAnalyzerWrapper *analyzerWrapper = - static_cast (d->analyzer); - - if (analyzerWrapper == 0) - return; - - analyzers.append(analyzer); - analyzer->d->deleteCLuceneAnalyzer = false; - - TCHAR *fName = QStringToTChar(fieldName); - analyzerWrapper->addAnalyzer(fName, analyzer->d->analyzer); - delete [] fName; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qanalyzer_p.h b/src/assistant/lib/fulltextsearch/qanalyzer_p.h deleted file mode 100644 index 162d6799b..000000000 --- a/src/assistant/lib/fulltextsearch/qanalyzer_p.h +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QANALYZER_P_H -#define QANALYZER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qreader_p.h" -#include "qtokenstream_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include -#include -#include - -CL_NS_DEF(analysis) - class Analyzer; -CL_NS_END -CL_NS_USE(analysis) - -QT_BEGIN_NAMESPACE - -class QCLuceneIndexWriter; -class QCLuceneQueryParser; -class QCLuceneStopAnalyzer; -class QCLuceneSimpleAnalyzer; -class QCLuceneKeywordAnalyzer; -class QCLuceneStandardAnalyzer; -class QCLuceneWhitespaceAnalyzer; -class QCLucenePerFieldAnalyzerWrapper; - -class QHELP_EXPORT QCLuceneAnalyzerPrivate : public QSharedData -{ -public: - QCLuceneAnalyzerPrivate(); - QCLuceneAnalyzerPrivate(const QCLuceneAnalyzerPrivate &other); - - ~QCLuceneAnalyzerPrivate(); - - Analyzer *analyzer; - bool deleteCLuceneAnalyzer; - -private: - QCLuceneAnalyzerPrivate &operator=(const QCLuceneAnalyzerPrivate &other); -}; - -class QHELP_EXPORT QCLuceneAnalyzer -{ -public: - virtual ~QCLuceneAnalyzer(); - - qint32 positionIncrementGap(const QString &fieldName) const; - QCLuceneTokenStream tokenStream(const QString &fieldName, - const QCLuceneReader &reader) const; - -protected: - friend class QCLuceneIndexWriter; - friend class QCLuceneQueryParser; - friend class QCLuceneStopAnalyzer; - friend class QCLuceneSimpleAnalyzer; - friend class QCLuceneKeywordAnalyzer; - friend class QCLuceneStandardAnalyzer; - friend class QCLuceneWhitespaceAnalyzer; - friend class QCLucenePerFieldAnalyzerWrapper; - QSharedDataPointer d; - -private: - QCLuceneAnalyzer(); -}; - -class QHELP_EXPORT QCLuceneStandardAnalyzer : public QCLuceneAnalyzer -{ -public: - QCLuceneStandardAnalyzer(); - QCLuceneStandardAnalyzer(const QStringList &stopWords); - - ~QCLuceneStandardAnalyzer(); -}; - -class QHELP_EXPORT QCLuceneWhitespaceAnalyzer : public QCLuceneAnalyzer -{ -public: - QCLuceneWhitespaceAnalyzer(); - ~QCLuceneWhitespaceAnalyzer(); -}; - -class QHELP_EXPORT QCLuceneSimpleAnalyzer : public QCLuceneAnalyzer -{ -public: - QCLuceneSimpleAnalyzer(); - ~QCLuceneSimpleAnalyzer(); -}; - -class QHELP_EXPORT QCLuceneStopAnalyzer : public QCLuceneAnalyzer -{ -public: - QCLuceneStopAnalyzer(); - QCLuceneStopAnalyzer(const QStringList &stopWords); - - ~QCLuceneStopAnalyzer(); - - QStringList englishStopWords() const; -}; - -class QHELP_EXPORT QCLuceneKeywordAnalyzer : public QCLuceneAnalyzer -{ -public: - QCLuceneKeywordAnalyzer(); - ~QCLuceneKeywordAnalyzer(); -}; - -class QHELP_EXPORT QCLucenePerFieldAnalyzerWrapper : public QCLuceneAnalyzer -{ -public: - QCLucenePerFieldAnalyzerWrapper(QCLuceneAnalyzer *defaultAnalyzer); - ~QCLucenePerFieldAnalyzerWrapper(); - - void addAnalyzer(const QString &fieldName, QCLuceneAnalyzer *analyzer); - -private: - QList analyzers; -}; - -QT_END_NAMESPACE - -#endif // QANALYZER_P_H diff --git a/src/assistant/lib/fulltextsearch/qclucene-config_p.h b/src/assistant/lib/fulltextsearch/qclucene-config_p.h deleted file mode 100644 index 476296cf5..000000000 --- a/src/assistant/lib/fulltextsearch/qclucene-config_p.h +++ /dev/null @@ -1,557 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QCLUCENE_CONFIG_P_H -#define QCLUCENE_CONFIG_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include - -#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H -#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1 - -/* -src/CLucene/clucene-config.h. -Generated -automatically -at -end -of -configure. -*/ -/* config.h.tmp. Generated by configure. */ -/* config.h.tmp.in. Generated from configure.ac by autoheader. */ - -/* Disable multithreading */ -/* #undef _CL_DISABLE_MULTITHREADING */ - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_ALGORITHM -#define _CL_HAVE_ALGORITHM 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_CTYPE_H -#define _CL_HAVE_CTYPE_H 1 -#endif - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#ifndef _CL_HAVE_DIRENT_H -#define _CL_HAVE_DIRENT_H 1 -#endif - -#if !defined (__MINGW32__) - /* Define to 1 if you have the header file. */ -# ifndef _CL_HAVE_DLFCN_H -# define _CL_HAVE_DLFCN_H 1 -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_ERRNO_H -#define _CL_HAVE_ERRNO_H 1 -#endif - -#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) - /* Define to 1 if you have the header file. */ -# ifndef _CL_HAVE_EXT_HASH_MAP -# define _CL_HAVE_EXT_HASH_MAP 1 -# endif - - /* Define to 1 if you have the header file. */ -# ifndef _CL_HAVE_EXT_HASH_SET -# define _CL_HAVE_EXT_HASH_SET 1 -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_FCNTL_H -#define _CL_HAVE_FCNTL_H 1 -#endif - -#if !defined(__xlC__) && !defined(__xlc__) && !defined (__MINGW32__) && \ - !defined(__HP_aCC) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC) || \ - defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x550) || (defined(__HP_aCC) && defined(__ia64)) - /* Define to 1 if the system has the type `float_t'. */ -# ifndef _CL_HAVE_FLOAT_T -# define _CL_HAVE_FLOAT_T 1 -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_FUNCTIONAL -#define _CL_HAVE_FUNCTIONAL 1 -#endif - -/* Does not support new float byte<->float conversions */ -#ifndef _CL_HAVE_FUNCTIONING_FLOAT_BYTE -#define _CL_HAVE_FUNCTIONING_FLOAT_BYTE -#endif - -/* Define to 1 if you have the `getpagesize' function. */ -#ifndef _CL_HAVE_GETPAGESIZE -#define _CL_HAVE_GETPAGESIZE 1 -#endif - -/* Define to 1 if you have the header file. */ -/* #undef _CL_HAVE_HASH_MAP */ - -/* Define to 1 if you have the header file. */ -/* #undef _CL_HAVE_HASH_SET */ - -/* Define to 1 if the system has the type `intptr_t'. */ -#ifndef _CL_HAVE_INTPTR_T -#define _CL_HAVE_INTPTR_T 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_INTTYPES_H -#define _CL_HAVE_INTTYPES_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_LIST -#define _CL_HAVE_LIST 1 -#endif - -/* Define to 1 if you have the `lltoa' function. */ -/* #undef _CL_HAVE_LLTOA */ - -#if defined(__MINGW32__) - /* Define to 1 if you have the `lltow' function. */ -# ifndef _CL_HAVE_LLTOW -# define _CL_HAVE_LLTOW 1 -# endif -#endif - -#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__xlC__) && !defined(__xlc__) - /* Define to 1 if long double works and has more range or precision than double. */ -# ifndef _CL_HAVE_LONG_DOUBLE -# define _CL_HAVE_LONG_DOUBLE 1 -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_MAP -#define _CL_HAVE_MAP 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_MATH_H -#define _CL_HAVE_MATH_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_MEMORY_H -#define _CL_HAVE_MEMORY_H 1 -#endif - -#if !defined(__MINGW32__) && !defined(__HP_aCC) && !defined(__xlC__) && !defined(__xlc__) - /* Define to 1 if you have a working `mmap' system call. */ -# ifndef _CL_HAVE_MMAP -# define _CL_HAVE_MMAP 1 -# endif -#endif - -/* define if the compiler implements namespaces */ -#ifndef _CL_HAVE_NAMESPACES -#define _CL_HAVE_NAMESPACES -#endif - -#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined(__HP_aCC) || defined(__xlC__) || defined(__xlc__) - /* Define if you have the nanosleep function */ -# ifndef _CL_HAVE_NANOSLEEP -# define _CL_HAVE_NANOSLEEP 1 -# endif -#endif - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -/* #undef _CL_HAVE_NDIR_H */ - -/* Does not support new float byte<->float conversions */ -/* #undef _CL_HAVE_NO_FLOAT_BYTE */ - -/* Does not support try/catch blocks */ -/* #undef _CL_HAVE_NO_FUNCTION_TRY_BLOCKS */ - -/* Define to 1 if you have the `printf' function. */ -#ifndef _CL_HAVE_PRINTF -#define _CL_HAVE_PRINTF 1 -#endif - -#if !defined(__MINGW32__) - /* Define if you have POSIX threads libraries and header files. */ -# ifndef _CL_HAVE_PTHREAD -# define _CL_HAVE_PTHREAD 1 -# endif -#endif - -/* Define if recursive pthread mutexes are available */ -/* #undef _CL_HAVE_PTHREAD_MUTEX_RECURSIVE */ - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_SET -#define _CL_HAVE_SET 1 -#endif - -/* Define to 1 if you have the `snprintf' function. */ -#ifndef _CL_HAVE_SNPRINTF -#define _CL_HAVE_SNPRINTF 1 -#endif - -/* Defined if the snprintf overflow test fails */ -/* #undef _CL_HAVE_SNPRINTF_BUG */ - -/* Define to 1 if you have the `snwprintf' function. */ -/* #undef _CL_HAVE_SNWPRINTF */ - -#if !defined(__HP_aCC) && !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) - /* define if the compiler supports ISO C++ standard library */ -# ifndef _CL_HAVE_STD -# define _CL_HAVE_STD -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_STDARG_H -#define _CL_HAVE_STDARG_H 1 -#endif - -/* x */ -#ifndef _CL_HAVE_STDEXCEPT -#define _CL_HAVE_STDEXCEPT -#endif - -#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__HP_aCC) && \ - !defined(__xlC__) && !defined(__xlc__) - /* Define to 1 if you have the header file. */ -# ifndef _CL_HAVE_STDINT_H -# define _CL_HAVE_STDINT_H 1 -# endif -#endif - -#if !defined(__HP_aCC) - /* Define to 1 if you have the header file. */ -# ifndef _CL_HAVE_STDLIB_H -# define _CL_HAVE_STDLIB_H 1 -# endif - - /* define if the compiler supports Standard Template Library */ -# ifndef _CL_HAVE_STL -# define _CL_HAVE_STL -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_STRINGS_H -#define _CL_HAVE_STRINGS_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_STRING_H -#define _CL_HAVE_STRING_H 1 -#endif - -/* Define to 1 if you have the `strlwr' function. */ -/* #undef _CL_HAVE_STRLWR */ - -/* Define to 1 if you have the `strtoll' function. */ -/* #undef _CL_HAVE_STRTOLL */ - -/* Define to 1 if you have the `strupr' function. */ -/* #undef _CL_HAVE_STRUPR */ - -/* Defined if the swprintf test fails */ -#ifndef _CL_HAVE_SWPRINTF_BUG -#define _CL_HAVE_SWPRINTF_BUG -#endif - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef _CL_HAVE_SYS_DIR_H */ - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -/* #undef _CL_HAVE_SYS_NDIR_H */ - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_SYS_STAT_H -#define _CL_HAVE_SYS_STAT_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_SYS_TIMEB_H -#define _CL_HAVE_SYS_TIMEB_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_SYS_TYPES_H -#define _CL_HAVE_SYS_TYPES_H 1 -#endif - -#if defined(__MINGW32__) - /* Define to 1 if you have the header file. */ - # ifndef _CL_HAVE_TCHAR_H - # define _CL_HAVE_TCHAR_H 1 - # endif -#endif - -#if defined(__MINGW32__) || defined(__SUNPRO_CC) || defined(__SUNPRO_C) - /* Define to 1 if you have the `tell' function. */ -# ifndef _CL_HAVE_TELL -# define _CL_HAVE_TELL 1 -# endif -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_UNISTD_H -#define _CL_HAVE_UNISTD_H 1 -#endif - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_VECTOR -#define _CL_HAVE_VECTOR 1 -#endif - -/* Define to 1 if you have the `vsnwprintf' function. */ -/* #undef _CL_HAVE_VSNWPRINTF */ - -/* Define to 1 if you have the header file. */ -#ifndef _CL_HAVE_WCHAR_H -#define _CL_HAVE_WCHAR_H 1 -#endif - -/* Define to 1 if the system has the type `wchar_t'. */ -#ifndef _CL_HAVE_WCHAR_T -#define _CL_HAVE_WCHAR_T 1 -#endif - -#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__MINGW32__) && \ - !defined(Q_OS_MAC) && !defined(__HP_aCC) - /* Define to 1 if you have the `wcscasecmp' function. */ -# ifndef _CL_HAVE_WCSCASECMP -# define _CL_HAVE_WCSCASECMP 1 -# endif -#endif - -/* Define to 1 if you have the `wcscat' function. */ -#ifndef _CL_HAVE_WCSCAT -#define _CL_HAVE_WCSCAT 1 -#endif - -/* Define to 1 if you have the `wcschr' function. */ -#ifndef _CL_HAVE_WCSCHR -#define _CL_HAVE_WCSCHR 1 -#endif - -/* Define to 1 if you have the `wcscmp' function. */ -#ifndef _CL_HAVE_WCSCMP -#define _CL_HAVE_WCSCMP 1 -#endif - -/* Define to 1 if you have the `wcscpy' function. */ -#ifndef _CL_HAVE_WCSCPY -#define _CL_HAVE_WCSCPY 1 -#endif - -/* Define to 1 if you have the `wcscspn' function. */ -#ifndef _CL_HAVE_WCSCSPN -#define _CL_HAVE_WCSCSPN 1 -#endif - -#if defined(__MINGW32__) - /* Define to 1 if you have the `wcsicmp' function. */ -# ifndef _CL_HAVE_WCSICMP -# define _CL_HAVE_WCSICMP 1 -# endif -#endif - -/* Define to 1 if you have the `wcslen' function. */ -#ifndef _CL_HAVE_WCSLEN -#define _CL_HAVE_WCSLEN 1 -#endif - -/* Define to 1 if you have the `wcsncmp' function. */ -#ifndef _CL_HAVE_WCSNCMP -#define _CL_HAVE_WCSNCMP 1 -#endif - -/* Define to 1 if you have the `wcsncpy' function. */ -#ifndef _CL_HAVE_WCSNCPY -#define _CL_HAVE_WCSNCPY 1 -#endif - -/* Define to 1 if you have the `wcsstr' function. */ -#ifndef _CL_HAVE_WCSSTR -#define _CL_HAVE_WCSSTR 1 -#endif - -/* Define to 1 if you have the `wcstod' function. */ -#ifndef _CL_HAVE_WCSTOD -#define _CL_HAVE_WCSTOD 1 -#endif - -#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) && !defined(__HP_aCC) - /* Define to 1 if you have the `wcstoll' function. */ -# ifndef _CL_HAVE_WCSTOLL -# define _CL_HAVE_WCSTOLL 1 -# endif -#endif - -#if defined(__MINGW32__) - /* Define to 1 if you have the `wcsupr' function. */ -# ifndef _CL_HAVE_WCSUPR -# define _CL_HAVE_WCSUPR 1 -# endif -#endif - -#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || defined(__HP_aCC) - /* Define to 1 if you have a functioning header file. */ -# ifndef _CL_HAVE_WCTYPE_H -# define _CL_HAVE_WCTYPE_H -# endif -#endif - -/* Define to 1 if you have the `wprintf' function. */ -/* #undef _CL_HAVE_WPRINTF */ - -#if defined(__MINGW32__) - /* Define to 1 if you have the `_filelength' function. */ -# ifndef _CL_HAVE__FILELENGTH -# define _CL_HAVE__FILELENGTH 1 -# endif -#endif - -/* How to define a static const in a class */ -#ifndef LUCENE_STATIC_CONSTANT_SYNTAX -#define LUCENE_STATIC_CONSTANT_SYNTAX 1 -#endif - -/* Name of package */ -#ifndef _CL_PACKAGE -#define _CL_PACKAGE "clucene-core" -#endif - -/* Define to the address where bug reports for this package should be sent. */ -#ifndef _CL_PACKAGE_BUGREPORT -#define _CL_PACKAGE_BUGREPORT "" -#endif - -/* Define to the full name of this package. */ -#ifndef _CL_PACKAGE_NAME -#define _CL_PACKAGE_NAME "" -#endif - -/* Define to the full name and version of this package. */ -#ifndef _CL_PACKAGE_STRING -#define _CL_PACKAGE_STRING "" -#endif - -/* Define to the one symbol short name of this package. */ -#ifndef _CL_PACKAGE_TARNAME -#define _CL_PACKAGE_TARNAME "" -#endif - -/* Define to the version of this package. */ -#ifndef _CL_PACKAGE_VERSION -#define _CL_PACKAGE_VERSION "" -#endif - -/* Define to the necessary symbol if this constant uses a non-standard name on - your system. */ -/* #undef _CL_PTHREAD_CREATE_JOINABLE */ - -/* The size of a `unsigned char', as computed by sizeof. */ -/* #undef _CL_SIZEOF_UNSIGNED_CHAR */ - -/* The size of a `unsigned int', as computed by sizeof. */ -/* #undef _CL_SIZEOF_UNSIGNED_INT */ - -/* The size of a `unsigned long', as computed by sizeof. */ -/* #undef _CL_SIZEOF_UNSIGNED_LONG */ - -/* The size of a `unsigned long long', as computed by sizeof. */ -/* #undef _CL_SIZEOF_UNSIGNED_LONG_LONG */ - -/* The size of a `unsigned __int64', as computed by sizeof. */ -/* #undef _CL_SIZEOF_UNSIGNED___INT64 */ - -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -/* #undef _CL_STAT_MACROS_BROKEN */ - -#if !defined(__HP_aCC) - /* Define to 1 if you have the ANSI C header files. */ -# ifndef _CL_STDC_HEADERS -# define _CL_STDC_HEADERS 1 -# endif - -/* Define to 1 if you can safely include both and . */ -# ifndef _CL_TIME_WITH_SYS_TIME -# define _CL_TIME_WITH_SYS_TIME 1 -# endif -#endif - -/* Version number of package */ -#ifndef _CL_VERSION -#define _CL_VERSION "0.9.17" -#endif - -/* Forces into Ascii mode */ -/* #undef _ASCII */ - -/* Conditional Debugging */ -/* #undef _CL__CND_DEBUG */ - -/* debugging option */ -/* #undef _DEBUG */ - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* If not already defined, then define as a datatype of *exactly* 32 bits. */ -/* #undef uint32_t */ - -/* If not already defined, then define as a datatype of *exactly* 64 bits. */ -/* #undef uint64_t */ - -/* If not already defined, then define as a datatype of *exactly* 8 bits. */ -/* #undef uint8_t */ - -/* once: -_SRC_CLUCENE_CLUCENE_CONFIG_H -*/ -#endif - - -#if defined Q_CC_MSVC && _MSC_VER < 1300 -# define LUCENE_NO_STDC_NAMESPACE -#endif - - -#endif // QCLUCENE_CONFIG_P_H - diff --git a/src/assistant/lib/fulltextsearch/qclucene_global_p.h b/src/assistant/lib/fulltextsearch/qclucene_global_p.h deleted file mode 100644 index 887b113e5..000000000 --- a/src/assistant/lib/fulltextsearch/qclucene_global_p.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QCLUCENE_GLOBAL_P_H -#define QCLUCENE_GLOBAL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#if !defined(_MSC_VER) -# include "qclucene-config_p.h" -#endif - -#include -#include - -#if !defined(_MSC_VER) && !defined(__MINGW32__) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) -# if !defined(TCHAR) -# define TCHAR wchar_t -# endif -#else -# include -#endif - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -#if !defined(QT_SHARED) && !defined(QT_DLL) -# define QHELP_EXPORT -#elif defined(QHELP_LIB) -# define QHELP_EXPORT Q_DECL_EXPORT -#else -# define QHELP_EXPORT Q_DECL_IMPORT -#endif - -// -// W A R N I N G -// ------------- -// -// adjustments here, need to be done in -// QTDIR/src/3rdparty/clucene/src/CLucene/StdHeader.h as well -// -#if defined(_LUCENE_DONTIMPLEMENT_NS_MACROS) - -#elif !defined(DISABLE_NAMESPACE) -# ifdef QT_NAMESPACE -# define CL_NS_DEF(sub) namespace QT_NAMESPACE { namespace lucene{ namespace sub{ -# define CL_NS_DEF2(sub,sub2) namespace QT_NAMESPACE { namespace lucene{ namespace sub{ namespace sub2 { - -# define CL_NS_END }}} -# define CL_NS_END2 }}}} - -# define CL_NS_USE(sub) using namespace QT_NAMESPACE::lucene::sub; -# define CL_NS_USE2(sub,sub2) using namespace QT_NAMESPACE::lucene::sub::sub2; - -# define CL_NS(sub) QT_NAMESPACE::lucene::sub -# define CL_NS2(sub,sub2) QT_NAMESPACE::lucene::sub::sub2 -# else -# define CL_NS_DEF(sub) namespace lucene{ namespace sub{ -# define CL_NS_DEF2(sub,sub2) namespace lucene{ namespace sub{ namespace sub2 { - -# define CL_NS_END }} -# define CL_NS_END2 }}} - -# define CL_NS_USE(sub) using namespace lucene::sub; -# define CL_NS_USE2(sub,sub2) using namespace lucene::sub::sub2; - -# define CL_NS(sub) lucene::sub -# define CL_NS2(sub,sub2) lucene::sub::sub2 -# endif -#else -# define CL_NS_DEF(sub) -# define CL_NS_DEF2(sub, sub2) -# define CL_NS_END -# define CL_NS_END2 -# define CL_NS_USE(sub) -# define CL_NS_USE2(sub,sub2) -# define CL_NS(sub) -# define CL_NS2(sub,sub2) -#endif - -namespace { - TCHAR* QStringToTChar(const QString &str) - { - TCHAR *string = new TCHAR[(str.length() +1) * sizeof(TCHAR)]; - memset(string, 0, (str.length() +1) * sizeof(TCHAR)); - #if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) - str.toWCharArray(string); - #else - const QByteArray ba = str.toAscii(); - strcpy(string, ba.constData()); - #endif - return string; - } - - QString TCharToQString(const TCHAR *string) - { - #if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) - QString retValue = QString::fromWCharArray(string); - return retValue; - #else - return QString(QLatin1String(string)); - #endif - } -} - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QCLUCENE_GLOBAL_P_H diff --git a/src/assistant/lib/fulltextsearch/qdocument.cpp b/src/assistant/lib/fulltextsearch/qdocument.cpp deleted file mode 100644 index 3c4cc068d..000000000 --- a/src/assistant/lib/fulltextsearch/qdocument.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qdocument_p.h" -#include "qreader_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneDocumentPrivate::QCLuceneDocumentPrivate() - : QSharedData() -{ - document = 0; - deleteCLuceneDocument = true; -} - -QCLuceneDocumentPrivate::QCLuceneDocumentPrivate(const QCLuceneDocumentPrivate &other) - : QSharedData() -{ - document = _CL_POINTER(other.document); - deleteCLuceneDocument = other.deleteCLuceneDocument; -} - -QCLuceneDocumentPrivate::~QCLuceneDocumentPrivate() -{ - if (deleteCLuceneDocument) - _CLDECDELETE(document); -} - - -QCLuceneDocument::QCLuceneDocument() - : d(new QCLuceneDocumentPrivate()) -{ - // nothing todo - d->document = new lucene::document::Document(); -} - -QCLuceneDocument::~QCLuceneDocument() -{ - qDeleteAll(fieldList); - fieldList.clear(); -} - -void QCLuceneDocument::add(QCLuceneField *field) -{ - field->d->deleteCLuceneField = false; - d->document->add(*field->d->field); - fieldList.append(field); -} - -QCLuceneField* QCLuceneDocument::getField(const QString &name) const -{ - QCLuceneField* field = 0; - foreach (field, fieldList) { - if (field->name() == name && field->d->field != 0) - return field; - } - - field = 0; - TCHAR *fieldName = QStringToTChar(name); - lucene::document::Field *f = d->document->getField(fieldName); - if (f) { - field = new QCLuceneField(); - field->d->field = f; - fieldList.append(field); - field->d->deleteCLuceneField = false; - - lucene::util::Reader *r = f->readerValue(); - if (r) { - field->reader->d->reader = r; - field->reader->d->deleteCLuceneReader = false; - } - } - delete [] fieldName; - - return field; -} - -QString QCLuceneDocument::get(const QString &name) const -{ - QCLuceneField* field = getField(name); - if (field) - return field->stringValue(); - - return QString(); -} - -QString QCLuceneDocument::toString() const -{ - return TCharToQString(d->document->toString()); -} - -void QCLuceneDocument::setBoost(qreal boost) -{ - d->document->setBoost(qreal(boost)); -} - -qreal QCLuceneDocument::getBoost() const -{ - return qreal(d->document->getBoost()); -} - -void QCLuceneDocument::removeField(const QString &name) -{ - TCHAR *fieldName = QStringToTChar(name); - d->document->removeField(fieldName); - delete [] fieldName; - - QList tmp; - lucene::document::DocumentFieldEnumeration *dfe = d->document->fields(); - while (dfe->hasMoreElements()) { - const lucene::document::Field* f = dfe->nextElement(); - foreach (QCLuceneField* field, fieldList) { - if (f == field->d->field) { - tmp.append(field); - break; - } - } - } - _CLDELETE(dfe); - fieldList = tmp; -} - -void QCLuceneDocument::removeFields(const QString &name) -{ - for (qint32 i = fieldList.count() -1; i >= 0; --i) { - QCLuceneField* field = fieldList.at(i); - if (field->name() == name) - delete fieldList.takeAt(i); - } - - TCHAR *fieldName = QStringToTChar(name); - d->document->removeFields(fieldName); - delete [] fieldName; -} - -QStringList QCLuceneDocument::getValues(const QString &name) const -{ - TCHAR *fieldName = QStringToTChar(name); - TCHAR **values = d->document->getValues(fieldName); - - QStringList retValue; - if (values) { - for (qint32 i = 0; 0 != values[i]; ++i) { - retValue.append(TCharToQString((const TCHAR*)values[i])); - delete [] values[i]; values[i] = 0; - } - delete values; - } - - delete [] fieldName; - return retValue; -} - -void QCLuceneDocument::clear() -{ - d->document->clear(); - qDeleteAll(fieldList); - fieldList.clear(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qdocument_p.h b/src/assistant/lib/fulltextsearch/qdocument_p.h deleted file mode 100644 index 31369af2a..000000000 --- a/src/assistant/lib/fulltextsearch/qdocument_p.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QDOCUMENT_P_H -#define QDOCUMENT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qfield_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include -#include -#include - -CL_NS_DEF(document) - class Document; -CL_NS_END -CL_NS_USE(document) - -QT_BEGIN_NAMESPACE - -class QCLuceneHits; -class QCLuceneIndexReader; -class QCLuceneIndexWriter; -class QCLuceneIndexSearcher; -class QCLuceneMultiSearcher; - -class QHELP_EXPORT QCLuceneDocumentPrivate : public QSharedData -{ -public: - QCLuceneDocumentPrivate(); - QCLuceneDocumentPrivate(const QCLuceneDocumentPrivate &other); - - ~QCLuceneDocumentPrivate(); - - Document *document; - bool deleteCLuceneDocument; - -private: - QCLuceneDocumentPrivate &operator=(const QCLuceneDocumentPrivate &other); -}; - -class QHELP_EXPORT QCLuceneDocument -{ -public: - QCLuceneDocument(); - ~QCLuceneDocument(); - - void add(QCLuceneField *field); - QCLuceneField* getField(const QString &name) const; - QString get(const QString &name) const; - QString toString() const; - void setBoost(qreal boost); - qreal getBoost() const; - void removeField(const QString &name); - void removeFields(const QString &name); - QStringList getValues(const QString &name) const; - void clear(); - -protected: - friend class QCLuceneHits; - friend class QCLuceneIndexReader; - friend class QCLuceneIndexWriter; - friend class QCLuceneIndexSearcher; - friend class QCLuceneMultiSearcher; - QSharedDataPointer d; - -private: - mutable QList fieldList; -}; - -QT_END_NAMESPACE - -#endif // QDOCUMENT_P_H diff --git a/src/assistant/lib/fulltextsearch/qfield.cpp b/src/assistant/lib/fulltextsearch/qfield.cpp deleted file mode 100644 index 448acf0e6..000000000 --- a/src/assistant/lib/fulltextsearch/qfield.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qfield_p.h" -#include "qreader_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneFieldPrivate::QCLuceneFieldPrivate() - : QSharedData() -{ - field = 0; - deleteCLuceneField = true; -} - -QCLuceneFieldPrivate::QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other) - : QSharedData() -{ - field = _CL_POINTER(other.field); - deleteCLuceneField = other.deleteCLuceneField; -} - -QCLuceneFieldPrivate::~QCLuceneFieldPrivate() -{ - if (deleteCLuceneField) - _CLDECDELETE(field); -} - - -QCLuceneField::QCLuceneField() - : d(new QCLuceneFieldPrivate()) - , reader(0) -{ - // nothing todo -} - -QCLuceneField::QCLuceneField(const QString &name, const QString &value, int configs) - : d(new QCLuceneFieldPrivate()) - , reader(0) -{ - TCHAR* fieldName = QStringToTChar(name); - TCHAR* fieldValue = QStringToTChar(value); - - d->field = new lucene::document::Field(fieldName, fieldValue, configs); - - delete [] fieldName; - delete [] fieldValue; -} - -QCLuceneField::QCLuceneField(const QString &name, QCLuceneReader *reader, - int configs) - : d(new QCLuceneFieldPrivate()) - , reader(reader) -{ - TCHAR* fieldName = QStringToTChar(name); - - reader->d->deleteCLuceneReader = false; // clucene takes ownership - d->field = new lucene::document::Field(fieldName, reader->d->reader, configs); - - delete [] fieldName; -} - -QCLuceneField::~QCLuceneField() -{ - delete reader; -} - -QString QCLuceneField::name() const -{ - return TCharToQString(d->field->name()); -} - -QString QCLuceneField::stringValue() const -{ - return TCharToQString((const TCHAR*)d->field->stringValue()); -} - -QCLuceneReader* QCLuceneField::readerValue() const -{ - return reader; -} - -bool QCLuceneField::isStored() const -{ - return d->field->isStored(); -} - -bool QCLuceneField::isIndexed() const -{ - return d->field->isIndexed(); -} - -bool QCLuceneField::isTokenized() const -{ - return d->field->isTokenized(); -} - -bool QCLuceneField::isCompressed() const -{ - return d->field->isCompressed(); -} - -void QCLuceneField::setConfig(int termVector) -{ - d->field->setConfig(termVector); -} - -bool QCLuceneField::isTermVectorStored() const -{ - return d->field->isTermVectorStored(); -} - -bool QCLuceneField::isStoreOffsetWithTermVector() const -{ - return d->field->isStoreOffsetWithTermVector(); -} - -bool QCLuceneField::isStorePositionWithTermVector() const -{ - return d->field->isStorePositionWithTermVector(); -} - -qreal QCLuceneField::getBoost() const -{ - return qreal(d->field->getBoost()); -} - -void QCLuceneField::setBoost(qreal value) -{ - d->field->setBoost(qreal(value)); -} - -bool QCLuceneField::isBinary() const -{ - return d->field->isBinary(); -} - -bool QCLuceneField::getOmitNorms() const -{ - return d->field->getOmitNorms(); -} - -void QCLuceneField::setOmitNorms(bool omitNorms) -{ - d->field->setOmitNorms(omitNorms); -} - -QString QCLuceneField::toString() const -{ - return TCharToQString(d->field->toString()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qfield_p.h b/src/assistant/lib/fulltextsearch/qfield_p.h deleted file mode 100644 index 39f2ff308..000000000 --- a/src/assistant/lib/fulltextsearch/qfield_p.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QFIELD_P_H -#define QFIELD_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qclucene_global_p.h" - -#include -#include -#include - -CL_NS_DEF(document) - class Field; -CL_NS_END -CL_NS_USE(document) - -QT_BEGIN_NAMESPACE - -class QCLuceneReader; -class QCLuceneDocument; - -class QHELP_EXPORT QCLuceneFieldPrivate : public QSharedData -{ -public: - QCLuceneFieldPrivate(); - QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other); - - ~QCLuceneFieldPrivate(); - - Field *field; - bool deleteCLuceneField; - -private: - QCLuceneFieldPrivate &operator=(const QCLuceneFieldPrivate &other); -}; - -class QHELP_EXPORT QCLuceneField -{ -public: - enum Store { - STORE_YES = 1, - STORE_NO = 2, - STORE_COMPRESS = 4 - }; - - enum Index { - INDEX_NO = 16, - INDEX_TOKENIZED = 32, - INDEX_UNTOKENIZED = 64, - INDEX_NONORMS = 128 - }; - - enum TermVector { - TERMVECTOR_NO = 256, - TERMVECTOR_YES = 512, - TERMVECTOR_WITH_POSITIONS = 1024, - TERMVECTOR_WITH_OFFSETS = 2048 - }; - - QCLuceneField(const QString &name, const QString &value, int configs); - QCLuceneField(const QString &name, QCLuceneReader *reader, int configs); - ~QCLuceneField(); - - QString name() const; - QString stringValue() const; - QCLuceneReader* readerValue() const; - bool isStored() const; - bool isIndexed() const; - bool isTokenized() const; - bool isCompressed() const; - void setConfig(int termVector); - bool isTermVectorStored() const; - bool isStoreOffsetWithTermVector() const; - bool isStorePositionWithTermVector() const; - qreal getBoost() const; - void setBoost(qreal value); - bool isBinary() const; - bool getOmitNorms() const; - void setOmitNorms(bool omitNorms); - QString toString() const; - -protected: - QCLuceneField(); - friend class QCLuceneDocument; - QSharedDataPointer d; - -private: - QCLuceneReader* reader; -}; - -QT_END_NAMESPACE - -#endif // QFIELD_P_H diff --git a/src/assistant/lib/fulltextsearch/qfilter.cpp b/src/assistant/lib/fulltextsearch/qfilter.cpp deleted file mode 100644 index 4807193ff..000000000 --- a/src/assistant/lib/fulltextsearch/qfilter.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qfilter_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneFilterPrivate::QCLuceneFilterPrivate() - : QSharedData() -{ - filter = 0; - deleteCLuceneFilter = true; -} - -QCLuceneFilterPrivate::QCLuceneFilterPrivate(const QCLuceneFilterPrivate &other) - : QSharedData() -{ - filter = _CL_POINTER(other.filter); - deleteCLuceneFilter = other.deleteCLuceneFilter; -} - -QCLuceneFilterPrivate::~QCLuceneFilterPrivate () -{ - if (deleteCLuceneFilter) - _CLDECDELETE(filter); -} - - -QCLuceneFilter::QCLuceneFilter() - : d(new QCLuceneFilterPrivate()) -{ - // nothing todo -} - -QCLuceneFilter::~QCLuceneFilter() -{ - // nothing todo -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qfilter_p.h b/src/assistant/lib/fulltextsearch/qfilter_p.h deleted file mode 100644 index 67f6615b1..000000000 --- a/src/assistant/lib/fulltextsearch/qfilter_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QFilter_P_H -#define QFilter_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qclucene_global_p.h" - -#include -#include - -CL_NS_DEF(search) - class Filter; -CL_NS_END -CL_NS_USE(search) - -QT_BEGIN_NAMESPACE - -class QCLuceneHits; -class QCLuceneSearcher; - -class QHELP_EXPORT QCLuceneFilterPrivate : public QSharedData -{ -public: - QCLuceneFilterPrivate(); - QCLuceneFilterPrivate(const QCLuceneFilterPrivate &other); - - ~QCLuceneFilterPrivate (); - - Filter *filter; - bool deleteCLuceneFilter; - -private: - QCLuceneFilterPrivate &operator=(const QCLuceneFilterPrivate &other); -}; - -class QHELP_EXPORT QCLuceneFilter -{ - QCLuceneFilter(); - virtual ~QCLuceneFilter(); - -protected: - friend class QCLuceneHits; - friend class QCLuceneSearcher; - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -#endif // QFilter_P_H diff --git a/src/assistant/lib/fulltextsearch/qhits.cpp b/src/assistant/lib/fulltextsearch/qhits.cpp deleted file mode 100644 index 5223a743d..000000000 --- a/src/assistant/lib/fulltextsearch/qhits.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qhits_p.h" -#include "qsearchable_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneHitsPrivate::QCLuceneHitsPrivate() - : QSharedData() -{ - hits = 0; - deleteCLuceneHits = true; -} - -QCLuceneHitsPrivate::QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other) - : QSharedData() -{ - hits = _CL_POINTER(other.hits); - deleteCLuceneHits = other.deleteCLuceneHits; -} - -QCLuceneHitsPrivate::~QCLuceneHitsPrivate() -{ - if (deleteCLuceneHits) - _CLDECDELETE(hits); -} - - -QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, - const QCLuceneQuery &query, const QCLuceneFilter &filter) - : d(new QCLuceneHitsPrivate()) -{ - d->hits = new lucene::search::Hits(searcher.d->searchable, query.d->query, - filter.d->filter); -} - -QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, - const QCLuceneFilter &filter, const QCLuceneSort &sort) - : d(new QCLuceneHitsPrivate()) -{ - d->hits = new lucene::search::Hits(searcher.d->searchable, query.d->query, - filter.d->filter, sort.d->sort); -} - -QCLuceneHits::~QCLuceneHits() -{ - // nothing todo -} - -QCLuceneDocument QCLuceneHits::document(const qint32 index) -{ - // TODO: check this - QCLuceneDocument document; - document.d->deleteCLuceneDocument = false; - lucene::document::Document &doc = d->hits->doc(int32_t(index)); - document.d->document = &doc; - - return document; -} - -qint32 QCLuceneHits::length() const -{ - return qint32(d->hits->length()); -} - -qint32 QCLuceneHits::id(const qint32 index) -{ - return qint32(d->hits->id(int32_t(index))); -} - -qreal QCLuceneHits::score(const qint32 index) -{ - return qreal(d->hits->score(int32_t(index))); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qhits_p.h b/src/assistant/lib/fulltextsearch/qhits_p.h deleted file mode 100644 index 98cd7021a..000000000 --- a/src/assistant/lib/fulltextsearch/qhits_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QHITS_P_H -#define QHITS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qsort_p.h" -#include "qquery_p.h" -#include "qfilter_p.h" -#include "qdocument_p.h" -#include "qclucene_global_p.h" - -#include -#include - -CL_NS_DEF(search) - class Hits; -CL_NS_END -CL_NS_USE(search) - -QT_BEGIN_NAMESPACE - -class QCLuceneSearcher; - -class QHELP_EXPORT QCLuceneHitsPrivate : public QSharedData -{ -public: - QCLuceneHitsPrivate(); - QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other); - - ~QCLuceneHitsPrivate(); - - Hits *hits; - bool deleteCLuceneHits; - -private: - QCLuceneHitsPrivate &operator=(const QCLuceneHitsPrivate &other); -}; - -class QHELP_EXPORT QCLuceneHits -{ -public: - QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, - const QCLuceneFilter &filter); - QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, - const QCLuceneFilter &filter, const QCLuceneSort &sort); - virtual ~QCLuceneHits(); - - QCLuceneDocument document(const qint32 index); - qint32 length() const; - qint32 id (const qint32 index); - qreal score(const qint32 index); - -protected: - friend class QCLuceneSearcher; - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -#endif // QHITS_P_H diff --git a/src/assistant/lib/fulltextsearch/qindexreader.cpp b/src/assistant/lib/fulltextsearch/qindexreader.cpp deleted file mode 100644 index 285a96334..000000000 --- a/src/assistant/lib/fulltextsearch/qindexreader.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qindexreader_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneIndexReaderPrivate::QCLuceneIndexReaderPrivate() - : QSharedData() -{ - reader = 0; - deleteCLuceneIndexReader = true; -} - -QCLuceneIndexReaderPrivate::QCLuceneIndexReaderPrivate(const QCLuceneIndexReaderPrivate &other) - : QSharedData() -{ - reader = _CL_POINTER(other.reader); - deleteCLuceneIndexReader = other.deleteCLuceneIndexReader; -} - -QCLuceneIndexReaderPrivate::~QCLuceneIndexReaderPrivate() -{ - if (deleteCLuceneIndexReader) - _CLDECDELETE(reader); -} - - -QCLuceneIndexReader::QCLuceneIndexReader() - : d(new QCLuceneIndexReaderPrivate()) -{ - // nothing todo, private -} - -QCLuceneIndexReader::~QCLuceneIndexReader() -{ - // nothing todo -} - -bool QCLuceneIndexReader::isLuceneFile(const QString &filename) -{ - using namespace lucene::index; - - return IndexReader::isLuceneFile(filename); -} - -bool QCLuceneIndexReader::indexExists(const QString &directory) -{ - using namespace lucene::index; - return IndexReader::indexExists(directory); -} - -QCLuceneIndexReader QCLuceneIndexReader::open(const QString &path) -{ - using namespace lucene::index; - - QCLuceneIndexReader indexReader; - indexReader.d->reader = IndexReader::open(path); - - return indexReader; -} - -void QCLuceneIndexReader::unlock(const QString &path) -{ - using namespace lucene::index; - IndexReader::unlock(path); -} - -bool QCLuceneIndexReader::isLocked(const QString &directory) -{ - using namespace lucene::index; - return IndexReader::isLocked(directory); -} - -quint64 QCLuceneIndexReader::lastModified(const QString &directory) -{ - using namespace lucene::index; - return quint64(IndexReader::lastModified(directory)); -} - -qint64 QCLuceneIndexReader::getCurrentVersion(const QString &directory) -{ - using namespace lucene::index; - return qint64(IndexReader::getCurrentVersion(directory)); -} - -void QCLuceneIndexReader::close() -{ - d->reader->close(); -} - -bool QCLuceneIndexReader::isCurrent() -{ - return d->reader->isCurrent(); -} - -void QCLuceneIndexReader::undeleteAll() -{ - d->reader->undeleteAll(); -} - -qint64 QCLuceneIndexReader::getVersion() -{ - return qint64(d->reader->getVersion()); -} - -void QCLuceneIndexReader::deleteDocument(qint32 docNum) -{ - d->reader->deleteDocument(int32_t(docNum)); -} - -bool QCLuceneIndexReader::hasNorms(const QString &field) -{ - TCHAR *fieldName = QStringToTChar(field); - bool retValue = d->reader->hasNorms(fieldName); - delete [] fieldName; - - return retValue; -} - -qint32 QCLuceneIndexReader::deleteDocuments(const QCLuceneTerm &term) -{ - return d->reader->deleteDocuments(term.d->term); -} - -bool QCLuceneIndexReader::document(qint32 index, QCLuceneDocument &document) -{ - if (!document.d->document) - document.d->document = new lucene::document::Document(); - - if (d->reader->document(int32_t(index), document.d->document)) - return true; - - return false; -} - -void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, qreal value) -{ - TCHAR *fieldName = QStringToTChar(field); - d->reader->setNorm(int32_t(doc), fieldName, qreal(value)); - delete [] fieldName; -} - -void QCLuceneIndexReader::setNorm(qint32 doc, const QString &field, quint8 value) -{ - TCHAR *fieldName = QStringToTChar(field); - d->reader->setNorm(int32_t(doc), fieldName, uint8_t(value)); - delete [] fieldName; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qindexreader_p.h b/src/assistant/lib/fulltextsearch/qindexreader_p.h deleted file mode 100644 index 7421daa17..000000000 --- a/src/assistant/lib/fulltextsearch/qindexreader_p.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QINDEXREADER_P_H -#define QINDEXREADER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qterm_p.h" -#include "qdocument_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include -#include - -CL_NS_DEF(index) - class IndexReader; -CL_NS_END -CL_NS_USE(index) - -QT_BEGIN_NAMESPACE - -class QCLuceneIndexWriter; -class QCLuceneIndexSearcher; - -class QHELP_EXPORT QCLuceneIndexReaderPrivate : public QSharedData -{ -public: - QCLuceneIndexReaderPrivate(); - QCLuceneIndexReaderPrivate(const QCLuceneIndexReaderPrivate &other); - - ~QCLuceneIndexReaderPrivate(); - - IndexReader *reader; - bool deleteCLuceneIndexReader; - -private: - QCLuceneIndexReaderPrivate &operator=(const QCLuceneIndexReaderPrivate &other); -}; - -class QHELP_EXPORT QCLuceneIndexReader -{ -public: - enum FieldOption { - ALL = 1, - INDEXED = 2, - UNINDEXED = 4, - INDEXED_WITH_TERMVECTOR = 8, - INDEXED_NO_TERMVECTOR = 16, - TERMVECTOR = 32, - TERMVECTOR_WITH_POSITION = 64, - TERMVECTOR_WITH_OFFSET = 128, - TERMVECTOR_WITH_POSITION_OFFSET = 256 - }; - - virtual ~QCLuceneIndexReader(); - - static bool isLuceneFile(const QString &filename); - static bool indexExists(const QString &directory); - static QCLuceneIndexReader open(const QString &path); - - static void unlock(const QString &path); - static bool isLocked(const QString &directory); - - static quint64 lastModified(const QString &directory); - static qint64 getCurrentVersion(const QString &directory); - - void close(); - bool isCurrent(); - void undeleteAll(); - qint64 getVersion(); - void deleteDocument(qint32 docNum); - bool hasNorms(const QString &field); - qint32 deleteDocuments(const QCLuceneTerm &term); - bool document(qint32 index, QCLuceneDocument &document); - void setNorm(qint32 doc, const QString &field, qreal value); - void setNorm(qint32 doc, const QString &field, quint8 value); - -protected: - friend class QCLuceneIndexWriter; - friend class QCLuceneIndexSearcher; - QSharedDataPointer d; - -private: - QCLuceneIndexReader(); -}; - -QT_END_NAMESPACE - -#endif // QINDEXREADER_P_H diff --git a/src/assistant/lib/fulltextsearch/qindexwriter.cpp b/src/assistant/lib/fulltextsearch/qindexwriter.cpp deleted file mode 100644 index 1f579eb65..000000000 --- a/src/assistant/lib/fulltextsearch/qindexwriter.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qindexwriter_p.h" -#include "qindexreader_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneIndexWriterPrivate::QCLuceneIndexWriterPrivate() - : QSharedData() -{ - writer = 0; - deleteCLuceneIndexWriter = true; -} - -QCLuceneIndexWriterPrivate::QCLuceneIndexWriterPrivate(const QCLuceneIndexWriterPrivate &other) - : QSharedData() -{ - writer = _CL_POINTER(other.writer); - deleteCLuceneIndexWriter = other.deleteCLuceneIndexWriter; -} - -QCLuceneIndexWriterPrivate::~QCLuceneIndexWriterPrivate() -{ - if (deleteCLuceneIndexWriter) - _CLDECDELETE(writer); -} - - -QCLuceneIndexWriter::QCLuceneIndexWriter(const QString &path, - QCLuceneAnalyzer &analyzer, - bool create, bool closeDir) - : d(new QCLuceneIndexWriterPrivate()) - , analyzer(analyzer) -{ - d->writer = new lucene::index::IndexWriter(path, - analyzer.d->analyzer, create, closeDir); -} - -QCLuceneIndexWriter::~QCLuceneIndexWriter() -{ - // nothing todo -} - -void QCLuceneIndexWriter::close() -{ - d->writer->close(); -} - -void QCLuceneIndexWriter::optimize() -{ - d->writer->optimize(); -} - -qint32 QCLuceneIndexWriter::docCount() -{ - return qint32(d->writer->docCount()); -} - -QCLuceneAnalyzer QCLuceneIndexWriter::getAnalyzer() -{ - return analyzer; -} - -void QCLuceneIndexWriter::addIndexes(const QList &readers) -{ - using namespace lucene::index; - IndexReader** readerArray = new IndexReader*[readers.count()]; - - for (int i = 0; i < readers.count(); ++i) - readerArray[i] = (readers.at(i))->d->reader; - - d->writer->addIndexes(readerArray); - delete [] readerArray; -} - -void QCLuceneIndexWriter::addDocument(QCLuceneDocument &doc, - QCLuceneAnalyzer &analyzer) -{ - if (doc.d->document) - d->writer->addDocument(doc.d->document, analyzer.d->analyzer); -} - -qint32 QCLuceneIndexWriter::getMaxFieldLength() const -{ - return qint32(d->writer->getMaxFieldLength()); -} - -void QCLuceneIndexWriter::setMaxFieldLength(qint32 value) -{ - d->writer->setMaxFieldLength(int32_t(value)); -} - -qint32 QCLuceneIndexWriter::getMaxBufferedDocs() const -{ - return qint32(d->writer->getMaxBufferedDocs()); -} - -void QCLuceneIndexWriter::setMaxBufferedDocs(qint32 value) -{ - d->writer->setMaxBufferedDocs(int32_t(value)); -} - -qint64 QCLuceneIndexWriter::getWriteLockTimeout() const -{ - return qint64(d->writer->getWriteLockTimeout()); -} - -void QCLuceneIndexWriter::setWriteLockTimeout(qint64 writeLockTimeout) -{ - d->writer->setWriteLockTimeout(int64_t(writeLockTimeout)); -} - -qint64 QCLuceneIndexWriter::getCommitLockTimeout() const -{ - return qint64(d->writer->getCommitLockTimeout()); -} - -void QCLuceneIndexWriter::setCommitLockTimeout(qint64 commitLockTimeout) -{ - d->writer->setCommitLockTimeout(int64_t(commitLockTimeout)); -} - -qint32 QCLuceneIndexWriter::getMergeFactor() const -{ - return qint32(d->writer->getMergeFactor()); -} - -void QCLuceneIndexWriter::setMergeFactor(qint32 value) -{ - d->writer->setMergeFactor(int32_t(value)); -} - -qint32 QCLuceneIndexWriter::getTermIndexInterval() const -{ - return qint32(d->writer->getTermIndexInterval()); -} - -void QCLuceneIndexWriter::setTermIndexInterval(qint32 interval) -{ - d->writer->setTermIndexInterval(int32_t(interval)); -} - -qint32 QCLuceneIndexWriter::getMinMergeDocs() const -{ - return qint32(d->writer->getMinMergeDocs()); -} - -void QCLuceneIndexWriter::setMinMergeDocs(qint32 value) -{ - d->writer->setMinMergeDocs(int32_t(value)); -} - -qint32 QCLuceneIndexWriter::getMaxMergeDocs() const -{ - return qint32(d->writer->getMaxMergeDocs()); -} - -void QCLuceneIndexWriter::setMaxMergeDocs(qint32 value) -{ - d->writer->setMaxMergeDocs(int32_t(value)); -} - -bool QCLuceneIndexWriter::getUseCompoundFile() const -{ - return d->writer->getUseCompoundFile(); -} - -void QCLuceneIndexWriter::setUseCompoundFile(bool value) -{ - d->writer->setUseCompoundFile(value); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qindexwriter_p.h b/src/assistant/lib/fulltextsearch/qindexwriter_p.h deleted file mode 100644 index 1f9c86115..000000000 --- a/src/assistant/lib/fulltextsearch/qindexwriter_p.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QINDEXWRITER_P_H -#define QINDEXWRITER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qanalyzer_p.h" -#include "qdocument_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include - -CL_NS_DEF(index) - class IndexWriter; -CL_NS_END -CL_NS_USE(index) - -QT_BEGIN_NAMESPACE - -class QCLuceneIndexReader; - -class QHELP_EXPORT QCLuceneIndexWriterPrivate : public QSharedData -{ -public: - QCLuceneIndexWriterPrivate(); - QCLuceneIndexWriterPrivate(const QCLuceneIndexWriterPrivate &other); - - ~QCLuceneIndexWriterPrivate(); - - IndexWriter *writer; - bool deleteCLuceneIndexWriter; - -private: - QCLuceneIndexWriterPrivate &operator=(const QCLuceneIndexWriterPrivate &other); -}; - -class QHELP_EXPORT QCLuceneIndexWriter -{ -public: - enum { - DEFAULT_MERGE_FACTOR = 10, - COMMIT_LOCK_TIMEOUT = 10000, - DEFAULT_MAX_BUFFERED_DOCS = 10, - DEFAULT_MAX_FIELD_LENGTH = 10000, - DEFAULT_TERM_INDEX_INTERVAL = 128, - DEFAULT_MAX_MERGE_DOCS = 0x7FFFFFFFL - }; - - QCLuceneIndexWriter(const QString &path, QCLuceneAnalyzer &analyzer, - bool create, bool closeDir = true); - virtual ~QCLuceneIndexWriter(); - - void close(); - void optimize(); - qint32 docCount(); - QCLuceneAnalyzer getAnalyzer(); - - void addIndexes(const QList &readers); - void addDocument(QCLuceneDocument &doc, QCLuceneAnalyzer &analyzer); - - qint32 getMaxFieldLength() const; - void setMaxFieldLength(qint32 value); - - qint32 getMaxBufferedDocs() const; - void setMaxBufferedDocs(qint32 value); - - qint64 getWriteLockTimeout() const; - void setWriteLockTimeout(qint64 writeLockTimeout); - - qint64 getCommitLockTimeout() const; - void setCommitLockTimeout(qint64 commitLockTimeout); - - qint32 getMergeFactor() const; - void setMergeFactor(qint32 value); - - qint32 getTermIndexInterval() const; - void setTermIndexInterval(qint32 interval); - - qint32 getMinMergeDocs() const; - void setMinMergeDocs(qint32 value); - - qint32 getMaxMergeDocs() const; - void setMaxMergeDocs(qint32 value); - - bool getUseCompoundFile() const; - void setUseCompoundFile(bool value); - -protected: - QSharedDataPointer d; - -private: - QCLuceneAnalyzer analyzer; -}; - -QT_END_NAMESPACE - -#endif // QINDEXWRITER_P_H diff --git a/src/assistant/lib/fulltextsearch/qquery.cpp b/src/assistant/lib/fulltextsearch/qquery.cpp deleted file mode 100644 index 170341cdd..000000000 --- a/src/assistant/lib/fulltextsearch/qquery.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qquery_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneQueryPrivate::QCLuceneQueryPrivate() - : QSharedData() -{ - query = 0; - deleteCLuceneQuery = true; -} - -QCLuceneQueryPrivate::QCLuceneQueryPrivate(const QCLuceneQueryPrivate &other) - : QSharedData() -{ - query = _CL_POINTER(other.query); - deleteCLuceneQuery = other.deleteCLuceneQuery; -} - -QCLuceneQueryPrivate::~QCLuceneQueryPrivate() -{ - if (deleteCLuceneQuery) - _CLDECDELETE(query); -} - - -QCLuceneQuery::QCLuceneQuery() - : d(new QCLuceneQueryPrivate()) -{ - // nothing todo, private -} - -QCLuceneQuery::~QCLuceneQuery() -{ - // nothing todo -} - -void QCLuceneQuery::setBoost(qreal boost) -{ - d->query->setBoost(qreal(boost)); -} - -qreal QCLuceneQuery::getBoost() const -{ - return qreal(d->query->getBoost()); -} - -QString QCLuceneQuery::getQueryName() const -{ - return TCharToQString(d->query->getQueryName()); -} - -bool QCLuceneQuery::instanceOf(const QString &other) const -{ - if (other == getQueryName()) - return true; - - return false; -} - -QString QCLuceneQuery::toString(const QString &field) const -{ - TCHAR *fieldName = QStringToTChar(field); - QString retValue = TCharToQString(d->query->toString(fieldName)); - delete [] fieldName; - - return retValue; -} - -quint32 QCLuceneQuery::hashCode() const -{ - return quint32(d->query->hashCode()); -} - -QString QCLuceneQuery::toString() const -{ - return TCharToQString(d->query->toString()); -} - -bool QCLuceneQuery::equals(const QCLuceneQuery &other) const -{ - return d->query->equals(other.d->query); -} - - -QCLucenePrefixQuery::QCLucenePrefixQuery(const QCLuceneTerm &prefix) - : QCLuceneQuery() - , prefix(prefix) -{ - d->query = new lucene::search::PrefixQuery(prefix.d->term); -} - -QCLucenePrefixQuery::~QCLucenePrefixQuery() -{ - // nothing todo -} - -QString QCLucenePrefixQuery::getClassName() -{ - return TCharToQString(lucene::search::PrefixQuery::getClassName()); -} - -QCLuceneTerm QCLucenePrefixQuery::getPrefix() const -{ - return prefix; -} - - -QCLuceneRangeQuery::QCLuceneRangeQuery(const QCLuceneTerm &lowerTerm, - const QCLuceneTerm &upperTerm, - bool inclusive) - : QCLuceneQuery() - , lowerTerm(lowerTerm) - , upperTerm(upperTerm) -{ - d->query = new lucene::search::RangeQuery(lowerTerm.d->term, - upperTerm.d->term, inclusive); -} - -QCLuceneRangeQuery::~QCLuceneRangeQuery() -{ - // nothing todo -} - -QString QCLuceneRangeQuery::getClassName() -{ - return TCharToQString(lucene::search::RangeQuery::getClassName()); -} - -QCLuceneTerm QCLuceneRangeQuery::getLowerTerm() const -{ - return lowerTerm; -} - -QCLuceneTerm QCLuceneRangeQuery::getUpperTerm() const -{ - return upperTerm; -} - -bool QCLuceneRangeQuery::isInclusive() const -{ - lucene::search::RangeQuery *query = - static_cast (d->query); - - if (query == 0) - return false; - - return query->isInclusive(); -} - -QString QCLuceneRangeQuery::getField() const -{ - lucene::search::RangeQuery *query = - static_cast (d->query); - - if (query == 0) - return QString(); - - return TCharToQString(query->getField()); -} - - -QCLuceneTermQuery::QCLuceneTermQuery(const QCLuceneTerm &term) - : QCLuceneQuery() - , term(term) -{ - d->query = new lucene::search::TermQuery(term.d->term); -} - -QCLuceneTermQuery::~QCLuceneTermQuery() -{ - // nothing todo -} - -QString QCLuceneTermQuery::getClassName() -{ - return TCharToQString(lucene::search::TermQuery::getClassName()); -} - -QCLuceneTerm QCLuceneTermQuery::getTerm() const -{ - return term; -} - - -QCLuceneBooleanQuery::QCLuceneBooleanQuery() - : QCLuceneQuery() -{ - d->query = new lucene::search::BooleanQuery(); -} - -QCLuceneBooleanQuery::~QCLuceneBooleanQuery() -{ - qDeleteAll(queries); -} - -QString QCLuceneBooleanQuery::getClassName() -{ - return TCharToQString(lucene::search::BooleanQuery::getClassName()); -} - -quint32 QCLuceneBooleanQuery::getClauseCount() const -{ - lucene::search::BooleanQuery *query = - static_cast (d->query); - - if (query == 0) - return 1024; - - return quint32(query->getClauseCount()); -} - -quint32 QCLuceneBooleanQuery::getMaxClauseCount() const -{ - lucene::search::BooleanQuery *query = - static_cast (d->query); - - if (query == 0) - return 1024; - - return quint32(query->getMaxClauseCount()); -} - -void QCLuceneBooleanQuery::setMaxClauseCount(quint32 maxClauseCount) -{ - lucene::search::BooleanQuery *query = - static_cast (d->query); - - if (query == 0) - return; - - query->setMaxClauseCount(size_t(maxClauseCount)); -} - -void QCLuceneBooleanQuery::add(QCLuceneQuery *query, bool required, bool prohibited) -{ - add(query, false, required, prohibited); -} - -void QCLuceneBooleanQuery::add(QCLuceneQuery *query, bool delQuery, - bool required, bool prohibited) -{ - lucene::search::BooleanQuery *booleanQuery = - static_cast (d->query); - - if (booleanQuery == 0) - return; - - booleanQuery->add(query->d->query, delQuery, required, prohibited); - - if (delQuery) { - queries.append(query); - query->d->deleteCLuceneQuery = false; - } -} - - -QCLucenePhraseQuery::QCLucenePhraseQuery() - : QCLuceneQuery() -{ - d->query = new lucene::search::PhraseQuery(); -} - -QCLucenePhraseQuery::~QCLucenePhraseQuery() -{ - termList.clear(); -} - -QString QCLucenePhraseQuery::getClassName() -{ - return TCharToQString(lucene::search::RangeQuery::getClassName()); -} - -qint32 QCLucenePhraseQuery::getSlop() const -{ - lucene::search::PhraseQuery *phraseQuery = - static_cast (d->query); - - if (phraseQuery == 0) - return 0; - - return qint32(phraseQuery->getSlop()); -} - -void QCLucenePhraseQuery::setSlop(const qint32 slop) -{ - lucene::search::PhraseQuery *phraseQuery = - static_cast (d->query); - - if (phraseQuery == 0) - return; - - phraseQuery->setSlop(int32_t(slop)); -} - -void QCLucenePhraseQuery::addTerm(const QCLuceneTerm &term) -{ - lucene::search::PhraseQuery *phraseQuery = - static_cast (d->query); - - if (phraseQuery == 0) - return; - - termList.append(term); - phraseQuery->add(term.d->term); -} - -void QCLucenePhraseQuery::addTerm(const QCLuceneTerm &term, qint32 position) -{ - lucene::search::PhraseQuery *phraseQuery = - static_cast (d->query); - - if (phraseQuery == 0) - return; - - termList.insert(position, term); - phraseQuery->add(term.d->term, int32_t(position)); - -} - -QString QCLucenePhraseQuery::getFieldName() const -{ - lucene::search::PhraseQuery *phraseQuery = - static_cast (d->query); - - if (phraseQuery == 0) - return QString(); - - return TCharToQString(phraseQuery->getFieldName()); -} - -QList QCLucenePhraseQuery::getTerms() const -{ - return termList; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qquery_p.h b/src/assistant/lib/fulltextsearch/qquery_p.h deleted file mode 100644 index 3268b7c42..000000000 --- a/src/assistant/lib/fulltextsearch/qquery_p.h +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QQUERY_P_H -#define QQUERY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qterm_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include -#include - -CL_NS_DEF(search) - class Query; -CL_NS_END -CL_NS_USE(search) - -QT_BEGIN_NAMESPACE - -class QCLuceneHits; -class QCLuceneTermQuery; -class QCLuceneRangeQuery; -class QCLuceneQueryParser; -class QCLucenePrefixQuery; -class QCLuceneBooleanQuery; -class QCLucenePhraseQuery; - -class QHELP_EXPORT QCLuceneQueryPrivate : public QSharedData -{ -public: - QCLuceneQueryPrivate(); - QCLuceneQueryPrivate(const QCLuceneQueryPrivate &other); - - ~QCLuceneQueryPrivate(); - - Query *query; - bool deleteCLuceneQuery; - -private: - QCLuceneQueryPrivate &operator=(const QCLuceneQueryPrivate &other); -}; - -class QHELP_EXPORT QCLuceneQuery -{ -public: - virtual ~QCLuceneQuery(); - - void setBoost(qreal boost); - qreal getBoost() const; - QString getQueryName() const; - bool instanceOf(const QString &other) const; - QString toString(const QString &field) const; - quint32 hashCode() const; - QString toString() const; - bool equals(const QCLuceneQuery &other) const; - -protected: - friend class QCLuceneHits; - friend class QCLuceneTermQuery; - friend class QCLuceneRangeQuery; - friend class QCLucenePrefixQuery; - friend class QCLuceneQueryParser; - friend class QCLuceneBooleanQuery; - friend class QCLucenePhraseQuery; - QSharedDataPointer d; - -private: - QCLuceneQuery(); -}; - -class QHELP_EXPORT QCLucenePrefixQuery : public QCLuceneQuery -{ -public: - QCLucenePrefixQuery(const QCLuceneTerm &prefix); - ~QCLucenePrefixQuery(); - - static QString getClassName(); - - QCLuceneTerm getPrefix() const; - -private: - QCLuceneTerm prefix; -}; - -class QHELP_EXPORT QCLuceneRangeQuery : public QCLuceneQuery -{ -public: - QCLuceneRangeQuery(const QCLuceneTerm &lowerTerm, - const QCLuceneTerm &upperTerm, bool inclusive); - ~QCLuceneRangeQuery(); - - static QString getClassName(); - - QCLuceneTerm getLowerTerm() const; - QCLuceneTerm getUpperTerm() const; - - bool isInclusive() const; - QString getField() const; - -private: - QCLuceneTerm lowerTerm; - QCLuceneTerm upperTerm; -}; - -class QHELP_EXPORT QCLuceneTermQuery : public QCLuceneQuery -{ -public: - QCLuceneTermQuery(const QCLuceneTerm &term); - ~QCLuceneTermQuery(); - - static QString getClassName(); - - QCLuceneTerm getTerm() const; - -private: - QCLuceneTerm term; -}; - -class QHELP_EXPORT QCLuceneBooleanQuery : public QCLuceneQuery -{ -public: - QCLuceneBooleanQuery(); - ~QCLuceneBooleanQuery(); - - static QString getClassName(); - - quint32 getClauseCount() const; - quint32 getMaxClauseCount() const; - void setMaxClauseCount(quint32 maxClauseCount); - - void add(QCLuceneQuery *query, bool required, bool prohibited); - void add(QCLuceneQuery *query, bool delQuery, bool required, bool prohibited); - -private: - QList queries; -}; - -class QHELP_EXPORT QCLucenePhraseQuery : public QCLuceneQuery -{ -public: - QCLucenePhraseQuery(); - ~QCLucenePhraseQuery(); - - static QString getClassName(); - - qint32 getSlop() const; - void setSlop(const qint32 slop); - - void addTerm(const QCLuceneTerm &term); - void addTerm(const QCLuceneTerm &term, qint32 position); - - QString getFieldName() const; - QList getTerms() const; - -private: - QList termList; -}; - -QT_END_NAMESPACE - -#endif // QQUERY_P_H diff --git a/src/assistant/lib/fulltextsearch/qqueryparser.cpp b/src/assistant/lib/fulltextsearch/qqueryparser.cpp deleted file mode 100644 index f306a041b..000000000 --- a/src/assistant/lib/fulltextsearch/qqueryparser.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qqueryparser_p.h" -#include "qquery_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneQueryParserPrivate::QCLuceneQueryParserPrivate() - : QSharedData() -{ - queryParser = 0; - deleteCLuceneQueryParser = true; -} - -QCLuceneQueryParserPrivate::QCLuceneQueryParserPrivate(const QCLuceneQueryParserPrivate &other) - : QSharedData() -{ - queryParser = _CL_POINTER(other.queryParser); - deleteCLuceneQueryParser = other.deleteCLuceneQueryParser; -} - -QCLuceneQueryParserPrivate::~QCLuceneQueryParserPrivate() -{ - if (deleteCLuceneQueryParser) - _CLDECDELETE(queryParser); -} - - -QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, - QCLuceneAnalyzer &analyzer) - : d(new QCLuceneQueryParserPrivate()) - , field(field) - , analyzer(analyzer) -{ - TCHAR *fieldName = QStringToTChar(field); - - d->queryParser = new lucene::queryParser::QueryParser(fieldName, - analyzer.d->analyzer); - - delete [] fieldName; -} - -QCLuceneQueryParser::~QCLuceneQueryParser() -{ - // nothing todo -} - -QCLuceneQuery* QCLuceneQueryParser::parse(const QString &query) -{ - TCHAR *string = QStringToTChar(query); - - QCLuceneQuery *retValue = 0; - lucene::search::Query* q = d->queryParser->parse(string); - if (q) { - retValue = new QCLuceneQuery(); - retValue->d->query = q; - } - - delete [] string; - return retValue; -} - -QCLuceneQuery* QCLuceneQueryParser::parse(QCLuceneReader &reader) -{ - QCLuceneQuery *retValue = 0; - lucene::search::Query* q = d->queryParser->parse(reader.d->reader); - if (q) { - retValue = new QCLuceneQuery(); - retValue->d->query = q; - } - - return retValue; -} - -QCLuceneQuery* QCLuceneQueryParser::parse(const QString &query, const QString &field, - QCLuceneAnalyzer &analyzer) -{ - QCLuceneQueryParser parser(field, analyzer); - return parser.parse(query); -} - -QCLuceneAnalyzer QCLuceneQueryParser::getAnalyzer() -{ - return analyzer; -} - -QString QCLuceneQueryParser::getField() -{ - return field; -} - - -QCLuceneMultiFieldQueryParser::QCLuceneMultiFieldQueryParser( - const QStringList &fieldList, QCLuceneAnalyzer &analyzer) - : QCLuceneQueryParser(QLatin1String(""), analyzer) -{ - Q_UNUSED(fieldList) -} - -QCLuceneMultiFieldQueryParser::~QCLuceneMultiFieldQueryParser() -{ - // nothing todo -} - -QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, - const QStringList &fieldList, - QCLuceneAnalyzer &analyzer) -{ - QCLuceneBooleanQuery *retValue = new QCLuceneBooleanQuery(); - foreach (const QString &field, fieldList) { - QCLuceneQuery *q = QCLuceneQueryParser::parse(query, field, analyzer); - if (!q) { - delete retValue; - retValue = 0; break; - } else { - retValue->add(q, true, false, false); - } - } - - return retValue; -} - -QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, - const QStringList &fieldList, - QList flags, - QCLuceneAnalyzer &analyzer) -{ - QCLuceneBooleanQuery *retValue = new QCLuceneBooleanQuery(); - qint32 i = 0; - foreach (const QString &field, fieldList) { - QCLuceneQuery *q = QCLuceneQueryParser::parse(query, field, analyzer); - if (q) { - qint32 flag = flags.at(i); - switch (flag) { - case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: { - retValue->add(q, true, true, false); - } break; - - case QCLuceneMultiFieldQueryParser::PROHIBITED_FIELD: { - retValue->add(q, true, false, true); - } break; - - default: { - retValue->add(q, true, false, false); - } break; - } - - ++i; - } else { - delete retValue; - retValue = 0; break; - } - } - return retValue; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qqueryparser_p.h b/src/assistant/lib/fulltextsearch/qqueryparser_p.h deleted file mode 100644 index e1b8c74eb..000000000 --- a/src/assistant/lib/fulltextsearch/qqueryparser_p.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QQUERYPARSER_P_H -#define QQUERYPARSER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qreader_p.h" -#include "qanalyzer_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include -#include - -CL_NS_DEF(queryParser) - class QueryParser; -CL_NS_END -CL_NS_USE(queryParser) - -QT_BEGIN_NAMESPACE - -class QCLuceneQuery; -class QCLuceneMultiFieldQueryParser; - -class QHELP_EXPORT QCLuceneQueryParserPrivate : public QSharedData -{ -public: - QCLuceneQueryParserPrivate(); - QCLuceneQueryParserPrivate(const QCLuceneQueryParserPrivate &other); - - ~QCLuceneQueryParserPrivate(); - - QueryParser *queryParser; - bool deleteCLuceneQueryParser; - -private: - QCLuceneQueryParserPrivate &operator=(const QCLuceneQueryParserPrivate &other); -}; - -class QHELP_EXPORT QCLuceneQueryParser -{ -public: - QCLuceneQueryParser(const QString &field, QCLuceneAnalyzer &analyzer); - virtual ~QCLuceneQueryParser(); - - QCLuceneQuery* parse(const QString &query); - QCLuceneQuery* parse(QCLuceneReader &reader); - static QCLuceneQuery* parse(const QString &query, const QString &field, - QCLuceneAnalyzer &analyzer); - QCLuceneAnalyzer getAnalyzer(); - QString getField(); - -protected: - friend class QCLuceneMultiFieldQueryParser; - QSharedDataPointer d; - -private: - QString field; - QCLuceneAnalyzer analyzer; -}; - -class QHELP_EXPORT QCLuceneMultiFieldQueryParser : public QCLuceneQueryParser -{ -public: - enum FieldFlags { - NORMAL_FIELD = 0, - REQUIRED_FIELD = 1, - PROHIBITED_FIELD = 2 - }; - - QCLuceneMultiFieldQueryParser(const QStringList &fieldList, - QCLuceneAnalyzer &analyzer); - ~QCLuceneMultiFieldQueryParser(); - - static QCLuceneQuery *parse(const QString &query, const QStringList &fieldList, - QCLuceneAnalyzer &analyzer); - static QCLuceneQuery *parse(const QString &query, const QStringList &fieldList, - QList flags, QCLuceneAnalyzer &analyzer); -}; - -QT_END_NAMESPACE - -#endif // QQUERYPARSER_P_H diff --git a/src/assistant/lib/fulltextsearch/qreader.cpp b/src/assistant/lib/fulltextsearch/qreader.cpp deleted file mode 100644 index 0a8b7accf..000000000 --- a/src/assistant/lib/fulltextsearch/qreader.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qreader_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneReaderPrivate::QCLuceneReaderPrivate() - : QSharedData() -{ - reader = 0; - deleteCLuceneReader = true; -} - -QCLuceneReaderPrivate::QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other) - : QSharedData() -{ - reader = _CL_POINTER(other.reader); - deleteCLuceneReader = other.deleteCLuceneReader; -} - -QCLuceneReaderPrivate::~QCLuceneReaderPrivate() -{ - if (deleteCLuceneReader) - _CLDECDELETE(reader); -} - -QCLuceneReader::QCLuceneReader() - : d(new QCLuceneReaderPrivate()) -{ - // nothing todo -} - -QCLuceneReader::~QCLuceneReader() -{ - // nothing todo -} - - -QCLuceneStringReader::QCLuceneStringReader(const QString &value) - : QCLuceneReader() - , string(QStringToTChar(value)) -{ - d->reader = new lucene::util::StringReader(string); -} - -QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length) - : QCLuceneReader() - , string(QStringToTChar(value)) -{ - d->reader = new lucene::util::StringReader(string, int32_t(length)); -} - -QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, - bool copyData) - : QCLuceneReader() - , string(QStringToTChar(value)) -{ - d->reader = new lucene::util::StringReader(string, int32_t(length), copyData); -} - -QCLuceneStringReader::~QCLuceneStringReader() -{ - delete [] string; -} - - -QCLuceneFileReader::QCLuceneFileReader(const QString &path, const QString &encoding, - qint32 cacheLength, qint32 cacheBuffer) - : QCLuceneReader() -{ - const QByteArray tmpPath = path.toLocal8Bit(); - const QByteArray tmpEncoding = encoding.toAscii(); - d->reader = new lucene::util::FileReader(tmpPath.constData(), - tmpEncoding.constData(), int32_t(cacheLength), int32_t(cacheBuffer)); -} - -QCLuceneFileReader::~QCLuceneFileReader() -{ - // nothing todo -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qreader_p.h b/src/assistant/lib/fulltextsearch/qreader_p.h deleted file mode 100644 index e24e9d836..000000000 --- a/src/assistant/lib/fulltextsearch/qreader_p.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QREADER_P_H -#define QREADER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qclucene_global_p.h" - -#include -#include -#include - -CL_NS_DEF(util) - class Reader; -CL_NS_END -CL_NS_USE(util) - -QT_BEGIN_NAMESPACE - -class QCLuceneField; -class QCLuceneAnalyzer; -class QCLuceneDocument; -class QCLuceneQueryParser; -class QCLuceneStandardTokenizer; - -class QHELP_EXPORT QCLuceneReaderPrivate : public QSharedData -{ -public: - QCLuceneReaderPrivate(); - QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other); - - ~QCLuceneReaderPrivate(); - - Reader* reader; - bool deleteCLuceneReader; - -private: - QCLuceneReaderPrivate &operator=(const QCLuceneReaderPrivate &other); -}; - -class QHELP_EXPORT QCLuceneReader -{ -public: - QCLuceneReader(); - virtual ~QCLuceneReader(); - -protected: - friend class QCLuceneField; - friend class QCLuceneAnalyzer; - friend class QCLuceneDocument; - friend class QCLuceneQueryParser; - friend class QCLuceneStandardTokenizer; - QSharedDataPointer d; -}; - -class QCLuceneStringReader : public QCLuceneReader -{ -public: - QCLuceneStringReader(const QString &value); - QCLuceneStringReader(const QString &value, qint32 length); - QCLuceneStringReader(const QString &value, qint32 length, bool copyData); - - ~QCLuceneStringReader(); - -private: - TCHAR *string; -}; - -class QHELP_EXPORT QCLuceneFileReader : public QCLuceneReader -{ -public: - QCLuceneFileReader(const QString &path, const QString &encoding, - qint32 cacheLength = 13, qint32 cacheBuffer = 14); - ~QCLuceneFileReader(); -}; - -QT_END_NAMESPACE - -#endif // QREADER_P_H diff --git a/src/assistant/lib/fulltextsearch/qsearchable.cpp b/src/assistant/lib/fulltextsearch/qsearchable.cpp deleted file mode 100644 index 508fc05f6..000000000 --- a/src/assistant/lib/fulltextsearch/qsearchable.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qsearchable_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneSearchablePrivate::QCLuceneSearchablePrivate() - : QSharedData() -{ - searchable = 0; - deleteCLuceneSearchable = true; -} - -QCLuceneSearchablePrivate::QCLuceneSearchablePrivate(const QCLuceneSearchablePrivate &other) - : QSharedData() -{ - searchable = _CL_POINTER(other.searchable); - deleteCLuceneSearchable = other.deleteCLuceneSearchable; -} - -QCLuceneSearchablePrivate::~QCLuceneSearchablePrivate() -{ - if (deleteCLuceneSearchable) - _CLDECDELETE(searchable); -} - - -QCLuceneSearchable::QCLuceneSearchable() - : d(new QCLuceneSearchablePrivate()) -{ - // nothing todo -} - -QCLuceneSearchable::~QCLuceneSearchable() -{ - // nothing todo -} - - -QCLuceneSearcher::QCLuceneSearcher() - : QCLuceneSearchable() -{ - // nothing todo -} - -QCLuceneSearcher::~QCLuceneSearcher() -{ - // nothing todo; -} - -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query) -{ - return search(query, QCLuceneFilter()); -} - -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, - const QCLuceneFilter &filter) -{ - return QCLuceneHits(*this, query, filter); -} - -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, - const QCLuceneSort &sort) -{ - return QCLuceneHits(*this, query, QCLuceneFilter(), sort); -} - -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, - const QCLuceneFilter &filter, - const QCLuceneSort &sort) -{ - return QCLuceneHits(*this, query, filter, sort); -} - - -QCLuceneIndexSearcher::QCLuceneIndexSearcher(const QString &path) - : QCLuceneSearcher() -{ - lucene::search::IndexSearcher *searcher = - new lucene::search::IndexSearcher(path); - - reader.d->reader = searcher->getReader(); - reader.d->deleteCLuceneIndexReader = false; - - d->searchable = searcher; -} - -QCLuceneIndexSearcher::QCLuceneIndexSearcher(const QCLuceneIndexReader &reader) - : QCLuceneSearcher() - , reader(reader) -{ - d->searchable = new lucene::search::IndexSearcher(reader.d->reader); -} - -QCLuceneIndexSearcher::~QCLuceneIndexSearcher() -{ - // nothing todo -} - -void QCLuceneIndexSearcher::close() -{ - d->searchable->close(); -} - -qint32 QCLuceneIndexSearcher::maxDoc() const -{ - return qint32(d->searchable->maxDoc()); -} - -QCLuceneIndexReader QCLuceneIndexSearcher::getReader() -{ - return reader; -} - -bool QCLuceneIndexSearcher::doc(qint32 i, QCLuceneDocument &document) -{ - return d->searchable->doc(int32_t(i), document.d->document); -} - - -QCLuceneMultiSearcher::QCLuceneMultiSearcher(const QList searchables) -: QCLuceneSearcher() -{ - lucene::search::Searchable** list= - _CL_NEWARRAY(lucene::search::Searchable*, searchables.count()); - - d->searchable = new lucene::search::MultiSearcher(list); - - _CLDELETE_ARRAY(list); -} - -QCLuceneMultiSearcher::~QCLuceneMultiSearcher() -{ - // nothing todo -} - -void QCLuceneMultiSearcher::close() -{ - d->searchable->close(); -} - -qint32 QCLuceneMultiSearcher::maxDoc() const -{ - return qint32(d->searchable->maxDoc()); -} - -qint32 QCLuceneMultiSearcher::subDoc(qint32 index) const -{ - lucene::search::MultiSearcher *searcher = - static_cast (d->searchable); - - if (searcher == 0) - return 0; - - return qint32(searcher->subDoc(int32_t(index))); -} - -qint32 QCLuceneMultiSearcher::subSearcher(qint32 index) const -{ - lucene::search::MultiSearcher *searcher = - static_cast (d->searchable); - - if (searcher == 0) - return 0; - - return qint32(searcher->subSearcher(int32_t(index))); -} - -qint32 QCLuceneMultiSearcher::searcherIndex(qint32 index) const -{ - lucene::search::MultiSearcher *searcher = - static_cast (d->searchable); - - if (searcher == 0) - return 0; - - return qint32(searcher->searcherIndex(int32_t(index))); -} - -bool QCLuceneMultiSearcher::doc(qint32 i, QCLuceneDocument &document) -{ - return d->searchable->doc(int32_t(i), document.d->document); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qsearchable_p.h b/src/assistant/lib/fulltextsearch/qsearchable_p.h deleted file mode 100644 index 149cfb049..000000000 --- a/src/assistant/lib/fulltextsearch/qsearchable_p.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QSEARCHABLE_P_H -#define QSEARCHABLE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhits_p.h" -#include "qsort_p.h" -#include "qquery_p.h" -#include "qfilter_p.h" -#include "qdocument_p.h" -#include "qindexreader_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include -#include - -CL_NS_DEF(search) - class Searcher; -CL_NS_END -CL_NS_USE(search) - -QT_BEGIN_NAMESPACE - -class QCLuceneHits; -class QCLuceneSearcher; -class QCLuceneIndexSearcher; -class QCLuceneMultiSearcher; - -class QHELP_EXPORT QCLuceneSearchablePrivate : public QSharedData -{ -public: - QCLuceneSearchablePrivate(); - QCLuceneSearchablePrivate(const QCLuceneSearchablePrivate &other); - - ~QCLuceneSearchablePrivate(); - - Searcher *searchable; - bool deleteCLuceneSearchable; - -private: - QCLuceneSearchablePrivate &operator=(const QCLuceneSearchablePrivate &other); -}; - -class QHELP_EXPORT QCLuceneSearchable -{ -public: - virtual ~QCLuceneSearchable(); - -protected: - friend class QCLuceneSearcher; - friend class QCLuceneIndexSearcher; - friend class QCLuceneMultiSearcher; - QSharedDataPointer d; - -private: - QCLuceneSearchable(); -}; - -class QHELP_EXPORT QCLuceneSearcher : public QCLuceneSearchable -{ -public: - QCLuceneSearcher(); - virtual ~QCLuceneSearcher(); - - QCLuceneHits search(const QCLuceneQuery &query); - QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneFilter &filter); - QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneSort &sort); - QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneFilter &filter, - const QCLuceneSort &sort); - -protected: - friend class QCLuceneHits; -}; - -class QHELP_EXPORT QCLuceneIndexSearcher : public QCLuceneSearcher -{ -public: - QCLuceneIndexSearcher(const QString &path); - QCLuceneIndexSearcher(const QCLuceneIndexReader &reader); - ~QCLuceneIndexSearcher(); - - void close(); - qint32 maxDoc() const; - QCLuceneIndexReader getReader(); - bool doc(qint32 i, QCLuceneDocument &document); - -private: - QCLuceneIndexReader reader; -}; - -class QHELP_EXPORT QCLuceneMultiSearcher : public QCLuceneSearcher -{ -public: - QCLuceneMultiSearcher(const QList searchables); - ~QCLuceneMultiSearcher(); - - void close(); - qint32 maxDoc() const; - qint32 subDoc(qint32 index) const; - qint32 subSearcher(qint32 index) const; - qint32 searcherIndex(qint32 index) const; - bool doc(qint32 i, QCLuceneDocument &document); -}; - -QT_END_NAMESPACE - -#endif // QSEARCHABLE_P_H diff --git a/src/assistant/lib/fulltextsearch/qsort.cpp b/src/assistant/lib/fulltextsearch/qsort.cpp deleted file mode 100644 index 4dface005..000000000 --- a/src/assistant/lib/fulltextsearch/qsort.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qsort_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneSortPrivate::QCLuceneSortPrivate() - : QSharedData() -{ - sort = 0; - deleteCLuceneSort = true; -} - -QCLuceneSortPrivate::QCLuceneSortPrivate (const QCLuceneSortPrivate &other) - : QSharedData() -{ - sort = _CL_POINTER(other.sort); - deleteCLuceneSort = other.deleteCLuceneSort; -} - -QCLuceneSortPrivate::~QCLuceneSortPrivate() -{ - if (deleteCLuceneSort) - _CLDECDELETE(sort); -} - - -QCLuceneSort::QCLuceneSort() - : d(new QCLuceneSortPrivate()) -{ - d->sort = new lucene::search::Sort(); -} - -QCLuceneSort::QCLuceneSort(const QStringList &fieldNames) - : d(new QCLuceneSortPrivate()) -{ - d->sort = new lucene::search::Sort(); - setSort(fieldNames); -} - -QCLuceneSort::QCLuceneSort(const QString &field, bool reverse) - : d(new QCLuceneSortPrivate()) -{ - d->sort = new lucene::search::Sort(); - setSort(field, reverse); -} - -QCLuceneSort::~QCLuceneSort() -{ - // nothing todo -} - -QString QCLuceneSort::toString() const -{ - return TCharToQString(d->sort->toString()); -} - -void QCLuceneSort::setSort(const QStringList &fieldNames) -{ - TCHAR **nameArray = new TCHAR*[fieldNames.count()]; - for (int i = 0; i < fieldNames.count(); ++i) - nameArray[i] = QStringToTChar(fieldNames.at(i)); - - d->sort->setSort((const TCHAR**)nameArray); - - for (int i = 0; i < fieldNames.count(); ++i) - delete [] nameArray[i]; - delete [] nameArray; -} - -void QCLuceneSort::setSort(const QString &field, bool reverse) -{ - TCHAR *name = QStringToTChar(field); - d->sort->setSort(name, reverse); - delete [] name; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qsort_p.h b/src/assistant/lib/fulltextsearch/qsort_p.h deleted file mode 100644 index 5d9372b11..000000000 --- a/src/assistant/lib/fulltextsearch/qsort_p.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QSORT_P_H -#define QSORT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qclucene_global_p.h" - -#include -#include -#include -#include - -CL_NS_DEF(search) - class Sort; -CL_NS_END -CL_NS_USE(search) - -QT_BEGIN_NAMESPACE - -class QCLuceneHits; -class QCLuceneField; - -class QHELP_EXPORT QCLuceneSortPrivate : public QSharedData -{ -public: - QCLuceneSortPrivate(); - QCLuceneSortPrivate (const QCLuceneSortPrivate &other); - - ~QCLuceneSortPrivate(); - - Sort *sort; - bool deleteCLuceneSort; - -private: - QCLuceneSortPrivate &operator=(const QCLuceneSortPrivate &other); -}; - -class QHELP_EXPORT QCLuceneSort -{ -public: - QCLuceneSort(); - explicit QCLuceneSort(const QStringList &fieldNames); - explicit QCLuceneSort(const QString &field, bool reverse = false); - - virtual ~QCLuceneSort(); - - QString toString() const; - void setSort(const QStringList &fieldNames); - void setSort(const QString &field, bool reverse = false); - -protected: - friend class QCLuceneHits; - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -#endif // QSORT_P_H diff --git a/src/assistant/lib/fulltextsearch/qterm.cpp b/src/assistant/lib/fulltextsearch/qterm.cpp deleted file mode 100644 index eeebf53c8..000000000 --- a/src/assistant/lib/fulltextsearch/qterm.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qterm_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneTermPrivate::QCLuceneTermPrivate() - : QSharedData() -{ - term = 0; - deleteCLuceneTerm = true; -} - -QCLuceneTermPrivate::QCLuceneTermPrivate(const QCLuceneTermPrivate &other) - : QSharedData() -{ - term = _CL_POINTER(other.term); - deleteCLuceneTerm = other.deleteCLuceneTerm; -} - -QCLuceneTermPrivate::~QCLuceneTermPrivate() -{ - if (deleteCLuceneTerm) - _CLDECDELETE(term); -} - - -QCLuceneTerm::QCLuceneTerm() - : d(new QCLuceneTermPrivate()) -{ - d->term = new lucene::index::Term(); -} - -QCLuceneTerm::QCLuceneTerm(const QString &field, const QString &text) - : d(new QCLuceneTermPrivate()) -{ - TCHAR *fieldName = QStringToTChar(field); - TCHAR *termText = QStringToTChar(text); - - d->term = new lucene::index::Term(fieldName, termText); - - delete [] fieldName; - delete [] termText; -} - -QCLuceneTerm::QCLuceneTerm(const QCLuceneTerm &fieldTerm, const QString &text) - : d(new QCLuceneTermPrivate()) -{ - TCHAR *termText = QStringToTChar(text); - d->term = new lucene::index::Term(fieldTerm.d->term, termText); - delete [] termText; -} - -QCLuceneTerm::~QCLuceneTerm() -{ - // nothing todo -} - -QString QCLuceneTerm::field() const -{ - return TCharToQString(d->term->field()); -} - -QString QCLuceneTerm::text() const -{ - return TCharToQString(d->term->text()); -} - -void QCLuceneTerm::set(const QString &field, const QString &text) -{ - set(field, text, true); -} - -void QCLuceneTerm::set(const QCLuceneTerm &fieldTerm, const QString &text) -{ - set(fieldTerm.field(), text, false); -} - -void QCLuceneTerm::set(const QString &field, const QString &text, bool internField) -{ - TCHAR *fieldName = QStringToTChar(field); - TCHAR *termText = QStringToTChar(text); - - d->term->set(fieldName, termText, internField); - - delete [] fieldName; - delete [] termText; -} - -bool QCLuceneTerm::equals(const QCLuceneTerm &other) const -{ - return d->term->equals(other.d->term); -} - -qint32 QCLuceneTerm::compareTo(const QCLuceneTerm &other) const -{ - return quint32(d->term->compareTo(other.d->term)); -} - -QString QCLuceneTerm::toString() const -{ - return TCharToQString(d->term->toString()); -} - -quint32 QCLuceneTerm::hashCode() const -{ - return quint32(d->term->hashCode()); -} - -quint32 QCLuceneTerm::textLength() const -{ - return quint32(d->term->textLength()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qterm_p.h b/src/assistant/lib/fulltextsearch/qterm_p.h deleted file mode 100644 index 5b981dc53..000000000 --- a/src/assistant/lib/fulltextsearch/qterm_p.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QTERM_P_H -#define QTERM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qclucene_global_p.h" - -#include -#include -#include - -CL_NS_DEF(index) - class Term; -CL_NS_END -CL_NS_USE(index) - -QT_BEGIN_NAMESPACE - -class QCLuceneTermQuery; -class QCLuceneRangeQuery; -class QCLucenePrefixQuery; -class QCLuceneIndexReader; -class QCLucenePhraseQuery; - -class QHELP_EXPORT QCLuceneTermPrivate : public QSharedData -{ -public: - QCLuceneTermPrivate(); - QCLuceneTermPrivate(const QCLuceneTermPrivate &other); - - ~QCLuceneTermPrivate(); - - Term *term; - bool deleteCLuceneTerm; - -private: - QCLuceneTermPrivate &operator=(const QCLuceneTermPrivate &other); -}; - -class QHELP_EXPORT QCLuceneTerm -{ -public: - QCLuceneTerm(); - QCLuceneTerm(const QString &field, const QString &text); - QCLuceneTerm(const QCLuceneTerm &fieldTerm, const QString &text); - - virtual ~QCLuceneTerm(); - - QString field() const; - QString text() const; - - void set(const QString &field, const QString &text); - void set(const QCLuceneTerm &fieldTerm, const QString &text); - void set(const QString &field, const QString &text, bool internField); - - bool equals(const QCLuceneTerm &other) const; - qint32 compareTo(const QCLuceneTerm &other) const; - - QString toString() const; - quint32 hashCode() const; - quint32 textLength() const; - -protected: - friend class QCLuceneTermQuery; - friend class QCLuceneRangeQuery; - friend class QCLucenePrefixQuery; - friend class QCLuceneIndexReader; - friend class QCLucenePhraseQuery; - QSharedDataPointer d; -}; - -QT_END_NAMESPACE - -#endif // QTERM_P_H diff --git a/src/assistant/lib/fulltextsearch/qtoken.cpp b/src/assistant/lib/fulltextsearch/qtoken.cpp deleted file mode 100644 index 537d9e675..000000000 --- a/src/assistant/lib/fulltextsearch/qtoken.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qtoken_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneTokenPrivate::QCLuceneTokenPrivate() - : QSharedData() -{ - token = 0; - deleteCLuceneToken = true; -} - -QCLuceneTokenPrivate::QCLuceneTokenPrivate(const QCLuceneTokenPrivate &other) - : QSharedData() -{ - token = _CL_POINTER(other.token); - deleteCLuceneToken = other.deleteCLuceneToken; -} - -QCLuceneTokenPrivate::~QCLuceneTokenPrivate() -{ - if (deleteCLuceneToken) - _CLDECDELETE(token); -} - - -QCLuceneToken::QCLuceneToken() - : d(new QCLuceneTokenPrivate()) - , tokenText(0) - , tokenType(0) -{ - d->token = new lucene::analysis::Token(); -} - -QCLuceneToken::QCLuceneToken(const QString &text, qint32 startOffset, - qint32 endOffset, const QString &defaultTyp) - : d(new QCLuceneTokenPrivate()) - , tokenText(QStringToTChar(text)) - , tokenType(QStringToTChar(defaultTyp)) -{ - d->token = new lucene::analysis::Token(tokenText, int32_t(startOffset), - int32_t(endOffset), tokenType); -} - -QCLuceneToken::~QCLuceneToken() -{ - delete [] tokenText; - delete [] tokenType; -} - -quint32 QCLuceneToken::bufferLength() const -{ - return quint32(d->token->bufferLength()); -} - -void QCLuceneToken::growBuffer(quint32 size) -{ - d->token->growBuffer(size_t(size)); -} - -qint32 QCLuceneToken::positionIncrement() const -{ - return qint32(d->token->getPositionIncrement()); -} - -void QCLuceneToken::setPositionIncrement(qint32 positionIncrement) -{ - d->token->setPositionIncrement(int32_t(positionIncrement)); -} - -QString QCLuceneToken::termText() const -{ - return TCharToQString(d->token->termText()); -} - -void QCLuceneToken::setTermText(const QString &text) -{ - delete [] tokenText; - tokenText = QStringToTChar(text); - d->token->setText(tokenText); -} - -quint32 QCLuceneToken::termTextLength() const -{ - return quint32(d->token->termTextLength()); -} - -void QCLuceneToken::resetTermTextLength() const -{ - d->token->resetTermTextLen(); -} - -qint32 QCLuceneToken::startOffset() const -{ - return quint32(d->token->startOffset()); -} - -void QCLuceneToken::setStartOffset(qint32 value) -{ - d->token->setStartOffset(int32_t(value)); -} - -qint32 QCLuceneToken::endOffset() const -{ - return quint32(d->token->endOffset()); -} - -void QCLuceneToken::setEndOffset(qint32 value) -{ - d->token->setEndOffset(int32_t(value)); -} - -QString QCLuceneToken::type() const -{ - return TCharToQString(d->token->type()); -} - -void QCLuceneToken::setType(const QString &type) -{ - delete [] tokenType; - tokenType = QStringToTChar(type); - d->token->setType(tokenType); -} - -QString QCLuceneToken::toString() const -{ - return TCharToQString(d->token->toString()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qtoken_p.h b/src/assistant/lib/fulltextsearch/qtoken_p.h deleted file mode 100644 index f3d25c4ff..000000000 --- a/src/assistant/lib/fulltextsearch/qtoken_p.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QTOKEN_P_H -#define QTOKEN_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qclucene_global_p.h" - -#include -#include -#include - -CL_NS_DEF(analysis) - class Token; -CL_NS_END -CL_NS_USE(analysis) - -QT_BEGIN_NAMESPACE - -class QCLuceneTokenizer; -class QCLuceneTokenStream; -class QCLuceneStandardTokenizer; - -class QHELP_EXPORT QCLuceneTokenPrivate : public QSharedData -{ -public: - QCLuceneTokenPrivate(); - QCLuceneTokenPrivate(const QCLuceneTokenPrivate &other); - - ~QCLuceneTokenPrivate(); - - Token *token; - bool deleteCLuceneToken; - -private: - QCLuceneTokenPrivate &operator=(const QCLuceneTokenPrivate &other); -}; - -class QHELP_EXPORT QCLuceneToken -{ -public: - QCLuceneToken(); - QCLuceneToken(const QString &text, qint32 startOffset, - qint32 endOffset, const QString &defaultTyp = QLatin1String("word")); - - virtual ~QCLuceneToken(); - - void set(const QString &text, qint32 startOffset, - qint32 endOffset, const QString &defaultTyp = QLatin1String("word")); - - quint32 bufferLength() const; - void growBuffer(quint32 size); - - qint32 positionIncrement() const; - void setPositionIncrement(qint32 positionIncrement); - - QString termText() const; - void setTermText(const QString &text); - - quint32 termTextLength() const; - void resetTermTextLength() const; - - qint32 startOffset() const; - void setStartOffset(qint32 value); - - qint32 endOffset() const; - void setEndOffset(qint32 value); - - QString type() const; - void setType(const QString &type); - - QString toString() const; - -protected: - friend class QCLuceneTokenizer; - friend class QCLuceneTokenStream; - friend class QCLuceneStandardTokenizer; - QSharedDataPointer d; - -private: - TCHAR *tokenText; - TCHAR *tokenType; -}; - -QT_END_NAMESPACE - -#endif // QTOKEN_P_H diff --git a/src/assistant/lib/fulltextsearch/qtokenizer.cpp b/src/assistant/lib/fulltextsearch/qtokenizer.cpp deleted file mode 100644 index 8a79b21e6..000000000 --- a/src/assistant/lib/fulltextsearch/qtokenizer.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qtokenizer_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneTokenizer::QCLuceneTokenizer() - : QCLuceneTokenStream() -{ - // nothing todo -} - -QCLuceneTokenizer::QCLuceneTokenizer(const QCLuceneReader &reader) - : QCLuceneTokenStream() - , reader(reader) -{ - // nothing todo -} - -QCLuceneTokenizer::~QCLuceneTokenizer() -{ - close(); -} - -void QCLuceneTokenizer::close() -{ - d->tokenStream->close(); -} - -bool QCLuceneTokenizer::next(QCLuceneToken &token) -{ - return d->tokenStream->next(token.d->token); -} - - -QCLuceneStandardTokenizer::QCLuceneStandardTokenizer(const QCLuceneReader &reader) - : QCLuceneTokenizer(reader) -{ - d->tokenStream = - new lucene::analysis::standard::StandardTokenizer(reader.d->reader); -} - -QCLuceneStandardTokenizer::~QCLuceneStandardTokenizer() -{ - // nothing todo -} - -bool QCLuceneStandardTokenizer::readApostrophe(const QString &string, - QCLuceneToken &token) -{ - lucene::analysis::standard::StandardTokenizer *stdTokenizer = - static_cast (d->tokenStream); - - if (stdTokenizer == 0) - return false; - - TCHAR* value = QStringToTChar(string); - lucene::util::StringBuffer buffer(value); - bool retValue = stdTokenizer->ReadApostrophe(&buffer, token.d->token); - delete [] value; - - return retValue; -} - -bool QCLuceneStandardTokenizer::readAt(const QString &string, QCLuceneToken &token) -{ - lucene::analysis::standard::StandardTokenizer *stdTokenizer = - static_cast (d->tokenStream); - - if (stdTokenizer == 0) - return false; - - TCHAR* value = QStringToTChar(string); - lucene::util::StringBuffer buffer(value); - bool retValue = stdTokenizer->ReadAt(&buffer, token.d->token); - delete [] value; - - return retValue; -} - -bool QCLuceneStandardTokenizer::readCompany(const QString &string, - QCLuceneToken &token) -{ - lucene::analysis::standard::StandardTokenizer *stdTokenizer = - static_cast (d->tokenStream); - - if (stdTokenizer == 0) - return false; - - TCHAR* value = QStringToTChar(string); - lucene::util::StringBuffer buffer(value); - bool retValue = stdTokenizer->ReadCompany(&buffer, token.d->token); - delete [] value; - - return retValue; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qtokenizer_p.h b/src/assistant/lib/fulltextsearch/qtokenizer_p.h deleted file mode 100644 index 0c6e8ea1d..000000000 --- a/src/assistant/lib/fulltextsearch/qtokenizer_p.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QTOKENIZER_P_H -#define QTOKENIZER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qtoken_p.h" -#include "qreader_p.h" -#include "qtokenstream_p.h" -#include "qclucene_global_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -class QHELP_EXPORT QCLuceneTokenizer : public QCLuceneTokenStream -{ -public: - QCLuceneTokenizer(const QCLuceneReader &reader); - virtual ~QCLuceneTokenizer(); - - void close(); - bool next(QCLuceneToken &token); - -protected: - friend class QCLuceneStandardTokenizer; - -private: - QCLuceneTokenizer(); - QCLuceneReader reader; -}; - -class QHELP_EXPORT QCLuceneStandardTokenizer : public QCLuceneTokenizer -{ -public: - QCLuceneStandardTokenizer(const QCLuceneReader &reader); - ~QCLuceneStandardTokenizer(); - - bool readApostrophe(const QString &string, QCLuceneToken &token); - bool readAt(const QString &string, QCLuceneToken &token); - bool readCompany(const QString &string, QCLuceneToken &token); -}; - -class QCLuceneCharTokenizer : public QCLuceneTokenizer -{ - -}; - -class QCLuceneLetterTokenizer : public QCLuceneCharTokenizer -{ - -}; - -class QCLuceneLowerCaseTokenizer : public QCLuceneLetterTokenizer -{ - -}; - -class QCLuceneWhitespaceTokenizer : public QCLuceneCharTokenizer -{ - -}; - -class QCLuceneKeywordTokenizer : public QCLuceneTokenizer -{ - -}; - -QT_END_NAMESPACE - -#endif // QTOKENIZER_P_H diff --git a/src/assistant/lib/fulltextsearch/qtokenstream.cpp b/src/assistant/lib/fulltextsearch/qtokenstream.cpp deleted file mode 100644 index 337ebf1e3..000000000 --- a/src/assistant/lib/fulltextsearch/qtokenstream.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#include "qtokenstream_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -QCLuceneTokenStreamPrivate::QCLuceneTokenStreamPrivate() - : QSharedData() -{ - tokenStream = 0; - deleteCLuceneTokenStream = true; -} - -QCLuceneTokenStreamPrivate::QCLuceneTokenStreamPrivate(const QCLuceneTokenStreamPrivate &other) - : QSharedData() -{ - tokenStream = _CL_POINTER(other.tokenStream); - deleteCLuceneTokenStream = other.deleteCLuceneTokenStream; -} - -QCLuceneTokenStreamPrivate::~QCLuceneTokenStreamPrivate() -{ - if (deleteCLuceneTokenStream) - _CLDECDELETE(tokenStream); -} - - -QCLuceneTokenStream::QCLuceneTokenStream() - : d(new QCLuceneTokenStreamPrivate()) -{ - // nothing todo -} - -QCLuceneTokenStream::~QCLuceneTokenStream() -{ - // nothing todo -} - -void QCLuceneTokenStream::close() -{ - d->tokenStream->close(); -} - -bool QCLuceneTokenStream::next(QCLuceneToken &token) -{ - return d->tokenStream->next(token.d->token); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/fulltextsearch/qtokenstream_p.h b/src/assistant/lib/fulltextsearch/qtokenstream_p.h deleted file mode 100644 index 8f4b9d06a..000000000 --- a/src/assistant/lib/fulltextsearch/qtokenstream_p.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. -** All rights reserved. -** -** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** -** 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. -** -****************************************************************************/ - -#ifndef QTOKENSTREAM_P_H -#define QTOKENSTREAM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qtoken_p.h" -#include "qclucene_global_p.h" - -#include -#include -#include - -CL_NS_DEF(analysis) - class TokenStream; -CL_NS_END -CL_NS_USE(analysis) - -QT_BEGIN_NAMESPACE - -class QCLuceneAnalyzer; -class QCLuceneTokenizer; -class QCLuceneStopAnalyzer; -class QCLuceneSimpleAnalyzer; -class QCLuceneKeywordAnalyzer; -class QCLuceneStandardAnalyzer; -class QCLuceneWhitespaceAnalyzer; -class QCLucenePerFieldAnalyzerWrapper; - -class QHELP_EXPORT QCLuceneTokenStreamPrivate : public QSharedData -{ -public: - QCLuceneTokenStreamPrivate(); - QCLuceneTokenStreamPrivate(const QCLuceneTokenStreamPrivate &other); - - ~QCLuceneTokenStreamPrivate(); - - TokenStream *tokenStream; - bool deleteCLuceneTokenStream; - -private: - QCLuceneTokenStreamPrivate &operator=(const QCLuceneTokenStreamPrivate &other); -}; - -class QHELP_EXPORT QCLuceneTokenStream -{ -public: - virtual ~QCLuceneTokenStream(); - - void close(); - bool next(QCLuceneToken &token); - -protected: - friend class QCLuceneAnalyzer; - friend class QCLuceneTokenizer; - friend class QCLuceneStopAnalyzer; - friend class QCLuceneSimpleAnalyzer; - friend class QCLuceneKeywordAnalyzer; - friend class QCLuceneStandardAnalyzer; - friend class QCLuceneWhitespaceAnalyzer; - friend class QCLucenePerFieldAnalyzerWrapper; - QSharedDataPointer d; - -private: - QCLuceneTokenStream(); -}; - -QT_END_NAMESPACE - -#endif // QTOKENSTREAM_P_H diff --git a/src/assistant/lib/helpsystem.qrc b/src/assistant/lib/helpsystem.qrc deleted file mode 100644 index 10efc6df1..000000000 --- a/src/assistant/lib/helpsystem.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - images/1leftarrow.png - images/1rightarrow.png - images/3leftarrow.png - images/3rightarrow.png - - diff --git a/src/assistant/lib/images/1leftarrow.png b/src/assistant/lib/images/1leftarrow.png deleted file mode 100644 index bd1a5a249..000000000 Binary files a/src/assistant/lib/images/1leftarrow.png and /dev/null differ diff --git a/src/assistant/lib/images/1rightarrow.png b/src/assistant/lib/images/1rightarrow.png deleted file mode 100644 index 0c0c44ae6..000000000 Binary files a/src/assistant/lib/images/1rightarrow.png and /dev/null differ diff --git a/src/assistant/lib/images/3leftarrow.png b/src/assistant/lib/images/3leftarrow.png deleted file mode 100644 index 8d38b0f57..000000000 Binary files a/src/assistant/lib/images/3leftarrow.png and /dev/null differ diff --git a/src/assistant/lib/images/3rightarrow.png b/src/assistant/lib/images/3rightarrow.png deleted file mode 100644 index c2faf501c..000000000 Binary files a/src/assistant/lib/images/3rightarrow.png and /dev/null differ diff --git a/src/assistant/lib/lib.pro b/src/assistant/lib/lib.pro deleted file mode 100644 index 280c77915..000000000 --- a/src/assistant/lib/lib.pro +++ /dev/null @@ -1,83 +0,0 @@ -load(qt_module) - -QT += widgets \ - sql \ - xml \ - network \ - core-private -TEMPLATE = lib -TARGET = QtHelp - -CONFIG += module -MODULE_PRI += ../../../modules/qt_help.pri - -DEFINES += QHELP_LIB \ - QT_CLUCENE_SUPPORT -CONFIG += qt \ - warn_on -include($$QT_SOURCE_TREE/src/qbase.pri) - -HEADERS += qthelpversion.h - -QMAKE_TARGET_PRODUCT = Help -QMAKE_TARGET_DESCRIPTION = Help \ - application \ - framework. -DEFINES -= QT_ASCII_CAST_WARNINGS -INCLUDEPATH += $$QT.help.includes -qclucene = QtCLucene$${QT_LIBINFIX} -if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { - mac:qclucene = $${qclucene}_debug - win32:qclucene = $${qclucene}d -} -linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ - QtSql \ - QtXml -LIBS_PRIVATE += -l$$qclucene -RESOURCES += helpsystem.qrc -SOURCES += qhelpenginecore.cpp \ - qhelpengine.cpp \ - qhelpdbreader.cpp \ - qhelpcontentwidget.cpp \ - qhelpindexwidget.cpp \ - qhelpgenerator.cpp \ - qhelpdatainterface.cpp \ - qhelpprojectdata.cpp \ - qhelpcollectionhandler.cpp \ - qhelpsearchengine.cpp \ - qhelpsearchquerywidget.cpp \ - qhelpsearchresultwidget.cpp \ - qhelpsearchindex_default.cpp \ - qhelpsearchindexwriter_default.cpp \ - qhelpsearchindexreader_default.cpp \ - qhelpsearchindexreader.cpp \ - qclucenefieldnames.cpp \ - qhelp_global.cpp - -# access to clucene -SOURCES += qhelpsearchindexwriter_clucene.cpp \ - qhelpsearchindexreader_clucene.cpp -HEADERS += qhelpenginecore.h \ - qhelpengine.h \ - qhelpengine_p.h \ - qhelp_global.h \ - qhelpdbreader_p.h \ - qhelpcontentwidget.h \ - qhelpindexwidget.h \ - qhelpgenerator_p.h \ - qhelpdatainterface_p.h \ - qhelpprojectdata_p.h \ - qhelpcollectionhandler_p.h \ - qhelpsearchengine.h \ - qhelpsearchquerywidget.h \ - qhelpsearchresultwidget.h \ - qhelpsearchindex_default_p.h \ - qhelpsearchindexwriter_default_p.h \ - qhelpsearchindexreader_default_p.h \ - qhelpsearchindexreader_p.h \ - qclucenefieldnames_p.h - -# access to clucene -HEADERS += qhelpsearchindexwriter_clucene_p.h \ - qhelpsearchindexreader_clucene_p.h diff --git a/src/assistant/lib/qclucenefieldnames.cpp b/src/assistant/lib/qclucenefieldnames.cpp deleted file mode 100644 index 31ef415af..000000000 --- a/src/assistant/lib/qclucenefieldnames.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qclucenefieldnames_p.h" - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace clucene { -const QString AttributeField(QLatin1String("attribute")); -const QString ContentField(QLatin1String("content")); -const QString NamespaceField(QLatin1String("namespace")); -const QString PathField(QLatin1String("path")); -const QString TitleField(QLatin1String("title")); -const QString TitleTokenizedField(QLatin1String("titleTokenized")); -} // namespace clucene -} // namespace fulltextsearch - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qclucenefieldnames_p.h b/src/assistant/lib/qclucenefieldnames_p.h deleted file mode 100644 index 733e27121..000000000 --- a/src/assistant/lib/qclucenefieldnames_p.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QCLUCENEFIELDNAMES_P_H -#define QCLUCENEFIELDNAMES_P_H - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace clucene { - extern const QString AttributeField; - extern const QString ContentField; - extern const QString NamespaceField; - extern const QString PathField; - extern const QString TitleField; - extern const QString TitleTokenizedField; -} // namespace clucene -} // namespace fulltextsearch - -QT_END_NAMESPACE - -#endif // QCLUCENEFIELDNAMES_P_H diff --git a/src/assistant/lib/qhelp_global.cpp b/src/assistant/lib/qhelp_global.cpp deleted file mode 100644 index 2c7ca6214..000000000 --- a/src/assistant/lib/qhelp_global.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include - -#include "qhelp_global.h" - -QString QHelpGlobal::uniquifyConnectionName(const QString &name, void *pointer) -{ - static int counter = 0; - static QMutex mutex; - - QMutexLocker locker(&mutex); - if (++counter > 1000) - counter = 0; - - return QString::fromLatin1("%1-%2-%3"). - arg(name).arg(quintptr(pointer)).arg(counter); -} - -QString QHelpGlobal::documentTitle(const QString &content) -{ - QString title = QCoreApplication::translate("QHelp", "Untitled"); - if (!content.isEmpty()) { - int start = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; - int end = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); - if ((end - start) > 0) { - title = content.mid(start, end - start); - if (Qt::mightBeRichText(title) || title.contains(QLatin1Char('&'))) { - QTextDocument doc; - doc.setHtml(title); - title = doc.toPlainText(); - } - } - } - return title; -} - -QString QHelpGlobal::codecFromData(const QByteArray &data) -{ - QString codec = codecFromXmlData(data); - if (codec.isEmpty()) - codec = codecFromHtmlData(data); - return codec.isEmpty() ? QLatin1String("utf-8") : codec; -} - -QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) -{ - QString head = QString::fromUtf8(data.constData(), qMin(1000, data.size())); - int start = head.indexOf(QLatin1String(" 0) { - QRegExp r(QLatin1String("charset=([^\"\\s]+)")); - while (start != -1) { - const int end = head.indexOf(QLatin1Char('>'), start) + 1; - if (end <= start) - break; - const QString &meta = head.mid(start, end - start).toLower(); - if (r.indexIn(meta) != -1) - return r.cap(1); - start = head.indexOf(QLatin1String(".*")); - return encodingExp.exactMatch(head) ? encodingExp.cap(1) : QString(); -} diff --git a/src/assistant/lib/qhelp_global.h b/src/assistant/lib/qhelp_global.h deleted file mode 100644 index 182298fc2..000000000 --- a/src/assistant/lib/qhelp_global.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELP_GLOBAL_H -#define QHELP_GLOBAL_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -#if !defined(QT_SHARED) && !defined(QT_DLL) -# define QHELP_EXPORT -#elif defined(QHELP_LIB) -# define QHELP_EXPORT Q_DECL_EXPORT -#else -# define QHELP_EXPORT Q_DECL_IMPORT -#endif - -class QHelpGlobal { -public: - static QString uniquifyConnectionName(const QString &name, void *pointer); - static QString documentTitle(const QString &content); - static QString codecFromData(const QByteArray &data); - -private: - static QString codecFromHtmlData(const QByteArray &data); - static QString codecFromXmlData(const QByteArray &data); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QHELP_GLOBAL_H diff --git a/src/assistant/lib/qhelpcollectionhandler.cpp b/src/assistant/lib/qhelpcollectionhandler.cpp deleted file mode 100644 index 169d37e05..000000000 --- a/src/assistant/lib/qhelpcollectionhandler.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpcollectionhandler_p.h" -#include "qhelp_global.h" -#include "qhelpdbreader_p.h" - -#include -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -QHelpCollectionHandler::QHelpCollectionHandler(const QString &collectionFile, QObject *parent) - : QObject(parent) - , m_dbOpened(false) - , m_collectionFile(collectionFile) - , m_connectionName(QString()) -{ - QFileInfo fi(m_collectionFile); - if (!fi.isAbsolute()) - m_collectionFile = fi.absoluteFilePath(); - m_query.clear(); -} - -QHelpCollectionHandler::~QHelpCollectionHandler() -{ - m_query.clear(); - if (m_dbOpened) - QSqlDatabase::removeDatabase(m_connectionName); -} - -bool QHelpCollectionHandler::isDBOpened() -{ - if (m_dbOpened) - return true; - emit error(tr("The collection file '%1' is not set up yet!"). - arg(m_collectionFile)); - return false; -} - -QString QHelpCollectionHandler::collectionFile() const -{ - return m_collectionFile; -} - -bool QHelpCollectionHandler::openCollectionFile() -{ - if (m_dbOpened) - return m_dbOpened; - - m_connectionName = QHelpGlobal::uniquifyConnectionName( - QLatin1String("QHelpCollectionHandler"), this); - bool openingOk = true; - { - QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), - m_connectionName); - if (db.driver() - && db.driver()->lastError().type() == QSqlError::ConnectionError) { - emit error(tr("Cannot load sqlite database driver!")); - return false; - } - - db.setDatabaseName(collectionFile()); - openingOk = db.open(); - if (openingOk) - m_query = QSqlQuery(db); - } - if (!openingOk) { - QSqlDatabase::removeDatabase(m_connectionName); - emit error(tr("Cannot open collection file: %1").arg(collectionFile())); - return false; - } - - m_query.exec(QLatin1String("PRAGMA synchronous=OFF")); - m_query.exec(QLatin1String("PRAGMA cache_size=3000")); - - m_query.exec(QLatin1String("SELECT COUNT(*) FROM sqlite_master WHERE TYPE=\'table\'" - "AND Name=\'NamespaceTable\'")); - m_query.next(); - if (m_query.value(0).toInt() < 1) { - if (!createTables(&m_query)) { - emit error(tr("Cannot create tables in file %1!").arg(collectionFile())); - return false; - } - } - - m_dbOpened = true; - return m_dbOpened; -} - -bool QHelpCollectionHandler::copyCollectionFile(const QString &fileName) -{ - if (!m_dbOpened) - return false; - - QFileInfo fi(fileName); - if (fi.exists()) { - emit error(tr("The collection file '%1' already exists!"). - arg(fileName)); - return false; - } - - if (!fi.absoluteDir().exists() && !QDir().mkpath(fi.absolutePath())) { - emit error(tr("Cannot create directory: %1").arg(fi.absolutePath())); - return false; - } - - QString colFile = fi.absoluteFilePath(); - QString connectionName = QHelpGlobal::uniquifyConnectionName( - QLatin1String("QHelpCollectionHandlerCopy"), this); - QSqlQuery *copyQuery = 0; - bool openingOk = true; - { - QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), connectionName); - db.setDatabaseName(colFile); - openingOk = db.open(); - if (openingOk) - copyQuery = new QSqlQuery(db); - } - - if (!openingOk) { - emit error(tr("Cannot open collection file: %1").arg(colFile)); - return false; - } - - copyQuery->exec(QLatin1String("PRAGMA synchronous=OFF")); - copyQuery->exec(QLatin1String("PRAGMA cache_size=3000")); - - if (!createTables(copyQuery)) { - emit error(tr("Cannot copy collection file: %1").arg(colFile)); - return false; - } - - QString oldBaseDir = QFileInfo(collectionFile()).absolutePath(); - QString oldFilePath; - QFileInfo newColFi(colFile); - m_query.exec(QLatin1String("SELECT Name, FilePath FROM NamespaceTable")); - while (m_query.next()) { - copyQuery->prepare(QLatin1String("INSERT INTO NamespaceTable VALUES(NULL, ?, ?)")); - copyQuery->bindValue(0, m_query.value(0).toString()); - oldFilePath = m_query.value(1).toString(); - if (!QDir::isAbsolutePath(oldFilePath)) - oldFilePath = oldBaseDir + QDir::separator() + oldFilePath; - copyQuery->bindValue(1, newColFi.absoluteDir().relativeFilePath(oldFilePath)); - copyQuery->exec(); - } - - m_query.exec(QLatin1String("SELECT NamespaceId, Name FROM FolderTable")); - while (m_query.next()) { - copyQuery->prepare(QLatin1String("INSERT INTO FolderTable VALUES(NULL, ?, ?)")); - copyQuery->bindValue(0, m_query.value(0).toString()); - copyQuery->bindValue(1, m_query.value(1).toString()); - copyQuery->exec(); - } - - m_query.exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); - while (m_query.next()) { - copyQuery->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); - copyQuery->bindValue(0, m_query.value(0).toString()); - copyQuery->exec(); - } - - m_query.exec(QLatin1String("SELECT Name FROM FilterNameTable")); - while (m_query.next()) { - copyQuery->prepare(QLatin1String("INSERT INTO FilterNameTable VALUES(NULL, ?)")); - copyQuery->bindValue(0, m_query.value(0).toString()); - copyQuery->exec(); - } - - m_query.exec(QLatin1String("SELECT NameId, FilterAttributeId FROM FilterTable")); - while (m_query.next()) { - copyQuery->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); - copyQuery->bindValue(0, m_query.value(0).toInt()); - copyQuery->bindValue(1, m_query.value(1).toInt()); - copyQuery->exec(); - } - - m_query.exec(QLatin1String("SELECT Key, Value FROM SettingsTable")); - while (m_query.next()) { - if (m_query.value(0).toString() == QLatin1String("CluceneSearchNamespaces")) - continue; - copyQuery->prepare(QLatin1String("INSERT INTO SettingsTable VALUES(?, ?)")); - copyQuery->bindValue(0, m_query.value(0).toString()); - copyQuery->bindValue(1, m_query.value(1)); - copyQuery->exec(); - } - - copyQuery->clear(); - delete copyQuery; - QSqlDatabase::removeDatabase(connectionName); - return true; -} - -bool QHelpCollectionHandler::createTables(QSqlQuery *query) -{ - QStringList tables; - tables << QLatin1String("CREATE TABLE NamespaceTable (" - "Id INTEGER PRIMARY KEY, " - "Name TEXT, " - "FilePath TEXT )") - << QLatin1String("CREATE TABLE FolderTable (" - "Id INTEGER PRIMARY KEY, " - "NamespaceId INTEGER, " - "Name TEXT )") - << QLatin1String("CREATE TABLE FilterAttributeTable (" - "Id INTEGER PRIMARY KEY, " - "Name TEXT )") - << QLatin1String("CREATE TABLE FilterNameTable (" - "Id INTEGER PRIMARY KEY, " - "Name TEXT )") - << QLatin1String("CREATE TABLE FilterTable (" - "NameId INTEGER, " - "FilterAttributeId INTEGER )") - << QLatin1String("CREATE TABLE SettingsTable (" - "Key TEXT PRIMARY KEY, " - "Value BLOB )"); - - foreach (const QString &q, tables) { - if (!query->exec(q)) - return false; - } - return true; -} - -QStringList QHelpCollectionHandler::customFilters() const -{ - QStringList list; - if (m_dbOpened) { - m_query.exec(QLatin1String("SELECT Name FROM FilterNameTable")); - while (m_query.next()) - list.append(m_query.value(0).toString()); - } - return list; -} - -bool QHelpCollectionHandler::removeCustomFilter(const QString &filterName) -{ - if (!isDBOpened() || filterName.isEmpty()) - return false; - - int filterNameId = -1; - m_query.prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); - m_query.bindValue(0, filterName); - m_query.exec(); - if (m_query.next()) - filterNameId = m_query.value(0).toInt(); - - if (filterNameId < 0) { - emit error(tr("Unknown filter '%1'!").arg(filterName)); - return false; - } - - m_query.prepare(QLatin1String("DELETE FROM FilterTable WHERE NameId=?")); - m_query.bindValue(0, filterNameId); - m_query.exec(); - - m_query.prepare(QLatin1String("DELETE FROM FilterNameTable WHERE Id=?")); - m_query.bindValue(0, filterNameId); - m_query.exec(); - - return true; -} - -bool QHelpCollectionHandler::addCustomFilter(const QString &filterName, - const QStringList &attributes) -{ - if (!isDBOpened() || filterName.isEmpty()) - return false; - - int nameId = -1; - m_query.prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); - m_query.bindValue(0, filterName); - m_query.exec(); - if (m_query.next()) - nameId = m_query.value(0).toInt(); - - m_query.exec(QLatin1String("SELECT Id, Name FROM FilterAttributeTable")); - QStringList idsToInsert = attributes; - QMap attributeMap; - while (m_query.next()) { - attributeMap.insert(m_query.value(1).toString(), - m_query.value(0).toInt()); - if (idsToInsert.contains(m_query.value(1).toString())) - idsToInsert.removeAll(m_query.value(1).toString()); - } - - foreach (const QString &id, idsToInsert) { - m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); - m_query.bindValue(0, id); - m_query.exec(); - attributeMap.insert(id, m_query.lastInsertId().toInt()); - } - - if (nameId < 0) { - m_query.prepare(QLatin1String("INSERT INTO FilterNameTable VALUES(NULL, ?)")); - m_query.bindValue(0, filterName); - if (m_query.exec()) - nameId = m_query.lastInsertId().toInt(); - } - - if (nameId < 0) { - emit error(tr("Cannot register filter %1!").arg(filterName)); - return false; - } - - m_query.prepare(QLatin1String("DELETE FROM FilterTable WHERE NameId=?")); - m_query.bindValue(0, nameId); - m_query.exec(); - - foreach (const QString &att, attributes) { - m_query.prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); - m_query.bindValue(0, nameId); - m_query.bindValue(1, attributeMap[att]); - if (!m_query.exec()) - return false; - } - return true; -} - -QHelpCollectionHandler::DocInfoList QHelpCollectionHandler::registeredDocumentations() const -{ - DocInfoList list; - if (m_dbOpened) { - m_query.exec(QLatin1String("SELECT a.Name, a.FilePath, b.Name " - "FROM NamespaceTable a, FolderTable b WHERE a.Id=b.NamespaceId")); - - while (m_query.next()) { - DocInfo info; - info.fileName = m_query.value(1).toString(); - info.folderName = m_query.value(2).toString(); - info.namespaceName = m_query.value(0).toString(); - list.append(info); - } - } - return list; -} - -bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) -{ - if (!isDBOpened()) - return false; - - QHelpDBReader reader(fileName, QHelpGlobal::uniquifyConnectionName( - QLatin1String("QHelpCollectionHandler"), this), 0); - if (!reader.init()) { - emit error(tr("Cannot open documentation file %1!").arg(fileName)); - return false; - } - - QString ns = reader.namespaceName(); - if (ns.isEmpty()) { - emit error(tr("Invalid documentation file '%1'!").arg(fileName)); - return false; - } - - int nsId = registerNamespace(ns, fileName); - if (nsId < 1) - return false; - - if (!registerVirtualFolder(reader.virtualFolder(), nsId)) - return false; - - addFilterAttributes(reader.filterAttributes()); - foreach (const QString &filterName, reader.customFilters()) - addCustomFilter(filterName, reader.filterAttributes(filterName)); - - optimizeDatabase(fileName); - - return true; -} - -bool QHelpCollectionHandler::unregisterDocumentation(const QString &namespaceName) -{ - if (!isDBOpened()) - return false; - - m_query.prepare(QLatin1String("SELECT Id FROM NamespaceTable WHERE Name=?")); - m_query.bindValue(0, namespaceName); - m_query.exec(); - - int nsId = -1; - if (m_query.next()) - nsId = m_query.value(0).toInt(); - - if (nsId < 0) { - emit error(tr("The namespace %1 was not registered!").arg(namespaceName)); - return false; - } - - m_query.prepare(QLatin1String("DELETE FROM NamespaceTable WHERE Id=?")); - m_query.bindValue(0, nsId); - m_query.exec(); - - m_query.prepare(QLatin1String("DELETE FROM FolderTable WHERE NamespaceId=?")); - m_query.bindValue(0, nsId); - return m_query.exec(); -} - -bool QHelpCollectionHandler::removeCustomValue(const QString &key) -{ - if (!isDBOpened()) - return false; - - m_query.prepare(QLatin1String("DELETE FROM SettingsTable WHERE Key=?")); - m_query.bindValue(0, key); - return m_query.exec(); -} - -QVariant QHelpCollectionHandler::customValue(const QString &key, - const QVariant &defaultValue) const -{ - QVariant value = defaultValue; - if (m_dbOpened) { - m_query.prepare(QLatin1String("SELECT COUNT(Key) FROM SettingsTable WHERE Key=?")); - m_query.bindValue(0, key); - if (!m_query.exec() || !m_query.next() || !m_query.value(0).toInt()) { - m_query.clear(); - return defaultValue; - } - - m_query.clear(); - m_query.prepare(QLatin1String("SELECT Value FROM SettingsTable WHERE Key=?")); - m_query.bindValue(0, key); - if (m_query.exec() && m_query.next()) - value = m_query.value(0); - m_query.clear(); - } - return value; -} - -bool QHelpCollectionHandler::setCustomValue(const QString &key, - const QVariant &value) -{ - if (!isDBOpened()) - return false; - - m_query.prepare(QLatin1String("SELECT Value FROM SettingsTable WHERE Key=?")); - m_query.bindValue(0, key); - m_query.exec(); - if (m_query.next()) { - m_query.prepare(QLatin1String("UPDATE SettingsTable SET Value=? where Key=?")); - m_query.bindValue(0, value); - m_query.bindValue(1, key); - } - else { - m_query.prepare(QLatin1String("INSERT INTO SettingsTable VALUES(?, ?)")); - m_query.bindValue(0, key); - m_query.bindValue(1, value); - } - return m_query.exec(); -} - -bool QHelpCollectionHandler::addFilterAttributes(const QStringList &attributes) -{ - if (!isDBOpened()) - return false; - - m_query.exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); - QSet atts; - while (m_query.next()) - atts.insert(m_query.value(0).toString()); - - foreach (const QString &s, attributes) { - if (!atts.contains(s)) { - m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); - m_query.bindValue(0, s); - m_query.exec(); - } - } - return true; -} - -QStringList QHelpCollectionHandler::filterAttributes() const -{ - QStringList list; - if (m_dbOpened) { - m_query.exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); - while (m_query.next()) - list.append(m_query.value(0).toString()); - } - return list; -} - -QStringList QHelpCollectionHandler::filterAttributes(const QString &filterName) const -{ - QStringList list; - if (m_dbOpened) { - m_query.prepare(QLatin1String("SELECT a.Name FROM FilterAttributeTable a, " - "FilterTable b, FilterNameTable c WHERE a.Id=b.FilterAttributeId " - "AND b.NameId=c.Id AND c.Name=?")); - m_query.bindValue(0, filterName); - m_query.exec(); - while (m_query.next()) - list.append(m_query.value(0).toString()); - } - return list; -} - -int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QString &fileName) -{ - m_query.prepare(QLatin1String("SELECT COUNT(Id) FROM NamespaceTable WHERE Name=?")); - m_query.bindValue(0, nspace); - m_query.exec(); - while (m_query.next()) { - if (m_query.value(0).toInt() > 0) { - emit error(tr("Namespace %1 already exists!").arg(nspace)); - return -1; - } - } - - QFileInfo fi(m_collectionFile); - m_query.prepare(QLatin1String("INSERT INTO NamespaceTable VALUES(NULL, ?, ?)")); - m_query.bindValue(0, nspace); - m_query.bindValue(1, fi.absoluteDir().relativeFilePath(fileName)); - int namespaceId = -1; - if (m_query.exec()) - namespaceId = m_query.lastInsertId().toInt(); - if (namespaceId < 1) { - emit error(tr("Cannot register namespace '%1'!").arg(nspace)); - return -1; - } - return namespaceId; -} - -bool QHelpCollectionHandler::registerVirtualFolder(const QString &folderName, int namespaceId) -{ - m_query.prepare(QLatin1String("INSERT INTO FolderTable VALUES(NULL, ?, ?)")); - m_query.bindValue(0, namespaceId); - m_query.bindValue(1, folderName); - return m_query.exec(); -} - -void QHelpCollectionHandler::optimizeDatabase(const QString &fileName) -{ - if (!QFile::exists(fileName)) - return; - - { // according to removeDatabase() documentation - QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), QLatin1String("optimize")); - db.setDatabaseName(fileName); - if (!db.open()) { - QSqlDatabase::removeDatabase(QLatin1String("optimize")); - emit error(tr("Cannot open database '%1' to optimize!").arg(fileName)); - return; - } - - QSqlQuery query(db); - db.exec(QLatin1String("PRAGMA synchronous=OFF")); - db.exec(QLatin1String("PRAGMA cache_size=3000")); - db.exec(QLatin1String("CREATE INDEX IF NOT EXISTS NameIndex ON IndexTable(Name)")); - db.exec(QLatin1String("CREATE INDEX IF NOT EXISTS FileNameIndex ON FileNameTable(Name)")); - db.exec(QLatin1String("CREATE INDEX IF NOT EXISTS FileIdIndex ON FileNameTable(FileId)")); - - db.close(); - } - - QSqlDatabase::removeDatabase(QLatin1String("optimize")); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpcollectionhandler_p.h b/src/assistant/lib/qhelpcollectionhandler_p.h deleted file mode 100644 index a97af8fa9..000000000 --- a/src/assistant/lib/qhelpcollectionhandler_p.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPCOLLECTIONHANDLER_H -#define QHELPCOLLECTIONHANDLER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QHelpCollectionHandler : public QObject -{ - Q_OBJECT - -public: - struct DocInfo - { - QString fileName; - QString folderName; - QString namespaceName; - }; - typedef QList DocInfoList; - - explicit QHelpCollectionHandler(const QString &collectionFile, - QObject *parent = 0); - ~QHelpCollectionHandler(); - - QString collectionFile() const; - - bool openCollectionFile(); - bool copyCollectionFile(const QString &fileName); - - QStringList customFilters() const; - bool removeCustomFilter(const QString &filterName); - bool addCustomFilter(const QString &filterName, - const QStringList &attributes); - - DocInfoList registeredDocumentations() const; - bool registerDocumentation(const QString &fileName); - bool unregisterDocumentation(const QString &namespaceName); - - bool removeCustomValue(const QString &key); - QVariant customValue(const QString &key, const QVariant &defaultValue) const; - bool setCustomValue(const QString &key, const QVariant &value); - - bool addFilterAttributes(const QStringList &attributes); - QStringList filterAttributes() const; - QStringList filterAttributes(const QString &filterName) const; - - int registerNamespace(const QString &nspace, const QString &fileName); - bool registerVirtualFolder(const QString &folderName, int namespaceId); - void optimizeDatabase(const QString &fileName); - -signals: - void error(const QString &msg); - -private: - bool isDBOpened(); - bool createTables(QSqlQuery *query); - - bool m_dbOpened; - QString m_collectionFile; - QString m_connectionName; - mutable QSqlQuery m_query; -}; - -QT_END_NAMESPACE - -#endif //QHELPCOLLECTIONHANDLER_H diff --git a/src/assistant/lib/qhelpcontentwidget.cpp b/src/assistant/lib/qhelpcontentwidget.cpp deleted file mode 100644 index 7e3cb93d1..000000000 --- a/src/assistant/lib/qhelpcontentwidget.cpp +++ /dev/null @@ -1,586 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpcontentwidget.h" -#include "qhelpenginecore.h" -#include "qhelpengine_p.h" -#include "qhelpdbreader_p.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpContentItemPrivate -{ -public: - QHelpContentItemPrivate(const QString &t, const QString &l, - QHelpDBReader *r, QHelpContentItem *p) - { - parent = p; - title = t; - link = l; - helpDBReader = r; - } - - QList childItems; - QHelpContentItem *parent; - QString title; - QString link; - QHelpDBReader *helpDBReader; -}; - -class QHelpContentProvider : public QThread -{ -public: - QHelpContentProvider(QHelpEnginePrivate *helpEngine); - ~QHelpContentProvider(); - void collectContents(const QString &customFilterName); - void stopCollecting(); - QHelpContentItem *rootItem(); - int nextChildCount() const; - -private: - void run(); - - QHelpEnginePrivate *m_helpEngine; - QHelpContentItem *m_rootItem; - QStringList m_filterAttributes; - QQueue m_rootItems; - QMutex m_mutex; - bool m_abort; -}; - -class QHelpContentModelPrivate -{ -public: - QHelpContentItem *rootItem; - QHelpContentProvider *qhelpContentProvider; -}; - - - -/*! - \class QHelpContentItem - \inmodule QtHelp - \brief The QHelpContentItem class provides an item for use with QHelpContentModel. - \since 4.4 -*/ - -QHelpContentItem::QHelpContentItem(const QString &name, const QString &link, - QHelpDBReader *reader, QHelpContentItem *parent) -{ - d = new QHelpContentItemPrivate(name, link, reader, parent); -} - -/*! - Destroys the help content item. -*/ -QHelpContentItem::~QHelpContentItem() -{ - qDeleteAll(d->childItems); - delete d; -} - -void QHelpContentItem::appendChild(QHelpContentItem *item) -{ - d->childItems.append(item); -} - -/*! - Returns the child of the content item in the give \a row. - - \sa parent() -*/ -QHelpContentItem *QHelpContentItem::child(int row) const -{ - if (row >= childCount()) - return 0; - return d->childItems.value(row); -} - -/*! - Returns the number of child items. -*/ -int QHelpContentItem::childCount() const -{ - return d->childItems.count(); -} - -/*! - Returns the row of this item from its parents view. -*/ -int QHelpContentItem::row() const -{ - if (d->parent) - return d->parent->d->childItems.indexOf(const_cast(this)); - return 0; -} - -/*! - Returns the title of the content item. -*/ -QString QHelpContentItem::title() const -{ - return d->title; -} - -/*! - Returns the URL of this content item. -*/ -QUrl QHelpContentItem::url() const -{ - return d->helpDBReader->urlOfPath(d->link); -} - -/*! - Returns the parent content item. -*/ -QHelpContentItem *QHelpContentItem::parent() const -{ - return d->parent; -} - -/*! - Returns the position of a given \a child. -*/ -int QHelpContentItem::childPosition(QHelpContentItem *child) const -{ - return d->childItems.indexOf(child); -} - - - -QHelpContentProvider::QHelpContentProvider(QHelpEnginePrivate *helpEngine) - : QThread(helpEngine) -{ - m_helpEngine = helpEngine; - m_rootItem = 0; - m_abort = false; -} - -QHelpContentProvider::~QHelpContentProvider() -{ - stopCollecting(); -} - -void QHelpContentProvider::collectContents(const QString &customFilterName) -{ - m_mutex.lock(); - m_filterAttributes = m_helpEngine->q->filterAttributes(customFilterName); - m_mutex.unlock(); - if (!isRunning()) { - start(LowPriority); - } else { - stopCollecting(); - start(LowPriority); - } -} - -void QHelpContentProvider::stopCollecting() -{ - if (!isRunning()) - return; - m_mutex.lock(); - m_abort = true; - m_mutex.unlock(); - wait(); -} - -QHelpContentItem *QHelpContentProvider::rootItem() -{ - QMutexLocker locker(&m_mutex); - return m_rootItems.dequeue(); -} - -int QHelpContentProvider::nextChildCount() const -{ - return m_rootItems.head()->childCount(); -} - -void QHelpContentProvider::run() -{ - QString title; - QString link; - int depth = 0; - QHelpContentItem *item = 0; - - m_mutex.lock(); - m_rootItem = new QHelpContentItem(QString(), QString(), 0); - m_rootItems.enqueue(m_rootItem); - QStringList atts = m_filterAttributes; - const QStringList fileNames = m_helpEngine->orderedFileNameList; - m_mutex.unlock(); - - foreach (const QString &dbFileName, fileNames) { - m_mutex.lock(); - if (m_abort) { - m_abort = false; - m_mutex.unlock(); - break; - } - m_mutex.unlock(); - QHelpDBReader reader(dbFileName, - QHelpGlobal::uniquifyConnectionName(dbFileName + - QLatin1String("FromQHelpContentProvider"), - QThread::currentThread()), 0); - if (!reader.init()) - continue; - foreach (const QByteArray& ba, reader.contentsForFilter(atts)) { - if (ba.size() < 1) - continue; - - int _depth = 0; - bool _root = false; - QStack stack; - - QDataStream s(ba); - for (;;) { - s >> depth; - s >> link; - s >> title; - if (title.isEmpty()) - break; -CHECK_DEPTH: - if (depth == 0) { - m_mutex.lock(); - item = new QHelpContentItem(title, link, - m_helpEngine->fileNameReaderMap.value(dbFileName), m_rootItem); - m_rootItem->appendChild(item); - m_mutex.unlock(); - stack.push(item); - _depth = 1; - _root = true; - } else { - if (depth > _depth && _root) { - _depth = depth; - stack.push(item); - } - if (depth == _depth) { - item = new QHelpContentItem(title, link, - m_helpEngine->fileNameReaderMap.value(dbFileName), stack.top()); - stack.top()->appendChild(item); - } else if (depth < _depth) { - stack.pop(); - --_depth; - goto CHECK_DEPTH; - } - } - } - } - } - m_mutex.lock(); - m_abort = false; - m_mutex.unlock(); -} - - - -/*! - \class QHelpContentModel - \inmodule QtHelp - \brief The QHelpContentModel class provides a model that supplies content to views. - \since 4.4 -*/ - -/*! - \fn void QHelpContentModel::contentsCreationStarted() - - This signal is emitted when the creation of the contents has - started. The current contents are invalid from this point on - until the signal contentsCreated() is emitted. - - \sa isCreatingContents() -*/ - -/*! - \fn void QHelpContentModel::contentsCreated() - - This signal is emitted when the contents have been created. -*/ - -QHelpContentModel::QHelpContentModel(QHelpEnginePrivate *helpEngine) - : QAbstractItemModel(helpEngine) -{ - d = new QHelpContentModelPrivate(); - d->rootItem = 0; - d->qhelpContentProvider = new QHelpContentProvider(helpEngine); - - connect(d->qhelpContentProvider, SIGNAL(finished()), - this, SLOT(insertContents()), Qt::QueuedConnection); - connect(helpEngine->q, SIGNAL(setupStarted()), this, SLOT(invalidateContents())); -} - -/*! - Destroys the help content model. -*/ -QHelpContentModel::~QHelpContentModel() -{ - delete d->rootItem; - delete d; -} - -void QHelpContentModel::invalidateContents(bool onShutDown) -{ - if (onShutDown) - disconnect(this, SLOT(insertContents())); - d->qhelpContentProvider->stopCollecting(); - if (d->rootItem) { - delete d->rootItem; - d->rootItem = 0; - } - if (!onShutDown) - reset(); -} - -/*! - Creates new contents by querying the help system - for contents specified for the \a customFilterName. -*/ -void QHelpContentModel::createContents(const QString &customFilterName) -{ - d->qhelpContentProvider->collectContents(customFilterName); - emit contentsCreationStarted(); -} - -void QHelpContentModel::insertContents() -{ - int count; - if (d->rootItem) { - count = d->rootItem->childCount() - 1; - beginRemoveRows(QModelIndex(), 0, count > 0 ? count : 0); - delete d->rootItem; - d->rootItem = 0; - endRemoveRows(); - } - - count = d->qhelpContentProvider->nextChildCount() - 1; - beginInsertRows(QModelIndex(), 0, count > 0 ? count : 0); - d->rootItem = d->qhelpContentProvider->rootItem(); - endInsertRows(); - reset(); - emit contentsCreated(); -} - -/*! - Returns true if the contents are currently rebuilt, otherwise - false. -*/ -bool QHelpContentModel::isCreatingContents() const -{ - return d->qhelpContentProvider->isRunning(); -} - -/*! - Returns the help content item at the model index position - \a index. -*/ -QHelpContentItem *QHelpContentModel::contentItemAt(const QModelIndex &index) const -{ - if (index.isValid()) - return static_cast(index.internalPointer()); - else - return d->rootItem; -} - -/*! - Returns the index of the item in the model specified by - the given \a row, \a column and \a parent index. -*/ -QModelIndex QHelpContentModel::index(int row, int column, const QModelIndex &parent) const -{ - if (!d->rootItem) - return QModelIndex(); - - QHelpContentItem *parentItem = contentItemAt(parent); - QHelpContentItem *item = parentItem->child(row); - if (!item) - return QModelIndex(); - return createIndex(row, column, item); -} - -/*! - Returns the parent of the model item with the given - \a index, or QModelIndex() if it has no parent. -*/ -QModelIndex QHelpContentModel::parent(const QModelIndex &index) const -{ - QHelpContentItem *item = contentItemAt(index); - if (!item) - return QModelIndex(); - - QHelpContentItem *parentItem = static_cast(item->parent()); - if (!parentItem) - return QModelIndex(); - - QHelpContentItem *grandparentItem = static_cast(parentItem->parent()); - if (!grandparentItem) - return QModelIndex(); - - int row = grandparentItem->childPosition(parentItem); - return createIndex(row, index.column(), parentItem); -} - -/*! - Returns the number of rows under the given \a parent. -*/ -int QHelpContentModel::rowCount(const QModelIndex &parent) const -{ - QHelpContentItem *parentItem = contentItemAt(parent); - if (!parentItem) - return 0; - return parentItem->childCount(); -} - -/*! - Returns the number of columns under the given \a parent. Currently returns always 1. -*/ -int QHelpContentModel::columnCount(const QModelIndex &parent) const -{ - Q_UNUSED(parent) - - return 1; -} - -/*! - Returns the data stored under the given \a role for - the item referred to by the \a index. -*/ -QVariant QHelpContentModel::data(const QModelIndex &index, int role) const -{ - if (role != Qt::DisplayRole) - return QVariant(); - - QHelpContentItem *item = contentItemAt(index); - if (!item) - return QVariant(); - return item->title(); -} - - - -/*! - \class QHelpContentWidget - \inmodule QtHelp - \brief The QHelpContentWidget class provides a tree view for displaying help content model items. - \since 4.4 -*/ - -/*! - \fn void QHelpContentWidget::linkActivated(const QUrl &link) - - This signal is emitted when a content item is activated and - its associated \a link should be shown. -*/ - -QHelpContentWidget::QHelpContentWidget() - : QTreeView(0) -{ - header()->hide(); - setUniformRowHeights(true); - connect(this, SIGNAL(activated(QModelIndex)), - this, SLOT(showLink(QModelIndex))); -} - -/*! - Returns the index of the content item with the \a link. - An invalid index is returned if no such an item exists. -*/ -QModelIndex QHelpContentWidget::indexOf(const QUrl &link) -{ - QHelpContentModel *contentModel = - qobject_cast(model()); - if (!contentModel || link.scheme() != QLatin1String("qthelp")) - return QModelIndex(); - - m_syncIndex = QModelIndex(); - for (int i=0; irowCount(); ++i) { - QHelpContentItem *itm = - contentModel->contentItemAt(contentModel->index(i, 0)); - if (itm && itm->url().host() == link.host()) { - QString path = link.path(); - if (path.startsWith(QLatin1Char('/'))) - path = path.mid(1); - if (searchContentItem(contentModel, contentModel->index(i, 0), path)) { - return m_syncIndex; - } - } - } - return QModelIndex(); -} - -bool QHelpContentWidget::searchContentItem(QHelpContentModel *model, - const QModelIndex &parent, const QString &path) -{ - QHelpContentItem *parentItem = model->contentItemAt(parent); - if (!parentItem) - return false; - - if (QDir::cleanPath(parentItem->url().path()) == path) { - m_syncIndex = parent; - return true; - } - - for (int i=0; ichildCount(); ++i) { - if (searchContentItem(model, model->index(i, 0, parent), path)) - return true; - } - return false; -} - -void QHelpContentWidget::showLink(const QModelIndex &index) -{ - QHelpContentModel *contentModel = qobject_cast(model()); - if (!contentModel) - return; - - QHelpContentItem *item = contentModel->contentItemAt(index); - if (!item) - return; - QUrl url = item->url(); - if (url.isValid()) - emit linkActivated(url); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpcontentwidget.h b/src/assistant/lib/qhelpcontentwidget.h deleted file mode 100644 index ab7d80a43..000000000 --- a/src/assistant/lib/qhelpcontentwidget.h +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPCONTENTWIDGET_H -#define QHELPCONTENTWIDGET_H - -#include - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QHelpEnginePrivate; -class QHelpDBReader; -class QHelpContentItemPrivate; -class QHelpContentModelPrivate; -class QHelpEngine; -class QHelpContentProvider; - -class QHELP_EXPORT QHelpContentItem -{ -public: - ~QHelpContentItem(); - - QHelpContentItem *child(int row) const; - int childCount() const; - QString title() const; - QUrl url() const; - int row() const; - QHelpContentItem *parent() const; - int childPosition(QHelpContentItem *child) const; - -private: - QHelpContentItem(const QString &name, const QString &link, - QHelpDBReader *reader, QHelpContentItem *parent = 0); - void appendChild(QHelpContentItem *child); - - QHelpContentItemPrivate *d; - friend class QHelpContentProvider; -}; - -class QHELP_EXPORT QHelpContentModel : public QAbstractItemModel -{ - Q_OBJECT - -public: - ~QHelpContentModel(); - - void createContents(const QString &customFilterName); - QHelpContentItem *contentItemAt(const QModelIndex &index) const; - - QVariant data(const QModelIndex &index, int role) const; - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - bool isCreatingContents() const; - -Q_SIGNALS: - void contentsCreationStarted(); - void contentsCreated(); - -private Q_SLOTS: - void insertContents(); - void invalidateContents(bool onShutDown = false); - -private: - QHelpContentModel(QHelpEnginePrivate *helpEngine); - QHelpContentModelPrivate *d; - friend class QHelpEnginePrivate; -}; - -class QHELP_EXPORT QHelpContentWidget : public QTreeView -{ - Q_OBJECT - -public: - QModelIndex indexOf(const QUrl &link); - -Q_SIGNALS: - void linkActivated(const QUrl &link); - -private Q_SLOTS: - void showLink(const QModelIndex &index); - -private: - bool searchContentItem(QHelpContentModel *model, - const QModelIndex &parent, const QString &path); - QModelIndex m_syncIndex; - -private: - QHelpContentWidget(); - friend class QHelpEngine; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif - diff --git a/src/assistant/lib/qhelpdatainterface.cpp b/src/assistant/lib/qhelpdatainterface.cpp deleted file mode 100644 index d3f07c756..000000000 --- a/src/assistant/lib/qhelpdatainterface.cpp +++ /dev/null @@ -1,273 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpdatainterface_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \internal - \class QHelpDataContentItem - \since 4.4 - \brief The QHelpDataContentItem class provides an item which represents - a topic or section of the contents. - - Every item holds several pieces of information, most notably the title - which can later be displayed in a contents overview. The reference is used - to store a relative file link to the corresponding section in the - documentation. -*/ - -/*! - Constructs a new content item with \a parent as parent item. - The constucted item has the title \a title and links to the - location specified by \a reference. -*/ -QHelpDataContentItem::QHelpDataContentItem(QHelpDataContentItem *parent, - const QString &title, const QString &reference) - : m_title(title), m_reference(reference) -{ - if (parent) - parent->m_children.append(this); -} - -/*! - Destructs the item and its children. -*/ -QHelpDataContentItem::~QHelpDataContentItem() -{ - qDeleteAll(m_children); -} - -/*! - Returns the title of the item. -*/ -QString QHelpDataContentItem::title() const -{ - return m_title; -} - -/*! - Returns the file reference of the item. -*/ -QString QHelpDataContentItem::reference() const -{ - return m_reference; -} - -/*! - Returns a list of all its child items. -*/ -QList QHelpDataContentItem::children() const -{ - return m_children; -} - -bool QHelpDataIndexItem::operator==(const QHelpDataIndexItem & other) const -{ - return (other.name == name) - && (other.reference == reference); -} - - - -/*! - \internal - \class QHelpDataFilterSection - \since 4.4 -*/ - -/*! - Constructs a help data filter section. -*/ -QHelpDataFilterSection::QHelpDataFilterSection() -{ - d = new QHelpDataFilterSectionData(); -} - -/*! - Adds the filter attribute \a filter to the filter attributes of - this section. -*/ -void QHelpDataFilterSection::addFilterAttribute(const QString &filter) -{ - d->filterAttributes.append(filter); -} - -/*! - Returns a list of all filter attributes defined for this section. -*/ -QStringList QHelpDataFilterSection::filterAttributes() const -{ - return d->filterAttributes; -} - -/*! - Adds the index item \a index to the list of indices. -*/ -void QHelpDataFilterSection::addIndex(const QHelpDataIndexItem &index) -{ - d->indices.append(index); -} - -/*! - Sets the filter sections list of indices to \a indices. -*/ -void QHelpDataFilterSection::setIndices(const QList &indices) -{ - d->indices = indices; -} - -/*! - Returns the list of indices. -*/ -QList QHelpDataFilterSection::indices() const -{ - return d->indices; -} - -/*! - Adds the top level content item \a content to the filter section. -*/ -void QHelpDataFilterSection::addContent(QHelpDataContentItem *content) -{ - d->contents.append(content); -} - -/*! - Sets the list of top level content items of the filter section to - \a contents. -*/ -void QHelpDataFilterSection::setContents(const QList &contents) -{ - qDeleteAll(d->contents); - d->contents = contents; -} - -/*! - Returns a list of top level content items. -*/ -QList QHelpDataFilterSection::contents() const -{ - return d->contents; -} - -/*! - Adds the file \a file to the filter section. -*/ -void QHelpDataFilterSection::addFile(const QString &file) -{ - d->files.append(file); -} - -/*! - Set the list of files to \a files. -*/ -void QHelpDataFilterSection::setFiles(const QStringList &files) -{ - d->files = files; -} - -/*! - Returns the list of files. -*/ -QStringList QHelpDataFilterSection::files() const -{ - return d->files; -} - -/*! - \internal - \class QHelpDataInterface - \since 4.4 -*/ - -/*! - \fn QHelpDataInterface::QHelpDataInterface() - - Constructs a new help data interface. -*/ - -/*! - \fn QHelpDataInterface::~QHelpDataInterface() - - Destroys the help data interface. -*/ - -/*! - \fn QString QHelpDataInterface::namespaceName() const = 0 - - Returns the namespace name of the help data set. -*/ - -/*! - \fn QString QHelpDataInterface::virtualFolder() const = 0 - - Returns the virtual folder of the help data set. -*/ - -/*! - \fn QList QHelpDataInterface::customFilters () const = 0 - - Returns a list of custom filters. Defining custom filters is optional. -*/ - -/*! - \fn QList QHelpDataInterface::filterSections() const = 0 - - Returns a list of filter sections. -*/ - -/*! - \fn QMap QHelpDataInterface::metaData() const = 0 - - Returns a map of meta data. A meta data item can hold almost any data - and is identified by its name. -*/ - -/*! - \fn QString QHelpDataInterface::rootPath() const = 0 - - Returns the root file path of the documentation data. All referenced file - path or links of content items are relative to this path. -*/ - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpdatainterface_p.h b/src/assistant/lib/qhelpdatainterface_p.h deleted file mode 100644 index 886d68650..000000000 --- a/src/assistant/lib/qhelpdatainterface_p.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPDATAINTERFACE_H -#define QHELPDATAINTERFACE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelp_global.h" - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QHELP_EXPORT QHelpDataContentItem -{ -public: - QHelpDataContentItem(QHelpDataContentItem *parent, const QString &title, - const QString &reference); - ~QHelpDataContentItem(); - - QString title() const; - QString reference() const; - QList children() const; - -private: - QString m_title; - QString m_reference; - QList m_children; -}; - -struct QHELP_EXPORT QHelpDataIndexItem { - QHelpDataIndexItem() {} - QHelpDataIndexItem(const QString &n, const QString &id, const QString &r) - : name(n), identifier(id), reference(r) {} - - QString name; - QString identifier; - QString reference; - - bool operator==(const QHelpDataIndexItem & other) const; -}; - -class QHelpDataFilterSectionData : public QSharedData -{ -public: - ~QHelpDataFilterSectionData() - { - qDeleteAll(contents); - } - - QStringList filterAttributes; - QList indices; - QList contents; - QStringList files; -}; - -class QHELP_EXPORT QHelpDataFilterSection -{ -public: - QHelpDataFilterSection(); - - void addFilterAttribute(const QString &filter); - QStringList filterAttributes() const; - - void addIndex(const QHelpDataIndexItem &index); - void setIndices(const QList &indices); - QList indices() const; - - void addContent(QHelpDataContentItem *content); - void setContents(const QList &contents); - QList contents() const; - - void addFile(const QString &file); - void setFiles(const QStringList &files); - QStringList files() const; - -private: - QSharedDataPointer d; -}; - -struct QHELP_EXPORT QHelpDataCustomFilter { - QStringList filterAttributes; - QString name; -}; - -class QHELP_EXPORT QHelpDataInterface -{ -public: - QHelpDataInterface() {} - virtual ~QHelpDataInterface() {} - - virtual QString namespaceName() const = 0; - virtual QString virtualFolder() const = 0; - virtual QList customFilters() const = 0; - virtual QList filterSections() const = 0; - virtual QMap metaData() const = 0; - virtual QString rootPath() const = 0; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QHELPDATAINTERFACE_H diff --git a/src/assistant/lib/qhelpdbreader.cpp b/src/assistant/lib/qhelpdbreader.cpp deleted file mode 100644 index c4735f8b8..000000000 --- a/src/assistant/lib/qhelpdbreader.cpp +++ /dev/null @@ -1,583 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpdbreader_p.h" -#include "qhelp_global.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QHelpDBReader::QHelpDBReader(const QString &dbName) - : QObject(0) -{ - initObject(dbName, - QHelpGlobal::uniquifyConnectionName(QLatin1String("QHelpDBReader"), - this)); -} - -QHelpDBReader::QHelpDBReader(const QString &dbName, const QString &uniqueId, - QObject *parent) - : QObject(parent) -{ - initObject(dbName, uniqueId); -} - -void QHelpDBReader::initObject(const QString &dbName, const QString &uniqueId) -{ - m_dbName = dbName; - m_uniqueId = uniqueId; - m_initDone = false; - m_query = 0; - m_useAttributesCache = false; -} - -QHelpDBReader::~QHelpDBReader() -{ - if (m_initDone) { - delete m_query; - QSqlDatabase::removeDatabase(m_uniqueId); - } -} - -bool QHelpDBReader::init() -{ - if (m_initDone) - return true; - - if (!QFile::exists(m_dbName)) - return false; - - QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId); - db.setDatabaseName(m_dbName); - if (!db.open()) { - /*: The placeholders are: %1 - The name of the database which cannot be opened - %2 - The unique id for the connection - %3 - The actual error string */ - m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text()); - QSqlDatabase::removeDatabase(m_uniqueId); - return false; - } - - m_initDone = true; - m_query = new QSqlQuery(db); - - return true; -} - -QString QHelpDBReader::databaseName() const -{ - return m_dbName; -} - -QString QHelpDBReader::errorMessage() const -{ - return m_error; -} - -QString QHelpDBReader::namespaceName() const -{ - if (!m_namespace.isEmpty()) - return m_namespace; - if (m_query) { - m_query->exec(QLatin1String("SELECT Name FROM NamespaceTable")); - if (m_query->next()) - m_namespace = m_query->value(0).toString(); - } - return m_namespace; -} - -QString QHelpDBReader::virtualFolder() const -{ - if (m_query) { - m_query->exec(QLatin1String("SELECT Name FROM FolderTable WHERE Id=1")); - if (m_query->next()) - return m_query->value(0).toString(); - } - return QString(); -} - -QList QHelpDBReader::filterAttributeSets() const -{ - QList result; - if (m_query) { - m_query->exec(QLatin1String("SELECT a.Id, b.Name FROM FileAttributeSetTable a, " - "FilterAttributeTable b WHERE a.FilterAttributeId=b.Id ORDER BY a.Id")); - int oldId = -1; - while (m_query->next()) { - int id = m_query->value(0).toInt(); - if (id != oldId) { - result.append(QStringList()); - oldId = id; - } - result.last().append(m_query->value(1).toString()); - } - } - return result; -} - -bool QHelpDBReader::fileExists(const QString &virtualFolder, - const QString &filePath, - const QStringList &filterAttributes) const -{ - if (virtualFolder.isEmpty() || filePath.isEmpty() || !m_query) - return false; - -//SELECT COUNT(a.Name) FROM FileNameTable a, FolderTable b, FileFilterTable c, FilterAttributeTable d WHERE a.FolderId=b.Id AND b.Name='qtdoc' AND a.Name='qstring.html' AND a.FileId=c.FileId AND c.FilterAttributeId=d.Id AND d.Name='qtrefdoc' - - QString query; - namespaceName(); - if (filterAttributes.isEmpty()) { - query = QString(QLatin1String("SELECT COUNT(a.Name) FROM FileNameTable a, FolderTable b " - "WHERE a.FolderId=b.Id AND b.Name=\'%1\' AND a.Name=\'%2\'")).arg(quote(virtualFolder)).arg(quote(filePath)); - } else { - query = QString(QLatin1String("SELECT COUNT(a.Name) FROM FileNameTable a, FolderTable b, " - "FileFilterTable c, FilterAttributeTable d WHERE a.FolderId=b.Id " - "AND b.Name=\'%1\' AND a.Name=\'%2\' AND a.FileId=c.FileId AND " - "c.FilterAttributeId=d.Id AND d.Name=\'%3\'")) - .arg(quote(virtualFolder)).arg(quote(filePath)) - .arg(quote(filterAttributes.first())); - for (int i=1; iexec(query); - if (m_query->next() && m_query->isValid() && m_query->value(0).toInt()) - return true; - return false; -} - -QByteArray QHelpDBReader::fileData(const QString &virtualFolder, - const QString &filePath) const -{ - QByteArray ba; - if (virtualFolder.isEmpty() || filePath.isEmpty() || !m_query) - return ba; - - namespaceName(); - m_query->prepare(QLatin1String("SELECT a.Data FROM FileDataTable a, FileNameTable b, FolderTable c, " - "NamespaceTable d WHERE a.Id=b.FileId AND (b.Name=? OR b.Name=?) AND b.FolderId=c.Id " - "AND c.Name=? AND c.NamespaceId=d.Id AND d.Name=?")); - m_query->bindValue(0, filePath); - m_query->bindValue(1, QString(QLatin1String("./") + filePath)); - m_query->bindValue(2, virtualFolder); - m_query->bindValue(3, m_namespace); - m_query->exec(); - if (m_query->next() && m_query->isValid()) - ba = qUncompress(m_query->value(0).toByteArray()); - return ba; -} - -QStringList QHelpDBReader::customFilters() const -{ - QStringList lst; - if (m_query) { - m_query->exec(QLatin1String("SELECT Name FROM FilterNameTable")); - while (m_query->next()) - lst.append(m_query->value(0).toString()); - } - return lst; -} - -QStringList QHelpDBReader::filterAttributes(const QString &filterName) const -{ - QStringList lst; - if (m_query) { - if (filterName.isEmpty()) { - m_query->prepare(QLatin1String("SELECT Name FROM FilterAttributeTable")); - } else { - m_query->prepare(QLatin1String("SELECT a.Name FROM FilterAttributeTable a, " - "FilterTable b, FilterNameTable c WHERE c.Name=? " - "AND c.Id=b.NameId AND b.FilterAttributeId=a.Id")); - m_query->bindValue(0, filterName); - } - m_query->exec(); - while (m_query->next()) - lst.append(m_query->value(0).toString()); - } - return lst; -} - -QStringList QHelpDBReader::indicesForFilter(const QStringList &filterAttributes) const -{ - QStringList indices; - if (!m_query) - return indices; - - //SELECT DISTINCT a.Name FROM IndexTable a, IndexFilterTable b, FilterAttributeTable c WHERE a.Id=b.IndexId AND b.FilterAttributeId=c.Id AND c.Name in ('4.2.3', 'qt') - - QString query; - if (filterAttributes.isEmpty()) { - query = QLatin1String("SELECT DISTINCT Name FROM IndexTable"); - } else { - query = QString(QLatin1String("SELECT DISTINCT a.Name FROM IndexTable a, " - "IndexFilterTable b, FilterAttributeTable c WHERE a.Id=b.IndexId " - "AND b.FilterAttributeId=c.Id AND c.Name='%1'")).arg(quote(filterAttributes.first())); - for (int i=1; iexec(query); - while (m_query->next()) { - if (!m_query->value(0).toString().isEmpty()) - indices.append(m_query->value(0).toString()); - } - return indices; -} - -void QHelpDBReader::linksForKeyword(const QString &keyword, const QStringList &filterAttributes, - QMap &linkMap) const -{ - if (!m_query) - return; - - QString query; - if (filterAttributes.isEmpty()) { - query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " - "FROM IndexTable a, FileNameTable d, " - "FolderTable e, NamespaceTable f WHERE " - "a.FileId=d.FileId AND d.FolderId=e.Id AND a.NamespaceId=f.Id " - "AND a.Name='%1'")).arg(quote(keyword)); - } else if (m_useAttributesCache) { - query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor, a.Id " - "FROM IndexTable a, " - "FileNameTable d, FolderTable e, NamespaceTable f WHERE " - "a.FileId=d.FileId AND d.FolderId=e.Id " - "AND a.NamespaceId=f.Id AND a.Name='%1'")) - .arg(quote(keyword)); - m_query->exec(query); - while (m_query->next()) { - if (m_indicesCache.contains(m_query->value(5).toInt())) { - linkMap.insertMulti(m_query->value(0).toString(), buildQUrl(m_query->value(1).toString(), - m_query->value(2).toString(), m_query->value(3).toString(), - m_query->value(4).toString())); - } - } - return; - } else { - query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " - "FROM IndexTable a, IndexFilterTable b, FilterAttributeTable c, " - "FileNameTable d, FolderTable e, NamespaceTable f " - "WHERE a.FileId=d.FileId AND d.FolderId=e.Id " - "AND a.NamespaceId=f.Id AND b.IndexId=a.Id AND b.FilterAttributeId=c.Id " - "AND a.Name='%1' AND c.Name='%2'")).arg(quote(keyword)) - .arg(quote(filterAttributes.first())); - for (int i=1; iexec(query); - while (m_query->next()) { - title = m_query->value(0).toString(); - if (title.isEmpty()) // generate a title + corresponding path - title = keyword + QLatin1String(" : ") + m_query->value(3).toString(); - linkMap.insertMulti(title, buildQUrl(m_query->value(1).toString(), - m_query->value(2).toString(), m_query->value(3).toString(), - m_query->value(4).toString())); - } -} - -void QHelpDBReader::linksForIdentifier(const QString &id, - const QStringList &filterAttributes, - QMap &linkMap) const -{ - if (!m_query) - return; - - QString query; - if (filterAttributes.isEmpty()) { - query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " - "FROM IndexTable a, FileNameTable d, FolderTable e, " - "NamespaceTable f WHERE a.FileId=d.FileId AND " - "d.FolderId=e.Id AND a.NamespaceId=f.Id AND a.Identifier='%1'")) - .arg(quote(id)); - } else if (m_useAttributesCache) { - query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor, a.Id " - "FROM IndexTable a," - "FileNameTable d, FolderTable e, NamespaceTable f WHERE " - "a.FileId=d.FileId AND d.FolderId=e.Id " - "AND a.NamespaceId=f.Id AND a.Identifier='%1'")) - .arg(quote(id)); - m_query->exec(query); - while (m_query->next()) { - if (m_indicesCache.contains(m_query->value(5).toInt())) { - linkMap.insertMulti(m_query->value(0).toString(), buildQUrl(m_query->value(1).toString(), - m_query->value(2).toString(), m_query->value(3).toString(), - m_query->value(4).toString())); - } - } - return; - } else { - query = QString(QLatin1String("SELECT d.Title, f.Name, e.Name, d.Name, a.Anchor " - "FROM IndexTable a, IndexFilterTable b, FilterAttributeTable c, " - "FileNameTable d, FolderTable e, NamespaceTable f " - "WHERE a.FileId=d.FileId AND d.FolderId=e.Id " - "AND a.NamespaceId=f.Id AND b.IndexId=a.Id AND b.FilterAttributeId=c.Id " - "AND a.Identifier='%1' AND c.Name='%2'")).arg(quote(id)) - .arg(quote(filterAttributes.first())); - for (int i=0; iexec(query); - while (m_query->next()) { - linkMap.insertMulti(m_query->value(0).toString(), buildQUrl(m_query->value(1).toString(), - m_query->value(2).toString(), m_query->value(3).toString(), - m_query->value(4).toString())); - } -} - -QUrl QHelpDBReader::buildQUrl(const QString &ns, const QString &folder, - const QString &relFileName, const QString &anchor) const -{ - QUrl url; - url.setScheme(QLatin1String("qthelp")); - url.setAuthority(ns); - url.setPath(folder + QLatin1Char('/') + relFileName); - url.setFragment(anchor); - return url; -} - -QList QHelpDBReader::contentsForFilter(const QStringList &filterAttributes) const -{ - QList contents; - if (!m_query) - return contents; - - //SELECT DISTINCT a.Data FROM ContentsTable a, ContentsFilterTable b, FilterAttributeTable c WHERE a.Id=b.ContentsId AND b.FilterAttributeId=c.Id AND c.Name='qt' INTERSECT SELECT DISTINCT a.Data FROM ContentsTable a, ContentsFilterTable b, FilterAttributeTable c WHERE a.Id=b.ContentsId AND b.FilterAttributeId=c.Id AND c.Name='3.3.8'; - - QString query; - if (filterAttributes.isEmpty()) { - query = QLatin1String("SELECT Data from ContentsTable"); - } else { - query = QString(QLatin1String("SELECT a.Data FROM ContentsTable a, " - "ContentsFilterTable b, FilterAttributeTable c " - "WHERE a.Id=b.ContentsId AND b.FilterAttributeId=c.Id " - "AND c.Name='%1'")).arg(quote(filterAttributes.first())); - for (int i=1; iexec(query); - while (m_query->next()) { - contents.append(m_query->value(0).toByteArray()); - } - return contents; -} - -QUrl QHelpDBReader::urlOfPath(const QString &relativePath) const -{ - QUrl url; - if (!m_query) - return url; - - m_query->exec(QLatin1String("SELECT a.Name, b.Name FROM NamespaceTable a, " - "FolderTable b WHERE a.id=b.NamespaceId and a.Id=1")); - if (m_query->next()) { - QString rp = relativePath; - QString anchor; - int i = rp.indexOf(QLatin1Char('#')); - if (i > -1) { - rp = relativePath.left(i); - anchor = relativePath.mid(i+1); - } - url = buildQUrl(m_query->value(0).toString(), - m_query->value(1).toString(), rp, anchor); - } - return url; -} - -QStringList QHelpDBReader::files(const QStringList &filterAttributes, - const QString &extensionFilter) const -{ - QStringList lst; - if (!m_query) - return lst; - - QString query; - QString extension; - if (!extensionFilter.isEmpty()) - extension = QString(QLatin1String("AND b.Name like \'%.%1\'")).arg(extensionFilter); - - if (filterAttributes.isEmpty()) { - query = QString(QLatin1String("SELECT a.Name, b.Name FROM FolderTable a, " - "FileNameTable b WHERE b.FolderId=a.Id %1")) - .arg(extension); - } else { - query = QString(QLatin1String("SELECT a.Name, b.Name FROM FolderTable a, " - "FileNameTable b, FileFilterTable c, FilterAttributeTable d " - "WHERE b.FolderId=a.Id AND b.FileId=c.FileId " - "AND c.FilterAttributeId=d.Id AND d.Name=\'%1\' %2")) - .arg(quote(filterAttributes.first())).arg(extension); - for (int i=1; iexec(query); - while (m_query->next()) { - lst.append(m_query->value(0).toString() + QLatin1Char('/') - + m_query->value(1).toString()); - } - - return lst; -} - -QVariant QHelpDBReader::metaData(const QString &name) const -{ - QVariant v; - if (!m_query) - return v; - - m_query->prepare(QLatin1String("SELECT COUNT(Value), Value FROM MetaDataTable " - "WHERE Name=?")); - m_query->bindValue(0, name); - if (m_query->exec() && m_query->next() - && m_query->value(0).toInt() == 1) - v = m_query->value(1); - return v; -} - -QString QHelpDBReader::mergeList(const QStringList &list) const -{ - QString str; - foreach (const QString &s, list) - str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', ")); - if (str.endsWith(QLatin1String(", "))) - str = str.left(str.length()-2); - return str; -} - -QString QHelpDBReader::quote(const QString &string) const -{ - QString s = string; - s.replace(QLatin1Char('\''), QLatin1String("\'\'")); - return s; -} - -QSet QHelpDBReader::indexIds(const QStringList &attributes) const -{ - QSet ids; - - if (attributes.isEmpty()) - return ids; - - QString query = QString(QLatin1String("SELECT a.IndexId FROM IndexFilterTable a, " - "FilterAttributeTable b WHERE a.FilterAttributeId=b.Id " - "AND b.Name='%1'")).arg(attributes.first()); - for (int i=0; iexec(query)) - return ids; - - while (m_query->next()) - ids.insert(m_query->value(0).toInt()); - - return ids; -} - -bool QHelpDBReader::createAttributesCache(const QStringList &attributes, - const QSet &indexIds) -{ - m_useAttributesCache = false; - - if (attributes.count() < 2) { - m_viewAttributes.clear(); - return true; - } - - bool needUpdate = !m_viewAttributes.count(); - - foreach (const QString &s, attributes) - m_viewAttributes.remove(s); - - if (m_viewAttributes.count() || needUpdate) { - m_viewAttributes.clear(); - m_indicesCache = indexIds; - } - foreach (const QString &s, attributes) - m_viewAttributes.insert(s); - m_useAttributesCache = true; - return true; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpdbreader_p.h b/src/assistant/lib/qhelpdbreader_p.h deleted file mode 100644 index 5fdf2e90b..000000000 --- a/src/assistant/lib/qhelpdbreader_p.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPDBREADER_H -#define QHELPDBREADER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QSqlQuery; - -class QHelpDBReader : public QObject -{ - Q_OBJECT - -public: - QHelpDBReader(const QString &dbName); - QHelpDBReader(const QString &dbName, const QString &uniqueId, - QObject *parent); - ~QHelpDBReader(); - - bool init(); - - QString errorMessage() const; - - QString databaseName() const; - QString namespaceName() const; - QString virtualFolder() const; - QList filterAttributeSets() const; - QStringList files(const QStringList &filterAttributes, - const QString &extensionFilter = QString()) const; - bool fileExists(const QString &virtualFolder, const QString &filePath, - const QStringList &filterAttributes = QStringList()) const; - QByteArray fileData(const QString &virtualFolder, - const QString &filePath) const; - - QStringList customFilters() const; - QStringList filterAttributes(const QString &filterName = QString()) const; - QStringList indicesForFilter(const QStringList &filterAttributes) const; - void linksForKeyword(const QString &keyword, const QStringList &filterAttributes, - QMap &linkMap) const; - - void linksForIdentifier(const QString &id, const QStringList &filterAttributes, - QMap &linkMap) const; - - QList contentsForFilter(const QStringList &filterAttributes) const; - QUrl urlOfPath(const QString &relativePath) const; - - QSet indexIds(const QStringList &attributes) const; - bool createAttributesCache(const QStringList &attributes, - const QSet &indexIds); - QVariant metaData(const QString &name) const; - -private: - void initObject(const QString &dbName, const QString &uniqueId); - QUrl buildQUrl(const QString &ns, const QString &folder, - const QString &relFileName, const QString &anchor) const; - QString mergeList(const QStringList &list) const; - QString quote(const QString &string) const; - - bool m_initDone; - QString m_dbName; - QString m_uniqueId; - QString m_error; - QSqlQuery *m_query; - mutable QString m_namespace; - QSet m_viewAttributes; - bool m_useAttributesCache; - QSet m_indicesCache; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/lib/qhelpengine.cpp b/src/assistant/lib/qhelpengine.cpp deleted file mode 100644 index 007cc84a9..000000000 --- a/src/assistant/lib/qhelpengine.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpengine.h" -#include "qhelpengine_p.h" -#include "qhelpdbreader_p.h" -#include "qhelpcontentwidget.h" -#include "qhelpindexwidget.h" -#include "qhelpsearchengine.h" -#include "qhelpcollectionhandler_p.h" - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QHelpEnginePrivate::QHelpEnginePrivate() - : QHelpEngineCorePrivate() - , contentModel(0) - , contentWidget(0) - , indexModel(0) - , indexWidget(0) - , searchEngine(0) -{ -} - -QHelpEnginePrivate::~QHelpEnginePrivate() -{ -} - -void QHelpEnginePrivate::init(const QString &collectionFile, - QHelpEngineCore *helpEngineCore) -{ - QHelpEngineCorePrivate::init(collectionFile, helpEngineCore); - - if (!contentModel) - contentModel = new QHelpContentModel(this); - if (!indexModel) - indexModel = new QHelpIndexModel(this); - - connect(helpEngineCore, SIGNAL(setupFinished()), this, - SLOT(applyCurrentFilter())); - connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)), this, - SLOT(applyCurrentFilter())); -} - -void QHelpEnginePrivate::applyCurrentFilter() -{ - if (!error.isEmpty()) - return; - contentModel->createContents(currentFilter); - indexModel->createIndex(currentFilter); -} - -void QHelpEnginePrivate::setContentsWidgetBusy() -{ - contentWidget->setCursor(Qt::WaitCursor); -} - -void QHelpEnginePrivate::unsetContentsWidgetBusy() -{ - contentWidget->unsetCursor(); -} - -void QHelpEnginePrivate::setIndexWidgetBusy() -{ - indexWidget->setCursor(Qt::WaitCursor); -} - -void QHelpEnginePrivate::unsetIndexWidgetBusy() -{ - indexWidget->unsetCursor(); -} - -void QHelpEnginePrivate::stopDataCollection() -{ - contentModel->invalidateContents(true); - indexModel->invalidateIndex(true); -} - - - -/*! - \class QHelpEngine - \since 4.4 - \inmodule QtHelp - \brief The QHelpEngine class provides access to contents and - indices of the help engine. - - -*/ - -/*! - Constructs a new help engine with the given \a parent. The help - engine uses the information stored in the \a collectionFile for - providing help. If the collection file does not already exist, - it will be created. -*/ -QHelpEngine::QHelpEngine(const QString &collectionFile, QObject *parent) - : QHelpEngineCore(d = new QHelpEnginePrivate(), parent) -{ - d->init(collectionFile, this); -} - -/*! - Destroys the help engine object. -*/ -QHelpEngine::~QHelpEngine() -{ - d->stopDataCollection(); -} - -/*! - Returns the content model. -*/ -QHelpContentModel *QHelpEngine::contentModel() const -{ - return d->contentModel; -} - -/*! - Returns the index model. -*/ -QHelpIndexModel *QHelpEngine::indexModel() const -{ - return d->indexModel; -} - -/*! - Returns the content widget. -*/ -QHelpContentWidget *QHelpEngine::contentWidget() -{ - if (!d->contentWidget) { - d->contentWidget = new QHelpContentWidget(); - d->contentWidget->setModel(d->contentModel); - connect(d->contentModel, SIGNAL(contentsCreationStarted()), - d, SLOT(setContentsWidgetBusy())); - connect(d->contentModel, SIGNAL(contentsCreated()), - d, SLOT(unsetContentsWidgetBusy())); - } - return d->contentWidget; -} - -/*! - Returns the index widget. -*/ -QHelpIndexWidget *QHelpEngine::indexWidget() -{ - if (!d->indexWidget) { - d->indexWidget = new QHelpIndexWidget(); - d->indexWidget->setModel(d->indexModel); - connect(d->indexModel, SIGNAL(indexCreationStarted()), - d, SLOT(setIndexWidgetBusy())); - connect(d->indexModel, SIGNAL(indexCreated()), - d, SLOT(unsetIndexWidgetBusy())); - } - return d->indexWidget; -} - -/*! - Returns the default search engine. -*/ -QHelpSearchEngine* QHelpEngine::searchEngine() -{ - if (!d->searchEngine) - d->searchEngine = new QHelpSearchEngine(this, this); - return d->searchEngine; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpengine.h b/src/assistant/lib/qhelpengine.h deleted file mode 100644 index cc0bca299..000000000 --- a/src/assistant/lib/qhelpengine.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPENGINE_H -#define QHELPENGINE_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QHelpContentModel; -class QHelpContentWidget; -class QHelpIndexModel; -class QHelpIndexWidget; -class QHelpEnginePrivate; -class QHelpSearchEngine; - -class QHELP_EXPORT QHelpEngine : public QHelpEngineCore -{ - Q_OBJECT - -public: - explicit QHelpEngine(const QString &collectionFile, QObject *parent = 0); - ~QHelpEngine(); - - QHelpContentModel *contentModel() const; - QHelpIndexModel *indexModel() const; - - QHelpContentWidget *contentWidget(); - QHelpIndexWidget *indexWidget(); - - QHelpSearchEngine *searchEngine(); - -private: - QHelpEnginePrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/assistant/lib/qhelpengine_p.h b/src/assistant/lib/qhelpengine_p.h deleted file mode 100644 index 5a7c30184..000000000 --- a/src/assistant/lib/qhelpengine_p.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPENGINE_P_H -#define QHELPENGINE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QSqlQuery; - -class QHelpEngineCore; -class QHelpDBReader; -class QHelpContentModel; -class QHelpContentWidget; -class QHelpIndexModel; -class QHelpIndexWidget; -class QHelpSearchEngine; -class QHelpCollectionHandler; - -class QHelpEngineCorePrivate : public QObject -{ - Q_OBJECT - -public: - QHelpEngineCorePrivate(); - virtual ~QHelpEngineCorePrivate(); - - virtual void init(const QString &collectionFile, - QHelpEngineCore *helpEngineCore); - - void clearMaps(); - bool setup(); - - QMap readerMap; - QMap fileNameReaderMap; - QMultiMap virtualFolderMap; - QStringList orderedFileNameList; - - QHelpCollectionHandler *collectionHandler; - QString currentFilter; - QString error; - bool needsSetup; - bool autoSaveFilter; - -protected: - QHelpEngineCore *q; - -private slots: - void errorReceived(const QString &msg); -}; - - -class QHelpEnginePrivate : public QHelpEngineCorePrivate -{ - Q_OBJECT - -public: - QHelpEnginePrivate(); - ~QHelpEnginePrivate(); - - void init(const QString &collectionFile, - QHelpEngineCore *helpEngineCore); - - QHelpContentModel *contentModel; - QHelpContentWidget *contentWidget; - - QHelpIndexModel *indexModel; - QHelpIndexWidget *indexWidget; - - QHelpSearchEngine *searchEngine; - - void stopDataCollection(); - - friend class QHelpContentProvider; - friend class QHelpContentModel; - friend class QHelpIndexProvider; - friend class QHelpIndexModel; - -public slots: - void setContentsWidgetBusy(); - void unsetContentsWidgetBusy(); - void setIndexWidgetBusy(); - void unsetIndexWidgetBusy(); - -private slots: - void applyCurrentFilter(); -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/lib/qhelpenginecore.cpp b/src/assistant/lib/qhelpenginecore.cpp deleted file mode 100644 index 178e11ee6..000000000 --- a/src/assistant/lib/qhelpenginecore.cpp +++ /dev/null @@ -1,737 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpenginecore.h" -#include "qhelpengine_p.h" -#include "qhelpdbreader_p.h" -#include "qhelpcollectionhandler_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QHelpEngineCorePrivate::QHelpEngineCorePrivate() -{ - QHelpGlobal::uniquifyConnectionName(QString(), this); - autoSaveFilter = true; -} - -void QHelpEngineCorePrivate::init(const QString &collectionFile, - QHelpEngineCore *helpEngineCore) -{ - q = helpEngineCore; - collectionHandler = new QHelpCollectionHandler(collectionFile, helpEngineCore); - connect(collectionHandler, SIGNAL(error(QString)), - this, SLOT(errorReceived(QString))); - needsSetup = true; -} - -QHelpEngineCorePrivate::~QHelpEngineCorePrivate() -{ - delete collectionHandler; - clearMaps(); -} - -void QHelpEngineCorePrivate::clearMaps() -{ - QMap::iterator it = readerMap.begin(); - while (it != readerMap.end()) { - delete it.value(); - ++it; - } - readerMap.clear(); - fileNameReaderMap.clear(); - virtualFolderMap.clear(); - orderedFileNameList.clear(); -} - -bool QHelpEngineCorePrivate::setup() -{ - error.clear(); - if (!needsSetup) - return true; - - needsSetup = false; - emit q->setupStarted(); - clearMaps(); - - if (!collectionHandler->openCollectionFile()) { - emit q->setupFinished(); - return false; - } - - const QHelpCollectionHandler::DocInfoList docList = - collectionHandler->registeredDocumentations(); - QFileInfo fi(collectionHandler->collectionFile()); - QString absFileName; - foreach(const QHelpCollectionHandler::DocInfo &info, docList) { - if (QDir::isAbsolutePath(info.fileName)) { - absFileName = info.fileName; - } else { - absFileName = QFileInfo(fi.absolutePath() + QDir::separator() + info.fileName) - .absoluteFilePath(); - } - QHelpDBReader *reader = new QHelpDBReader(absFileName, - QHelpGlobal::uniquifyConnectionName(info.fileName, this), this); - if (!reader->init()) { - emit q->warning(QHelpEngineCore::tr("Cannot open documentation file %1: %2!") - .arg(absFileName, reader->errorMessage())); - continue; - } - - readerMap.insert(info.namespaceName, reader); - fileNameReaderMap.insert(absFileName, reader); - virtualFolderMap.insert(info.folderName, reader); - orderedFileNameList.append(absFileName); - } - q->currentFilter(); - emit q->setupFinished(); - return true; -} - -void QHelpEngineCorePrivate::errorReceived(const QString &msg) -{ - error = msg; -} - - - -/*! - \class QHelpEngineCore - \since 4.4 - \inmodule QtHelp - \brief The QHelpEngineCore class provides the core functionality - of the help system. - - Before the help engine can be used, it must be initialized by - calling setupData(). At the beginning of the setup process the - signal setupStarted() is emitted. From this point on until - the signal setupFinished() is emitted, is the help data in an - undefined meaning unusable state. - - The core help engine can be used to perform different tasks. - By calling linksForIdentifier() the engine returns - urls specifying the file locations inside the help system. The - actual file data can then be retrived by calling fileData(). In - contrast to all other functions in this class, linksForIdentifier() - depends on the currently set custom filter. Depending on the filter, - the function may return different hits. - - Every help engine can contain any number of custom filters. A custom - filter is defined by a name and set of filter attributes and can be - added to the help engine by calling addCustomFilter(). Analogous, - it is removed by calling removeCustomFilter(). customFilters() returns - all defined filters. - - The help engine also offers the possibility to set and read values - in a persistant way comparable to ini files or Windows registry - entries. For more information see setValue() or value(). - - This class does not offer any GUI components or functionality for - indices or contents. If you need one of those use QHelpEngine - instead. - - When creating a custom help viewer the viewer can be - configured by writing a custom collection file which could contain various - keywords to be used to configure the help engine. These keywords and values - and their meaning can be found in the help information for - \l{assistant-custom-help-viewer.html#creating-a-custom-help-collection-file} - {creating a custom help collection file} for Assistant. -*/ - -/*! - \fn void QHelpEngineCore::setupStarted() - - This signal is emitted when setup is started. -*/ - -/*! - \fn void QHelpEngineCore::setupFinished() - - This signal is emitted when the setup is complete. -*/ - -/*! - \fn void QHelpEngineCore::currentFilterChanged(const QString &newFilter) - - This signal is emitted when the current filter is changed to - \a newFilter. -*/ - -/*! - \fn void QHelpEngineCore::warning(const QString &msg) - - This signal is emitted when a non critical error occurs. - The warning message is stored in \a msg. -*/ - -/*! - Constructs a new core help engine with a \a parent. The help engine - uses the information stored in the \a collectionFile to provide help. - If the collection file does not exist yet, it'll be created. -*/ -QHelpEngineCore::QHelpEngineCore(const QString &collectionFile, QObject *parent) - : QObject(parent) -{ - d = new QHelpEngineCorePrivate(); - d->init(collectionFile, this); -} - -/*! - \internal -*/ -QHelpEngineCore::QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate, - QObject *parent) - : QObject(parent) -{ - d = helpEngineCorePrivate; -} - -/*! - Destructs the help engine. -*/ -QHelpEngineCore::~QHelpEngineCore() -{ - delete d; -} - -/*! - \property QHelpEngineCore::collectionFile - \brief the absolute file name of the collection file currently used. - \since 4.5 - - Setting this property leaves the help engine in an invalid state. It is - important to invoke setupData() or any getter function in order to setup - the help engine again. -*/ -QString QHelpEngineCore::collectionFile() const -{ - return d->collectionHandler->collectionFile(); -} - -void QHelpEngineCore::setCollectionFile(const QString &fileName) -{ - if (fileName == collectionFile()) - return; - - if (d->collectionHandler) { - delete d->collectionHandler; - d->collectionHandler = 0; - d->clearMaps(); - } - d->init(fileName, this); - d->needsSetup = true; -} - -/*! - Sets up the help engine by processing the information found - in the collection file and returns true if successful; otherwise - returns false. - - By calling the function, the help - engine is forced to initialize itself immediately. Most of - the times, this function does not have to be called - explicitly because getter functions which depend on a correctly - set up help engine do that themselves. - - \note \c{qsqlite4.dll} needs to be deployed with the application as the - help system uses the sqlite driver when loading help collections. -*/ -bool QHelpEngineCore::setupData() -{ - d->needsSetup = true; - return d->setup(); -} - -/*! - Creates the file \a fileName and copies all contents from - the current collection file into the newly created file, - and returns true if successful; otherwise returns false. - - The copying process makes sure that file references to Qt - Collection files (\c{.qch}) files are updated accordingly. -*/ -bool QHelpEngineCore::copyCollectionFile(const QString &fileName) -{ - if (!d->setup()) - return false; - return d->collectionHandler->copyCollectionFile(fileName); -} - -/*! - Returns the namespace name defined for the Qt compressed help file (.qch) - specified by its \a documentationFileName. If the file is not valid, an - empty string is returned. - - \sa documentationFileName() -*/ -QString QHelpEngineCore::namespaceName(const QString &documentationFileName) -{ - QHelpDBReader reader(documentationFileName, - QHelpGlobal::uniquifyConnectionName(QLatin1String("GetNamespaceName"), - QThread::currentThread()), 0); - if (reader.init()) - return reader.namespaceName(); - return QString(); -} - -/*! - Registers the Qt compressed help file (.qch) contained in the file - \a documentationFileName. One compressed help file, uniquely - identified by its namespace can only be registered once. - True is returned if the registration was successful, otherwise - false. - - \sa unregisterDocumentation(), error() -*/ -bool QHelpEngineCore::registerDocumentation(const QString &documentationFileName) -{ - d->error.clear(); - d->needsSetup = true; - return d->collectionHandler->registerDocumentation(documentationFileName); -} - -/*! - Unregisters the Qt compressed help file (.qch) identified by its - \a namespaceName from the help collection. Returns true - on success, otherwise false. - - \sa registerDocumentation(), error() -*/ -bool QHelpEngineCore::unregisterDocumentation(const QString &namespaceName) -{ - d->error.clear(); - d->needsSetup = true; - return d->collectionHandler->unregisterDocumentation(namespaceName); -} - -/*! - Returns the absolute file name of the Qt compressed help file (.qch) - identified by the \a namespaceName. If there is no Qt compressed help file - with the specified namespace registered, an empty string is returned. - - \sa namespaceName() -*/ -QString QHelpEngineCore::documentationFileName(const QString &namespaceName) -{ - if (d->setup()) { - const QHelpCollectionHandler::DocInfoList docList = - d->collectionHandler->registeredDocumentations(); - foreach(const QHelpCollectionHandler::DocInfo &info, docList) { - if (info.namespaceName == namespaceName) { - if (QDir::isAbsolutePath(info.fileName)) - return QDir::cleanPath(info.fileName); - - QFileInfo fi(d->collectionHandler->collectionFile()); - fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName); - return QDir::cleanPath(fi.absoluteFilePath()); - } - } - } - return QString(); -} - -/*! - Returns a list of all registered Qt compressed help files of the current collection file. - The returned names are the namespaces of the registered Qt compressed help files (.qch). -*/ -QStringList QHelpEngineCore::registeredDocumentations() const -{ - QStringList list; - if (!d->setup()) - return list; - const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations(); - foreach(const QHelpCollectionHandler::DocInfo &info, docList) { - list.append(info.namespaceName); - } - return list; -} - -/*! - Returns a list of custom filters. - - \sa addCustomFilter(), removeCustomFilter() -*/ -QStringList QHelpEngineCore::customFilters() const -{ - if (!d->setup()) - return QStringList(); - return d->collectionHandler->customFilters(); -} - -/*! - Adds the new custom filter \a filterName. The filter attributes - are specified by \a attributes. If the filter already exists, - its attribute set is replaced. The function returns true if - the operation succeeded, otherwise it returns false. - - \sa customFilters(), removeCustomFilter() -*/ -bool QHelpEngineCore::addCustomFilter(const QString &filterName, - const QStringList &attributes) -{ - d->error.clear(); - d->needsSetup = true; - return d->collectionHandler->addCustomFilter(filterName, - attributes); -} - -/*! - Returns true if the filter \a filterName was removed successfully, - otherwise false. - - \sa addCustomFilter(), customFilters() -*/ -bool QHelpEngineCore::removeCustomFilter(const QString &filterName) -{ - d->error.clear(); - d->needsSetup = true; - return d->collectionHandler->removeCustomFilter(filterName); -} - -/*! - Returns a list of all defined filter attributes. -*/ -QStringList QHelpEngineCore::filterAttributes() const -{ - if (!d->setup()) - return QStringList(); - return d->collectionHandler->filterAttributes(); -} - -/*! - Returns a list of filter attributes used by the custom - filter \a filterName. -*/ -QStringList QHelpEngineCore::filterAttributes(const QString &filterName) const -{ - if (!d->setup()) - return QStringList(); - return d->collectionHandler->filterAttributes(filterName); -} - -/*! - \property QHelpEngineCore::currentFilter - \brief the name of the custom filter currently applied. - \since 4.5 - - Setting this property will save the new custom filter permanently in the - help collection file. To set a custom filter without saving it - permanently, disable the auto save filter mode. - - \sa autoSaveFilter() -*/ -QString QHelpEngineCore::currentFilter() const -{ - if (!d->setup()) - return QString(); - - if (d->currentFilter.isEmpty()) { - QString filter = - d->collectionHandler->customValue(QLatin1String("CurrentFilter"), - QString()).toString(); - if (!filter.isEmpty() - && d->collectionHandler->customFilters().contains(filter)) - d->currentFilter = filter; - } - return d->currentFilter; -} - -void QHelpEngineCore::setCurrentFilter(const QString &filterName) -{ - if (!d->setup() || filterName == d->currentFilter) - return; - d->currentFilter = filterName; - if (d->autoSaveFilter) { - d->collectionHandler->setCustomValue(QLatin1String("CurrentFilter"), - d->currentFilter); - } - emit currentFilterChanged(d->currentFilter); -} - -/*! - Returns a list of filter attributes for the different filter sections - defined in the Qt compressed help file with the given namespace - \a namespaceName. -*/ -QList QHelpEngineCore::filterAttributeSets(const QString &namespaceName) const -{ - if (d->setup()) { - QHelpDBReader *reader = d->readerMap.value(namespaceName); - if (reader) - return reader->filterAttributeSets(); - } - return QList(); -} - -/*! - Returns a list of files contained in the Qt compressed help file \a - namespaceName. The files can be filtered by \a filterAttributes as - well as by their extension \a extensionFilter (e.g. 'html'). -*/ -QList QHelpEngineCore::files(const QString namespaceName, - const QStringList &filterAttributes, - const QString &extensionFilter) -{ - QList res; - if (!d->setup()) - return res; - QHelpDBReader *reader = d->readerMap.value(namespaceName); - if (!reader) { - d->error = tr("The specified namespace does not exist!"); - return res; - } - - QUrl url; - url.setScheme(QLatin1String("qthelp")); - url.setAuthority(namespaceName); - - const QStringList files = reader->files(filterAttributes, extensionFilter); - foreach (const QString &file, files) { - url.setPath(QLatin1String("/") + file); - res.append(url); - } - return res; -} - -/*! - Returns an invalid URL if the file \a url cannot be found. - If the file exists, either the same url is returned or a - different url if the file is located in a different namespace - which is merged via a common virtual folder. -*/ -QUrl QHelpEngineCore::findFile(const QUrl &url) const -{ - QUrl res; - if (!d->setup() || !url.isValid() || url.toString().count(QLatin1Char('/')) < 4 - || url.scheme() != QLatin1String("qthelp")) - return res; - - QString ns = url.authority(); - QString filePath = QDir::cleanPath(url.path()); - if (filePath.startsWith(QLatin1Char('/'))) - filePath = filePath.mid(1); - QString virtualFolder = filePath.mid(0, filePath.indexOf(QLatin1Char('/'), 1)); - filePath = filePath.mid(virtualFolder.length()+1); - - QHelpDBReader *defaultReader = 0; - if (d->readerMap.contains(ns)) { - defaultReader = d->readerMap.value(ns); - if (defaultReader->fileExists(virtualFolder, filePath)) - return url; - } - - QStringList filterAtts = filterAttributes(currentFilter()); - foreach (QHelpDBReader *reader, d->virtualFolderMap.values(virtualFolder)) { - if (reader == defaultReader) - continue; - if (reader->fileExists(virtualFolder, filePath, filterAtts)) { - res = url; - res.setAuthority(reader->namespaceName()); - return res; - } - } - - foreach (QHelpDBReader *reader, d->virtualFolderMap.values(virtualFolder)) { - if (reader == defaultReader) - continue; - if (reader->fileExists(virtualFolder, filePath)) { - res = url; - res.setAuthority(reader->namespaceName()); - break; - } - } - - return res; -} - -/*! - Returns the data of the file specified by \a url. If the - file does not exist, an empty QByteArray is returned. - - \sa findFile() -*/ -QByteArray QHelpEngineCore::fileData(const QUrl &url) const -{ - if (!d->setup() || !url.isValid() || url.toString().count(QLatin1Char('/')) < 4 - || url.scheme() != QLatin1String("qthelp")) - return QByteArray(); - - QString ns = url.authority(); - QString filePath = QDir::cleanPath(url.path()); - if (filePath.startsWith(QLatin1Char('/'))) - filePath = filePath.mid(1); - QString virtualFolder = filePath.mid(0, filePath.indexOf(QLatin1Char('/'), 1)); - filePath = filePath.mid(virtualFolder.length()+1); - - QByteArray ba; - QHelpDBReader *defaultReader = 0; - if (d->readerMap.contains(ns)) { - defaultReader = d->readerMap.value(ns); - ba = defaultReader->fileData(virtualFolder, filePath); - } - - if (ba.isEmpty()) { - foreach (QHelpDBReader *reader, d->virtualFolderMap.values(virtualFolder)) { - if (reader == defaultReader) - continue; - ba = reader->fileData(virtualFolder, filePath); - if (!ba.isEmpty()) - return ba; - } - } - return ba; -} - -/*! - Returns a map of hits found for the \a id. A hit contains the - title of the document and the url where the keyword is located. - The result depends on the current filter, meaning only the keywords - registered for the current filter will be returned. -*/ -QMap QHelpEngineCore::linksForIdentifier(const QString &id) const -{ - QMap linkMap; - if (!d->setup()) - return linkMap; - - QStringList atts = filterAttributes(d->currentFilter); - foreach (QHelpDBReader *reader, d->readerMap) - reader->linksForIdentifier(id, atts, linkMap); - - return linkMap; -} - -/*! - Removes the \a key from the settings section in the - collection file. Returns true if the value was removed - successfully, otherwise false. - - \sa customValue(), setCustomValue() -*/ -bool QHelpEngineCore::removeCustomValue(const QString &key) -{ - d->error.clear(); - return d->collectionHandler->removeCustomValue(key); -} - -/*! - Returns the value assigned to the \a key. If the requested - key does not exist, the specified \a defaultValue is - returned. - - \sa setCustomValue(), removeCustomValue() -*/ -QVariant QHelpEngineCore::customValue(const QString &key, const QVariant &defaultValue) const -{ - if (!d->setup()) - return QVariant(); - return d->collectionHandler->customValue(key, defaultValue); -} - -/*! - Save the \a value under the \a key. If the key already exist, - the value will be overwritten. Returns true if the value was - saved successfully, otherwise false. - - \sa customValue(), removeCustomValue() -*/ -bool QHelpEngineCore::setCustomValue(const QString &key, const QVariant &value) -{ - d->error.clear(); - return d->collectionHandler->setCustomValue(key, value); -} - -/*! - Returns the meta data for the Qt compressed help file \a - documentationFileName. If there is no data available for - \a name, an invalid QVariant() is returned. The meta - data is defined when creating the Qt compressed help file and - cannot be modified later. Common meta data includes e.g. - the author of the documentation. -*/ -QVariant QHelpEngineCore::metaData(const QString &documentationFileName, - const QString &name) -{ - QHelpDBReader reader(documentationFileName, QLatin1String("GetMetaData"), 0); - - if (reader.init()) - return reader.metaData(name); - return QVariant(); -} - -/*! - Returns a description of the last error that occurred. -*/ -QString QHelpEngineCore::error() const -{ - return d->error; -} - -/*! - \property QHelpEngineCore::autoSaveFilter - \brief whether QHelpEngineCore is in auto save filter mode or not. - \since 4.5 - - If QHelpEngineCore is in auto save filter mode, the current filter is - automatically saved when it is changed by the setCurrentFilter() - function. The filter is saved persistently in the help collection file. - - By default, this mode is on. -*/ -void QHelpEngineCore::setAutoSaveFilter(bool save) -{ - d->autoSaveFilter = save; -} - -bool QHelpEngineCore::autoSaveFilter() const -{ - return d->autoSaveFilter; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpenginecore.h b/src/assistant/lib/qhelpenginecore.h deleted file mode 100644 index fbfb8a0e8..000000000 --- a/src/assistant/lib/qhelpenginecore.h +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPENGINECORE_H -#define QHELPENGINECORE_H - -#include - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QHelpEngineCorePrivate; - -class QHELP_EXPORT QHelpEngineCore : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool autoSaveFilter READ autoSaveFilter WRITE setAutoSaveFilter) - Q_PROPERTY(QString collectionFile READ collectionFile WRITE setCollectionFile) - Q_PROPERTY(QString currentFilter READ currentFilter WRITE setCurrentFilter) - -public: - explicit QHelpEngineCore(const QString &collectionFile, QObject *parent = 0); - virtual ~QHelpEngineCore(); - - bool setupData(); - - QString collectionFile() const; - void setCollectionFile(const QString &fileName); - - bool copyCollectionFile(const QString &fileName); - - static QString namespaceName(const QString &documentationFileName); - bool registerDocumentation(const QString &documentationFileName); - bool unregisterDocumentation(const QString &namespaceName); - QString documentationFileName(const QString &namespaceName); - - QStringList customFilters() const; - bool removeCustomFilter(const QString &filterName); - bool addCustomFilter(const QString &filterName, - const QStringList &attributes); - - QStringList filterAttributes() const; - QStringList filterAttributes(const QString &filterName) const; - - QString currentFilter() const; - void setCurrentFilter(const QString &filterName); - - QStringList registeredDocumentations() const; - QList filterAttributeSets(const QString &namespaceName) const; - QList files(const QString namespaceName, - const QStringList &filterAttributes, - const QString &extensionFilter = QString()); - QUrl findFile(const QUrl &url) const; - QByteArray fileData(const QUrl &url) const; - - QMap linksForIdentifier(const QString &id) const; - - bool removeCustomValue(const QString &key); - QVariant customValue(const QString &key, - const QVariant &defaultValue = QVariant()) const; - bool setCustomValue(const QString &key, const QVariant &value); - - static QVariant metaData(const QString &documentationFileName, - const QString &name); - - QString error() const; - - void setAutoSaveFilter(bool save); - bool autoSaveFilter() const; - -Q_SIGNALS: - void setupStarted(); - void setupFinished(); - void currentFilterChanged(const QString &newFilter); - void warning(const QString &msg); - -protected: - QHelpEngineCore(QHelpEngineCorePrivate *helpEngineCorePrivate, - QObject *parent); - -private: - QHelpEngineCorePrivate *d; - friend class QHelpEngineCorePrivate; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QHELPENGINECORE_H diff --git a/src/assistant/lib/qhelpgenerator.cpp b/src/assistant/lib/qhelpgenerator.cpp deleted file mode 100644 index ce9c8562d..000000000 --- a/src/assistant/lib/qhelpgenerator.cpp +++ /dev/null @@ -1,909 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpgenerator_p.h" -#include "qhelpdatainterface_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpGeneratorPrivate -{ -public: - QHelpGeneratorPrivate(); - ~QHelpGeneratorPrivate(); - - QString error; - QSqlQuery *query; - - int namespaceId; - int virtualFolderId; - - QMap fileMap; - QMap > fileFilterMap; - - double progress; - double oldProgress; - double contentStep; - double fileStep; - double indexStep; -}; - -QHelpGeneratorPrivate::QHelpGeneratorPrivate() -{ - query = 0; - namespaceId = -1; - virtualFolderId = -1; -} - -QHelpGeneratorPrivate::~QHelpGeneratorPrivate() -{ -} - - - -/*! - \internal - \class QHelpGenerator - \since 4.4 - \brief The QHelpGenerator class generates a new - Qt compressed help file (.qch). - - The help generator takes a help data structure as - input for generating a new Qt compressed help files. Since - the generation may takes some time, the generator emits - various signals to inform about its current state. -*/ - -/*! - \fn void QHelpGenerator::statusChanged(const QString &msg) - - This signal is emitted when the generation status changes. - The status is basically a specific task like inserting - files or building up the keyword index. The parameter - \a msg contains the detailed status description. -*/ - -/*! - \fn void QHelpGenerator::progressChanged(double progress) - - This signal is emitted when the progress changes. The - \a progress ranges from 0 to 100. -*/ - -/*! - \fn void QHelpGenerator::warning(const QString &msg) - - This signal is emitted when a non critical error occurs, - e.g. when a referenced file cannot be found. \a msg - contains the exact warning message. -*/ - -/*! - Constructs a new help generator with the give \a parent. -*/ -QHelpGenerator::QHelpGenerator(QObject *parent) - : QObject(parent) -{ - d = new QHelpGeneratorPrivate; -} - -/*! - Destructs the help generator. -*/ -QHelpGenerator::~QHelpGenerator() -{ - delete d; -} - -/*! - Takes the \a helpData and generates a new documentation - set from it. The Qt compressed help file is written to \a - outputFileName. Returns true on success, otherwise false. -*/ -bool QHelpGenerator::generate(QHelpDataInterface *helpData, - const QString &outputFileName) -{ - emit progressChanged(0); - d->error.clear(); - if (!helpData || helpData->namespaceName().isEmpty()) { - d->error = tr("Invalid help data!"); - return false; - } - - QString outFileName = outputFileName; - if (outFileName.isEmpty()) { - d->error = tr("No output file name specified!"); - return false; - } - - QFileInfo fi(outFileName); - if (fi.exists()) { - if (!fi.dir().remove(fi.fileName())) { - d->error = tr("The file %1 cannot be overwritten!").arg(outFileName); - return false; - } - } - - setupProgress(helpData); - - emit statusChanged(tr("Building up file structure...")); - bool openingOk = true; - { - QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), QLatin1String("builder")); - db.setDatabaseName(outFileName); - openingOk = db.open(); - if (openingOk) - d->query = new QSqlQuery(db); - } - - if (!openingOk) { - d->error = tr("Cannot open data base file %1!").arg(outFileName); - cleanupDB(); - return false; - } - - d->query->exec(QLatin1String("PRAGMA synchronous=OFF")); - d->query->exec(QLatin1String("PRAGMA cache_size=3000")); - - addProgress(1.0); - createTables(); - insertFileNotFoundFile(); - insertMetaData(helpData->metaData()); - - if (!registerVirtualFolder(helpData->virtualFolder(), helpData->namespaceName())) { - d->error = tr("Cannot register namespace %1!").arg(helpData->namespaceName()); - cleanupDB(); - return false; - } - addProgress(1.0); - - emit statusChanged(tr("Insert custom filters...")); - foreach (const QHelpDataCustomFilter &f, helpData->customFilters()) { - if (!registerCustomFilter(f.name, f.filterAttributes, true)) { - cleanupDB(); - return false; - } - } - addProgress(1.0); - - int i = 1; - QList::const_iterator it = helpData->filterSections().constBegin(); - while (it != helpData->filterSections().constEnd()) { - emit statusChanged(tr("Insert help data for filter section (%1 of %2)...") - .arg(i++).arg(helpData->filterSections().count())); - insertFilterAttributes((*it).filterAttributes()); - QByteArray ba; - QDataStream s(&ba, QIODevice::WriteOnly); - foreach (QHelpDataContentItem *itm, (*it).contents()) - writeTree(s, itm, 0); - if (!insertFiles((*it).files(), helpData->rootPath(), (*it).filterAttributes()) - || !insertContents(ba, (*it).filterAttributes()) - || !insertKeywords((*it).indices(), (*it).filterAttributes())) { - cleanupDB(); - return false; - } - ++it; - } - - cleanupDB(); - emit progressChanged(100); - emit statusChanged(tr("Documentation successfully generated.")); - return true; -} - -void QHelpGenerator::setupProgress(QHelpDataInterface *helpData) -{ - d->progress = 0; - d->oldProgress = 0; - - int numberOfFiles = 0; - int numberOfIndices = 0; - QList::const_iterator it = helpData->filterSections().constBegin(); - while (it != helpData->filterSections().constEnd()) { - numberOfFiles += (*it).files().count(); - numberOfIndices += (*it).indices().count(); - ++it; - } - // init 2% - // filters 1% - // contents 10% - // files 60% - // indices 27% - d->contentStep = 10.0/(double)helpData->customFilters().count(); - d->fileStep = 60.0/(double)numberOfFiles; - d->indexStep = 27.0/(double)numberOfIndices; -} - -void QHelpGenerator::addProgress(double step) -{ - d->progress += step; - if ((d->progress-d->oldProgress) >= 1.0 && d->progress <= 100.0) { - d->oldProgress = d->progress; - emit progressChanged(ceil(d->progress)); - } -} - -void QHelpGenerator::cleanupDB() -{ - if (d->query) { - d->query->clear(); - delete d->query; - d->query = 0; - } - QSqlDatabase::removeDatabase(QLatin1String("builder")); -} - -void QHelpGenerator::writeTree(QDataStream &s, QHelpDataContentItem *item, int depth) -{ - QString fReference = QDir::cleanPath(item->reference()); - if (fReference.startsWith(QLatin1String("./"))) - fReference = fReference.mid(2); - - s << depth; - s << fReference; - s << item->title(); - foreach (QHelpDataContentItem *i, item->children()) - writeTree(s, i, depth+1); -} - -/*! - Returns the last error message. -*/ -QString QHelpGenerator::error() const -{ - return d->error; -} - -bool QHelpGenerator::createTables() -{ - if (!d->query) - return false; - - d->query->exec(QLatin1String("SELECT COUNT(*) FROM sqlite_master WHERE TYPE=\'table\'" - "AND Name=\'NamespaceTable\'")); - d->query->next(); - if (d->query->value(0).toInt() > 0) { - d->error = tr("Some tables already exist!"); - return false; - } - - QStringList tables; - tables << QLatin1String("CREATE TABLE NamespaceTable (" - "Id INTEGER PRIMARY KEY," - "Name TEXT )") - << QLatin1String("CREATE TABLE FilterAttributeTable (" - "Id INTEGER PRIMARY KEY, " - "Name TEXT )") - << QLatin1String("CREATE TABLE FilterNameTable (" - "Id INTEGER PRIMARY KEY, " - "Name TEXT )") - << QLatin1String("CREATE TABLE FilterTable (" - "NameId INTEGER, " - "FilterAttributeId INTEGER )") - << QLatin1String("CREATE TABLE IndexTable (" - "Id INTEGER PRIMARY KEY, " - "Name TEXT, " - "Identifier TEXT, " - "NamespaceId INTEGER, " - "FileId INTEGER, " - "Anchor TEXT )") - << QLatin1String("CREATE TABLE IndexItemTable (" - "Id INTEGER, " - "IndexId INTEGER )") - << QLatin1String("CREATE TABLE IndexFilterTable (" - "FilterAttributeId INTEGER, " - "IndexId INTEGER )") - << QLatin1String("CREATE TABLE ContentsTable (" - "Id INTEGER PRIMARY KEY, " - "NamespaceId INTEGER, " - "Data BLOB )") - << QLatin1String("CREATE TABLE ContentsFilterTable (" - "FilterAttributeId INTEGER, " - "ContentsId INTEGER )") - << QLatin1String("CREATE TABLE FileAttributeSetTable (" - "Id INTEGER, " - "FilterAttributeId INTEGER )") - << QLatin1String("CREATE TABLE FileDataTable (" - "Id INTEGER PRIMARY KEY, " - "Data BLOB )") - << QLatin1String("CREATE TABLE FileFilterTable (" - "FilterAttributeId INTEGER, " - "FileId INTEGER )") - << QLatin1String("CREATE TABLE FileNameTable (" - "FolderId INTEGER, " - "Name TEXT, " - "FileId INTEGER, " - "Title TEXT )") - << QLatin1String("CREATE TABLE FolderTable(" - "Id INTEGER PRIMARY KEY, " - "Name Text, " - "NamespaceID INTEGER )") - << QLatin1String("CREATE TABLE MetaDataTable(" - "Name Text, " - "Value BLOB )"); - - foreach (const QString &q, tables) { - if (!d->query->exec(q)) { - d->error = tr("Cannot create tables!"); - return false; - } - } - - d->query->exec(QLatin1String("INSERT INTO MetaDataTable VALUES('qchVersion', '1.0')")); - - d->query->prepare(QLatin1String("INSERT INTO MetaDataTable VALUES('CreationDate', ?)")); - d->query->bindValue(0, QDateTime::currentDateTime().toString(Qt::ISODate)); - d->query->exec(); - - return true; -} - -bool QHelpGenerator::insertFileNotFoundFile() -{ - if (!d->query) - return false; - - d->query->exec(QLatin1String("SELECT id FROM FileNameTable WHERE Name=\'\'")); - if (d->query->next() && d->query->isValid()) - return true; - - d->query->prepare(QLatin1String("INSERT INTO FileDataTable VALUES (Null, ?)")); - d->query->bindValue(0, QByteArray()); - if (!d->query->exec()) - return false; - - int fileId = d->query->lastInsertId().toInt(); - d->query->prepare(QLatin1String("INSERT INTO FileNameTable (FolderId, Name, FileId, Title) " - " VALUES (0, '', ?, '')")); - d->query->bindValue(0, fileId); - if (fileId > -1 && d->query->exec()) { - d->fileMap.insert(QString(), fileId); - return true; - } - return false; -} - -bool QHelpGenerator::registerVirtualFolder(const QString &folderName, const QString &ns) -{ - if (!d->query || folderName.isEmpty() || ns.isEmpty()) - return false; - - d->query->prepare(QLatin1String("SELECT Id FROM FolderTable WHERE Name=?")); - d->query->bindValue(0, folderName); - d->query->exec(); - d->query->next(); - if (d->query->isValid() && d->query->value(0).toInt() > 0) - return true; - - d->namespaceId = -1; - d->query->prepare(QLatin1String("SELECT Id FROM NamespaceTable WHERE Name=?")); - d->query->bindValue(0, ns); - d->query->exec(); - while (d->query->next()) { - d->namespaceId = d->query->value(0).toInt(); - break; - } - - if (d->namespaceId < 0) { - d->query->prepare(QLatin1String("INSERT INTO NamespaceTable VALUES(NULL, ?)")); - d->query->bindValue(0, ns); - if (d->query->exec()) - d->namespaceId = d->query->lastInsertId().toInt(); - } - - if (d->namespaceId > 0) { - d->query->prepare(QLatin1String("SELECT Id FROM FolderTable WHERE Name=?")); - d->query->bindValue(0, folderName); - d->query->exec(); - while (d->query->next()) - d->virtualFolderId = d->query->value(0).toInt(); - - if (d->virtualFolderId > 0) - return true; - - d->query->prepare(QLatin1String("INSERT INTO FolderTable (NamespaceId, Name) " - "VALUES (?, ?)")); - d->query->bindValue(0, d->namespaceId); - d->query->bindValue(1, folderName); - if (d->query->exec()) { - d->virtualFolderId = d->query->lastInsertId().toInt(); - return d->virtualFolderId > 0; - } - } - d->error = tr("Cannot register virtual folder!"); - return false; -} - -bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPath, - const QStringList &filterAttributes) -{ - if (!d->query) - return false; - - emit statusChanged(tr("Insert files...")); - QList filterAtts; - foreach (const QString &filterAtt, filterAttributes) { - d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable " - "WHERE Name=?")); - d->query->bindValue(0, filterAtt); - d->query->exec(); - if (d->query->next()) - filterAtts.append(d->query->value(0).toInt()); - } - - int filterSetId = -1; - d->query->exec(QLatin1String("SELECT MAX(Id) FROM FileAttributeSetTable")); - if (d->query->next()) - filterSetId = d->query->value(0).toInt(); - if (filterSetId < 0) - return false; - ++filterSetId; - foreach (const int &attId, filterAtts) { - d->query->prepare(QLatin1String("INSERT INTO FileAttributeSetTable " - "VALUES(?, ?)")); - d->query->bindValue(0, filterSetId); - d->query->bindValue(1, attId); - d->query->exec(); - } - - int tableFileId = 1; - d->query->exec(QLatin1String("SELECT MAX(Id) FROM FileDataTable")); - if (d->query->next()) - tableFileId = d->query->value(0).toInt() + 1; - - QString title; - QString charSet; - FileNameTableData fileNameData; - QList fileDataList; - QMap > tmpFileFilterMap; - QList fileNameDataList; - - int i = 0; - foreach (const QString &file, files) { - const QString fileName = QDir::cleanPath(file); - if (fileName.startsWith(QLatin1String("../"))) { - emit warning(tr("The referenced file %1 must be inside or within a " - "subdirectory of (%2). Skipping it.").arg(fileName).arg(rootPath)); - continue; - } - - QFile fi(rootPath + QDir::separator() + fileName); - if (!fi.exists()) { - emit warning(tr("The file %1 does not exist! Skipping it.") - .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName))); - continue; - } - - if (!fi.open(QIODevice::ReadOnly)) { - emit warning(tr("Cannot open file %1! Skipping it.") - .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName))); - continue; - } - - QByteArray data = fi.readAll(); - if (fileName.endsWith(QLatin1String(".html")) - || fileName.endsWith(QLatin1String(".htm"))) { - charSet = QHelpGlobal::codecFromData(data); - QTextStream stream(&data); - stream.setCodec(QTextCodec::codecForName(charSet.toLatin1().constData())); - title = QHelpGlobal::documentTitle(stream.readAll()); - } else { - title = fileName.mid(fileName.lastIndexOf(QLatin1Char('/')) + 1); - } - - int fileId = -1; - QMap::Iterator fileMapIt = d->fileMap.find(fileName); - if (fileMapIt == d->fileMap.end()) { - fileDataList.append(qCompress(data)); - - fileNameData.name = fileName; - fileNameData.fileId = tableFileId; - fileNameData.title = title; - fileNameDataList.append(fileNameData); - - d->fileMap.insert(fileName, tableFileId); - d->fileFilterMap.insert(tableFileId, filterAtts.toSet()); - tmpFileFilterMap.insert(tableFileId, filterAtts.toSet()); - - ++tableFileId; - } else { - fileId = fileMapIt.value(); - QSet &fileFilterSet = d->fileFilterMap[fileId]; - QSet &tmpFileFilterSet = tmpFileFilterMap[fileId]; - foreach (const int &filter, filterAtts) { - if (!fileFilterSet.contains(filter) - && !tmpFileFilterSet.contains(filter)) { - fileFilterSet.insert(filter); - tmpFileFilterSet.insert(filter); - } - } - } - } - - if (!tmpFileFilterMap.isEmpty()) { - d->query->exec(QLatin1String("BEGIN")); - QMap >::const_iterator it = tmpFileFilterMap.constBegin(); - while (it != tmpFileFilterMap.constEnd()) { - QSet::const_iterator si = it.value().constBegin(); - while (si != it.value().constEnd()) { - d->query->prepare(QLatin1String("INSERT INTO FileFilterTable " - "VALUES(?, ?)")); - d->query->bindValue(0, *si); - d->query->bindValue(1, it.key()); - d->query->exec(); - ++si; - } - ++it; - } - - QList::const_iterator fileIt = fileDataList.constBegin(); - while (fileIt != fileDataList.constEnd()) { - d->query->prepare(QLatin1String("INSERT INTO FileDataTable VALUES " - "(Null, ?)")); - d->query->bindValue(0, *fileIt); - d->query->exec(); - ++fileIt; - if (++i%20 == 0) - addProgress(d->fileStep*20.0); - } - - QList::const_iterator fileNameIt = - fileNameDataList.constBegin(); - while (fileNameIt != fileNameDataList.constEnd()) { - d->query->prepare(QLatin1String("INSERT INTO FileNameTable " - "(FolderId, Name, FileId, Title) VALUES (?, ?, ?, ?)")); - d->query->bindValue(0, 1); - d->query->bindValue(1, (*fileNameIt).name); - d->query->bindValue(2, (*fileNameIt).fileId); - d->query->bindValue(3, (*fileNameIt).title); - d->query->exec(); - ++fileNameIt; - } - d->query->exec(QLatin1String("COMMIT")); - } - - d->query->exec(QLatin1String("SELECT MAX(Id) FROM FileDataTable")); - if (d->query->next() - && d->query->value(0).toInt() == tableFileId-1) { - addProgress(d->fileStep*(i%20)); - return true; - } - return false; -} - -bool QHelpGenerator::registerCustomFilter(const QString &filterName, - const QStringList &filterAttribs, bool forceUpdate) -{ - if (!d->query) - return false; - - d->query->exec(QLatin1String("SELECT Id, Name FROM FilterAttributeTable")); - QStringList idsToInsert = filterAttribs; - QMap attributeMap; - while (d->query->next()) { - attributeMap.insert(d->query->value(1).toString(), - d->query->value(0).toInt()); - idsToInsert.removeAll(d->query->value(1).toString()); - } - - foreach (const QString &id, idsToInsert) { - d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); - d->query->bindValue(0, id); - d->query->exec(); - attributeMap.insert(id, d->query->lastInsertId().toInt()); - } - - int nameId = -1; - d->query->prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); - d->query->bindValue(0, filterName); - d->query->exec(); - while (d->query->next()) { - nameId = d->query->value(0).toInt(); - break; - } - - if (nameId < 0) { - d->query->prepare(QLatin1String("INSERT INTO FilterNameTable VALUES(NULL, ?)")); - d->query->bindValue(0, filterName); - if (d->query->exec()) - nameId = d->query->lastInsertId().toInt(); - } else if (!forceUpdate) { - d->error = tr("The filter %1 is already registered!").arg(filterName); - return false; - } - - if (nameId < 0) { - d->error = tr("Cannot register filter %1!").arg(filterName); - return false; - } - - d->query->prepare(QLatin1String("DELETE FROM FilterTable WHERE NameId=?")); - d->query->bindValue(0, nameId); - d->query->exec(); - - foreach (const QString &att, filterAttribs) { - d->query->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); - d->query->bindValue(0, nameId); - d->query->bindValue(1, attributeMap[att]); - if (!d->query->exec()) - return false; - } - return true; -} - -bool QHelpGenerator::insertKeywords(const QList &keywords, - const QStringList &filterAttributes) -{ - if (!d->query) - return false; - - emit statusChanged(tr("Insert indices...")); - int indexId = 1; - d->query->exec(QLatin1String("SELECT MAX(Id) FROM IndexTable")); - if (d->query->next()) - indexId = d->query->value(0).toInt() + 1; - - QList filterAtts; - foreach (const QString &filterAtt, filterAttributes) { - d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?")); - d->query->bindValue(0, filterAtt); - d->query->exec(); - if (d->query->next()) - filterAtts.append(d->query->value(0).toInt()); - } - - int pos = -1; - QString fileName; - QString anchor; - QString fName; - int fileId = 1; - QList indexFilterTable; - - int i = 0; - d->query->exec(QLatin1String("BEGIN")); - QSet indices; - foreach (const QHelpDataIndexItem &itm, keywords) { - // Identical ids make no sense and just confuse the Assistant user, - // so we ignore all repetitions. - if (indices.contains(itm.identifier)) - continue; - - // Still empty ids should be ignored, as otherwise we will include only - // the first keyword with an empty id. - if (!itm.identifier.isEmpty()) - indices.insert(itm.identifier); - - pos = itm.reference.indexOf(QLatin1Char('#')); - fileName = itm.reference.left(pos); - if (pos > -1) - anchor = itm.reference.mid(pos+1); - else - anchor.clear(); - - fName = QDir::cleanPath(fileName); - if (fName.startsWith(QLatin1String("./"))) - fName = fName.mid(2); - - QMap::ConstIterator it = d->fileMap.find(fName); - if (it != d->fileMap.end()) - fileId = it.value(); - else - fileId = 1; - - d->query->prepare(QLatin1String("INSERT INTO IndexTable (Name, Identifier, NamespaceId, FileId, Anchor) " - "VALUES(?, ?, ?, ?, ?)")); - d->query->bindValue(0, itm.name); - d->query->bindValue(1, itm.identifier); - d->query->bindValue(2, d->namespaceId); - d->query->bindValue(3, fileId); - d->query->bindValue(4, anchor); - d->query->exec(); - - indexFilterTable.append(indexId++); - if (++i%100 == 0) - addProgress(d->indexStep*100.0); - } - d->query->exec(QLatin1String("COMMIT")); - - d->query->exec(QLatin1String("BEGIN")); - foreach (int idx, indexFilterTable) { - foreach (int a, filterAtts) { - d->query->prepare(QLatin1String("INSERT INTO IndexFilterTable (FilterAttributeId, IndexId) " - "VALUES(?, ?)")); - d->query->bindValue(0, a); - d->query->bindValue(1, idx); - d->query->exec(); - } - } - d->query->exec(QLatin1String("COMMIT")); - - d->query->exec(QLatin1String("SELECT COUNT(Id) FROM IndexTable")); - if (d->query->next() && d->query->value(0).toInt() >= indices.count()) - return true; - return false; -} - -bool QHelpGenerator::insertContents(const QByteArray &ba, - const QStringList &filterAttributes) -{ - if (!d->query) - return false; - - emit statusChanged(tr("Insert contents...")); - d->query->prepare(QLatin1String("INSERT INTO ContentsTable (NamespaceId, Data) " - "VALUES(?, ?)")); - d->query->bindValue(0, d->namespaceId); - d->query->bindValue(1, ba); - d->query->exec(); - int contentId = d->query->lastInsertId().toInt(); - if (contentId < 1) { - d->error = tr("Cannot insert contents!"); - return false; - } - - // associate the filter attributes - foreach (const QString &filterAtt, filterAttributes) { - d->query->prepare(QLatin1String("INSERT INTO ContentsFilterTable (FilterAttributeId, ContentsId) " - "SELECT Id, ? FROM FilterAttributeTable WHERE Name=?")); - d->query->bindValue(0, contentId); - d->query->bindValue(1, filterAtt); - d->query->exec(); - if (!d->query->isActive()) { - d->error = tr("Cannot register contents!"); - return false; - } - } - addProgress(d->contentStep); - return true; -} - -bool QHelpGenerator::insertFilterAttributes(const QStringList &attributes) -{ - if (!d->query) - return false; - - d->query->exec(QLatin1String("SELECT Name FROM FilterAttributeTable")); - QSet atts; - while (d->query->next()) - atts.insert(d->query->value(0).toString()); - - foreach (const QString &s, attributes) { - if (!atts.contains(s)) { - d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); - d->query->bindValue(0, s); - d->query->exec(); - } - } - return true; -} - -bool QHelpGenerator::insertMetaData(const QMap &metaData) -{ - if (!d->query) - return false; - - QMap::const_iterator it = metaData.constBegin(); - while (it != metaData.constEnd()) { - d->query->prepare(QLatin1String("INSERT INTO MetaDataTable VALUES(?, ?)")); - d->query->bindValue(0, it.key()); - d->query->bindValue(1, it.value()); - d->query->exec(); - ++it; - } - return true; -} - -bool QHelpGenerator::checkLinks(const QHelpDataInterface &helpData) -{ - /* - * Step 1: Gather the canoncal file paths of all files in the project. - * We use a set, because there will be a lot of look-ups. - */ - QSet files; - foreach (const QHelpDataFilterSection &filterSection, helpData.filterSections()) { - foreach (const QString &file, filterSection.files()) { - QFileInfo fileInfo(helpData.rootPath() + QDir::separator() + file); - const QString &canonicalFileName = fileInfo.canonicalFilePath(); - if (!fileInfo.exists()) - emit warning(tr("File '%1' does not exist.").arg(file)); - else - files.insert(canonicalFileName); - } - } - - /* - * Step 2: Check the hypertext and image references of all HTML files. - * Note that we don't parse the files, but simply grep for the - * respective HTML elements. Therefore. contents that are e.g. - * commented out can cause false warning. - */ - bool allLinksOk = true; - foreach (const QString &fileName, files) { - if (!fileName.endsWith(QLatin1String("html")) - && !fileName.endsWith(QLatin1String("htm"))) - continue; - QFile htmlFile(fileName); - if (!htmlFile.open(QIODevice::ReadOnly)) { - emit warning(tr("File '%1' cannot be opened.").arg(fileName)); - continue; - } - const QRegExp linkPattern(QLatin1String("<(?:a href|img src)=\"?([^#\">]+)[#\">]")); - QTextStream stream(&htmlFile); - const QString codec = QHelpGlobal::codecFromData(htmlFile.read(1000)); - stream.setCodec(QTextCodec::codecForName(codec.toLatin1().constData())); - const QString &content = stream.readAll(); - QStringList invalidLinks; - for (int pos = linkPattern.indexIn(content); pos != -1; - pos = linkPattern.indexIn(content, pos + 1)) { - const QString& linkedFileName = linkPattern.cap(1); - if (linkedFileName.contains(QLatin1String("://"))) - continue; - const QString curDir = QFileInfo(fileName).dir().path(); - const QString &canonicalLinkedFileName = - QFileInfo(curDir + QDir::separator() + linkedFileName).canonicalFilePath(); - if (!files.contains(canonicalLinkedFileName) - && !invalidLinks.contains(canonicalLinkedFileName)) { - emit warning(tr("File '%1' contains an invalid link to file '%2'"). - arg(fileName).arg(linkedFileName)); - allLinksOk = false; - invalidLinks.append(canonicalLinkedFileName); - } - } - } - - if (!allLinksOk) - d->error = tr("Invalid links in HTML files."); - return allLinksOk; -} - -QT_END_NAMESPACE - diff --git a/src/assistant/lib/qhelpgenerator_p.h b/src/assistant/lib/qhelpgenerator_p.h deleted file mode 100644 index ad32c05de..000000000 --- a/src/assistant/lib/qhelpgenerator_p.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPGENERATOR_H -#define QHELPGENERATOR_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelp_global.h" -#include "qhelpdatainterface_p.h" - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QHelpGeneratorPrivate; - -class QHELP_EXPORT QHelpGenerator : public QObject -{ - Q_OBJECT - -public: - QHelpGenerator(QObject *parent = 0); - ~QHelpGenerator(); - - bool generate(QHelpDataInterface *helpData, - const QString &outputFileName); - bool checkLinks(const QHelpDataInterface &helpData); - QString error() const; - -Q_SIGNALS: - void statusChanged(const QString &msg); - void progressChanged(double progress); - void warning(const QString &msg); - -private: - struct FileNameTableData - { - QString name; - int fileId; - QString title; - }; - - void writeTree(QDataStream &s, QHelpDataContentItem *item, int depth); - bool createTables(); - bool insertFileNotFoundFile(); - bool registerCustomFilter(const QString &filterName, - const QStringList &filterAttribs, bool forceUpdate = false); - bool registerVirtualFolder(const QString &folderName, const QString &ns); - bool insertFilterAttributes(const QStringList &attributes); - bool insertKeywords(const QList &keywords, - const QStringList &filterAttributes); - bool insertFiles(const QStringList &files, const QString &rootPath, - const QStringList &filterAttributes); - bool insertContents(const QByteArray &ba, - const QStringList &filterAttributes); - bool insertMetaData(const QMap &metaData); - void cleanupDB(); - void setupProgress(QHelpDataInterface *helpData); - void addProgress(double step); - - QHelpGeneratorPrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/assistant/lib/qhelpindexwidget.cpp b/src/assistant/lib/qhelpindexwidget.cpp deleted file mode 100644 index 1b34ca0aa..000000000 --- a/src/assistant/lib/qhelpindexwidget.cpp +++ /dev/null @@ -1,444 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpindexwidget.h" -#include "qhelpenginecore.h" -#include "qhelpengine_p.h" -#include "qhelpdbreader_p.h" - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpIndexProvider : public QThread -{ -public: - QHelpIndexProvider(QHelpEnginePrivate *helpEngine); - ~QHelpIndexProvider(); - void collectIndices(const QString &customFilterName); - void stopCollecting(); - QStringList indices() const; - QList activeReaders() const; - QSet indexIds(QHelpDBReader *reader) const; - -private: - void run(); - - QHelpEnginePrivate *m_helpEngine; - QStringList m_indices; - QList m_activeReaders; - QMap > m_indexIds; - QStringList m_filterAttributes; - mutable QMutex m_mutex; - bool m_abort; -}; - -class QHelpIndexModelPrivate -{ -public: - QHelpIndexModelPrivate(QHelpEnginePrivate *hE) - { - helpEngine = hE; - indexProvider = new QHelpIndexProvider(helpEngine); - insertedRows = 0; - } - - QHelpEnginePrivate *helpEngine; - QHelpIndexProvider *indexProvider; - QStringList indices; - int insertedRows; - QString currentFilter; - QList activeReaders; -}; - -static bool caseInsensitiveLessThan(const QString &as, const QString &bs) -{ - return QString::compare(as, bs, Qt::CaseInsensitive) < 0; -} - -QHelpIndexProvider::QHelpIndexProvider(QHelpEnginePrivate *helpEngine) - : QThread(helpEngine) -{ - m_helpEngine = helpEngine; - m_abort = false; -} - -QHelpIndexProvider::~QHelpIndexProvider() -{ - stopCollecting(); -} - -void QHelpIndexProvider::collectIndices(const QString &customFilterName) -{ - m_mutex.lock(); - m_filterAttributes = m_helpEngine->q->filterAttributes(customFilterName); - m_mutex.unlock(); - if (!isRunning()) { - start(LowPriority); - } else { - stopCollecting(); - start(LowPriority); - } -} - -void QHelpIndexProvider::stopCollecting() -{ - if (!isRunning()) - return; - m_mutex.lock(); - m_abort = true; - m_mutex.unlock(); - wait(); - m_abort = false; -} - -QStringList QHelpIndexProvider::indices() const -{ - QMutexLocker lck(&m_mutex); - return m_indices; -} - -QList QHelpIndexProvider::activeReaders() const -{ - QMutexLocker lck(&m_mutex); - return m_activeReaders; -} - -QSet QHelpIndexProvider::indexIds(QHelpDBReader *reader) const -{ - QMutexLocker lck(&m_mutex); - if (m_indexIds.contains(reader)) - return m_indexIds.value(reader); - return QSet(); -} - -void QHelpIndexProvider::run() -{ - m_mutex.lock(); - QStringList atts = m_filterAttributes; - m_indices.clear(); - m_activeReaders.clear(); - QSet indicesSet; - m_mutex.unlock(); - - foreach (const QString &dbFileName, m_helpEngine->fileNameReaderMap.keys()) { - m_mutex.lock(); - if (m_abort) { - m_mutex.unlock(); - return; - } - m_mutex.unlock(); - QHelpDBReader reader(dbFileName, - QHelpGlobal::uniquifyConnectionName(dbFileName + - QLatin1String("FromIndexProvider"), - QThread::currentThread()), 0); - if (!reader.init()) - continue; - QStringList lst = reader.indicesForFilter(atts); - if (!lst.isEmpty()) { - m_mutex.lock(); - foreach (const QString &s, lst) - indicesSet.insert(s); - if (m_abort) { - m_mutex.unlock(); - return; - } - QHelpDBReader *orgReader = m_helpEngine->fileNameReaderMap.value(dbFileName); - m_indexIds.insert(orgReader, reader.indexIds(atts)); - m_activeReaders.append(orgReader); - m_mutex.unlock(); - } - } - m_mutex.lock(); - m_indices = indicesSet.values(); - qSort(m_indices.begin(), m_indices.end(), caseInsensitiveLessThan); - m_mutex.unlock(); -} - - - -/*! - \class QHelpIndexModel - \since 4.4 - \inmodule QtHelp - \brief The QHelpIndexModel class provides a model that - supplies index keywords to views. - - -*/ - -/*! - \fn void QHelpIndexModel::indexCreationStarted() - - This signal is emitted when the creation of a new index - has started. The current index is invalid from this - point on until the signal indexCreated() is emitted. - - \sa isCreatingIndex() -*/ - -/*! - \fn void QHelpIndexModel::indexCreated() - - This signal is emitted when the index has been created. -*/ - -QHelpIndexModel::QHelpIndexModel(QHelpEnginePrivate *helpEngine) - : QStringListModel(helpEngine) -{ - d = new QHelpIndexModelPrivate(helpEngine); - - connect(d->indexProvider, SIGNAL(finished()), this, SLOT(insertIndices())); - connect(helpEngine->q, SIGNAL(setupStarted()), this, SLOT(invalidateIndex())); -} - -QHelpIndexModel::~QHelpIndexModel() -{ - delete d; -} - -void QHelpIndexModel::invalidateIndex(bool onShutDown) -{ - if (onShutDown) - disconnect(this, SLOT(insertIndices())); - d->indexProvider->stopCollecting(); - d->indices.clear(); - if (!onShutDown) - filter(QString()); -} - -/*! - Creates a new index by querying the help system for - keywords for the specified \a customFilterName. -*/ -void QHelpIndexModel::createIndex(const QString &customFilterName) -{ - d->currentFilter = customFilterName; - d->indexProvider->collectIndices(customFilterName); - emit indexCreationStarted(); -} - -void QHelpIndexModel::insertIndices() -{ - d->indices = d->indexProvider->indices(); - d->activeReaders = d->indexProvider->activeReaders(); - QStringList attributes = d->helpEngine->q->filterAttributes(d->currentFilter); - if (attributes.count() > 1) { - foreach (QHelpDBReader *r, d->activeReaders) - r->createAttributesCache(attributes, d->indexProvider->indexIds(r)); - } - filter(QString()); - emit indexCreated(); -} - -/*! - Returns true if the index is currently built up, otherwise - false. -*/ -bool QHelpIndexModel::isCreatingIndex() const -{ - return d->indexProvider->isRunning(); -} - -/*! - Returns all hits found for the \a keyword. A hit consists of - the URL and the document title. -*/ -QMap QHelpIndexModel::linksForKeyword(const QString &keyword) const -{ - QMap linkMap; - QStringList filterAttributes = d->helpEngine->q->filterAttributes(d->currentFilter); - foreach (QHelpDBReader *reader, d->activeReaders) - reader->linksForKeyword(keyword, filterAttributes, linkMap); - return linkMap; -} - -/*! - Filters the indices and returns the model index of the best - matching keyword. In a first step, only the keywords containing - \a filter are kept in the model's index list. Analogously, if - \a wildcard is not empty, only the keywords matched are left - in the index list. In a second step, the best match is - determined and its index model returned. When specifying a - wildcard expression, the \a filter string is used to - search for the best match. -*/ -QModelIndex QHelpIndexModel::filter(const QString &filter, const QString &wildcard) -{ - if (filter.isEmpty()) { - setStringList(d->indices); - return index(-1, 0, QModelIndex()); - } - - QStringList lst; - int goodMatch = -1; - int perfectMatch = -1; - - if (!wildcard.isEmpty()) { - QRegExp regExp(wildcard, Qt::CaseInsensitive); - regExp.setPatternSyntax(QRegExp::Wildcard); - foreach (const QString &index, d->indices) { - if (index.contains(regExp)) { - lst.append(index); - if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { - if (goodMatch == -1) - goodMatch = lst.count()-1; - if (filter.length() == index.length()){ - perfectMatch = lst.count()-1; - } - } else if (perfectMatch > -1 && index == filter) { - perfectMatch = lst.count()-1; - } - } - } - } else { - foreach (const QString &index, d->indices) { - if (index.contains(filter, Qt::CaseInsensitive)) { - lst.append(index); - if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { - if (goodMatch == -1) - goodMatch = lst.count()-1; - if (filter.length() == index.length()){ - perfectMatch = lst.count()-1; - } - } else if (perfectMatch > -1 && index == filter) { - perfectMatch = lst.count()-1; - } - } - } - - } - - if (perfectMatch == -1) - perfectMatch = qMax(0, goodMatch); - - setStringList(lst); - return index(perfectMatch, 0, QModelIndex()); -} - - - -/*! - \class QHelpIndexWidget - \inmodule QtHelp - \since 4.4 - \brief The QHelpIndexWidget class provides a list view - displaying the QHelpIndexModel. -*/ - -/*! - \fn void QHelpIndexWidget::linkActivated(const QUrl &link, - const QString &keyword) - - This signal is emitted when an item is activated and its - associated \a link should be shown. To know where the link - belongs to, the \a keyword is given as a second paremeter. -*/ - -/*! - \fn void QHelpIndexWidget::linksActivated(const QMap &links, - const QString &keyword) - - This signal is emitted when the item representing the \a keyword - is activated and the item has more than one link associated. - The \a links consist of the document title and their URL. -*/ - -QHelpIndexWidget::QHelpIndexWidget() - : QListView(0) -{ - setEditTriggers(QAbstractItemView::NoEditTriggers); - setUniformItemSizes(true); - connect(this, SIGNAL(activated(QModelIndex)), - this, SLOT(showLink(QModelIndex))); -} - -void QHelpIndexWidget::showLink(const QModelIndex &index) -{ - if (!index.isValid()) - return; - - QHelpIndexModel *indexModel = qobject_cast(model()); - if (!indexModel) - return; - QVariant v = indexModel->data(index, Qt::DisplayRole); - QString name; - if (v.isValid()) - name = v.toString(); - - QMap links = indexModel->linksForKeyword(name); - if (links.count() == 1) { - emit linkActivated(links.constBegin().value(), name); - } else if (links.count() > 1) { - emit linksActivated(links, name); - } -} - -/*! - Activates the current item which will result eventually in - the emitting of a linkActivated() or linksActivated() - signal. -*/ -void QHelpIndexWidget::activateCurrentItem() -{ - showLink(currentIndex()); -} - -/*! - Filters the indices according to \a filter or \a wildcard. - The item with the best match is set as current item. - - \sa QHelpIndexModel::filter() -*/ -void QHelpIndexWidget::filterIndices(const QString &filter, const QString &wildcard) -{ - QHelpIndexModel *indexModel = qobject_cast(model()); - if (!indexModel) - return; - QModelIndex idx = indexModel->filter(filter, wildcard); - if (idx.isValid()) - setCurrentIndex(idx); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpindexwidget.h b/src/assistant/lib/qhelpindexwidget.h deleted file mode 100644 index 41e66f647..000000000 --- a/src/assistant/lib/qhelpindexwidget.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPINDEXWIDGET_H -#define QHELPINDEXWIDGET_H - -#include - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QHelpEnginePrivate; -class QHelpIndexModelPrivate; - -class QHELP_EXPORT QHelpIndexModel : public QStringListModel -{ - Q_OBJECT - -public: - void createIndex(const QString &customFilterName); - QModelIndex filter(const QString &filter, - const QString &wildcard = QString()); - - QMap linksForKeyword(const QString &keyword) const; - bool isCreatingIndex() const; - -Q_SIGNALS: - void indexCreationStarted(); - void indexCreated(); - -private Q_SLOTS: - void insertIndices(); - void invalidateIndex(bool onShutDown = false); - -private: - QHelpIndexModel(QHelpEnginePrivate *helpEngine); - ~QHelpIndexModel(); - - QHelpIndexModelPrivate *d; - friend class QHelpEnginePrivate; -}; - -class QHELP_EXPORT QHelpIndexWidget : public QListView -{ - Q_OBJECT - -Q_SIGNALS: - void linkActivated(const QUrl &link, const QString &keyword); - void linksActivated(const QMap &links, - const QString &keyword); - -public Q_SLOTS: - void filterIndices(const QString &filter, - const QString &wildcard = QString()); - void activateCurrentItem(); - -private Q_SLOTS: - void showLink(const QModelIndex &index); - -private: - QHelpIndexWidget(); - friend class QHelpEngine; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/assistant/lib/qhelpprojectdata.cpp b/src/assistant/lib/qhelpprojectdata.cpp deleted file mode 100644 index bd59e289c..000000000 --- a/src/assistant/lib/qhelpprojectdata.cpp +++ /dev/null @@ -1,450 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpprojectdata_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpProjectDataPrivate : public QXmlStreamReader -{ -public: - void readData(const QByteArray &contents); - - QString virtualFolder; - QString namespaceName; - QString rootPath; - - QStringList fileList; - QList customFilterList; - QList filterSectionList; - QMap metaData; - - QString errorMsg; - -private: - void readProject(); - void readCustomFilter(); - void readFilterSection(); - void readTOC(); - void readKeywords(); - void readFiles(); - void raiseUnknownTokenError(); - void addMatchingFiles(const QString &pattern); - bool hasValidSyntax(const QString &nameSpace, const QString &vFolder) const; - - QMap dirEntriesCache; -}; - -void QHelpProjectDataPrivate::raiseUnknownTokenError() -{ - raiseError(QCoreApplication::translate("QHelpProject", "Unknown token.")); -} - -void QHelpProjectDataPrivate::readData(const QByteArray &contents) -{ - addData(contents); - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("QtHelpProject") - && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) - readProject(); - else - raiseError(QCoreApplication::translate("QHelpProject", - "Unknown token. Expected \"QtHelpProject\"!")); - } - } - - if (hasError()) { - raiseError(QCoreApplication::translate("QHelpProject", - "Error in line %1: %2").arg(lineNumber()) - .arg(errorString())); - } -} - -void QHelpProjectDataPrivate::readProject() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("virtualFolder")) { - virtualFolder = readElementText(); - if (!hasValidSyntax(QLatin1String("test"), virtualFolder)) - raiseError(QCoreApplication::translate("QHelpProject", - "Virtual folder has invalid syntax.")); - } else if (name() == QLatin1String("namespace")) { - namespaceName = readElementText(); - if (!hasValidSyntax(namespaceName, QLatin1String("test"))) - raiseError(QCoreApplication::translate("QHelpProject", - "Namespace has invalid syntax.")); - } else if (name() == QLatin1String("customFilter")) { - readCustomFilter(); - } else if (name() == QLatin1String("filterSection")) { - readFilterSection(); - } else if (name() == QLatin1String("metaData")) { - QString n = attributes().value(QLatin1String("name")).toString(); - if (!metaData.contains(n)) - metaData[n] - = attributes().value(QLatin1String("value")).toString(); - else - metaData.insert(n, attributes(). - value(QLatin1String("value")).toString()); - } else { - raiseUnknownTokenError(); - } - } else if (isEndElement() && name() == QLatin1String("QtHelpProject")) { - if (namespaceName.isEmpty()) - raiseError(QCoreApplication::translate("QHelpProject", - "Missing namespace in QtHelpProject.")); - else if (virtualFolder.isEmpty()) - raiseError(QCoreApplication::translate("QHelpProject", - "Missing virtual folder in QtHelpProject")); - break; - } - } -} - -void QHelpProjectDataPrivate::readCustomFilter() -{ - QHelpDataCustomFilter filter; - filter.name = attributes().value(QLatin1String("name")).toString(); - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("filterAttribute")) - filter.filterAttributes.append(readElementText()); - else - raiseUnknownTokenError(); - } else if (isEndElement() && name() == QLatin1String("customFilter")) { - break; - } - } - customFilterList.append(filter); -} - -void QHelpProjectDataPrivate::readFilterSection() -{ - filterSectionList.append(QHelpDataFilterSection()); - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("filterAttribute")) - filterSectionList.last().addFilterAttribute(readElementText()); - else if (name() == QLatin1String("toc")) - readTOC(); - else if (name() == QLatin1String("keywords")) - readKeywords(); - else if (name() == QLatin1String("files")) - readFiles(); - else - raiseUnknownTokenError(); - } else if (isEndElement() && name() == QLatin1String("filterSection")) { - break; - } - } -} - -void QHelpProjectDataPrivate::readTOC() -{ - QStack contentStack; - QHelpDataContentItem *itm = 0; - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("section")) { - QString title = attributes().value(QLatin1String("title")).toString(); - QString ref = attributes().value(QLatin1String("ref")).toString(); - if (contentStack.isEmpty()) { - itm = new QHelpDataContentItem(0, title, ref); - filterSectionList.last().addContent(itm); - } else { - itm = new QHelpDataContentItem(contentStack.top(), title, ref); - } - contentStack.push(itm); - } else { - raiseUnknownTokenError(); - } - } else if (isEndElement()) { - if (name() == QLatin1String("section")) { - contentStack.pop(); - continue; - } else if (name() == QLatin1String("toc") && contentStack.isEmpty()) { - break; - } else { - raiseUnknownTokenError(); - } - } - } -} - -void QHelpProjectDataPrivate::readKeywords() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("keyword")) { - if (attributes().value(QLatin1String("ref")).toString().isEmpty() - || (attributes().value(QLatin1String("name")).toString().isEmpty() - && attributes().value(QLatin1String("id")).toString().isEmpty())) - raiseError(QCoreApplication::translate("QHelpProject", - "Missing attribute in keyword at line %1.") - .arg(lineNumber())); - filterSectionList.last() - .addIndex(QHelpDataIndexItem(attributes(). - value(QLatin1String("name")).toString(), - attributes().value(QLatin1String("id")).toString(), - attributes().value(QLatin1String("ref")).toString())); - } else { - raiseUnknownTokenError(); - } - } else if (isEndElement()) { - if (name() == QLatin1String("keyword")) - continue; - else if (name() == QLatin1String("keywords")) - break; - else - raiseUnknownTokenError(); - } - } -} - -void QHelpProjectDataPrivate::readFiles() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("file")) - addMatchingFiles(readElementText()); - else - raiseUnknownTokenError(); - } else if (isEndElement()) { - if (name() == QLatin1String("file")) - continue; - else if (name() == QLatin1String("files")) - break; - else - raiseUnknownTokenError(); - } - } -} - -// Expand file pattern and add matches into list. If the pattern does not match -// any files, insert the pattern itself so the QHelpGenerator will emit a -// meaningful warning later. -void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern) -{ - // The pattern matching is expensive, so we skip it if no - // wildcard symbols occur in the string. - if (!pattern.contains('?') && !pattern.contains('*') - && !pattern.contains('[') && !pattern.contains(']')) { - filterSectionList.last().addFile(pattern); - return; - } - - QFileInfo fileInfo(rootPath + '/' + pattern); - const QDir &dir = fileInfo.dir(); - const QString &path = dir.canonicalPath(); - - // QDir::entryList() is expensive, so we cache the results. - QMap::ConstIterator it = dirEntriesCache.find(path); - const QStringList &entries = it != dirEntriesCache.constEnd() ? - it.value() : dir.entryList(QDir::Files); - if (it == dirEntriesCache.constEnd()) - dirEntriesCache.insert(path, entries); - - bool matchFound = false; -#ifdef Q_OS_WIN - Qt::CaseSensitivity cs = Qt::CaseInsensitive; -#else - Qt::CaseSensitivity cs = Qt::CaseSensitive; -#endif - QRegExp regExp(fileInfo.fileName(), cs, QRegExp::Wildcard); - foreach (const QString &file, entries) { - if (regExp.exactMatch(file)) { - matchFound = true; - filterSectionList.last(). - addFile(QFileInfo(pattern).dir().path() + '/' + file); - } - } - if (!matchFound) - filterSectionList.last().addFile(pattern); -} - -bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace, - const QString &vFolder) const -{ - const QLatin1Char slash('/'); - if (nameSpace.contains(slash) || vFolder.contains(slash)) - return false; - QUrl url; - const QLatin1String scheme("qthelp"); - url.setScheme(scheme); - const QString canonicalNamespace = nameSpace.toLower(); - url.setHost(canonicalNamespace); - url.setPath(vFolder); - - const QString expectedUrl(scheme + QLatin1String("://") - + canonicalNamespace + slash + vFolder); - return url.isValid() && url.toString() == expectedUrl; -} - -/*! - \internal - \class QHelpProjectData - \since 4.4 - \brief The QHelpProjectData class stores all information found - in a Qt help project file. - - The structure is filled with data by calling readData(). The - specified file has to have the Qt help project file format in - order to be read successfully. Possible reading errors can be - retrieved by calling errorMessage(). -*/ - -/*! - Constructs a Qt help project data structure. -*/ -QHelpProjectData::QHelpProjectData() -{ - d = new QHelpProjectDataPrivate; -} - -/*! - Destroys the help project data. -*/ -QHelpProjectData::~QHelpProjectData() -{ - delete d; -} - -/*! - Reads the file \a fileName and stores the help data. The file has to - have the Qt help project file format. Returns true if the file - was successfully read, otherwise false. - - \sa errorMessage() -*/ -bool QHelpProjectData::readData(const QString &fileName) -{ - d->rootPath = QFileInfo(fileName).absolutePath(); - QFile file(fileName); - if (!file.open(QIODevice::ReadOnly)) { - d->errorMsg = QCoreApplication::translate("QHelpProject", - "The input file %1 could not be opened!").arg(fileName); - return false; - } - - d->readData(file.readAll()); - return !d->hasError(); -} - -/*! - Returns an error message if the reading of the Qt help project - file failed. Otherwise, an empty QString is returned. - - \sa readData() -*/ -QString QHelpProjectData::errorMessage() const -{ - if (d->hasError()) - return d->errorString(); - return d->errorMsg; -} - -/*! - \internal -*/ -QString QHelpProjectData::namespaceName() const -{ - return d->namespaceName; -} - -/*! - \internal -*/ -QString QHelpProjectData::virtualFolder() const -{ - return d->virtualFolder; -} - -/*! - \internal -*/ -QList QHelpProjectData::customFilters() const -{ - return d->customFilterList; -} - -/*! - \internal -*/ -QList QHelpProjectData::filterSections() const -{ - return d->filterSectionList; -} - -/*! - \internal -*/ -QMap QHelpProjectData::metaData() const -{ - return d->metaData; -} - -/*! - \internal -*/ -QString QHelpProjectData::rootPath() const -{ - return d->rootPath; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpprojectdata_p.h b/src/assistant/lib/qhelpprojectdata_p.h deleted file mode 100644 index 64ae32505..000000000 --- a/src/assistant/lib/qhelpprojectdata_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPPROJECTDATA_H -#define QHELPPROJECTDATA_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelp_global.h" -#include "qhelpdatainterface_p.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QHelpProjectDataPrivate; - -class QHELP_EXPORT QHelpProjectData : public QHelpDataInterface -{ -public: - QHelpProjectData(); - ~QHelpProjectData(); - - bool readData(const QString &fileName); - QString errorMessage() const; - - QString namespaceName() const; - QString virtualFolder() const; - QList customFilters() const; - QList filterSections() const; - QMap metaData() const; - QString rootPath() const; - -private: - QHelpProjectDataPrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/assistant/lib/qhelpsearchengine.cpp b/src/assistant/lib/qhelpsearchengine.cpp deleted file mode 100644 index f8f8acf44..000000000 --- a/src/assistant/lib/qhelpsearchengine.cpp +++ /dev/null @@ -1,450 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpenginecore.h" -#include "qhelpsearchengine.h" -#include "qhelpsearchquerywidget.h" -#include "qhelpsearchresultwidget.h" - -#include "qhelpsearchindexreader_p.h" -#if defined(QT_CLUCENE_SUPPORT) -# include "qhelpsearchindexreader_clucene_p.h" -# include "qhelpsearchindexwriter_clucene_p.h" -#else -# include "qhelpsearchindexreader_default_p.h" -# include "qhelpsearchindexwriter_default_p.h" -#endif - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -#if defined(QT_CLUCENE_SUPPORT) - using namespace fulltextsearch::clucene; -#else - using namespace fulltextsearch::std; -#endif - -class QHelpSearchEnginePrivate : public QObject -{ - Q_OBJECT - -signals: - void indexingStarted(); - void indexingFinished(); - - void searchingStarted(); - void searchingFinished(int hits); - -private: - QHelpSearchEnginePrivate(QHelpEngineCore *helpEngine) - : queryWidget(0) - , resultWidget(0) - , helpEngine(helpEngine) - { - indexReader = 0; - indexWriter = 0; - } - - ~QHelpSearchEnginePrivate() - { - delete indexReader; - delete indexWriter; - } - - int hitCount() const - { - int count = 0; - if (indexReader) - count = indexReader->hitCount(); - - return count; - } - - QList hits(int start, int end) const - { - return indexReader ? - indexReader->hits(start, end) : - QList(); - } - - void updateIndex(bool reindex = false) - { - if (helpEngine.isNull()) - return; - - if (!QFile::exists(QFileInfo(helpEngine->collectionFile()).path())) - return; - - if (!indexWriter) { - indexWriter = new QHelpSearchIndexWriter(); - - connect(indexWriter, SIGNAL(indexingStarted()), this, SIGNAL(indexingStarted())); - connect(indexWriter, SIGNAL(indexingFinished()), this, SIGNAL(indexingFinished())); - connect(indexWriter, SIGNAL(indexingFinished()), this, SLOT(optimizeIndex())); - } - - indexWriter->cancelIndexing(); - indexWriter->updateIndex(helpEngine->collectionFile(), - indexFilesFolder(), reindex); - } - - void cancelIndexing() - { - if (indexWriter) - indexWriter->cancelIndexing(); - } - - void search(const QList &queryList) - { - if (helpEngine.isNull()) - return; - - if (!QFile::exists(QFileInfo(helpEngine->collectionFile()).path())) - return; - - if (!indexReader) { -#if defined(QT_CLUCENE_SUPPORT) - indexReader = new QHelpSearchIndexReaderClucene(); -#else - indexReader = new QHelpSearchIndexReaderDefault(); -#endif // QT_CLUCENE_SUPPORT - connect(indexReader, SIGNAL(searchingStarted()), this, SIGNAL(searchingStarted())); - connect(indexReader, SIGNAL(searchingFinished(int)), this, SIGNAL(searchingFinished(int))); - } - - m_queryList = queryList; - indexReader->cancelSearching(); - indexReader->search(helpEngine->collectionFile(), indexFilesFolder(), queryList); - } - - void cancelSearching() - { - if (indexReader) - indexReader->cancelSearching(); - } - - QString indexFilesFolder() const - { - QString indexFilesFolder = QLatin1String(".fulltextsearch"); - if (helpEngine && !helpEngine->collectionFile().isEmpty()) { - QFileInfo fi(helpEngine->collectionFile()); - indexFilesFolder = fi.absolutePath() + QDir::separator() - + QLatin1Char('.') - + fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc"))); - } - return indexFilesFolder; - } - -private slots: - void optimizeIndex() - { -#if defined(QT_CLUCENE_SUPPORT) - if (indexWriter && !helpEngine.isNull()) { - indexWriter->optimizeIndex(); - } -#endif - } - -private: - friend class QHelpSearchEngine; - - QHelpSearchQueryWidget *queryWidget; - QHelpSearchResultWidget *resultWidget; - - fulltextsearch::QHelpSearchIndexReader *indexReader; - QHelpSearchIndexWriter *indexWriter; - - QPointer helpEngine; - - QList m_queryList; -}; - -#include "qhelpsearchengine.moc" - - -/*! - \class QHelpSearchQuery - \since 4.4 - \inmodule QtHelp - \brief The QHelpSearchQuery class contains the field name and the associated - search term - - The QHelpSearchQuery class contains the field name and the associated search - term. Depending on the field the search term might get split up into separate - terms to be parsed differently by the search engine. - - \sa QHelpSearchQueryWidget -*/ - -/*! - \fn QHelpSearchQuery::QHelpSearchQuery() - - Constructs a new empty QHelpSearchQuery. -*/ - -/*! - \fn QHelpSearchQuery::QHelpSearchQuery(FieldName field, const QStringList &wordList) - - Constructs a new QHelpSearchQuery and initializes it with the given \a field and \a wordList. -*/ - -/*! - \enum QHelpSearchQuery::FieldName - This enum type specifies the field names that are handled by the search engine. - - \value DEFAULT the default field provided by the search widget, several terms should be - split and stored in the word list except search terms enclosed in quotes. - \value FUZZY a field only provided in use with clucene. Terms should be split in separate - words and passed to the search engine. - \value WITHOUT a field only provided in use with clucene. Terms should be split in separate - words and passed to the search engine. - \value PHRASE a field only provided in use with clucene. Terms should not be split in separate - words. - \value ALL a field only provided in use with clucene. Terms should be split in separate - words and passed to the search engine - \value ATLEAST a field only provided in use with clucene. Terms should be split in separate - words and passed to the search engine -*/ - -/*! - \class QHelpSearchEngine - \since 4.4 - \inmodule QtHelp - \brief The QHelpSearchEngine class provides access to widgets reusable - to integrate fulltext search as well as to index and search documentation. - - Before the search engine can be used, one has to instantiate at least a - QHelpEngineCore object that needs to be passed to the search engines constructor. - This is required as the search engine needs to be connected to the help - engines setupFinished() signal to know when it can start to index documentation. - - After starting the indexing process the signal indexingStarted() is emitted and - on the end of the indexing process the indexingFinished() is emitted. To stop - the indexing one can call cancelIndexing(). - - While the indexing process has finished, the search engine can now be used to search - thru its index for a given term. To do this one may use the possibility of creating the - QHelpSearchQuery list by self or reuse the QHelpSearchQueryWidget which has the inbuild - functionality to set up a proper search queries list that get's passed to the search engines - search() function. - - After the list of querys has been passed to the search engine, the signal searchingStarted() - is emitted and after the search has finished the searchingFinished() signal is emitted. The - search process can be stopped by calling cancelSearching(). - - If the search succeeds, the searchingFinished() will be called with the search hits count, - which can be reused to fetch the search hits from the search engine. Calling the hits() - function with the range of hits you would like to get will return a list of the requested - SearchHits. They basically constist at the moment of a pair of strings where the values - of that pair are the documentation file path and the page title. - - To display the given hits use the QHelpSearchResultWidget or build up your own one if you need - more advanced functionality. Note that the QHelpSearchResultWidget can not be instantiated - directly, you must retrieve the widget from the search engine in use as all connections will be - established for you by the widget itself. -*/ - -/*! - \fn void QHelpSearchEngine::indexingStarted() - - This signal is emitted when indexing process is started. -*/ - -/*! - \fn void QHelpSearchEngine::indexingFinished() - - This signal is emitted when the indexing process is complete. -*/ - -/*! - \fn void QHelpSearchEngine::searchingStarted() - - This signal is emitted when the search process is started. -*/ - -/*! - \fn void QHelpSearchEngine::searchingFinished(int hits) - - This signal is emitted when the search process is complete. - The hit count is stored in \a hits. -*/ - -/*! - Constructs a new search engine with the given \a parent. The search engine - uses the given \a helpEngine to access the documentation that needs to be indexed. - The QHelpEngine's setupFinished() signal is automatically connected to the - QHelpSearchEngine's indexing function, so that new documentation will be indexed - after the signal is emitted. -*/ -QHelpSearchEngine::QHelpSearchEngine(QHelpEngineCore *helpEngine, QObject *parent) - : QObject(parent) -{ - d = new QHelpSearchEnginePrivate(helpEngine); - - connect(helpEngine, SIGNAL(setupFinished()), this, SLOT(indexDocumentation())); - - connect(d, SIGNAL(indexingStarted()), this, SIGNAL(indexingStarted())); - connect(d, SIGNAL(indexingFinished()), this, SIGNAL(indexingFinished())); - connect(d, SIGNAL(searchingStarted()), this, SIGNAL(searchingStarted())); - connect(d, SIGNAL(searchingFinished(int)), this, SIGNAL(searchingFinished(int))); -} - -/*! - Destructs the search engine. -*/ -QHelpSearchEngine::~QHelpSearchEngine() -{ - delete d; -} - -/*! - Returns a widget to use as input widget. Depending on your search engine - configuration you will get a different widget with more or less subwidgets. -*/ -QHelpSearchQueryWidget* QHelpSearchEngine::queryWidget() -{ - if (!d->queryWidget) - d->queryWidget = new QHelpSearchQueryWidget(); - - return d->queryWidget; -} - -/*! - Returns a widget that can hold and display the search results. -*/ -QHelpSearchResultWidget* QHelpSearchEngine::resultWidget() -{ - if (!d->resultWidget) - d->resultWidget = new QHelpSearchResultWidget(this); - - return d->resultWidget; -} - -/*! - \obsolete - Returns the amount of hits the search engine found. - \sa hitCount() -*/ -int QHelpSearchEngine::hitsCount() const -{ - return d->hitCount(); -} - -/*! - \since 4.6 - Returns the amount of hits the search engine found. -*/ -int QHelpSearchEngine::hitCount() const -{ - return d->hitCount(); -} - -/*! - \typedef QHelpSearchEngine::SearchHit - - Typedef for QPair. - The values of that pair are the documentation file path and the page title. - - \sa hits() -*/ - -/*! - Returns a list of search hits within the range of \a start \a end. -*/ -QList QHelpSearchEngine::hits(int start, int end) const -{ - return d->hits(start, end); -} - -/*! - Returns the list of queries last searched for. - \since 4.5 -*/ -QList QHelpSearchEngine::query() const -{ - return d->m_queryList; -} - -/*! - Forces the search engine to reindex all documentation files. -*/ -void QHelpSearchEngine::reindexDocumentation() -{ - d->updateIndex(true); -} - -/*! - Stops the indexing process. -*/ -void QHelpSearchEngine::cancelIndexing() -{ - d->cancelIndexing(); -} - -/*! - Stops the search process. -*/ -void QHelpSearchEngine::cancelSearching() -{ - d->cancelSearching(); -} - -/*! - Starts the search process using the given list of queries \a queryList - build by the search field name and the values to search for. -*/ -void QHelpSearchEngine::search(const QList &queryList) -{ - d->search(queryList); -} - -void QHelpSearchEngine::indexDocumentation() -{ - d->updateIndex(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchengine.h b/src/assistant/lib/qhelpsearchengine.h deleted file mode 100644 index baceb7057..000000000 --- a/src/assistant/lib/qhelpsearchengine.h +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHENGINE_H -#define QHELPSEARCHENGINE_H - -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QHelpEngineCore; -class QHelpSearchQueryWidget; -class QHelpSearchResultWidget; -class QHelpSearchEnginePrivate; - -class QHELP_EXPORT QHelpSearchQuery -{ -public: - enum FieldName { DEFAULT = 0, FUZZY, WITHOUT, PHRASE, ALL, ATLEAST }; - - QHelpSearchQuery() - : fieldName(DEFAULT) { wordList.clear(); } - QHelpSearchQuery(FieldName field, const QStringList &wordList) - : fieldName(field), wordList(wordList) {} - - FieldName fieldName; - QStringList wordList; -}; - -class QHELP_EXPORT QHelpSearchEngine : public QObject -{ - Q_OBJECT - -public: - explicit QHelpSearchEngine(QHelpEngineCore *helpEngine, - QObject *parent = 0); - ~QHelpSearchEngine(); - - QHelpSearchQueryWidget* queryWidget(); - QHelpSearchResultWidget* resultWidget(); - -#ifdef QT_DEPRECATED - QT_DEPRECATED int hitsCount() const; -#endif - int hitCount() const; - - typedef QPair SearchHit; - QList hits(int start, int end) const; - - QList query() const; - -public Q_SLOTS: - void reindexDocumentation(); - void cancelIndexing(); - - void search(const QList &queryList); - void cancelSearching(); - -Q_SIGNALS: - void indexingStarted(); - void indexingFinished(); - - void searchingStarted(); - void searchingFinished(int hits); - -private Q_SLOTS: - void indexDocumentation(); - -private: - QHelpSearchEnginePrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QHELPSEARCHENGINE_H diff --git a/src/assistant/lib/qhelpsearchindex_default.cpp b/src/assistant/lib/qhelpsearchindex_default.cpp deleted file mode 100644 index 9974f618d..000000000 --- a/src/assistant/lib/qhelpsearchindex_default.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpsearchindex_default_p.h" - -QT_BEGIN_NAMESPACE - -QDataStream &operator>>(QDataStream &s, Document &l) -{ - s >> l.docNumber; - s >> l.frequency; - return s; -} - -QDataStream &operator<<(QDataStream &s, const Document &l) -{ - s << qint16(l.docNumber); - s << qint16(l.frequency); - return s; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchindex_default_p.h b/src/assistant/lib/qhelpsearchindex_default_p.h deleted file mode 100644 index 868609960..000000000 --- a/src/assistant/lib/qhelpsearchindex_default_p.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHINDEXDEFAULT_H -#define QHELPSEARCHINDEXDEFAULT_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtHelpInternal { - -struct Document { - Document(qint16 d, qint16 f) - : docNumber(d), frequency(f) {} - - Document() - : docNumber(-1), frequency(0) {} - - bool operator==(const Document &doc) const { - return docNumber == doc.docNumber; - } - bool operator<(const Document &doc) const { - return frequency > doc.frequency; - } - bool operator<=(const Document &doc) const { - return frequency >= doc.frequency; - } - bool operator>(const Document &doc) const { - return frequency < doc.frequency; - } - - qint16 docNumber; - qint16 frequency; -}; - -struct DocumentInfo : public Document { - DocumentInfo() - : Document(-1, 0), documentTitle(QString()), documentUrl(QString()) {} - - DocumentInfo(qint16 d, qint16 f, const QString &title, const QString &url) - : Document(d, f), documentTitle(title), documentUrl(url) {} - - DocumentInfo(const Document &document, const QString &title, const QString &url) - : Document(document.docNumber, document.frequency), documentTitle(title), documentUrl(url) {} - - QString documentTitle; - QString documentUrl; -}; - -struct Entry { - Entry(qint16 d) { documents.append(Document(d, 1)); } - Entry(QVector l) : documents(l) {} - - QVector documents; -}; - -struct PosEntry { - PosEntry(int p) { positions.append(p); } - QList positions; -}; - -struct Term { - Term() : frequency(-1) {} - Term(const QString &t, int f, QVector l) : term(t), frequency(f), documents(l) {} - QString term; - int frequency; - QVectordocuments; - bool operator<(const Term &i2) const { return frequency < i2.frequency; } -}; - -struct TermInfo { - TermInfo() : frequency(-1) {} - TermInfo(const QString &t, int f, QVector l) - : term(t), frequency(f), documents(l) {} - - bool operator<(const TermInfo &i2) const { return frequency < i2.frequency; } - - QString term; - int frequency; - QVectordocuments; -}; - -} // namespace QtHelpInternal - -using QtHelpInternal::Document; -using QtHelpInternal::DocumentInfo; -using QtHelpInternal::Entry; -using QtHelpInternal::PosEntry; -using QtHelpInternal::Term; -using QtHelpInternal::TermInfo; - -QDataStream &operator>>(QDataStream &s, Document &l); -QDataStream &operator<<(QDataStream &s, const Document &l); - -QT_END_NAMESPACE - -#endif // QHELPSEARCHINDEXDEFAULT_H diff --git a/src/assistant/lib/qhelpsearchindexreader.cpp b/src/assistant/lib/qhelpsearchindexreader.cpp deleted file mode 100644 index 1ee356d2f..000000000 --- a/src/assistant/lib/qhelpsearchindexreader.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpsearchindexreader_p.h" - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { - -QHelpSearchIndexReader::QHelpSearchIndexReader() - : QThread() - , m_cancel(false) -{ - // nothing todo -} - -QHelpSearchIndexReader::~QHelpSearchIndexReader() -{ - mutex.lock(); - this->m_cancel = true; - mutex.unlock(); - - wait(); -} - -void QHelpSearchIndexReader::cancelSearching() -{ - mutex.lock(); - this->m_cancel = true; - mutex.unlock(); -} - -void QHelpSearchIndexReader::search(const QString &collectionFile, const QString &indexFilesFolder, - const QList &queryList) -{ - wait(); - - this->hitList.clear(); - this->m_cancel = false; - this->m_query = queryList; - this->m_collectionFile = collectionFile; - this->m_indexFilesFolder = indexFilesFolder; - - start(QThread::NormalPriority); -} - -int QHelpSearchIndexReader::hitCount() const -{ - QMutexLocker lock(&mutex); - return hitList.count(); -} - -QList QHelpSearchIndexReader::hits(int start, - int end) const -{ - QList hits; - QMutexLocker lock(&mutex); - for (int i = start; i < end && i < hitList.count(); ++i) - hits.append(hitList.at(i)); - return hits; -} - - -} // namespace fulltextsearch - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchindexreader_clucene.cpp b/src/assistant/lib/qhelpsearchindexreader_clucene.cpp deleted file mode 100644 index 537e1d765..000000000 --- a/src/assistant/lib/qhelpsearchindexreader_clucene.cpp +++ /dev/null @@ -1,481 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "fulltextsearch/qindexreader_p.h" -#include "fulltextsearch/qqueryparser_p.h" -#include "fulltextsearch/qsearchable_p.h" -#include "qclucenefieldnames_p.h" -#include "qhelpenginecore.h" - -#include "qhelpsearchindexreader_clucene_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace clucene { - -QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() - : QHelpSearchIndexReader() -{ - // nothing todo -} - -QHelpSearchIndexReaderClucene::~QHelpSearchIndexReaderClucene() -{ -} - - -void QHelpSearchIndexReaderClucene::run() -{ - mutex.lock(); - - if (m_cancel) { - mutex.unlock(); - return; - } - - const QString collectionFile(this->m_collectionFile); - const QList &queryList = this->m_query; - const QString indexPath(m_indexFilesFolder); - - mutex.unlock(); - - QHelpEngineCore engine(collectionFile, 0); - if (!engine.setupData()) - return; - - QFileInfo fInfo(indexPath); - if (fInfo.exists() && !fInfo.isWritable()) { - qWarning("Full Text Search, could not read index (missing permissions)."); - return; - } - - if(QCLuceneIndexReader::indexExists(indexPath)) { - mutex.lock(); - if (m_cancel) { - mutex.unlock(); - return; - } - mutex.unlock(); - - emit searchingStarted(); - -#if !defined(QT_NO_EXCEPTIONS) - try { -#endif - QCLuceneBooleanQuery booleanQueryTitle; - QCLuceneBooleanQuery booleanQueryContent; - QCLuceneStandardAnalyzer analyzer; - const QStringList& attribList = - engine.filterAttributes(engine.currentFilter()); - bool titleQueryIsValid = buildQuery(queryList, TitleTokenizedField, - attribList, booleanQueryTitle, analyzer); - bool contentQueryIsValid = buildQuery(queryList, ContentField, - attribList, booleanQueryContent, analyzer); - if (!titleQueryIsValid && !contentQueryIsValid) { - emit searchingFinished(0); - return; - } - - QCLuceneIndexSearcher indexSearcher(indexPath); - - // QCLuceneHits object must be allocated on the heap, because - // there is no default constructor. - QSharedPointer titleHits; - QSharedPointer contentHits; - if (titleQueryIsValid) { - titleHits = QSharedPointer(new QCLuceneHits( - indexSearcher.search(booleanQueryTitle))); - } - if (contentQueryIsValid) { - contentHits = QSharedPointer(new QCLuceneHits( - indexSearcher.search(booleanQueryContent))); - } - bool boost = true; - if ((titleHits.isNull() || titleHits->length() == 0) - && (contentHits.isNull() || contentHits->length() == 0)) { - booleanQueryTitle = QCLuceneBooleanQuery(); - booleanQueryContent = QCLuceneBooleanQuery(); - titleQueryIsValid = - buildTryHarderQuery(queryList, TitleTokenizedField, - attribList, booleanQueryTitle, analyzer); - contentQueryIsValid = - buildTryHarderQuery(queryList, ContentField, attribList, - booleanQueryContent, analyzer); - if (!titleQueryIsValid && !contentQueryIsValid) { - emit searchingFinished(0); - return; - } - if (titleQueryIsValid) { - titleHits = QSharedPointer(new QCLuceneHits( - indexSearcher.search(booleanQueryTitle))); - } - if (contentQueryIsValid) { - contentHits = QSharedPointer(new QCLuceneHits( - indexSearcher.search(booleanQueryContent))); - } - boost = false; - } - QList > cluceneHitsList; - if (!titleHits.isNull()) - cluceneHitsList.append(titleHits); - if (!contentHits.isNull()) - cluceneHitsList.append(contentHits); - - QSet pathSet; - QCLuceneDocument document; - const QStringList namespaceList = engine.registeredDocumentations(); - - foreach (const QSharedPointer &hits, cluceneHitsList) { - for (qint32 i = 0; i < hits->length(); i++) { - document = hits->document(i); - const QString path = document.get(PathField); - if (!pathSet.contains(path) && namespaceList.contains( - document.get(NamespaceField), Qt::CaseInsensitive)) { - pathSet.insert(path); - hitList.append(qMakePair(path, document.get(TitleField))); - } - document.clear(); - - mutex.lock(); - if (m_cancel) { - mutex.unlock(); - emit searchingFinished(0); - return; - } - mutex.unlock(); - } - } - - indexSearcher.close(); - const int count = hitList.count(); - if ((count > 0) && boost) - boostSearchHits(engine, hitList, queryList); - emit searchingFinished(hitList.count()); - -#if !defined(QT_NO_EXCEPTIONS) - } catch(...) { - mutex.lock(); - hitList.clear(); - mutex.unlock(); - emit searchingFinished(0); - } -#endif - } -} - -bool QHelpSearchIndexReaderClucene::buildQuery( - const QList &queries, const QString &fieldName, - const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer) -{ - bool queryIsValid = false; - foreach (const QHelpSearchQuery &query, queries) { - if (fieldName != ContentField && isNegativeQuery(query)) { - queryIsValid = false; - break; - } - switch (query.fieldName) { - case QHelpSearchQuery::FUZZY: - if (addFuzzyQuery(query, fieldName, booleanQuery, analyzer)) - queryIsValid = true; - break; - case QHelpSearchQuery::WITHOUT: - if (fieldName != ContentField) - return false; - if (addWithoutQuery(query, fieldName, booleanQuery)) - queryIsValid = true; - break; - case QHelpSearchQuery::PHRASE: - if (addPhraseQuery(query, fieldName, booleanQuery)) - queryIsValid = true; - break; - case QHelpSearchQuery::ALL: - if (addAllQuery(query, fieldName, booleanQuery)) - queryIsValid = true; - break; - case QHelpSearchQuery::DEFAULT: - if (addDefaultQuery(query, fieldName, true, booleanQuery, analyzer)) - queryIsValid = true; - break; - case QHelpSearchQuery::ATLEAST: - if (addAtLeastQuery(query, fieldName, booleanQuery, analyzer)) - queryIsValid = true; - break; - default: - Q_ASSERT(!"Invalid field name"); - } - } - - if (queryIsValid && !filterAttributes.isEmpty()) { - queryIsValid = - addAttributesQuery(filterAttributes, booleanQuery, analyzer); - } - - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::buildTryHarderQuery( - const QList &queries, const QString &fieldName, - const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer) -{ - if (queries.isEmpty()) - return false; - const QHelpSearchQuery &query = queries.front(); - if (query.fieldName != QHelpSearchQuery::DEFAULT) - return false; - if (isNegativeQuery(query)) - return false; - if (!addDefaultQuery(query, fieldName, false, booleanQuery, analyzer)) - return false; - if (filterAttributes.isEmpty()) - return true; - return addAttributesQuery(filterAttributes, booleanQuery, analyzer); -} - -bool QHelpSearchIndexReaderClucene::isNegativeQuery(const QHelpSearchQuery &query) const -{ - const QString &search = query.wordList.join(" "); - return search.contains('!') || search.contains('-') - || search.contains(QLatin1String(" NOT ")); -} - -bool QHelpSearchIndexReaderClucene::addFuzzyQuery(const QHelpSearchQuery &query, - const QString &fieldName, QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer) -{ - bool queryIsValid = false; - const QLatin1String fuzzy("~"); - foreach (const QString &term, query.wordList) { - if (!term.isEmpty()) { - QCLuceneQuery *lQuery = - QCLuceneQueryParser::parse(term + fuzzy, fieldName, analyzer); - if (lQuery != 0) { - booleanQuery.add(lQuery, true, false, false); - queryIsValid = true; - } - } - } - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::addWithoutQuery(const QHelpSearchQuery &query, - const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) -{ - bool queryIsValid = false; - const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, query.wordList) { - if (stopWords.contains(term, Qt::CaseInsensitive)) - continue; - QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( - fieldName, term.toLower())); - booleanQuery.add(lQuery, true, false, true); - queryIsValid = true; - } - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::addPhraseQuery(const QHelpSearchQuery &query, - const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) -{ - bool queryIsValid = false; - const QString &term = query.wordList.at(0).toLower(); - if (term.contains(QLatin1Char(' '))) { - const QStringList termList = term.split(QLatin1String(" ")); - QCLucenePhraseQuery *q = new QCLucenePhraseQuery(); - const QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, termList) { - if (!stopWords.contains(term, Qt::CaseInsensitive)) - q->addTerm(QCLuceneTerm(fieldName, term.toLower())); - } - if (!q->getTerms().isEmpty()) { - booleanQuery.add(q, true, true, false); - queryIsValid = true; - } - } else { - QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( - fieldName, term.toLower())); - booleanQuery.add(lQuery, true, true, false); - queryIsValid = true; - } - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::addAllQuery(const QHelpSearchQuery &query, - const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) -{ - bool queryIsValid = false; - const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, query.wordList) { - if (stopWords.contains(term, Qt::CaseInsensitive)) - continue; - QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( - fieldName, term.toLower())); - booleanQuery.add(lQuery, true, true, false); - queryIsValid = true; - } - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::addDefaultQuery(const QHelpSearchQuery &query, - const QString &fieldName, bool allTermsRequired, - QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer) -{ - bool queryIsValid = false; - foreach (const QString &term, query.wordList) { - QCLuceneQuery *lQuery = - QCLuceneQueryParser::parse(term.toLower(), fieldName, analyzer); - if (lQuery) { - booleanQuery.add(lQuery, true, allTermsRequired, false); - queryIsValid = true; - } - } - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::addAtLeastQuery( - const QHelpSearchQuery &query, const QString &fieldName, - QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer) -{ - bool queryIsValid = false; - foreach (const QString &term, query.wordList) { - if (!term.isEmpty()) { - QCLuceneQuery *lQuery = - QCLuceneQueryParser::parse(term, fieldName, analyzer); - if (lQuery) { - booleanQuery.add(lQuery, true, false, false); - queryIsValid = true; - } - } - } - return queryIsValid; -} - -bool QHelpSearchIndexReaderClucene::addAttributesQuery( - const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer) -{ - QCLuceneQuery* lQuery = QCLuceneQueryParser::parse(QLatin1String("+") - + filterAttributes.join(QLatin1String(" +")), AttributeField, analyzer); - if (!lQuery) - return false; - booleanQuery.add(lQuery, true, true, false); - return true; -} - -void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine, - QList &hitList, const QList &queryList) -{ - foreach (const QHelpSearchQuery &query, queryList) { - if (query.fieldName != QHelpSearchQuery::DEFAULT) - continue; - - QString joinedQuery = query.wordList.join(QLatin1String(" ")); - - QCLuceneStandardAnalyzer analyzer; - QCLuceneQuery *parsedQuery = QCLuceneQueryParser::parse( - joinedQuery, ContentField, analyzer); - - if (parsedQuery) { - joinedQuery = parsedQuery->toString(); - delete parsedQuery; - } - - const QString contentString(ContentField + QLatin1String(":")); - int length = contentString.length(); - int index = joinedQuery.indexOf(contentString); - - QString term; - int nextIndex = 0; - QStringList searchTerms; - while (index != -1) { - nextIndex = joinedQuery.indexOf(contentString, index + 1); - term = joinedQuery.mid(index + length, nextIndex - (length + index)).simplified(); - if (term.startsWith(QLatin1String("\"")) - && term.endsWith(QLatin1String("\""))) { - searchTerms.append(term.remove(QLatin1String("\""))); - } else { - searchTerms += term.split(QLatin1Char(' ')); - } - index = nextIndex; - } - searchTerms.removeDuplicates(); - - int count = qMin(75, hitList.count()); - QMap hitMap; - for (int i = 0; i < count; ++i) { - const QHelpSearchEngine::SearchHit &hit = hitList.at(i); - QString data = QString::fromUtf8(engine.fileData(hit.first)); - - int counter = 0; - foreach (const QString &term, searchTerms) - counter += data.count(term, Qt::CaseInsensitive); - hitMap.insertMulti(counter, hit); - } - - QList boostedList; - QMap::const_iterator it = hitMap.constEnd(); - do { - --it; - boostedList.append(it.value()); - } while (it != hitMap.constBegin()); - boostedList += hitList.mid(count, hitList.count()); - mutex.lock(); - hitList = boostedList; - mutex.unlock(); - } -} - -} // namespace clucene -} // namespace fulltextsearch - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchindexreader_clucene_p.h b/src/assistant/lib/qhelpsearchindexreader_clucene_p.h deleted file mode 100644 index dec18a07b..000000000 --- a/src/assistant/lib/qhelpsearchindexreader_clucene_p.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHINDEXREADERCLUCENE_H -#define QHELPSEARCHINDEXREADERCLUCENE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -#include "fulltextsearch/qanalyzer_p.h" -#include "fulltextsearch/qquery_p.h" -#include "qhelpsearchindexreader_p.h" - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace clucene { - -class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader -{ - Q_OBJECT - -public: - QHelpSearchIndexReaderClucene(); - ~QHelpSearchIndexReaderClucene(); - -private: - void run(); - void boostSearchHits(const QHelpEngineCore &engine, QList &hitList, - const QList &queryList); - bool buildQuery(const QList &queries, - const QString &fieldName, - const QStringList &filterAttributes, - QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer); - bool buildTryHarderQuery(const QList &queries, - const QString &fieldName, - const QStringList &filterAttributes, - QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer); - bool addFuzzyQuery(const QHelpSearchQuery &query, const QString &fieldName, - QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); - bool addWithoutQuery(const QHelpSearchQuery &query, const QString &fieldName, - QCLuceneBooleanQuery &booleanQuery); - bool addPhraseQuery(const QHelpSearchQuery &query, const QString &fieldName, - QCLuceneBooleanQuery &booleanQuery); - bool addAllQuery(const QHelpSearchQuery &query, const QString &fieldName, - QCLuceneBooleanQuery &booleanQuery); - bool addDefaultQuery(const QHelpSearchQuery &query, const QString &fieldName, - bool allTermsRequired, QCLuceneBooleanQuery &booleanQuery, - QCLuceneAnalyzer &analyzer); - bool addAtLeastQuery(const QHelpSearchQuery &query, const QString &fieldName, - QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); - bool addAttributesQuery(const QStringList &filterAttributes, - QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); - bool isNegativeQuery(const QHelpSearchQuery &query) const; -}; - -} // namespace clucene -} // namespace fulltextsearch - -QT_END_NAMESPACE - -#endif // QHELPSEARCHINDEXREADERCLUCENE_H diff --git a/src/assistant/lib/qhelpsearchindexreader_default.cpp b/src/assistant/lib/qhelpsearchindexreader_default.cpp deleted file mode 100644 index e49fdfcbd..000000000 --- a/src/assistant/lib/qhelpsearchindexreader_default.cpp +++ /dev/null @@ -1,612 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpenginecore.h" -#include "qhelpsearchindexreader_default_p.h" - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace std { - -namespace { - QStringList split( const QString &str ) - { - QStringList lst; - int j = 0; - int i = str.indexOf(QLatin1Char('*'), j ); - - if (str.startsWith(QLatin1String("*"))) - lst << QLatin1String("*"); - - while ( i != -1 ) { - if ( i > j && i <= (int)str.length() ) { - lst << str.mid( j, i - j ); - lst << QLatin1String("*"); - } - j = i + 1; - i = str.indexOf(QLatin1Char('*'), j ); - } - - int l = str.length() - 1; - if ( str.mid( j, l - j + 1 ).length() > 0 ) - lst << str.mid( j, l - j + 1 ); - - return lst; - } -} - - -Reader::Reader() - : indexPath(QString()) - , indexFile(QString()) - , documentFile(QString()) -{ - termList.clear(); - indexTable.clear(); - searchIndexTable.clear(); -} - -Reader::~Reader() -{ - reset(); - searchIndexTable.clear(); -} - -bool Reader::readIndex() -{ - if (indexTable.contains(indexFile)) - return true; - - QFile idxFile(indexFile); - if (!idxFile.open(QFile::ReadOnly)) - return false; - - QString key; - int numOfDocs; - EntryTable entryTable; - QVector docs; - QDataStream dictStream(&idxFile); - while (!dictStream.atEnd()) { - dictStream >> key; - dictStream >> numOfDocs; - docs.resize(numOfDocs); - dictStream >> docs; - entryTable.insert(key, new Entry(docs)); - } - idxFile.close(); - - if (entryTable.isEmpty()) - return false; - - QFile docFile(documentFile); - if (!docFile.open(QFile::ReadOnly)) - return false; - - QString title, url; - DocumentList documentList; - QDataStream docStream(&docFile); - while (!docStream.atEnd()) { - docStream >> title; - docStream >> url; - documentList.append(QStringList(title) << url); - } - docFile.close(); - - if (documentList.isEmpty()) { - cleanupIndex(entryTable); - return false; - } - - indexTable.insert(indexFile, Index(entryTable, documentList)); - return true; -} - -bool Reader::initCheck() const -{ - return !searchIndexTable.isEmpty(); -} - -void Reader::setIndexPath(const QString &path) -{ - indexPath = path; -} - -void Reader::filterFilesForAttributes(const QStringList &attributes) -{ - searchIndexTable.clear(); - for(IndexTable::ConstIterator it = indexTable.begin(); it != indexTable.end(); ++it) { - const QString fileName = it.key(); - bool containsAll = true; - QStringList split = fileName.split(QLatin1String("@")); - foreach (const QString &attribute, attributes) { - if (!split.contains(attribute, Qt::CaseInsensitive)) { - containsAll = false; - break; - } - } - - if (containsAll) - searchIndexTable.insert(fileName, it.value()); - } -} - -void Reader::setIndexFile(const QString &namespaceName, const QString &attributes) -{ - QString extension = namespaceName + QLatin1String("@") + attributes; - indexFile = indexPath + QLatin1String("/indexdb40.") + extension; - documentFile = indexPath + QLatin1String("/indexdoc40.") + extension; -} - -bool Reader::splitSearchTerm(const QString &searchTerm, QStringList *terms, - QStringList *termSeq, QStringList *seqWords) -{ - QString term = searchTerm; - - term = term.simplified(); - term = term.replace(QLatin1String("\'"), QLatin1String("\"")); - term = term.replace(QLatin1String("`"), QLatin1String("\"")); - term = term.replace(QLatin1String("-"), QLatin1String(" ")); - term = term.replace(QRegExp(QLatin1String("\\s[\\S]?\\s")), QLatin1String(" ")); - - *terms = term.split(QLatin1Char(' ')); - QStringList::iterator it = terms->begin(); - for (; it != terms->end(); ++it) { - (*it) = (*it).simplified(); - (*it) = (*it).toLower(); - (*it) = (*it).replace(QLatin1String("\""), QLatin1String("")); - } - - if (term.contains(QLatin1Char('\"'))) { - if ((term.count(QLatin1Char('\"')))%2 == 0) { - int beg = 0; - int end = 0; - QString s; - beg = term.indexOf(QLatin1Char('\"'), beg); - while (beg != -1) { - beg++; - end = term.indexOf(QLatin1Char('\"'), beg); - s = term.mid(beg, end - beg); - s = s.toLower(); - s = s.simplified(); - if (s.contains(QLatin1Char('*'))) { - qWarning("Full Text Search, using a wildcard within phrases is not allowed."); - return false; - } - *seqWords += s.split(QLatin1Char(' ')); - *termSeq << s; - beg = term.indexOf(QLatin1Char('\"'), end + 1); - } - } else { - qWarning("Full Text Search, the closing quotation mark is missing."); - return false; - } - } - - return true; -} - -void Reader::searchInIndex(const QStringList &terms) -{ - foreach (const QString &term, terms) { - QVector documents; - - for(IndexTable::ConstIterator it = searchIndexTable.begin(); - it != searchIndexTable.end(); ++it) { - EntryTable entryTable = it.value().first; - DocumentList documentList = it.value().second; - - if (term.contains(QLatin1Char('*'))) - documents = setupDummyTerm(getWildcardTerms(term, entryTable), entryTable); - else if (entryTable.value(term)) - documents = entryTable.value(term)->documents; - else - continue; - - if (!documents.isEmpty()) { - DocumentInfo info; - QString title, url; - QVector documentsInfo; - foreach(const Document &doc, documents) { - info.docNumber = doc.docNumber; - info.frequency = doc.frequency; - info.documentUrl = documentList.at(doc.docNumber).at(1); - info.documentTitle = documentList.at(doc.docNumber).at(0); - documentsInfo.append(info); - } - - bool found = false; - for(QList::Iterator tit = termList.begin(); - tit != termList.end(); ++tit) { - TermInfo *t = &(*tit); - if(t->term == term) { - t->documents += documentsInfo; - t->frequency += documentsInfo.count(); - found = true; break; - } - } - if (!found) - termList.append(TermInfo(term, documentsInfo.count(), documentsInfo)); - } - } - } - qSort(termList); -} - -QVector Reader::hits() -{ - QVector documents; - if (!termList.count()) - return documents; - - documents = termList.takeFirst().documents; - for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { - TermInfo *t = &(*it); - QVector docs = t->documents; - for(QVector::Iterator minDoc_it = documents.begin(); - minDoc_it != documents.end(); ) { - bool found = false; - for (QVector::ConstIterator doc_it = docs.constBegin(); - doc_it != docs.constEnd(); ++doc_it ) { - if ( (*minDoc_it).docNumber == (*doc_it).docNumber ) { - (*minDoc_it).frequency += (*doc_it).frequency; - found = true; - break; - } - } - if (!found) - minDoc_it = documents.erase(minDoc_it); - else - ++minDoc_it; - } - } - - qSort(documents); - return documents; -} - -bool Reader::searchForPattern(const QStringList &patterns, const QStringList &words, - const QByteArray &data) -{ - if (data.isEmpty()) - return false; - - for(QHash::ConstIterator mit = - miniIndex.begin(); mit != miniIndex.end(); ++mit) { - delete mit.value(); - } - miniIndex.clear(); - - wordNum = 3; - QStringList::ConstIterator cIt = words.begin(); - for ( ; cIt != words.end(); ++cIt ) - miniIndex.insert(*cIt, new PosEntry(0)); - - QTextStream s(data); - QString text = s.readAll(); - bool valid = true; - const QChar *buf = text.unicode(); - QChar str[64]; - QChar c = buf[0]; - int j = 0; - int i = 0; - while ( j < text.length() ) { - if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { - valid = false; - if ( i > 1 ) - buildMiniIndex( QString(str,i) ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { - valid = true; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { - str[i] = c.toLower(); - ++i; - } else { - if ( i > 1 ) - buildMiniIndex( QString(str,i) ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - buildMiniIndex( QString(str,i) ); - - QStringList::ConstIterator patIt = patterns.begin(); - QStringList wordLst; - QList a, b; - QList::iterator aIt; - for ( ; patIt != patterns.end(); ++patIt ) { - wordLst = (*patIt).split(QLatin1Char(' ')); - a = miniIndex[ wordLst[0] ]->positions; - for ( int j = 1; j < (int)wordLst.count(); ++j ) { - b = miniIndex[ wordLst[j] ]->positions; - aIt = a.begin(); - while ( aIt != a.end() ) { - if ( b.contains( *aIt + 1 )) { - (*aIt)++; - ++aIt; - } else { - aIt = a.erase( aIt ); - } - } - } - } - if ( a.count() ) - return true; - return false; -} - -QVector Reader::setupDummyTerm(const QStringList &terms, - const EntryTable &entryTable) -{ - QList termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) { - if (entryTable.value(*it)) { - Entry *e = entryTable.value(*it); - termList.append(Term(*it, e->documents.count(), e->documents ) ); - } - } - QVector maxList(0); - if ( !termList.count() ) - return maxList; - qSort(termList); - - maxList = termList.takeLast().documents; - for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { - Term *t = &(*it); - QVector docs = t->documents; - for (QVector::iterator docIt = docs.begin(); docIt != docs.end(); ++docIt ) { - if ( maxList.indexOf( *docIt ) == -1 ) - maxList.append( *docIt ); - } - } - return maxList; -} - -QStringList Reader::getWildcardTerms(const QString &term, - const EntryTable &entryTable) -{ - QStringList lst; - QStringList terms = split(term); - QStringList::Iterator iter; - - for(EntryTable::ConstIterator it = entryTable.begin(); - it != entryTable.end(); ++it) { - int index = 0; - bool found = false; - QString text( it.key() ); - for ( iter = terms.begin(); iter != terms.end(); ++iter ) { - if ( *iter == QLatin1String("*") ) { - found = true; - continue; - } - if ( iter == terms.begin() && (*iter)[0] != text[0] ) { - found = false; - break; - } - index = text.indexOf( *iter, index ); - if ( *iter == terms.last() && index != (int)text.length()-1 ) { - index = text.lastIndexOf( *iter ); - if ( index != (int)text.length() - (int)(*iter).length() ) { - found = false; - break; - } - } - if ( index != -1 ) { - found = true; - index += (*iter).length(); - continue; - } else { - found = false; - break; - } - } - if (found) - lst << text; - } - - return lst; -} - -void Reader::buildMiniIndex(const QString &string) -{ - if (miniIndex[string]) - miniIndex[string]->positions.append(wordNum); - ++wordNum; -} - -void Reader::reset() -{ - for(IndexTable::Iterator it = indexTable.begin(); - it != indexTable.end(); ++it) { - cleanupIndex(it.value().first); - it.value().second.clear(); - } -} - -void Reader::cleanupIndex(EntryTable &entryTable) -{ - for(EntryTable::ConstIterator it = - entryTable.begin(); it != entryTable.end(); ++it) { - delete it.value(); - } - - entryTable.clear(); -} - - -QHelpSearchIndexReaderDefault::QHelpSearchIndexReaderDefault() - : QHelpSearchIndexReader() -{ - // nothing todo -} - -QHelpSearchIndexReaderDefault::~QHelpSearchIndexReaderDefault() -{ -} - -void QHelpSearchIndexReaderDefault::run() -{ - mutex.lock(); - - if (m_cancel) { - mutex.unlock(); - return; - } - - const QList &queryList = this->m_query; - const QLatin1String key("DefaultSearchNamespaces"); - const QString collectionFile(this->m_collectionFile); - const QString indexPath = m_indexFilesFolder; - - mutex.unlock(); - - QString queryTerm; - foreach (const QHelpSearchQuery &query, queryList) { - if (query.fieldName == QHelpSearchQuery::DEFAULT) { - queryTerm = query.wordList.at(0); - break; - } - } - - if (queryTerm.isEmpty()) - return; - - QHelpEngineCore engine(collectionFile, 0); - if (!engine.setupData()) - return; - - const QStringList registeredDocs = engine.registeredDocumentations(); - const QStringList indexedNamespaces = engine.customValue(key).toString(). - split(QLatin1String("|"), QString::SkipEmptyParts); - - emit searchingStarted(); - - // setup the reader - m_reader.setIndexPath(indexPath); - foreach(const QString &namespaceName, registeredDocs) { - mutex.lock(); - if (m_cancel) { - mutex.unlock(); - searchingFinished(0); // TODO: check this ??? - return; - } - mutex.unlock(); - - const QList attributeSets = - engine.filterAttributeSets(namespaceName); - - foreach (const QStringList &attributes, attributeSets) { - // read all index files - m_reader.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); - if (!m_reader.readIndex()) { - qWarning("Full Text Search, could not read file for namespace: %s.", - namespaceName.toUtf8().constData()); - } - } - } - - // get the current filter attributes and minimize the index files table - m_reader.filterFilesForAttributes(engine.filterAttributes(engine.currentFilter())); - - hitList.clear(); - QStringList terms, termSeq, seqWords; - if (m_reader.initCheck() && // check if we could read anything - m_reader.splitSearchTerm(queryTerm, &terms, &termSeq, &seqWords) ) { - - // search for term(s) - m_reader.searchInIndex(terms); // TODO: should this be interruptible as well ??? - - QVector hits = m_reader.hits(); - if (!hits.isEmpty()) { - if (termSeq.isEmpty()) { - foreach (const DocumentInfo &docInfo, hits) { - mutex.lock(); - if (m_cancel) { - mutex.unlock(); - searchingFinished(0); // TODO: check this, speed issue while locking??? - return; - } - mutex.unlock(); - hitList.append(qMakePair(docInfo.documentTitle, docInfo.documentUrl)); - } - } else { - foreach (const DocumentInfo &docInfo, hits) { - mutex.lock(); - if (m_cancel) { - mutex.unlock(); - searchingFinished(0); // TODO: check this, speed issue while locking??? - return; - } - mutex.unlock(); - - if (m_reader.searchForPattern(termSeq, seqWords, engine.fileData(docInfo.documentUrl))) // TODO: should this be interruptible as well ??? - hitList.append(qMakePair(docInfo.documentTitle, docInfo.documentUrl)); - } - } - } - } - - emit searchingFinished(hitList.count()); -} - -} // namespace std -} // namespace fulltextsearch - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchindexreader_default_p.h b/src/assistant/lib/qhelpsearchindexreader_default_p.h deleted file mode 100644 index 30dfe1ed6..000000000 --- a/src/assistant/lib/qhelpsearchindexreader_default_p.h +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHINDEXREADERDEFAULT_H -#define QHELPSEARCHINDEXREADERDEFAULT_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelpsearchindex_default_p.h" -#include "qhelpsearchindexreader_p.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace std { - -class Reader -{ - typedef QList DocumentList; - typedef QHash EntryTable; - typedef QPair Index; - typedef QHash IndexTable; - -public: - Reader(); - ~Reader(); - - bool readIndex(); - bool initCheck() const; - void setIndexPath(const QString &path); - void filterFilesForAttributes(const QStringList &attributes); - void setIndexFile(const QString &namespaceName, const QString &attributes); - bool splitSearchTerm(const QString &searchTerm, QStringList *terms, - QStringList *termSeq, QStringList *seqWords); - - void searchInIndex(const QStringList &terms); - QVector hits(); - bool searchForPattern(const QStringList &patterns, - const QStringList &words, const QByteArray &data); - -private: - QVector setupDummyTerm(const QStringList &terms, const EntryTable &entryTable); - QStringList getWildcardTerms(const QString &term, const EntryTable &entryTable); - void buildMiniIndex(const QString &string); - void reset(); - void cleanupIndex(EntryTable &entryTable); - -private: - uint wordNum; - QString indexPath; - QString indexFile; - QString documentFile; - - IndexTable indexTable; - QList termList; - IndexTable searchIndexTable; - QHash miniIndex; -}; - - -class QHelpSearchIndexReaderDefault : public QHelpSearchIndexReader -{ - Q_OBJECT - -public: - QHelpSearchIndexReaderDefault(); - ~QHelpSearchIndexReaderDefault(); - -private: - void run(); - -private: - Reader m_reader; -}; - -} // namespace std -} // namespace fulltextsearch - -QT_END_NAMESPACE - -#endif // QHELPSEARCHINDEXREADERDEFAULT_H diff --git a/src/assistant/lib/qhelpsearchindexreader_p.h b/src/assistant/lib/qhelpsearchindexreader_p.h deleted file mode 100644 index 0d7518a6e..000000000 --- a/src/assistant/lib/qhelpsearchindexreader_p.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHINDEXREADER_H -#define QHELPSEARCHINDEXREADER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelpsearchengine.h" - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpEngineCore; - -namespace fulltextsearch { - -class QHelpSearchIndexReader : public QThread -{ - Q_OBJECT - -public: - QHelpSearchIndexReader(); - ~QHelpSearchIndexReader(); - - void cancelSearching(); - void search(const QString &collectionFile, - const QString &indexFilesFolder, - const QList &queryList); - int hitCount() const; - QList hits(int start, int end) const; - -signals: - void searchingStarted(); - void searchingFinished(int hits); - -protected: - mutable QMutex mutex; - QList hitList; - bool m_cancel; - QString m_collectionFile; - QList m_query; - QString m_indexFilesFolder; - -private: - virtual void run()=0; -}; - -} // namespace fulltextsearch - -QT_END_NAMESPACE - -#endif // QHELPSEARCHINDEXREADER_H diff --git a/src/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/src/assistant/lib/qhelpsearchindexwriter_clucene.cpp deleted file mode 100644 index f3d5e4fc3..000000000 --- a/src/assistant/lib/qhelpsearchindexwriter_clucene.cpp +++ /dev/null @@ -1,898 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qclucenefieldnames_p.h" -#include "qhelpenginecore.h" -#include "qhelp_global.h" -#include "fulltextsearch/qhits_p.h" -#include "fulltextsearch/qquery_p.h" -#include "fulltextsearch/qanalyzer_p.h" -#include "fulltextsearch/qdocument_p.h" -#include "fulltextsearch/qsearchable_p.h" -#include "fulltextsearch/qindexreader_p.h" -#include "fulltextsearch/qindexwriter_p.h" -#include "qhelpsearchindexwriter_clucene_p.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include "private/qfunctions_p.h" - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace clucene { - -// taken from qtexthtmlparser -static const struct QTextHtmlEntity -{ - const char *name; - quint16 code; -} entities[] = { - { "AElig", 0x00c6 }, - { "AMP", 38 }, - { "Aacute", 0x00c1 }, - { "Acirc", 0x00c2 }, - { "Agrave", 0x00c0 }, - { "Alpha", 0x0391 }, - { "Aring", 0x00c5 }, - { "Atilde", 0x00c3 }, - { "Auml", 0x00c4 }, - { "Beta", 0x0392 }, - { "Ccedil", 0x00c7 }, - { "Chi", 0x03a7 }, - { "Dagger", 0x2021 }, - { "Delta", 0x0394 }, - { "ETH", 0x00d0 }, - { "Eacute", 0x00c9 }, - { "Ecirc", 0x00ca }, - { "Egrave", 0x00c8 }, - { "Epsilon", 0x0395 }, - { "Eta", 0x0397 }, - { "Euml", 0x00cb }, - { "GT", 62 }, - { "Gamma", 0x0393 }, - { "Iacute", 0x00cd }, - { "Icirc", 0x00ce }, - { "Igrave", 0x00cc }, - { "Iota", 0x0399 }, - { "Iuml", 0x00cf }, - { "Kappa", 0x039a }, - { "LT", 60 }, - { "Lambda", 0x039b }, - { "Mu", 0x039c }, - { "Ntilde", 0x00d1 }, - { "Nu", 0x039d }, - { "OElig", 0x0152 }, - { "Oacute", 0x00d3 }, - { "Ocirc", 0x00d4 }, - { "Ograve", 0x00d2 }, - { "Omega", 0x03a9 }, - { "Omicron", 0x039f }, - { "Oslash", 0x00d8 }, - { "Otilde", 0x00d5 }, - { "Ouml", 0x00d6 }, - { "Phi", 0x03a6 }, - { "Pi", 0x03a0 }, - { "Prime", 0x2033 }, - { "Psi", 0x03a8 }, - { "QUOT", 34 }, - { "Rho", 0x03a1 }, - { "Scaron", 0x0160 }, - { "Sigma", 0x03a3 }, - { "THORN", 0x00de }, - { "Tau", 0x03a4 }, - { "Theta", 0x0398 }, - { "Uacute", 0x00da }, - { "Ucirc", 0x00db }, - { "Ugrave", 0x00d9 }, - { "Upsilon", 0x03a5 }, - { "Uuml", 0x00dc }, - { "Xi", 0x039e }, - { "Yacute", 0x00dd }, - { "Yuml", 0x0178 }, - { "Zeta", 0x0396 }, - { "aacute", 0x00e1 }, - { "acirc", 0x00e2 }, - { "acute", 0x00b4 }, - { "aelig", 0x00e6 }, - { "agrave", 0x00e0 }, - { "alefsym", 0x2135 }, - { "alpha", 0x03b1 }, - { "amp", 38 }, - { "and", 0x22a5 }, - { "ang", 0x2220 }, - { "apos", 0x0027 }, - { "aring", 0x00e5 }, - { "asymp", 0x2248 }, - { "atilde", 0x00e3 }, - { "auml", 0x00e4 }, - { "bdquo", 0x201e }, - { "beta", 0x03b2 }, - { "brvbar", 0x00a6 }, - { "bull", 0x2022 }, - { "cap", 0x2229 }, - { "ccedil", 0x00e7 }, - { "cedil", 0x00b8 }, - { "cent", 0x00a2 }, - { "chi", 0x03c7 }, - { "circ", 0x02c6 }, - { "clubs", 0x2663 }, - { "cong", 0x2245 }, - { "copy", 0x00a9 }, - { "crarr", 0x21b5 }, - { "cup", 0x222a }, - { "curren", 0x00a4 }, - { "dArr", 0x21d3 }, - { "dagger", 0x2020 }, - { "darr", 0x2193 }, - { "deg", 0x00b0 }, - { "delta", 0x03b4 }, - { "diams", 0x2666 }, - { "divide", 0x00f7 }, - { "eacute", 0x00e9 }, - { "ecirc", 0x00ea }, - { "egrave", 0x00e8 }, - { "empty", 0x2205 }, - { "emsp", 0x2003 }, - { "ensp", 0x2002 }, - { "epsilon", 0x03b5 }, - { "equiv", 0x2261 }, - { "eta", 0x03b7 }, - { "eth", 0x00f0 }, - { "euml", 0x00eb }, - { "euro", 0x20ac }, - { "exist", 0x2203 }, - { "fnof", 0x0192 }, - { "forall", 0x2200 }, - { "frac12", 0x00bd }, - { "frac14", 0x00bc }, - { "frac34", 0x00be }, - { "frasl", 0x2044 }, - { "gamma", 0x03b3 }, - { "ge", 0x2265 }, - { "gt", 62 }, - { "hArr", 0x21d4 }, - { "harr", 0x2194 }, - { "hearts", 0x2665 }, - { "hellip", 0x2026 }, - { "iacute", 0x00ed }, - { "icirc", 0x00ee }, - { "iexcl", 0x00a1 }, - { "igrave", 0x00ec }, - { "image", 0x2111 }, - { "infin", 0x221e }, - { "int", 0x222b }, - { "iota", 0x03b9 }, - { "iquest", 0x00bf }, - { "isin", 0x2208 }, - { "iuml", 0x00ef }, - { "kappa", 0x03ba }, - { "lArr", 0x21d0 }, - { "lambda", 0x03bb }, - { "lang", 0x2329 }, - { "laquo", 0x00ab }, - { "larr", 0x2190 }, - { "lceil", 0x2308 }, - { "ldquo", 0x201c }, - { "le", 0x2264 }, - { "lfloor", 0x230a }, - { "lowast", 0x2217 }, - { "loz", 0x25ca }, - { "lrm", 0x200e }, - { "lsaquo", 0x2039 }, - { "lsquo", 0x2018 }, - { "lt", 60 }, - { "macr", 0x00af }, - { "mdash", 0x2014 }, - { "micro", 0x00b5 }, - { "middot", 0x00b7 }, - { "minus", 0x2212 }, - { "mu", 0x03bc }, - { "nabla", 0x2207 }, - { "nbsp", 0x00a0 }, - { "ndash", 0x2013 }, - { "ne", 0x2260 }, - { "ni", 0x220b }, - { "not", 0x00ac }, - { "notin", 0x2209 }, - { "nsub", 0x2284 }, - { "ntilde", 0x00f1 }, - { "nu", 0x03bd }, - { "oacute", 0x00f3 }, - { "ocirc", 0x00f4 }, - { "oelig", 0x0153 }, - { "ograve", 0x00f2 }, - { "oline", 0x203e }, - { "omega", 0x03c9 }, - { "omicron", 0x03bf }, - { "oplus", 0x2295 }, - { "or", 0x22a6 }, - { "ordf", 0x00aa }, - { "ordm", 0x00ba }, - { "oslash", 0x00f8 }, - { "otilde", 0x00f5 }, - { "otimes", 0x2297 }, - { "ouml", 0x00f6 }, - { "para", 0x00b6 }, - { "part", 0x2202 }, - { "percnt", 0x0025 }, - { "permil", 0x2030 }, - { "perp", 0x22a5 }, - { "phi", 0x03c6 }, - { "pi", 0x03c0 }, - { "piv", 0x03d6 }, - { "plusmn", 0x00b1 }, - { "pound", 0x00a3 }, - { "prime", 0x2032 }, - { "prod", 0x220f }, - { "prop", 0x221d }, - { "psi", 0x03c8 }, - { "quot", 34 }, - { "rArr", 0x21d2 }, - { "radic", 0x221a }, - { "rang", 0x232a }, - { "raquo", 0x00bb }, - { "rarr", 0x2192 }, - { "rceil", 0x2309 }, - { "rdquo", 0x201d }, - { "real", 0x211c }, - { "reg", 0x00ae }, - { "rfloor", 0x230b }, - { "rho", 0x03c1 }, - { "rlm", 0x200f }, - { "rsaquo", 0x203a }, - { "rsquo", 0x2019 }, - { "sbquo", 0x201a }, - { "scaron", 0x0161 }, - { "sdot", 0x22c5 }, - { "sect", 0x00a7 }, - { "shy", 0x00ad }, - { "sigma", 0x03c3 }, - { "sigmaf", 0x03c2 }, - { "sim", 0x223c }, - { "spades", 0x2660 }, - { "sub", 0x2282 }, - { "sube", 0x2286 }, - { "sum", 0x2211 }, - { "sup", 0x2283 }, - { "sup1", 0x00b9 }, - { "sup2", 0x00b2 }, - { "sup3", 0x00b3 }, - { "supe", 0x2287 }, - { "szlig", 0x00df }, - { "tau", 0x03c4 }, - { "there4", 0x2234 }, - { "theta", 0x03b8 }, - { "thetasym", 0x03d1 }, - { "thinsp", 0x2009 }, - { "thorn", 0x00fe }, - { "tilde", 0x02dc }, - { "times", 0x00d7 }, - { "trade", 0x2122 }, - { "uArr", 0x21d1 }, - { "uacute", 0x00fa }, - { "uarr", 0x2191 }, - { "ucirc", 0x00fb }, - { "ugrave", 0x00f9 }, - { "uml", 0x00a8 }, - { "upsih", 0x03d2 }, - { "upsilon", 0x03c5 }, - { "uuml", 0x00fc }, - { "weierp", 0x2118 }, - { "xi", 0x03be }, - { "yacute", 0x00fd }, - { "yen", 0x00a5 }, - { "yuml", 0x00ff }, - { "zeta", 0x03b6 }, - { "zwj", 0x200d }, - { "zwnj", 0x200c } -}; - -Q_STATIC_GLOBAL_OPERATOR bool operator<(const QString &entityStr, const QTextHtmlEntity &entity) -{ - return entityStr < QLatin1String(entity.name); -} - -Q_STATIC_GLOBAL_OPERATOR bool operator<(const QTextHtmlEntity &entity, const QString &entityStr) -{ - return QLatin1String(entity.name) < entityStr; -} - -static QChar resolveEntity(const QString &entity) -{ - const QTextHtmlEntity *start = &entities[0]; - const QTextHtmlEntity *end = &entities[(sizeof(entities) / sizeof(entities[0]))]; - const QTextHtmlEntity *e = qBinaryFind(start, end, entity); - if (e == end) - return QChar(); - return e->code; -} - -static const uint latin1Extended[0xA0 - 0x80] = { - 0x20ac, // 0x80 - 0x0081, // 0x81 direct mapping - 0x201a, // 0x82 - 0x0192, // 0x83 - 0x201e, // 0x84 - 0x2026, // 0x85 - 0x2020, // 0x86 - 0x2021, // 0x87 - 0x02C6, // 0x88 - 0x2030, // 0x89 - 0x0160, // 0x8A - 0x2039, // 0x8B - 0x0152, // 0x8C - 0x008D, // 0x8D direct mapping - 0x017D, // 0x8E - 0x008F, // 0x8F directmapping - 0x0090, // 0x90 directmapping - 0x2018, // 0x91 - 0x2019, // 0x92 - 0x201C, // 0x93 - 0X201D, // 0x94 - 0x2022, // 0x95 - 0x2013, // 0x96 - 0x2014, // 0x97 - 0x02DC, // 0x98 - 0x2122, // 0x99 - 0x0161, // 0x9A - 0x203A, // 0x9B - 0x0153, // 0x9C - 0x009D, // 0x9D direct mapping - 0x017E, // 0x9E - 0x0178 // 0x9F -}; -// end taken from qtexthtmlparser - -class DocumentHelper -{ -public: - DocumentHelper(const QString &fileName, const QByteArray &data) - : fileName(fileName) , data(readData(data)) {} - ~DocumentHelper() {} - - bool addFieldsToDocument(QCLuceneDocument *document, - const QString &namespaceName, const QString &attributes = QString()) - { - if (!document) - return false; - - if(!data.isEmpty()) { - QString parsedData = parseData(); - QString parsedTitle = QHelpGlobal::documentTitle(data); - - if(!parsedData.isEmpty()) { - document->add(new QCLuceneField(ContentField, - parsedData,QCLuceneField::INDEX_TOKENIZED)); - document->add(new QCLuceneField(PathField, fileName, - QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(TitleField, parsedTitle, - QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(TitleTokenizedField, parsedTitle, - QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); - document->add(new QCLuceneField(NamespaceField, namespaceName, - QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(AttributeField, attributes, - QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); - return true; - } - } - - return false; - } - -private: - QString readData(const QByteArray &data) - { - QTextStream textStream(data); - const QByteArray &codec = QHelpGlobal::codecFromData(data).toLatin1(); - textStream.setCodec(QTextCodec::codecForName(codec.constData())); - - QString stream = textStream.readAll(); - if (stream.isNull() || stream.isEmpty()) - return QString(); - - return stream; - } - - QString parseData() const - { - const int length = data.length(); - const QChar *buf = data.unicode(); - - QString parsedContent; - parsedContent.reserve(length); - - bool valid = true; - int j = 0, count = 0; - - QChar c; - while (j < length) { - c = buf[j++]; - if (c == QLatin1Char('<') || c == QLatin1Char('&')) { - if (count > 1 && c != QLatin1Char('&')) - parsedContent.append(QLatin1Char(' ')); - else if (c == QLatin1Char('&')) { - // Note: this will modify the counter j, in case we sucessful parsed the entity - // we will have modified the counter to stay 1 before the closing ';', so - // the following if condition will be met with if (c == QLatin1Char(';')) - parsedContent.append(parseEntity(length, buf, j)); - } - - count = 0; - valid = false; - continue; - } - if ((c == QLatin1Char('>') || c == QLatin1Char(';')) && !valid) { - valid = true; - continue; - } - if (!valid) - continue; - - if (c.isLetterOrNumber() || c.isPrint()) { - ++count; - parsedContent.append(c.toLower()); - } else { - if (count > 1) - parsedContent.append(QLatin1Char(' ')); - count = 0; - } - } - - return parsedContent; - } - - // taken from qtexthtmlparser - // parses an entity after "&", and returns it - QString parseEntity(int len, const QChar *buf, int &pos) const - { - int recover = pos; - QString entity; - while (pos < len) { - QChar c = buf[pos++]; - if (c.isSpace() || pos - recover > 9) { - goto error; - } - if (c == QLatin1Char(';')) { - pos--; - break; - } - entity += c; - } - { - QChar resolved = resolveEntity(entity); - if (!resolved.isNull()) - return QString(resolved); - } - if (entity.length() > 1 && entity.at(0) == QLatin1Char('#')) { - entity.remove(0, 1); // removing leading # - - int base = 10; - bool ok = false; - - if (entity.at(0).toLower() == QLatin1Char('x')) { // hex entity? - entity.remove(0, 1); - base = 16; - } - - uint uc = entity.toUInt(&ok, base); - if (ok) { - if (uc >= 0x80 && uc < 0x80 + (sizeof(latin1Extended) / sizeof(latin1Extended[0]))) - uc = latin1Extended[uc - 0x80]; // windows latin 1 extended - QString str; - if (uc > 0xffff) { - // surrogate pair - uc -= 0x10000; - ushort high = uc/0x400 + 0xd800; - ushort low = uc%0x400 + 0xdc00; - str.append(QChar(high)); - str.append(QChar(low)); - } else { - str.append(QChar(uc)); - } - return str; - } - } - error: - pos = recover; - return QLatin1String(" "); - } - // end taken from qtexthtmlparser - -private: - QString fileName; - QString data; -}; - - -QHelpSearchIndexWriter::QHelpSearchIndexWriter() - : QThread(0) - , m_cancel(false) -{ - // nothing todo -} - -QHelpSearchIndexWriter::~QHelpSearchIndexWriter() -{ - mutex.lock(); - this->m_cancel = true; - waitCondition.wakeOne(); - mutex.unlock(); - - wait(); -} - -void QHelpSearchIndexWriter::cancelIndexing() -{ - mutex.lock(); - this->m_cancel = true; - mutex.unlock(); -} - -void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, - const QString &indexFilesFolder, bool reindex) -{ - wait(); - mutex.lock(); - this->m_cancel = false; - this->m_reindex = reindex; - this->m_collectionFile = collectionFile; - this->m_indexFilesFolder = indexFilesFolder; - mutex.unlock(); - - start(QThread::LowestPriority); -} - -void QHelpSearchIndexWriter::optimizeIndex() -{ -#if !defined(QT_NO_EXCEPTIONS) - try { -#endif - if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) { - if (QCLuceneIndexReader::isLocked(m_indexFilesFolder)) - return; - - QCLuceneStandardAnalyzer analyzer; - QCLuceneIndexWriter writer(m_indexFilesFolder, analyzer, false); - writer.optimize(); - writer.close(); - } -#if !defined(QT_NO_EXCEPTIONS) - } catch (...) { - qWarning("Full Text Search, could not optimize index."); - return; - } -#endif -} - -void QHelpSearchIndexWriter::run() -{ -#if !defined(QT_NO_EXCEPTIONS) - try { -#endif - QMutexLocker mutexLocker(&mutex); - - if (m_cancel) - return; - - const bool reindex = this->m_reindex; - const QString collectionFile(this->m_collectionFile); - - mutexLocker.unlock(); - - QHelpEngineCore engine(collectionFile, 0); - if (!engine.setupData()) - return; - - const QLatin1String key("CluceneIndexedNamespaces"); - if (reindex) - engine.setCustomValue(key, QLatin1String("")); - - QMap indexMap; - const QLatin1String oldKey("CluceneSearchNamespaces"); - if (!engine.customValue(oldKey, QString()).isNull()) { - // old style qhc file < 4.4.2, need to convert... - const QStringList indexedNamespaces - = engine.customValue(oldKey).toString() - .split(QLatin1String("|"), QString::SkipEmptyParts); - foreach (const QString &nameSpace, indexedNamespaces) - indexMap.insert(nameSpace, QDateTime()); - engine.removeCustomValue(oldKey); - } else { - QDataStream dataStream(engine.customValue(key).toByteArray()); - dataStream >> indexMap; - } - - QString indexPath = m_indexFilesFolder; - - QFileInfo fInfo(indexPath); - if (fInfo.exists() && !fInfo.isWritable()) { - qWarning("Full Text Search, could not create index (missing permissions for '%s').", - qPrintable(indexPath)); - return; - } - - emit indexingStarted(); - - QCLuceneIndexWriter *writer = 0; - QCLuceneStandardAnalyzer analyzer; - const QStringList registeredDocs = engine.registeredDocumentations(); - - QLocalSocket localSocket; - localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) - .arg(QLatin1String(QT_VERSION_STR))); - - QLocalServer localServer; - bool otherInstancesRunning = true; - if (!localSocket.waitForConnected()) { - otherInstancesRunning = false; - localServer.listen(QString(QLatin1String("QtAssistant%1")) - .arg(QLatin1String(QT_VERSION_STR))); - } - - // check if it's locked, and if the other instance is running - if (!otherInstancesRunning && QCLuceneIndexReader::isLocked(indexPath)) - QCLuceneIndexReader::unlock(indexPath); - - if (QCLuceneIndexReader::isLocked(indexPath)) { - // poll unless indexing finished to fake progress - while (QCLuceneIndexReader::isLocked(indexPath)) { - mutexLocker.relock(); - if (m_cancel) - break; - mutexLocker.unlock(); - this->sleep(1); - } - emit indexingFinished(); - return; - } - - if (QCLuceneIndexReader::indexExists(indexPath) && !reindex) { - foreach(const QString &namespaceName, registeredDocs) { - mutexLocker.relock(); - if (m_cancel) { - emit indexingFinished(); - return; - } - mutexLocker.unlock(); - - if (!indexMap.contains(namespaceName)) { - // make sure we remove some partly indexed stuff - removeDocuments(indexPath, namespaceName); - } else { - QString path = engine.documentationFileName(namespaceName); - if (indexMap.value(namespaceName) - < QFileInfo(path).lastModified()) { - // make sure we remove some outdated indexed stuff - indexMap.remove(namespaceName); - removeDocuments(indexPath, namespaceName); - } - - if (indexMap.contains(namespaceName)) { - // make sure we really have content indexed for namespace - QCLuceneTermQuery query(QCLuceneTerm(NamespaceField, namespaceName)); - QCLuceneIndexSearcher indexSearcher(indexPath); - QCLuceneHits hits = indexSearcher.search(query); - if (hits.length() <= 0) - indexMap.remove(namespaceName); - } - } - } - writer = new QCLuceneIndexWriter(indexPath, analyzer, false); - } else { - indexMap.clear(); - writer = new QCLuceneIndexWriter(indexPath, analyzer, true); - } - - writer->setMergeFactor(100); - writer->setMinMergeDocs(1000); - writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); - - QStringList namespaces; - foreach(const QString &namespaceName, registeredDocs) { - mutexLocker.relock(); - if (m_cancel) { - closeIndexWriter(writer); - emit indexingFinished(); - return; - } - mutexLocker.unlock(); - - namespaces.append(namespaceName); - if (indexMap.contains(namespaceName)) - continue; - - const QList attributeSets = - engine.filterAttributeSets(namespaceName); - - if (attributeSets.isEmpty()) { - const QList docFiles = indexableFiles(&engine, namespaceName, - QStringList()); - if (!addDocuments(docFiles, engine, QStringList(), namespaceName, - writer, analyzer)) - break; - } else { - bool bail = false; - foreach (const QStringList &attributes, attributeSets) { - const QList docFiles = indexableFiles(&engine, - namespaceName, attributes); - if (!addDocuments(docFiles, engine, attributes, namespaceName, - writer, analyzer)) { - bail = true; - break; - } - } - if (bail) - break; - } - - mutexLocker.relock(); - if (!m_cancel) { - QString path(engine.documentationFileName(namespaceName)); - indexMap.insert(namespaceName, QFileInfo(path).lastModified()); - writeIndexMap(engine, indexMap); - } - mutexLocker.unlock(); - } - - closeIndexWriter(writer); - - mutexLocker.relock(); - if (!m_cancel) { - mutexLocker.unlock(); - - QStringList indexedNamespaces = indexMap.keys(); - foreach(const QString &namespaceName, indexedNamespaces) { - mutexLocker.relock(); - if (m_cancel) - break; - mutexLocker.unlock(); - - if (!namespaces.contains(namespaceName)) { - indexMap.remove(namespaceName); - writeIndexMap(engine, indexMap); - removeDocuments(indexPath, namespaceName); - } - } - } - -#if !defined(QT_NO_EXCEPTIONS) - } catch (...) { - qWarning("%s: Failed because of CLucene exception.", Q_FUNC_INFO); - } -#endif - - emit indexingFinished(); -} - -bool QHelpSearchIndexWriter::addDocuments(const QList docFiles, - const QHelpEngineCore &engine, const QStringList &attributes, - const QString &namespaceName, QCLuceneIndexWriter *writer, - QCLuceneAnalyzer &analyzer) -{ - QMutexLocker locker(&mutex); - const QString attrList = attributes.join(QLatin1String(" ")); - - locker.unlock(); - foreach(const QUrl &url, docFiles) { - QCLuceneDocument document; - DocumentHelper helper(url.toString(), engine.fileData(url)); - if (helper.addFieldsToDocument(&document, namespaceName, attrList)) { -#if !defined(QT_NO_EXCEPTIONS) - try { -#endif - writer->addDocument(document, analyzer); -#if !defined(QT_NO_EXCEPTIONS) - } catch (...) { - qWarning("Full Text Search, could not properly add documents."); - return false; - } -#endif - } - locker.relock(); - if (m_cancel) - return false; - locker.unlock(); - } - return true; -} - -void QHelpSearchIndexWriter::removeDocuments(const QString &indexPath, - const QString &namespaceName) -{ - if (namespaceName.isEmpty() || QCLuceneIndexReader::isLocked(indexPath)) - return; - - QCLuceneIndexReader reader = QCLuceneIndexReader::open(indexPath); - reader.deleteDocuments(QCLuceneTerm(NamespaceField, namespaceName)); - - reader.close(); -} - -bool QHelpSearchIndexWriter::writeIndexMap(QHelpEngineCore &engine, - const QMap &indexMap) -{ - QByteArray bArray; - - QDataStream data(&bArray, QIODevice::ReadWrite); - data << indexMap; - - return engine.setCustomValue(QLatin1String("CluceneIndexedNamespaces"), - bArray); -} - -QList QHelpSearchIndexWriter::indexableFiles(QHelpEngineCore *helpEngine, - const QString &namespaceName, const QStringList &attributes) const -{ - QList docFiles = helpEngine->files(namespaceName, attributes, - QLatin1String("html")); - docFiles += helpEngine->files(namespaceName, attributes, QLatin1String("htm")); - docFiles += helpEngine->files(namespaceName, attributes, QLatin1String("txt")); - - return docFiles; -} - -void QHelpSearchIndexWriter::closeIndexWriter(QCLuceneIndexWriter *writer) -{ -#if !defined(QT_NO_EXCEPTIONS) - try { -#endif - writer->close(); - delete writer; -#if !defined(QT_NO_EXCEPTIONS) - } catch (...) { - qWarning("Full Text Search, could not properly close index writer."); - } -#endif -} - -} // namespace clucene -} // namespace fulltextsearch - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchindexwriter_clucene_p.h b/src/assistant/lib/qhelpsearchindexwriter_clucene_p.h deleted file mode 100644 index 89146f5a7..000000000 --- a/src/assistant/lib/qhelpsearchindexwriter_clucene_p.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHINDEXWRITERCLUCENE_H -#define QHELPSEARCHINDEXWRITERCLUCENE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelpenginecore.h" -#include "fulltextsearch/qanalyzer_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QCLuceneIndexWriter; - -namespace fulltextsearch { -namespace clucene { - -class QHelpSearchIndexWriter : public QThread -{ - Q_OBJECT - -public: - QHelpSearchIndexWriter(); - ~QHelpSearchIndexWriter(); - - void cancelIndexing(); - void updateIndex(const QString &collectionFile, - const QString &indexFilesFolder, bool reindex); - void optimizeIndex(); - -signals: - void indexingStarted(); - void indexingFinished(); - -private: - void run(); - - bool addDocuments(const QList docFiles, const QHelpEngineCore &engine, - const QStringList &attributes, const QString &namespaceName, - QCLuceneIndexWriter *writer, QCLuceneAnalyzer &analyzer); - void removeDocuments(const QString &indexPath, const QString &namespaceName); - - bool writeIndexMap(QHelpEngineCore& engine, - const QMap& indexMap); - - QList indexableFiles(QHelpEngineCore *helpEngine, - const QString &namespaceName, const QStringList &attributes) const; - - void closeIndexWriter(QCLuceneIndexWriter *writer); - -private: - QMutex mutex; - QWaitCondition waitCondition; - - bool m_cancel; - bool m_reindex; - QString m_collectionFile; - QString m_indexFilesFolder; -}; - -} // namespace clucene -} // namespace fulltextsearch - - -QT_END_NAMESPACE - -#endif // QHELPSEARCHINDEXWRITERCLUCENE_H diff --git a/src/assistant/lib/qhelpsearchindexwriter_default.cpp b/src/assistant/lib/qhelpsearchindexwriter_default.cpp deleted file mode 100644 index db7f6ba0d..000000000 --- a/src/assistant/lib/qhelpsearchindexwriter_default.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpsearchindexwriter_default_p.h" -#include "qhelp_global.h" -#include "qhelpenginecore.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace std { - -Writer::Writer(const QString &path) - : indexPath(path) - , indexFile(QString()) - , documentFile(QString()) -{ - // nothing todo -} - -Writer::~Writer() -{ - reset(); -} - -void Writer::reset() -{ - for(QHash::ConstIterator it = - index.begin(); it != index.end(); ++it) { - delete it.value(); - } - - index.clear(); - documentList.clear(); -} - -bool Writer::writeIndex() const -{ - bool status; - QFile idxFile(indexFile); - if (!(status = idxFile.open(QFile::WriteOnly))) - return status; - - QDataStream indexStream(&idxFile); - for(QHash::ConstIterator it = - index.begin(); it != index.end(); ++it) { - indexStream << it.key(); - indexStream << it.value()->documents.count(); - indexStream << it.value()->documents; - } - idxFile.close(); - - QFile docFile(documentFile); - if (!(status = docFile.open(QFile::WriteOnly))) - return status; - - QDataStream docStream(&docFile); - foreach(const QStringList &list, documentList) { - docStream << list.at(0); - docStream << list.at(1); - } - docFile.close(); - - return status; -} - -void Writer::removeIndex() const -{ - QFile idxFile(indexFile); - if (idxFile.exists()) - idxFile.remove(); - - QFile docFile(documentFile); - if (docFile.exists()) - docFile.remove(); -} - -void Writer::setIndexFile(const QString &namespaceName, const QString &attributes) -{ - QString extension = namespaceName + QLatin1String("@") + attributes; - indexFile = indexPath + QLatin1String("/indexdb40.") + extension; - documentFile = indexPath + QLatin1String("/indexdoc40.") + extension; -} - -void Writer::insertInIndex(const QString &string, int docNum) -{ - if (string == QLatin1String("amp") || string == QLatin1String("nbsp")) - return; - - Entry *entry = 0; - if (index.count()) - entry = index[string]; - - if (entry) { - if (entry->documents.last().docNumber != docNum) - entry->documents.append(Document(docNum, 1)); - else - entry->documents.last().frequency++; - } else { - index.insert(string, new Entry(docNum)); - } -} - -void Writer::insertInDocumentList(const QString &title, const QString &url) -{ - documentList.append(QStringList(title) << url); -} - - -QHelpSearchIndexWriter::QHelpSearchIndexWriter() - : QThread() - , m_cancel(false) -{ - // nothing todo -} - -QHelpSearchIndexWriter::~QHelpSearchIndexWriter() -{ - mutex.lock(); - this->m_cancel = true; - waitCondition.wakeOne(); - mutex.unlock(); - - wait(); -} - -void QHelpSearchIndexWriter::cancelIndexing() -{ - mutex.lock(); - this->m_cancel = true; - mutex.unlock(); -} - -void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, - const QString &indexFilesFolder, - bool reindex) -{ - wait(); - QMutexLocker lock(&mutex); - - this->m_cancel = false; - this->m_reindex = reindex; - this->m_collectionFile = collectionFile; - this->m_indexFilesFolder = indexFilesFolder; - - start(QThread::LowestPriority); -} - -void QHelpSearchIndexWriter::run() -{ - mutex.lock(); - - if (m_cancel) { - mutex.unlock(); - return; - } - - const bool reindex(this->m_reindex); - const QLatin1String key("DefaultSearchNamespaces"); - const QString collectionFile(this->m_collectionFile); - const QString indexPath = m_indexFilesFolder; - - mutex.unlock(); - - QHelpEngineCore engine(collectionFile, 0); - if (!engine.setupData()) - return; - - if (reindex) - engine.setCustomValue(key, QLatin1String("")); - - const QStringList registeredDocs = engine.registeredDocumentations(); - const QStringList indexedNamespaces = engine.customValue(key).toString(). - split(QLatin1String("|"), QString::SkipEmptyParts); - - emit indexingStarted(); - - QStringList namespaces; - Writer writer(indexPath); - foreach(const QString &namespaceName, registeredDocs) { - mutex.lock(); - if (m_cancel) { - mutex.unlock(); - return; - } - mutex.unlock(); - - // if indexed, continue - namespaces.append(namespaceName); - if (indexedNamespaces.contains(namespaceName)) - continue; - - const QList attributeSets = - engine.filterAttributeSets(namespaceName); - - foreach (const QStringList &attributes, attributeSets) { - // cleanup maybe old or unfinished files - writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); - writer.removeIndex(); - - QSet documentsSet; - const QList docFiles = engine.files(namespaceName, attributes); - foreach(QUrl url, docFiles) { - if (m_cancel) - return; - - // get rid of duplicated files - if (url.hasFragment()) - url.setFragment(QString()); - - QString s = url.toString(); - if (s.endsWith(QLatin1String(".html")) - || s.endsWith(QLatin1String(".htm")) - || s.endsWith(QLatin1String(".txt"))) - documentsSet.insert(s); - } - - int docNum = 0; - const QStringList documentsList(documentsSet.toList()); - foreach(const QString &url, documentsList) { - if (m_cancel) - return; - - QByteArray data(engine.fileData(url)); - if (data.isEmpty()) - continue; - - QTextStream s(data); - QString en = QHelpGlobal::codecFromData(data); - s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); - - QString text = s.readAll(); - if (text.isNull()) - continue; - - QString title = QHelpGlobal::documentTitle(text); - - int j = 0; - int i = 0; - bool valid = true; - const QChar *buf = text.unicode(); - QChar str[64]; - QChar c = buf[0]; - - while ( j < text.length() ) { - if (m_cancel) - return; - - if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { - valid = false; - if ( i > 1 ) - writer.insertInIndex(QString(str,i), docNum); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { - valid = true; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { - str[i] = c.toLower(); - ++i; - } else { - if ( i > 1 ) - writer.insertInIndex(QString(str,i), docNum); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - writer.insertInIndex(QString(str,i), docNum); - - docNum++; - writer.insertInDocumentList(title, url); - } - - if (writer.writeIndex()) { - engine.setCustomValue(key, addNamespace( - engine.customValue(key).toString(), namespaceName)); - } - - writer.reset(); - } - } - - QStringListIterator qsli(indexedNamespaces); - while (qsli.hasNext()) { - const QString namespaceName = qsli.next(); - if (namespaces.contains(namespaceName)) - continue; - - const QList attributeSets = - engine.filterAttributeSets(namespaceName); - - foreach (const QStringList &attributes, attributeSets) { - writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); - writer.removeIndex(); - } - - engine.setCustomValue(key, removeNamespace( - engine.customValue(key).toString(), namespaceName)); - } - - emit indexingFinished(); -} - -QString QHelpSearchIndexWriter::addNamespace(const QString namespaces, - const QString &namespaceName) -{ - QString value = namespaces; - if (!value.contains(namespaceName)) - value.append(namespaceName).append(QLatin1String("|")); - - return value; -} - -QString QHelpSearchIndexWriter::removeNamespace(const QString namespaces, - const QString &namespaceName) -{ - QString value = namespaces; - if (value.contains(namespaceName)) - value.remove(namespaceName + QLatin1String("|")); - - return value; -} - -} // namespace std -} // namespace fulltextsearch - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchindexwriter_default_p.h b/src/assistant/lib/qhelpsearchindexwriter_default_p.h deleted file mode 100644 index d510fbc9d..000000000 --- a/src/assistant/lib/qhelpsearchindexwriter_default_p.h +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHINDEXWRITERDEFAULT_H -#define QHELPSEARCHINDEXWRITERDEFAULT_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the help generator tools. This header file may change from version -// to version without notice, or even be removed. -// -// We mean it. -// - -#include "qhelpsearchindex_default_p.h" - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace fulltextsearch { -namespace std { - -class Writer -{ -public: - Writer(const QString &path); - ~Writer(); - - void reset(); - bool writeIndex() const; - void removeIndex() const; - void setIndexFile(const QString &namespaceName, const QString &attributes); - void insertInIndex(const QString &string, int docNum); - void insertInDocumentList(const QString &title, const QString &url); - -private: - QString indexPath; - QString indexFile; - QString documentFile; - - QHash index; - QList documentList; -}; - - -class QHelpSearchIndexWriter : public QThread -{ - Q_OBJECT - -public: - QHelpSearchIndexWriter(); - ~QHelpSearchIndexWriter(); - - void cancelIndexing(); - void updateIndex(const QString &collectionFile, - const QString &indexFilesFolder, bool reindex); - -signals: - void indexingStarted(); - void indexingFinished(); - -private: - void run(); - QString addNamespace(const QString namespaces, const QString &namespaceName); - QString removeNamespace(const QString namespaces, const QString &namespaceName); - -private: - QMutex mutex; - QWaitCondition waitCondition; - - bool m_cancel; - bool m_reindex; - QString m_collectionFile; - QString m_indexFilesFolder; -}; - -} // namespace std -} // namespace fulltextsearch - -QT_END_NAMESPACE - -#endif // QHELPSEARCHINDEXWRITERDEFAULT_H diff --git a/src/assistant/lib/qhelpsearchquerywidget.cpp b/src/assistant/lib/qhelpsearchquerywidget.cpp deleted file mode 100644 index 55974ada5..000000000 --- a/src/assistant/lib/qhelpsearchquerywidget.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpsearchquerywidget.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpSearchQueryWidgetPrivate : public QObject -{ - Q_OBJECT - -private: - struct QueryHistory { - explicit QueryHistory() : curQuery(-1) {} - QList > queries; - int curQuery; - }; - - class CompleterModel : public QAbstractListModel - { - public: - explicit CompleterModel(QObject *parent) - : QAbstractListModel(parent) {} - - int rowCount(const QModelIndex &parent = QModelIndex()) const - { - return parent.isValid() ? 0 : termList.size(); - } - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const - { - if (!index.isValid() || index.row() >= termList.count()|| - (role != Qt::EditRole && role != Qt::DisplayRole)) - return QVariant(); - return termList.at(index.row()); - } - - void addTerm(const QString &term) - { - if (!termList.contains(term)) { - termList.append(term); - reset(); - } - } - - private: - QStringList termList; - }; - - QHelpSearchQueryWidgetPrivate() - : QObject() - , simpleSearch(true) - , searchCompleter(new CompleterModel(this), this) - { - searchButton = 0; - advancedSearchWidget = 0; - showHideAdvancedSearchButton = 0; - defaultQuery = 0; - exactQuery = 0; - similarQuery = 0; - withoutQuery = 0; - allQuery = 0; - atLeastQuery = 0; - } - - ~QHelpSearchQueryWidgetPrivate() - { - // nothing todo - } - - void retranslate() - { - simpleSearchLabel->setText(QHelpSearchQueryWidget::tr("Search for:")); - prevQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Previous search")); - nextQueryButton->setToolTip(QHelpSearchQueryWidget::tr("Next search")); - searchButton->setText(QHelpSearchQueryWidget::tr("Search")); -#ifdef QT_CLUCENE_SUPPORT - advancedSearchLabel->setText(QHelpSearchQueryWidget::tr("Advanced search")); - similarLabel->setText(QHelpSearchQueryWidget::tr("words similar to:")); - withoutLabel->setText(QHelpSearchQueryWidget::tr("without the words:")); - exactLabel->setText(QHelpSearchQueryWidget::tr("with exact phrase:")); - allLabel->setText(QHelpSearchQueryWidget::tr("with all of the words:")); - atLeastLabel->setText(QHelpSearchQueryWidget::tr("with at least one of the words:")); -#endif - } - - QStringList buildTermList(const QString query) - { - bool s = false; - QString phrase; - QStringList wordList; - QString searchTerm = query; - - for (int i = 0; i < searchTerm.length(); ++i) { - if (searchTerm[i] == QLatin1Char('\"') && !s) { - s = true; - phrase = searchTerm[i]; - continue; - } - if (searchTerm[i] != QLatin1Char('\"') && s) - phrase += searchTerm[i]; - if (searchTerm[i] == QLatin1Char('\"') && s) { - s = false; - phrase += searchTerm[i]; - wordList.append(phrase); - searchTerm.remove(phrase); - } - } - if (s) - searchTerm.replace(phrase, phrase.mid(1)); - - const QRegExp exp(QLatin1String("\\s+")); - wordList += searchTerm.split(exp, QString::SkipEmptyParts); - return wordList; - } - - void saveQuery(const QList &query, QueryHistory &queryHist) - { - // We only add the query to the list if it is different from the last one. - bool insert = false; - if (queryHist.queries.empty()) - insert = true; - else { - const QList &lastQuery = queryHist.queries.last(); - if (lastQuery.size() != query.size()) { - insert = true; - } else { - for (int i = 0; i < query.size(); ++i) { - if (query.at(i).fieldName != lastQuery.at(i).fieldName - || query.at(i).wordList != lastQuery.at(i).wordList) { - insert = true; - break; - } - } - } - } - if (insert) { - queryHist.queries.append(query); - foreach (const QHelpSearchQuery &queryPart, query) { - static_cast(searchCompleter.model())-> - addTerm(queryPart.wordList.join(" ")); - } - } - } - - void nextOrPrevQuery(int maxOrMinIndex, int addend, QToolButton *thisButton, - QToolButton *otherButton) - { - QueryHistory *queryHist; - QList lineEdits; - if (simpleSearch) { - queryHist = &simpleQueries; - lineEdits << defaultQuery; - } else { - queryHist = &complexQueries; - lineEdits << allQuery << atLeastQuery << similarQuery - << withoutQuery << exactQuery; - } - foreach (QLineEdit *lineEdit, lineEdits) - lineEdit->clear(); - - // Otherwise, the respective button would be disabled. - Q_ASSERT(queryHist->curQuery != maxOrMinIndex); - - queryHist->curQuery += addend; - const QList &query = - queryHist->queries.at(queryHist->curQuery); - foreach (const QHelpSearchQuery &queryPart, query) { - if (QLineEdit *lineEdit = lineEditFor(queryPart.fieldName)) - lineEdit->setText(queryPart.wordList.join(" ")); - } - - if (queryHist->curQuery == maxOrMinIndex) - thisButton->setEnabled(false); - otherButton->setEnabled(true); - } - - QLineEdit* lineEditFor(const QHelpSearchQuery::FieldName &fieldName) const - { - switch (fieldName) { - case QHelpSearchQuery::DEFAULT: - return defaultQuery; - case QHelpSearchQuery::ALL: - return allQuery; - case QHelpSearchQuery::ATLEAST: - return atLeastQuery; - case QHelpSearchQuery::FUZZY: - return similarQuery; - case QHelpSearchQuery::WITHOUT: - return withoutQuery; - case QHelpSearchQuery::PHRASE: - return exactQuery; - default: - Q_ASSERT(0); - } - return 0; - } - - void enableOrDisableToolButtons() - { - const QueryHistory &queryHist = simpleSearch ? simpleQueries - : complexQueries; - prevQueryButton->setEnabled(queryHist.curQuery > 0); - nextQueryButton->setEnabled(queryHist.curQuery - < queryHist.queries.size() - 1); - } - -private slots: - void showHideAdvancedSearch() - { - if (simpleSearch) { - advancedSearchWidget->show(); - showHideAdvancedSearchButton->setText((QLatin1String("-"))); - } else { - advancedSearchWidget->hide(); - showHideAdvancedSearchButton->setText((QLatin1String("+"))); - } - - simpleSearch = !simpleSearch; - defaultQuery->setEnabled(simpleSearch); - enableOrDisableToolButtons(); - } - - void searchRequested() - { - QList queryList; -#if !defined(QT_CLUCENE_SUPPORT) - queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - QStringList(defaultQuery->text()))); - -#else - if (defaultQuery->isEnabled()) { - queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - buildTermList(defaultQuery->text()))); - } else { - const QRegExp exp(QLatin1String("\\s+")); - QStringList lst = similarQuery->text().split(exp, - QString::SkipEmptyParts); - if (!lst.isEmpty()) { - QStringList fuzzy; - foreach (const QString &term, lst) - fuzzy += buildTermList(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, - fuzzy)); - } - - lst = withoutQuery->text().split(exp, QString::SkipEmptyParts); - if (!lst.isEmpty()) { - QStringList without; - foreach (const QString &term, lst) - without.append(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, - without)); - } - - if (!exactQuery->text().isEmpty()) { - QString phrase = exactQuery->text().remove(QLatin1Char('\"')); - phrase = phrase.simplified(); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, - QStringList(phrase))); - } - - lst = allQuery->text().split(exp, QString::SkipEmptyParts); - if (!lst.isEmpty()) { - QStringList all; - foreach (const QString &term, lst) - all.append(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); - } - - lst = atLeastQuery->text().split(exp, QString::SkipEmptyParts); - if (!lst.isEmpty()) { - QStringList atLeast; - foreach (const QString &term, lst) - atLeast += buildTermList(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, - atLeast)); - } - } -#endif - QueryHistory &queryHist = simpleSearch ? simpleQueries : complexQueries; - saveQuery(queryList, queryHist); - queryHist.curQuery = queryHist.queries.size() - 1; - if (queryHist.curQuery > 0) - prevQueryButton->setEnabled(true); - nextQueryButton->setEnabled(false); - } - - void nextQuery() - { - nextOrPrevQuery((simpleSearch ? simpleQueries - : complexQueries).queries.size() - 1, 1, nextQueryButton, - prevQueryButton); - } - - void prevQuery() - { - nextOrPrevQuery(0, -1, prevQueryButton, nextQueryButton); - } - -private: - friend class QHelpSearchQueryWidget; - - bool simpleSearch; - QLabel *simpleSearchLabel; - QLabel *advancedSearchLabel; - QLabel *similarLabel; - QLabel *withoutLabel; - QLabel *exactLabel; - QLabel *allLabel; - QLabel *atLeastLabel; - QPushButton *searchButton; - QWidget* advancedSearchWidget; - QToolButton *showHideAdvancedSearchButton; - QLineEdit *defaultQuery; - QLineEdit *exactQuery; - QLineEdit *similarQuery; - QLineEdit *withoutQuery; - QLineEdit *allQuery; - QLineEdit *atLeastQuery; - QToolButton *nextQueryButton; - QToolButton *prevQueryButton; - QueryHistory simpleQueries; - QueryHistory complexQueries; - QCompleter searchCompleter; -}; - -#include "qhelpsearchquerywidget.moc" - - -/*! - \class QHelpSearchQueryWidget - \since 4.4 - \inmodule QtHelp - \brief The QHelpSearchQueryWidget class provides a simple line edit or - an advanced widget to enable the user to input a search term in a - standardized input mask. -*/ - -/*! - \fn void QHelpSearchQueryWidget::search() - - This signal is emitted when a the user has the search button invoked. - After reciving the signal you can ask the QHelpSearchQueryWidget for the - build list of QHelpSearchQuery's that you may pass to the QHelpSearchEngine's - search() function. -*/ - -/*! - Constructs a new search query widget with the given \a parent. -*/ -QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent) - : QWidget(parent) -{ - d = new QHelpSearchQueryWidgetPrivate(); - - QVBoxLayout *vLayout = new QVBoxLayout(this); - vLayout->setMargin(0); - - QHBoxLayout* hBoxLayout = new QHBoxLayout(); - d->simpleSearchLabel = new QLabel(this); - d->defaultQuery = new QLineEdit(this); - d->defaultQuery->setCompleter(&d->searchCompleter); - d->prevQueryButton = new QToolButton(this); - d->prevQueryButton->setArrowType(Qt::LeftArrow); - d->prevQueryButton->setEnabled(false); - d->nextQueryButton = new QToolButton(this); - d->nextQueryButton->setArrowType(Qt::RightArrow); - d->nextQueryButton->setEnabled(false); - d->searchButton = new QPushButton(this); - hBoxLayout->addWidget(d->simpleSearchLabel); - hBoxLayout->addWidget(d->defaultQuery); - hBoxLayout->addWidget(d->prevQueryButton); - hBoxLayout->addWidget(d->nextQueryButton); - hBoxLayout->addWidget(d->searchButton); - - vLayout->addLayout(hBoxLayout); - - connect(d->prevQueryButton, SIGNAL(clicked()), d, SLOT(prevQuery())); - connect(d->nextQueryButton, SIGNAL(clicked()), d, SLOT(nextQuery())); - connect(d->searchButton, SIGNAL(clicked()), this, SIGNAL(search())); - connect(d->defaultQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); - -#if defined(QT_CLUCENE_SUPPORT) - hBoxLayout = new QHBoxLayout(); - d->showHideAdvancedSearchButton = new QToolButton(this); - d->showHideAdvancedSearchButton->setText(QLatin1String("+")); - d->showHideAdvancedSearchButton->setMinimumSize(25, 20); - - d->advancedSearchLabel = new QLabel(this); - QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth()); - d->advancedSearchLabel->setSizePolicy(sizePolicy); - - QFrame* hLine = new QFrame(this); - hLine->setFrameStyle(QFrame::HLine); - hBoxLayout->addWidget(d->showHideAdvancedSearchButton); - hBoxLayout->addWidget(d->advancedSearchLabel); - hBoxLayout->addWidget(hLine); - - vLayout->addLayout(hBoxLayout); - - // setup advanced search layout - d->advancedSearchWidget = new QWidget(this); - QGridLayout *gLayout = new QGridLayout(d->advancedSearchWidget); - gLayout->setMargin(0); - - d->similarLabel = new QLabel(this); - gLayout->addWidget(d->similarLabel, 0, 0); - d->similarQuery = new QLineEdit(this); - d->similarQuery->setCompleter(&d->searchCompleter); - gLayout->addWidget(d->similarQuery, 0, 1); - - d->withoutLabel = new QLabel(this); - gLayout->addWidget(d->withoutLabel, 1, 0); - d->withoutQuery = new QLineEdit(this); - d->withoutQuery->setCompleter(&d->searchCompleter); - gLayout->addWidget(d->withoutQuery, 1, 1); - - d->exactLabel = new QLabel(this); - gLayout->addWidget(d->exactLabel, 2, 0); - d->exactQuery = new QLineEdit(this); - d->exactQuery->setCompleter(&d->searchCompleter); - gLayout->addWidget(d->exactQuery, 2, 1); - - d->allLabel = new QLabel(this); - gLayout->addWidget(d->allLabel, 3, 0); - d->allQuery = new QLineEdit(this); - d->allQuery->setCompleter(&d->searchCompleter); - gLayout->addWidget(d->allQuery, 3, 1); - - d->atLeastLabel = new QLabel(this); - gLayout->addWidget(d->atLeastLabel, 4, 0); - d->atLeastQuery = new QLineEdit(this); - d->atLeastQuery->setCompleter(&d->searchCompleter); - gLayout->addWidget(d->atLeastQuery, 4, 1); - - vLayout->addWidget(d->advancedSearchWidget); - d->advancedSearchWidget->hide(); - - d->retranslate(); - - connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); - connect(d->similarQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); - connect(d->withoutQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); - connect(d->allQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); - connect(d->atLeastQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); - connect(d->showHideAdvancedSearchButton, SIGNAL(clicked()), - d, SLOT(showHideAdvancedSearch())); -#endif - connect(this, SIGNAL(search()), d, SLOT(searchRequested())); -} - -/*! - Destroys the search query widget. -*/ -QHelpSearchQueryWidget::~QHelpSearchQueryWidget() -{ - delete d; -} - -/*! - Expands the search query widget so that the extended search fields are shown. -*/ -void QHelpSearchQueryWidget::expandExtendedSearch() -{ - if (d->simpleSearch) - d->showHideAdvancedSearch(); -} - -/*! - Collapses the search query widget so that only the default search field is - shown. -*/ -void QHelpSearchQueryWidget::collapseExtendedSearch() -{ - if (!d->simpleSearch) - d->showHideAdvancedSearch(); -} - -/*! - Returns a list of queries to use in combination with the search engines - search(QList &queryList) function. -*/ -QList QHelpSearchQueryWidget::query() const -{ - const QHelpSearchQueryWidgetPrivate::QueryHistory &queryHist = - d->simpleSearch ? d->simpleQueries : d->complexQueries; - return queryHist.queries.isEmpty() ? - QList() : queryHist.queries.last(); -} - -/*! - Sets the QHelpSearchQueryWidget input fields to the values specified by - \a queryList search field name. Please note that one has to call the search - engine's search(QList &queryList) function to perform the - actual search. -*/ -void QHelpSearchQueryWidget::setQuery(const QList &queryList) -{ - QList lineEdits; - lineEdits << d->defaultQuery << d->allQuery << d->atLeastQuery - << d->similarQuery << d->withoutQuery << d->exactQuery; - foreach (QLineEdit *lineEdit, lineEdits) - lineEdit->clear(); - - const QLatin1String space(" "); - foreach (const QHelpSearchQuery &q, queryList) { - if (QLineEdit *lineEdit = d->lineEditFor(q.fieldName)) - lineEdit->setText(lineEdit->text() + q.wordList.join(space) + space); - } - d->searchRequested(); -} - -/*! - \reimp -*/ -void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent) -{ - if (focusEvent->reason() != Qt::MouseFocusReason) { - d->defaultQuery->selectAll(); - d->defaultQuery->setFocus(); - } -} - -/*! \reimp -*/ -void QHelpSearchQueryWidget::changeEvent(QEvent *event) -{ - if (event->type() == QEvent::LanguageChange) - d->retranslate(); - else - QWidget::changeEvent(event); -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchquerywidget.h b/src/assistant/lib/qhelpsearchquerywidget.h deleted file mode 100644 index e438df0b5..000000000 --- a/src/assistant/lib/qhelpsearchquerywidget.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHQUERYWIDGET_H -#define QHELPSEARCHQUERYWIDGET_H - -#include -#include - -#include -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QFocusEvent; -class QHelpSearchQueryWidgetPrivate; - -class QHELP_EXPORT QHelpSearchQueryWidget : public QWidget -{ - Q_OBJECT - -public: - QHelpSearchQueryWidget(QWidget *parent = 0); - ~QHelpSearchQueryWidget(); - - void expandExtendedSearch(); - void collapseExtendedSearch(); - - QList query() const; - void setQuery(const QList &queryList); - -Q_SIGNALS: - void search(); - -private: - virtual void focusInEvent(QFocusEvent *focusEvent); - virtual void changeEvent(QEvent *event); - -private: - QHelpSearchQueryWidgetPrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QHELPSEARCHQUERYWIDGET_H diff --git a/src/assistant/lib/qhelpsearchresultwidget.cpp b/src/assistant/lib/qhelpsearchresultwidget.cpp deleted file mode 100644 index 964185b5e..000000000 --- a/src/assistant/lib/qhelpsearchresultwidget.cpp +++ /dev/null @@ -1,447 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qhelpsearchresultwidget.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QDefaultResultWidget : public QTreeWidget -{ - Q_OBJECT - -public: - QDefaultResultWidget(QWidget *parent = 0) - : QTreeWidget(parent) - { - header()->hide(); - connect(this, SIGNAL(itemActivated(QTreeWidgetItem*,int)), - this, SLOT(itemActivated(QTreeWidgetItem*,int))); - } - - void showResultPage(const QList hits) - { - foreach (const QHelpSearchEngine::SearchHit &hit, hits) - new QTreeWidgetItem(this, QStringList(hit.first) << hit.second); - } - -signals: - void requestShowLink(const QUrl &url); - -private slots: - void itemActivated(QTreeWidgetItem *item, int /* column */) - { - if (item) { - QString data = item->data(1, Qt::DisplayRole).toString(); - emit requestShowLink(data); - } - } -}; - - -class QCLuceneResultWidget : public QTextBrowser -{ - Q_OBJECT - -public: - QCLuceneResultWidget(QWidget *parent = 0) - : QTextBrowser(parent) - { - connect(this, SIGNAL(anchorClicked(QUrl)), - this, SIGNAL(requestShowLink(QUrl))); - setContextMenuPolicy(Qt::NoContextMenu); - } - - void showResultPage(const QList hits, bool isIndexing) - { - QString htmlFile = QString(QLatin1String("%1")) - .arg(tr("Search Results")); - - int count = hits.count(); - if (count != 0) { - if (isIndexing) - htmlFile += QString(QLatin1String("
" - "%1 " - "%2

")).arg(tr("Note:")) - .arg(tr("The search results may not be complete since the " - "documentation is still being indexed!")); - - foreach (const QHelpSearchEngine::SearchHit &hit, hits) { - htmlFile += QString(QLatin1String("
%2
%1

")) - .arg(hit.first).arg(hit.second); - } - } else { - htmlFile += QLatin1String("


") - + tr("Your search did not match any documents.") - + QLatin1String("

"); - if (isIndexing) - htmlFile += QLatin1String("

") - + tr("(The reason for this might be that the documentation " - "is still being indexed.)") - + QLatin1String("

"); - } - - htmlFile += QLatin1String(""); - - setHtml(htmlFile); - } - -signals: - void requestShowLink(const QUrl &url); - -private slots: - void setSource(const QUrl & /* name */) {} -}; - - -class QHelpSearchResultWidgetPrivate : public QObject -{ - Q_OBJECT - -private slots: - void setResults(int hitsCount) - { - if (!searchEngine.isNull()) { -#if defined(QT_CLUCENE_SUPPORT) - showFirstResultPage(); - updateNextButtonState(((hitsCount > 20) ? true : false)); -#else - resultTreeWidget->clear(); - resultTreeWidget->showResultPage(searchEngine->hits(0, hitsCount)); -#endif - } - } - - void showNextResultPage() - { - if (!searchEngine.isNull() - && resultLastToShow < searchEngine->hitCount()) { - resultLastToShow += 20; - resultFirstToShow += 20; - - resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, - resultLastToShow), isIndexing); - if (resultLastToShow >= searchEngine->hitCount()) - updateNextButtonState(false); - } - updateHitRange(); - } - - void showLastResultPage() - { - if (!searchEngine.isNull()) { - resultLastToShow = searchEngine->hitCount(); - resultFirstToShow = resultLastToShow - (resultLastToShow % 20); - - if (resultFirstToShow == resultLastToShow) - resultFirstToShow -= 20; - - resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, - resultLastToShow), isIndexing); - updateNextButtonState(false); - } - updateHitRange(); - } - - void showFirstResultPage() - { - if (!searchEngine.isNull()) { - resultLastToShow = 20; - resultFirstToShow = 0; - - resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, - resultLastToShow), isIndexing); - updatePrevButtonState(false); - } - updateHitRange(); - } - - void showPreviousResultPage() - { - if (!searchEngine.isNull()) { - int count = resultLastToShow % 20; - if (count == 0 || resultLastToShow != searchEngine->hitCount()) - count = 20; - - resultLastToShow -= count; - resultFirstToShow = resultLastToShow -20; - - resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, - resultLastToShow), isIndexing); - if (resultFirstToShow == 0) - updatePrevButtonState(false); - } - updateHitRange(); - } - - void updatePrevButtonState(bool state = true) - { - firstResultPage->setEnabled(state); - previousResultPage->setEnabled(state); - } - - void updateNextButtonState(bool state = true) - { - nextResultPage->setEnabled(state); - lastResultPage->setEnabled(state); - } - - void indexingStarted() - { - isIndexing = true; - } - - void indexingFinished() - { - isIndexing = false; - } - -private: - QHelpSearchResultWidgetPrivate(QHelpSearchEngine *engine) - : QObject() - , searchEngine(engine) - , isIndexing(false) - { - resultTreeWidget = 0; - resultTextBrowser = 0; - - resultLastToShow = 20; - resultFirstToShow = 0; - - firstResultPage = 0; - previousResultPage = 0; - hitsLabel = 0; - nextResultPage = 0; - lastResultPage = 0; - - connect(searchEngine, SIGNAL(indexingStarted()), - this, SLOT(indexingStarted())); - connect(searchEngine, SIGNAL(indexingFinished()), - this, SLOT(indexingFinished())); - } - - ~QHelpSearchResultWidgetPrivate() - { - delete searchEngine; - } - - QToolButton* setupToolButton(const QString &iconPath) - { - QToolButton *button = new QToolButton(); - button->setEnabled(false); - button->setAutoRaise(true); - button->setIcon(QIcon(iconPath)); - button->setIconSize(QSize(12, 12)); - button->setMaximumSize(QSize(16, 16)); - - return button; - } - - void updateHitRange() - { - int last = 0; - int first = 0; - int count = 0; - - if (!searchEngine.isNull()) { - count = searchEngine->hitCount(); - if (count > 0) { - first = resultFirstToShow +1; - last = resultLastToShow > count ? count : resultLastToShow; - } - } - hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %n Hits", 0, count).arg(first).arg(last)); - } - -private: - friend class QHelpSearchResultWidget; - - QPointer searchEngine; - - QDefaultResultWidget *resultTreeWidget; - QCLuceneResultWidget *resultTextBrowser; - - int resultLastToShow; - int resultFirstToShow; - bool isIndexing; - - QToolButton *firstResultPage; - QToolButton *previousResultPage; - QLabel *hitsLabel; - QToolButton *nextResultPage; - QToolButton *lastResultPage; -}; - -#include "qhelpsearchresultwidget.moc" - - -/*! - \class QHelpSearchResultWidget - \since 4.4 - \inmodule QtHelp - \brief The QHelpSearchResultWidget class provides either a tree - widget or a text browser depending on the used search engine to display - the hits found by the search. -*/ - -/*! - \fn void QHelpSearchResultWidget::requestShowLink(const QUrl &link) - - This signal is emitted when a item is activated and its associated - \a link should be shown. -*/ - -QHelpSearchResultWidget::QHelpSearchResultWidget(QHelpSearchEngine *engine) - : QWidget(0) - , d(new QHelpSearchResultWidgetPrivate(engine)) -{ - QVBoxLayout *vLayout = new QVBoxLayout(this); - vLayout->setMargin(0); - vLayout->setSpacing(0); - -#if defined(QT_CLUCENE_SUPPORT) - QHBoxLayout *hBoxLayout = new QHBoxLayout(); -#ifndef Q_OS_MAC - hBoxLayout->setMargin(0); - hBoxLayout->setSpacing(0); -#endif - hBoxLayout->addWidget(d->firstResultPage = d->setupToolButton( - QString::fromUtf8(":/trolltech/assistant/images/3leftarrow.png"))); - - hBoxLayout->addWidget(d->previousResultPage = d->setupToolButton( - QString::fromUtf8(":/trolltech/assistant/images/1leftarrow.png"))); - - d->hitsLabel = new QLabel(tr("0 - 0 of 0 Hits"), this); - d->hitsLabel->setEnabled(false); - hBoxLayout->addWidget(d->hitsLabel); - d->hitsLabel->setAlignment(Qt::AlignCenter); - d->hitsLabel->setMinimumSize(QSize(150, d->hitsLabel->height())); - - hBoxLayout->addWidget(d->nextResultPage = d->setupToolButton( - QString::fromUtf8(":/trolltech/assistant/images/1rightarrow.png"))); - - hBoxLayout->addWidget(d->lastResultPage = d->setupToolButton( - QString::fromUtf8(":/trolltech/assistant/images/3rightarrow.png"))); - - QSpacerItem *spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - hBoxLayout->addItem(spacer); - - vLayout->addLayout(hBoxLayout); - - d->resultTextBrowser = new QCLuceneResultWidget(this); - vLayout->addWidget(d->resultTextBrowser); - - connect(d->resultTextBrowser, SIGNAL(requestShowLink(QUrl)), this, - SIGNAL(requestShowLink(QUrl))); - - connect(d->nextResultPage, SIGNAL(clicked()), d, SLOT(showNextResultPage())); - connect(d->lastResultPage, SIGNAL(clicked()), d, SLOT(showLastResultPage())); - connect(d->firstResultPage, SIGNAL(clicked()), d, SLOT(showFirstResultPage())); - connect(d->previousResultPage, SIGNAL(clicked()), d, SLOT(showPreviousResultPage())); - - connect(d->firstResultPage, SIGNAL(clicked()), d, SLOT(updateNextButtonState())); - connect(d->previousResultPage, SIGNAL(clicked()), d, SLOT(updateNextButtonState())); - connect(d->nextResultPage, SIGNAL(clicked()), d, SLOT(updatePrevButtonState())); - connect(d->lastResultPage, SIGNAL(clicked()), d, SLOT(updatePrevButtonState())); - -#else - d->resultTreeWidget = new QDefaultResultWidget(this); - vLayout->addWidget(d->resultTreeWidget); - connect(d->resultTreeWidget, SIGNAL(requestShowLink(QUrl)), this, - SIGNAL(requestShowLink(QUrl))); -#endif - - connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int))); -} - -/*! \reimp -*/ -void QHelpSearchResultWidget::changeEvent(QEvent *event) -{ - if (event->type() == QEvent::LanguageChange) - d->setResults(d->searchEngine->hitCount()); -} - -/*! - Destroys the search result widget. -*/ -QHelpSearchResultWidget::~QHelpSearchResultWidget() -{ - delete d; -} - -/*! - Returns a reference of the URL that the item at \a point owns, or an - empty URL if no item exists at that point. -*/ -QUrl QHelpSearchResultWidget::linkAt(const QPoint &point) -{ - QUrl url; -#if defined(QT_CLUCENE_SUPPORT) - if (d->resultTextBrowser) - url = d->resultTextBrowser->anchorAt(point); -#else - if (d->resultTreeWidget) { - QTreeWidgetItem *item = d->resultTreeWidget->itemAt(point); - if (item) - url = item->data(1, Qt::DisplayRole).toString(); - } -#endif - return url; -} - -QT_END_NAMESPACE diff --git a/src/assistant/lib/qhelpsearchresultwidget.h b/src/assistant/lib/qhelpsearchresultwidget.h deleted file mode 100644 index f9300e979..000000000 --- a/src/assistant/lib/qhelpsearchresultwidget.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHELPSEARCHRESULTWIDGET_H -#define QHELPSEARCHRESULTWIDGET_H - -#include -#include - -#include -#include -#include - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Help) - -class QHelpSearchResultWidgetPrivate; - -class QHELP_EXPORT QHelpSearchResultWidget : public QWidget -{ - Q_OBJECT - -public: - ~QHelpSearchResultWidget(); - QUrl linkAt(const QPoint &point); - -Q_SIGNALS: - void requestShowLink(const QUrl &url); - -private: - friend class QHelpSearchEngine; - - QHelpSearchResultWidgetPrivate *d; - QHelpSearchResultWidget(QHelpSearchEngine *engine); - virtual void changeEvent(QEvent *event); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QHELPSEARCHRESULTWIDGET_H diff --git a/src/assistant/qcollectiongenerator/main.cpp b/src/assistant/qcollectiongenerator/main.cpp new file mode 100644 index 000000000..87bdf7996 --- /dev/null +++ b/src/assistant/qcollectiongenerator/main.cpp @@ -0,0 +1,615 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../shared/collectionconfiguration.h" +#include "../shared/helpgenerator.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +QT_USE_NAMESPACE + +class QCG { + Q_DECLARE_TR_FUNCTIONS(QCollectionGenerator) +}; + +class CollectionConfigReader : public QXmlStreamReader +{ +public: + void readData(const QByteArray &contents); + + QString title() const { return m_title; } + QString homePage() const { return m_homePage; } + QString startPage() const { return m_startPage; } + QString applicationIcon() const { return m_applicationIcon; } + QString currentFilter() const { return m_currentFilter; } + bool enableFilterFunctionality() const + { return m_enableFilterFunctionality; } + bool hideFilterFunctionality() const + { return m_hideFilterFunctionality; } + bool enableAddressBar() const { return m_enableAddressBar; } + bool hideAddressBar() const { return m_hideAddressBar; } + bool enableDocumentationManager() const + { return m_enableDocumentationManager; } + + QMap aboutMenuTexts() const + { return m_aboutMenuTexts; } + QString aboutIcon() const { return m_aboutIcon; } + QMap aboutTextFiles() const + { return m_aboutTextFiles; } + + QMap filesToGenerate() const + { return m_filesToGenerate; } + + QStringList filesToRegister() const { return m_filesToRegister; } + + QString cacheDirectory() const { return m_cacheDirectory; } + bool cacheDirRelativeToCollection() const { return m_cacheDirRelativeToCollection; } + + bool fullTextSearchFallbackEnabled() const { + return m_enableFullTextSearchFallback; + } + +private: + void raiseErrorWithLine(); + void readConfig(); + void readAssistantSettings(); + void readMenuTexts(); + void readAboutDialog(); + void readDocFiles(); + void readGenerate(); + void readFiles(); + void readRegister(); + + QString m_title; + QString m_homePage; + QString m_startPage; + QString m_applicationIcon; + QString m_currentFilter; + bool m_enableFilterFunctionality; + bool m_hideFilterFunctionality; + bool m_enableAddressBar; + bool m_hideAddressBar; + bool m_enableDocumentationManager; + QMap m_aboutMenuTexts; + QString m_aboutIcon; + QMap m_aboutTextFiles; + QMap m_filesToGenerate; + QStringList m_filesToRegister; + QString m_cacheDirectory; + bool m_cacheDirRelativeToCollection; + bool m_enableFullTextSearchFallback; +}; + +void CollectionConfigReader::raiseErrorWithLine() +{ + raiseError(QCG::tr("Unknown token at line %1.").arg(lineNumber())); +} + +void CollectionConfigReader::readData(const QByteArray &contents) +{ + m_enableFilterFunctionality = true; + m_hideFilterFunctionality = true; + m_enableAddressBar = true; + m_hideAddressBar = true; + m_enableDocumentationManager = true; + m_enableFullTextSearchFallback = false; + + addData(contents); + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("QHelpCollectionProject") + && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) + readConfig(); + else + raiseError(QCG::tr("Unknown token at line %1. " + "Expected \"QtHelpCollectionProject\".") + .arg(lineNumber())); + } + } +} + +void CollectionConfigReader::readConfig() +{ + bool ok = false; + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("assistant")) + readAssistantSettings(); + else if (name() == QLatin1String("docFiles")) + readDocFiles(); + else + raiseErrorWithLine(); + } else if (isEndElement() && name() == QLatin1String("QHelpCollectionProject")) { + ok = true; + } + } + if (!ok && !hasError()) + raiseError(QCG::tr("Missing end tags.")); +} + +void CollectionConfigReader::readAssistantSettings() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("title")) { + m_title = readElementText(); + } else if (name() == QLatin1String("homePage")) { + m_homePage = readElementText(); + } else if (name() == QLatin1String("startPage")) { + m_startPage = readElementText(); + } else if (name() == QLatin1String("currentFilter")) { + m_currentFilter = readElementText(); + } else if (name() == QLatin1String("applicationIcon")) { + m_applicationIcon = readElementText(); + } else if (name() == QLatin1String("enableFilterFunctionality")) { + if (attributes().value(QLatin1String("visible")) == QLatin1String("true")) + m_hideFilterFunctionality = false; + if (readElementText() == QLatin1String("false")) + m_enableFilterFunctionality = false; + } else if (name() == QLatin1String("enableDocumentationManager")) { + if (readElementText() == QLatin1String("false")) + m_enableDocumentationManager = false; + } else if (name() == QLatin1String("enableAddressBar")) { + if (attributes().value(QLatin1String("visible")) == QLatin1String("true")) + m_hideAddressBar = false; + if (readElementText() == QLatin1String("false")) + m_enableAddressBar = false; + } else if (name() == QLatin1String("aboutMenuText")) { + readMenuTexts(); + } else if (name() == QLatin1String("aboutDialog")) { + readAboutDialog(); + } else if (name() == "cacheDirectory") { + m_cacheDirRelativeToCollection = + attributes().value(QLatin1String("base")) + == QLatin1String("collection"); + m_cacheDirectory = readElementText(); + } else if (name() == QLatin1String("enableFullTextSearchFallback")) { + if (readElementText() == QLatin1String("true")) + m_enableFullTextSearchFallback = true; + } else { + raiseErrorWithLine(); + } + } else if (isEndElement() && name() == QLatin1String("assistant")) { + break; + } + } +} + +void CollectionConfigReader::readMenuTexts() +{ + while (!atEnd()) + { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("text")) { + QString lang = attributes().value(QLatin1String("language")).toString(); + if (lang.isEmpty()) + lang = QLatin1String("default"); + m_aboutMenuTexts.insert(lang, readElementText()); + } else { + raiseErrorWithLine(); + } + } else if (isEndElement() && name() == QLatin1String("aboutMenuText")) { + break; + } + } +} + +void CollectionConfigReader::readAboutDialog() +{ + while (!atEnd()) + { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("file")) { + QString lang = attributes().value(QLatin1String("language")).toString(); + if (lang.isEmpty()) + lang = QLatin1String("default"); + m_aboutTextFiles.insert(lang, readElementText()); + } else if (name() == QLatin1String("icon")) { + m_aboutIcon = readElementText(); + } else { + raiseErrorWithLine(); + } + } else if (isEndElement() && name() == QLatin1String("aboutDialog")) { + break; + } + } +} + +void CollectionConfigReader::readDocFiles() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("generate")) { + readGenerate(); + } else if (name() == QLatin1String("register")) { + readRegister(); + } else { + raiseErrorWithLine(); + } + } else if (isEndElement() && name() == QLatin1String("docFiles")) { + break; + } + } +} + +void CollectionConfigReader::readGenerate() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("file")) + readFiles(); + else + raiseErrorWithLine(); + } else if (isEndElement() && name() == QLatin1String("generate")) { + break; + } + } +} + +void CollectionConfigReader::readFiles() +{ + QString input; + QString output; + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("input")) + input = readElementText(); + else if (name() == QLatin1String("output")) + output = readElementText(); + else + raiseErrorWithLine(); + } else if (isEndElement() && name() == QLatin1String("file")) { + break; + } + } + if (input.isEmpty() || output.isEmpty()) { + raiseError(QCG::tr("Missing input or output file for help file generation.")); + return; + } + m_filesToGenerate.insert(input, output); +} + +void CollectionConfigReader::readRegister() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name() == QLatin1String("file")) + m_filesToRegister.append(readElementText()); + else + raiseErrorWithLine(); + } else if (isEndElement() && name() == QLatin1String("register")) { + break; + } + } +} + +namespace { + QString absoluteFileName(const QString &basePath, const QString &fileName) + { + return QFileInfo(fileName).isAbsolute() ? + fileName : basePath + QDir::separator() + fileName; + } +} + +int main(int argc, char *argv[]) +{ + QString error; + QString arg; + QString collectionFile; + QString configFile; + QString basePath; + bool showHelp = false; + bool showVersion = false; + + QCoreApplication app(argc, argv); +#ifndef Q_OS_WIN32 + QTranslator translator; + QTranslator qtTranslator; + QTranslator qt_helpTranslator; + QString sysLocale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (translator.load(QLatin1String("assistant_") + sysLocale, resourceDir) + && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir) + && qt_helpTranslator.load(QLatin1String("qt_help_") + sysLocale, resourceDir)) { + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); + app.installTranslator(&qt_helpTranslator); + } +#endif // Q_OS_WIN32 + + for (int i=1; i [options]\n\n" + " -o Generates a collection file\n" + " called . If\n" + " this option is not specified\n" + " a default name will be used.\n" + " -v Displays the version of\n" + " qcollectiongenerator.\n\n"); + + if (showHelp) { + fputs(qPrintable(help), stdout); + return 0; + }else if (!error.isEmpty()) { + fprintf(stderr, "%s\n\n%s", qPrintable(error), qPrintable(help)); + return -1; + } + + QFile file(configFile); + if (!file.open(QIODevice::ReadOnly)) { + fputs(qPrintable(QCG::tr("Could not open %1.\n").arg(configFile)), stderr); + return -1; + } + + if (collectionFile.isEmpty()) { + QFileInfo fi(configFile); + collectionFile = basePath + QDir::separator() + + fi.baseName() + QLatin1String(".qhc"); + } + + fputs(qPrintable(QCG::tr("Reading collection config file...\n")), stdout); + CollectionConfigReader config; + config.readData(file.readAll()); + if (config.hasError()) { + fputs(qPrintable(QCG::tr("Collection config file error: %1\n") + .arg(config.errorString())), stderr); + return -1; + } + + QMap::const_iterator it = config.filesToGenerate().constBegin(); + while (it != config.filesToGenerate().constEnd()) { + fputs(qPrintable(QCG::tr("Generating help for %1...\n").arg(it.key())), stdout); + QHelpProjectData helpData; + if (!helpData.readData(absoluteFileName(basePath, it.key()))) { + fprintf(stderr, "%s\n", qPrintable(helpData.errorMessage())); + return -1; + } + + HelpGenerator helpGenerator; + if (!helpGenerator.generate(&helpData, absoluteFileName(basePath, it.value()))) { + fprintf(stderr, "%s\n", qPrintable(helpGenerator.error())); + return -1; + } + ++it; + } + + fputs(qPrintable(QCG::tr("Creating collection file...\n")), stdout); + + QFileInfo colFi(collectionFile); + if (colFi.exists()) { + if (!colFi.dir().remove(colFi.fileName())) { + fputs(qPrintable(QCG::tr("The file %1 cannot be overwritten.\n") + .arg(collectionFile)), stderr); + return -1; + } + } + + QHelpEngineCore helpEngine(collectionFile); + if (!helpEngine.setupData()) { + fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); + return -1; + } + + foreach (const QString &file, config.filesToRegister()) { + if (!helpEngine.registerDocumentation(absoluteFileName(basePath, file))) { + fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); + return -1; + } + } + if (!config.filesToRegister().isEmpty()) + CollectionConfiguration::updateLastRegisterTime(helpEngine); + + if (!config.title().isEmpty()) + CollectionConfiguration::setWindowTitle(helpEngine, config.title()); + + if (!config.homePage().isEmpty()) { + CollectionConfiguration::setDefaultHomePage(helpEngine, + config.homePage()); + } + + if (!config.startPage().isEmpty()) { + CollectionConfiguration::setLastShownPages(helpEngine, + QStringList(config.startPage())); + } + + if (!config.currentFilter().isEmpty()) { + helpEngine.setCurrentFilter(config.currentFilter()); + } + + if (!config.cacheDirectory().isEmpty()) { + CollectionConfiguration::setCacheDir(helpEngine, config.cacheDirectory(), + config.cacheDirRelativeToCollection()); + } + + CollectionConfiguration::setFilterFunctionalityEnabled(helpEngine, + config.enableFilterFunctionality()); + CollectionConfiguration::setFilterToolbarVisible(helpEngine, + !config.hideFilterFunctionality()); + CollectionConfiguration::setDocumentationManagerEnabled(helpEngine, + config.enableDocumentationManager()); + CollectionConfiguration::setAddressBarEnabled(helpEngine, + config.enableAddressBar()); + CollectionConfiguration::setAddressBarVisible(helpEngine, + !config.hideAddressBar()); + CollectionConfiguration::setCreationTime(helpEngine, + QDateTime::currentDateTime().toTime_t()); + CollectionConfiguration::setFullTextSearchFallbackEnabled(helpEngine, + config.fullTextSearchFallbackEnabled()); + + if (!config.applicationIcon().isEmpty()) { + QFile icon(absoluteFileName(basePath, config.applicationIcon())); + if (!icon.open(QIODevice::ReadOnly)) { + fputs(qPrintable(QCG::tr("Cannot open %1.\n").arg(icon.fileName())), stderr); + return -1; + } + CollectionConfiguration::setApplicationIcon(helpEngine, icon.readAll()); + } + + if (config.aboutMenuTexts().count()) { + QByteArray ba; + QDataStream s(&ba, QIODevice::WriteOnly); + QMap::const_iterator it = config.aboutMenuTexts().constBegin(); + while (it != config.aboutMenuTexts().constEnd()) { + s << it.key(); + s << it.value(); + ++it; + } + CollectionConfiguration::setAboutMenuTexts(helpEngine, ba); + } + + if (!config.aboutIcon().isEmpty()) { + QFile icon(absoluteFileName(basePath, config.aboutIcon())); + if (!icon.open(QIODevice::ReadOnly)) { + fputs(qPrintable(QCG::tr("Cannot open %1.\n").arg(icon.fileName())), stderr); + return -1; + } + CollectionConfiguration::setAboutIcon(helpEngine, icon.readAll()); + } + + if (config.aboutTextFiles().count()) { + QByteArray ba; + QDataStream s(&ba, QIODevice::WriteOnly); + QMap::const_iterator it = config.aboutTextFiles().constBegin(); + QMap imgData; + + QRegExp srcRegExp(QLatin1String("src=(\"(.+)\"|([^\"\\s]+)).*>")); + srcRegExp.setMinimal(true); + QRegExp imgRegExp(QLatin1String("(]+>)")); + imgRegExp.setMinimal(true); + + while (it != config.aboutTextFiles().constEnd()) { + s << it.key(); + QFileInfo fi(absoluteFileName(basePath, it.value())); + QFile f(fi.absoluteFilePath()); + if (!f.open(QIODevice::ReadOnly)) { + fputs(qPrintable(QCG::tr("Cannot open %1.\n").arg(f.fileName())), stderr); + return -1; + } + QByteArray data = f.readAll(); + s << data; + + QString contents = QString::fromUtf8(data); + int pos = 0; + while ((pos = imgRegExp.indexIn(contents, pos)) != -1) { + QString imgTag = imgRegExp.cap(1); + pos += imgRegExp.matchedLength(); + + if (srcRegExp.indexIn(imgTag, 0) != -1) { + QString src = srcRegExp.cap(2); + if (src.isEmpty()) + src = srcRegExp.cap(3); + + QFile img(fi.absolutePath() + QDir::separator() + src); + if (img.open(QIODevice::ReadOnly)) { + if (!imgData.contains(src)) + imgData.insert(src, img.readAll()); + } else { + fputs(qPrintable(QCG::tr("Cannot open referenced image file %1.\n") + .arg(img.fileName())), stderr); + } + } + } + ++it; + } + CollectionConfiguration::setAboutTexts(helpEngine, ba); + if (imgData.count()) { + QByteArray imageData; + QBuffer buffer(&imageData); + buffer.open(QIODevice::WriteOnly); + QDataStream out(&buffer); + out << imgData; + CollectionConfiguration::setAboutImages(helpEngine, imageData); + } + } + + return 0; +} diff --git a/src/assistant/qcollectiongenerator/qcollectiongenerator.pro b/src/assistant/qcollectiongenerator/qcollectiongenerator.pro new file mode 100644 index 000000000..e8df8e4f6 --- /dev/null +++ b/src/assistant/qcollectiongenerator/qcollectiongenerator.pro @@ -0,0 +1,16 @@ +QT += network help-private +TEMPLATE = app +DESTDIR = $$QT.designer.bins +TARGET = qcollectiongenerator +CONFIG += qt \ + warn_on \ + help \ + console +CONFIG -= app_bundle +target.path = $$[QT_INSTALL_BINS] +INSTALLS += target +SOURCES += ../shared/helpgenerator.cpp \ + main.cpp \ + ../shared/collectionconfiguration.cpp +HEADERS += ../shared/helpgenerator.h \ + ../shared/collectionconfiguration.h diff --git a/src/assistant/qhelpconverter/adpreader.cpp b/src/assistant/qhelpconverter/adpreader.cpp new file mode 100644 index 000000000..a0983755e --- /dev/null +++ b/src/assistant/qhelpconverter/adpreader.cpp @@ -0,0 +1,179 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "adpreader.h" + +static bool versionIsAtLeast320(const QString &version) +{ + return QRegExp("\\d.\\d\\.\\d").exactMatch(version) + && (version[0] > '3' || (version[0] == '3' && version[2] >= '2')); +} + +QT_BEGIN_NAMESPACE + +void AdpReader::readData(const QByteArray &contents) +{ + clear(); + m_contents.clear(); + m_keywords.clear(); + m_properties.clear(); + m_files.clear(); + addData(contents); + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name().toString().toLower() == QLatin1String("assistantconfig") + && versionIsAtLeast320(attributes().value(QLatin1String("version")).toString())) { + readProject(); + } else if (name().toString().toLower() == QLatin1String("dcf")) { + QString ref = attributes().value(QLatin1String("ref")).toString(); + addFile(ref); + m_contents.append(ContentItem(attributes().value(QLatin1String("title")).toString(), + ref, 0)); + readDCF(); + } else { + raiseError(); + } + } + } +} + +QList AdpReader::contents() const +{ + return m_contents; +} + +QList AdpReader::keywords() const +{ + return m_keywords; +} + +QSet AdpReader::files() const +{ + return m_files; +} + +QMap AdpReader::properties() const +{ + return m_properties; +} + +void AdpReader::readProject() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + QString s = name().toString().toLower(); + if (s == QLatin1String("profile")) { + readProfile(); + } else if (s == QLatin1String("dcf")) { + QString ref = attributes().value(QLatin1String("ref")).toString(); + addFile(ref); + m_contents.append(ContentItem(attributes().value(QLatin1String("title")).toString(), + ref, 0)); + readDCF(); + } else { + raiseError(); + } + } + } +} + +void AdpReader::readProfile() +{ + while (!atEnd()) { + readNext(); + if (isStartElement()) { + if (name().toString().toLower() == QLatin1String("property")) { + QString prop = attributes().value(QLatin1String("name")).toString().toLower(); + m_properties[prop] = readElementText(); + } else { + raiseError(); + } + } else if (isEndElement()) { + break; + } + } +} + +void AdpReader::readDCF() +{ + int depth = 0; + while (!atEnd()) { + readNext(); + QString str = name().toString().toLower(); + if (isStartElement()) { + if (str == QLatin1String("section")) { + QString ref = attributes().value(QLatin1String("ref")).toString(); + addFile(ref); + m_contents.append(ContentItem(attributes().value(QLatin1String("title")).toString(), + ref, ++depth)); + } else if (str == QLatin1String("keyword")) { + QString ref = attributes().value(QLatin1String("ref")).toString(); + addFile(ref); + m_keywords.append(KeywordItem(readElementText(), ref)); + } else { + raiseError(); + } + } else if (isEndElement()) { + if (str == QLatin1String("section")) + --depth; + else if (str == QLatin1String("dcf")) + break; + } + } +} + +void AdpReader::addFile(const QString &file) +{ + QString s = file; + if (s.startsWith(QLatin1String("./"))) + s = s.mid(2); + int i = s.indexOf(QLatin1Char('#')); + if (i > -1) + s = s.left(i); + if (!m_files.contains(s)) + m_files.insert(s); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/adpreader.h b/src/assistant/qhelpconverter/adpreader.h new file mode 100644 index 000000000..9900866c9 --- /dev/null +++ b/src/assistant/qhelpconverter/adpreader.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ADPREADER_H +#define ADPREADER_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +struct ContentItem { + ContentItem(const QString &t, const QString &r, int d) + : title(t), reference(r), depth(d) {} + QString title; + QString reference; + int depth; +}; + +struct KeywordItem { + KeywordItem(const QString &k, const QString &r) + : keyword(k), reference(r) {} + QString keyword; + QString reference; +}; + +class AdpReader : public QXmlStreamReader +{ +public: + void readData(const QByteArray &contents); + QList contents() const; + QList keywords() const; + QSet files() const; + + QMap properties() const; + +private: + void readProject(); + void readProfile(); + void readDCF(); + void addFile(const QString &file); + + QMap m_properties; + QList m_contents; + QList m_keywords; + QSet m_files; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/assistant-128.png b/src/assistant/qhelpconverter/assistant-128.png new file mode 100644 index 000000000..f05949f6d Binary files /dev/null and b/src/assistant/qhelpconverter/assistant-128.png differ diff --git a/src/assistant/qhelpconverter/assistant.png b/src/assistant/qhelpconverter/assistant.png new file mode 100644 index 000000000..ea4d1e70c Binary files /dev/null and b/src/assistant/qhelpconverter/assistant.png differ diff --git a/src/assistant/qhelpconverter/conversionwizard.cpp b/src/assistant/qhelpconverter/conversionwizard.cpp new file mode 100644 index 000000000..0a80a0e71 --- /dev/null +++ b/src/assistant/qhelpconverter/conversionwizard.cpp @@ -0,0 +1,265 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "conversionwizard.h" +#include "inputpage.h" +#include "generalpage.h" +#include "filterpage.h" +#include "identifierpage.h" +#include "pathpage.h" +#include "filespage.h" +#include "outputpage.h" +#include "finishpage.h" +#include "qhpwriter.h" +#include "qhcpwriter.h" +#include "helpwindow.h" + +QT_BEGIN_NAMESPACE + +ConversionWizard::ConversionWizard() +{ + setWindowIcon(QIcon(QLatin1String(":/trolltech/qhelpconverter/assistant.png"))); + setWindowTitle(tr("Help Conversion Wizard")); + setPixmap(QWizard::WatermarkPixmap, + QPixmap(QLatin1String(":/trolltech/qhelpconverter/assistant-128.png"))) ; + setOptions(QWizard::IndependentPages|QWizard::NoBackButtonOnLastPage + |QWizard::HaveHelpButton); + + m_inputPage = new InputPage(&m_adpReader); + setPage(Input_Page, m_inputPage); + + m_generalPage = new GeneralPage(); + setPage(General_Page, m_generalPage); + + m_filterPage = new FilterPage(); + setPage(Filter_Page, m_filterPage); + m_filterPage->setMaximumHeight(240); + + m_identifierPage = new IdentifierPage(); + setPage(Identifier_Page, m_identifierPage); + + m_pathPage = new PathPage(); + setPage(Path_Page, m_pathPage); + m_pathPage->setMaximumHeight(240); + + m_filesPage = new FilesPage(); + setPage(Files_Page, m_filesPage); + m_filesPage->setMaximumHeight(240); + + m_outputPage = new OutputPage(); + setPage(Output_Page, m_outputPage); + m_outputPage->setMaximumHeight(240); + + m_finishPage = new FinishPage(); + setPage(Finish_Page, m_finishPage); + m_finishPage->setMaximumHeight(240); + + connect(this, SIGNAL(currentIdChanged(int)), + this, SLOT(pageChanged(int))); + + m_helpWindow = 0; + qApp->installEventFilter(this); + + QAbstractButton *btn = button(QWizard::HelpButton); + btn->setCheckable(true); + connect(btn, SIGNAL(toggled(bool)), this, SLOT(showHelp(bool))); +} + +void ConversionWizard::setAdpFileName(const QString &fileName) +{ + setField(QLatin1String("adpFileName"), fileName); +} + +void ConversionWizard::initializePage(int id) +{ + switch (id) { + case Path_Page: { + QFileInfo fi(field(QLatin1String("adpFileName")).toString()); + m_pathPage->setPath(fi.absolutePath()); + break; + } + case Output_Page: { + QFileInfo fi(field(QLatin1String("adpFileName")).toString()); + m_outputPage->setPath(fi.absolutePath()); + setField(QLatin1String("ProjectFileName"), fi.baseName() + + QLatin1String(".qhp")); + setField(QLatin1String("CollectionFileName"), fi.baseName() + + QLatin1String(".qhcp")); + break; + } + } +} + +void ConversionWizard::pageChanged(int id) +{ + if (id == Files_Page) { + QApplication::setOverrideCursor(Qt::WaitCursor); + m_files.clear(); + QFileInfo fi(field(QLatin1String("adpFileName")).toString()); + QDir rootDir = fi.absolutePath(); + foreach (const QString &p, m_pathPage->paths()) { + QDir dir(p); + QString rel = rootDir.relativeFilePath(dir.absolutePath()); + if (!rel.isEmpty()) + rel.append(QLatin1Char('/')); + foreach (const QString &f, dir.entryList(m_pathPage->filters())) + m_files.append(rel + f); + } + m_filesPage->setFilesToRemove(getUnreferencedFiles(m_files)); + QApplication::restoreOverrideCursor(); + } else if (id == Output_Page) { + m_outputPage->setCollectionComponentEnabled( + !m_adpReader.properties().isEmpty()); + } else if (id == Finish_Page) { + QTimer::singleShot(300, this, SLOT(convert())); + } +} + +void ConversionWizard::showHelp(bool toggle) +{ + int w = 180; + int h = 180; + if (!m_helpWindow) { + m_helpWindow = new HelpWindow(this); + m_helpWindow->setMaximumWidth(w); + m_helpWindow->setMaximumHeight(h); + m_helpWindow->setMinimumHeight(h); + } + + if (toggle) { + m_helpWindow->setHelp(currentPage()->objectName()); + QAbstractButton *btn = button(QWizard::HelpButton); + QPoint p = btn->pos(); + int x = p.x(); + if (btn->pos().x() > w) + x = p.x() + btn->width() - w; + m_helpWindow->move(x, p.y()-h); + m_helpWindow->show(); + } else { + m_helpWindow->hide(); + } +} + +bool ConversionWizard::eventFilter(QObject *obj, QEvent *e) +{ + if (m_helpWindow && m_helpWindow->isVisible()) { + if (obj != button(QWizard::HelpButton) + && e->type() == QEvent::MouseButtonRelease) { + QMouseEvent *me = static_cast(e); + if (!m_helpWindow->geometry().contains(mapFromParent(me->globalPos()))) { + m_helpWindow->hide(); + button(QWizard::HelpButton)->setChecked(false); + } + } else if (e->type() == QEvent::KeyPress) { + m_helpWindow->hide(); + button(QWizard::HelpButton)->setChecked(false); + } + } + return QWizard::eventFilter(obj, e); +} + +QStringList ConversionWizard::getUnreferencedFiles(const QStringList &files) +{ + QStringList lst; + QSet adpFiles = m_adpReader.files(); + foreach (const QString &s, files) { + if (!adpFiles.contains(s)) + lst.append(s); + } + return lst; +} + +void ConversionWizard::convert() +{ + QFileInfo fi(field(QLatin1String("adpFileName")).toString()); + m_finishPage->appendMessage(tr("Converting %1...") + .arg(fi.fileName())); + QApplication::setOverrideCursor(Qt::WaitCursor); + QString qhpFileName = field(QLatin1String("ProjectFileName")).toString(); + QhpWriter qhpWriter(field(QLatin1String("namespaceName")).toString(), + field(QLatin1String("virtualFolder")).toString()); + qhpWriter.setAdpReader(&m_adpReader); + qhpWriter.setFilterAttributes(m_filterPage->filterAttributes()); + qhpWriter.setCustomFilters(m_filterPage->customFilters()); + + foreach (const QString &f, m_filesPage->filesToRemove()) + m_files.removeAll(f); + qhpWriter.setFiles(m_files); + + if (field(QLatin1String("createIdentifier")).toBool()) { + if (field(QLatin1String("fileNamePrefix")).toBool()) + qhpWriter.generateIdentifiers(QhpWriter::FilePrefix); + else + qhpWriter.generateIdentifiers(QhpWriter::GlobalPrefix, + field(QLatin1String("globalPrefix")).toString()); + } else { + qhpWriter.generateIdentifiers(QhpWriter::SkipAll); + } + + qhpWriter.writeFile(fi.absolutePath() + QDir::separator() + + qhpFileName); + + m_finishPage->appendMessage(tr("Writing help collection file...")); + + if (!m_adpReader.properties().isEmpty()) { + QhcpWriter qhcpWriter; + qhcpWriter.setHelpProjectFile(qhpFileName); + qhcpWriter.setProperties(m_adpReader.properties()); + qhcpWriter.setTitlePath(QLatin1String("qthelp://") + + field(QLatin1String("namespaceName")).toString() + + QLatin1String("/") + +field(QLatin1String("virtualFolder")).toString()); + qhcpWriter.writeFile(fi.absolutePath() + QDir::separator() + + field(QLatin1String("CollectionFileName")).toString()); + } + + m_finishPage->appendMessage(tr("Done.")); + QApplication::restoreOverrideCursor(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/conversionwizard.h b/src/assistant/qhelpconverter/conversionwizard.h new file mode 100644 index 000000000..ff66d271e --- /dev/null +++ b/src/assistant/qhelpconverter/conversionwizard.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CONVERSIONWIZARD_H +#define CONVERSIONWIZARD_H + +#include +#include "adpreader.h" + +QT_BEGIN_NAMESPACE + +class InputPage; +class GeneralPage; +class FilterPage; +class IdentifierPage; +class PathPage; +class FilesPage; +class OutputPage; +class FinishPage; +class HelpWindow; + +class ConversionWizard : public QWizard +{ + Q_OBJECT + +public: + ConversionWizard(); + void setAdpFileName(const QString &fileName); + +private slots: + void pageChanged(int id); + void showHelp(bool toggle); + void convert(); + +private: + enum Pages {Input_Page, General_Page, Filter_Page, + Identifier_Page, Path_Page, Files_Page, Output_Page, + Finish_Page}; + void initializePage(int id); + QStringList getUnreferencedFiles(const QStringList &files); + bool eventFilter(QObject *obj, QEvent *e); + + AdpReader m_adpReader; + InputPage *m_inputPage; + GeneralPage *m_generalPage; + FilterPage *m_filterPage; + IdentifierPage *m_identifierPage; + PathPage *m_pathPage; + FilesPage *m_filesPage; + OutputPage *m_outputPage; + FinishPage *m_finishPage; + QStringList m_files; + HelpWindow *m_helpWindow; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/doc/filespage.html b/src/assistant/qhelpconverter/doc/filespage.html new file mode 100644 index 000000000..a7aac18da --- /dev/null +++ b/src/assistant/qhelpconverter/doc/filespage.html @@ -0,0 +1,8 @@ + + +

Sometimes it can happen that the previously specified paths contain +more or other files than actually needed for the documentation.

+

This page lists all files which are likely to be unused because they +are neither referenced by any keyword nor be the TOC.

+ + diff --git a/src/assistant/qhelpconverter/doc/filterpage.html b/src/assistant/qhelpconverter/doc/filterpage.html new file mode 100644 index 000000000..7b3781bd5 --- /dev/null +++ b/src/assistant/qhelpconverter/doc/filterpage.html @@ -0,0 +1,13 @@ + + +

The help system offers the possibility to filter all installed documentations +for certain attributes. Commonly specified attributes are e.g. the company +and product name as well as the product version.

+

The help engine and Assistant use custom filters to do the actual +documentation filtering. A custom filter is basically just a alias name for a +list of filter attributes. So, if e.g. the custom filter "MyFilter" lists +the attributes "mycompany, myproduct" then only the documentation with those +attributes will be shown.

+

Warning: The filter attributes are case sensitive!

+ + diff --git a/src/assistant/qhelpconverter/doc/generalpage.html b/src/assistant/qhelpconverter/doc/generalpage.html new file mode 100644 index 000000000..8d106bec1 --- /dev/null +++ b/src/assistant/qhelpconverter/doc/generalpage.html @@ -0,0 +1,10 @@ + + +

The namespace is needed to identify this documentation when having +several documentation sets installed in a collection.

+

Virtual folders are used to enable file references between all +documents. Thereby, the virtual folder acts as the root path of all +documents, even if those are part of different documentation sets, +meaning listed under different namespaces.

+ + diff --git a/src/assistant/qhelpconverter/doc/identifierpage.html b/src/assistant/qhelpconverter/doc/identifierpage.html new file mode 100644 index 000000000..952b88de8 --- /dev/null +++ b/src/assistant/qhelpconverter/doc/identifierpage.html @@ -0,0 +1,17 @@ + + +

Identifiers are mostly used to make keywords unique, but they can also +be used to specify keywords which should not be shown in the index. Identifiers +are especially help full when using context sensitive help and one keyword has +more links assigned to it.

+

E.g. consider the keyword "replace" in Qt. It is +included, among others, in QString and QList. To be able to retrieve the proper +documentation, there is an identifier "QString::replace" and one +"QList::replace".

+

A global prefix, e.g. "MyApp::" is set for all keywords independent +where they are located. When inheriting the prefix from the file name, +the keywords get the prefix "[filename]::" where the file name is taken from the +reference of the keyword. The file name is just the base name, i.e. without any +directory or extension.

+ + diff --git a/src/assistant/qhelpconverter/doc/inputpage.html b/src/assistant/qhelpconverter/doc/inputpage.html new file mode 100644 index 000000000..4054c5472 --- /dev/null +++ b/src/assistant/qhelpconverter/doc/inputpage.html @@ -0,0 +1,7 @@ + + +

Both, a .adp or .dcf file can be specified. If an .adp file is detected, +the wizard generates a Qt help collection file in addition to the help +project file.

+ + diff --git a/src/assistant/qhelpconverter/doc/outputpage.html b/src/assistant/qhelpconverter/doc/outputpage.html new file mode 100644 index 000000000..332ef69fc --- /dev/null +++ b/src/assistant/qhelpconverter/doc/outputpage.html @@ -0,0 +1,7 @@ + + +

The specified output files will be located in the same directory as the +.adp or .dcf file. The collection file will only be generated if the input +file was an .adp file.

+ + diff --git a/src/assistant/qhelpconverter/doc/pathpage.html b/src/assistant/qhelpconverter/doc/pathpage.html new file mode 100644 index 000000000..95449b3c3 --- /dev/null +++ b/src/assistant/qhelpconverter/doc/pathpage.html @@ -0,0 +1,8 @@ + + +

The new help system uses, in contrast to the old Qt Assistant, compressed +help files containing all files (html files, images, stylesheets, ...) +necessary to display the documentation correctly.

+

To be able to find all those files, the source paths have to be given.

+ + diff --git a/src/assistant/qhelpconverter/filespage.cpp b/src/assistant/qhelpconverter/filespage.cpp new file mode 100644 index 000000000..e30ec42ef --- /dev/null +++ b/src/assistant/qhelpconverter/filespage.cpp @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "filespage.h" + +QT_BEGIN_NAMESPACE + +FilesPage::FilesPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Unreferenced Files")); + setSubTitle(tr("Remove files which are neither referenced " + "by a keyword nor by the TOC.")); + + m_ui.setupUi(this); + m_ui.fileListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); + m_ui.fileListWidget->installEventFilter(this); + connect(m_ui.removeButton, SIGNAL(clicked()), + this, SLOT(removeFile())); + connect(m_ui.removeAllButton, SIGNAL(clicked()), + this, SLOT(removeAllFiles())); + + m_ui.fileLabel->setText(tr("

Warning: " + "When removing images or stylesheets, be aware that those files " + "are not directly referenced by the .adp or .dcf " + "file.

")); +} + +void FilesPage::setFilesToRemove(const QStringList &files) +{ + m_files = files; + m_ui.fileListWidget->clear(); + m_ui.fileListWidget->addItems(files); +} + +QStringList FilesPage::filesToRemove() const +{ + return m_filesToRemove; +} + +void FilesPage::removeFile() +{ + int row = m_ui.fileListWidget->currentRow() + - m_ui.fileListWidget->selectedItems().count() + 1; + foreach (const QListWidgetItem *item, m_ui.fileListWidget->selectedItems()) { + m_filesToRemove.append(item->text()); + delete item; + } + if (m_ui.fileListWidget->count() > row && row >= 0) + m_ui.fileListWidget->setCurrentRow(row); + else + m_ui.fileListWidget->setCurrentRow(m_ui.fileListWidget->count()); +} + +void FilesPage::removeAllFiles() +{ + m_ui.fileListWidget->clear(); + m_filesToRemove = m_files; +} + +bool FilesPage::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == m_ui.fileListWidget && event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + if (ke->key() == Qt::Key_Delete) { + removeFile(); + return true; + } + } + return QWizardPage::eventFilter(obj, event); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/filespage.h b/src/assistant/qhelpconverter/filespage.h new file mode 100644 index 000000000..07022e898 --- /dev/null +++ b/src/assistant/qhelpconverter/filespage.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FILESPAGE_H +#define FILESPAGE_H + +#include +#include "ui_filespage.h" + +QT_BEGIN_NAMESPACE + +class FilesPage : public QWizardPage +{ + Q_OBJECT + +public: + FilesPage(QWidget *parent = 0); + void setFilesToRemove(const QStringList &files); + QStringList filesToRemove() const; + +private slots: + void removeFile(); + void removeAllFiles(); + +private: + bool eventFilter(QObject *obj, QEvent *event); + + Ui::FilesPage m_ui; + QStringList m_files; + QStringList m_filesToRemove; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/filespage.ui b/src/assistant/qhelpconverter/filespage.ui new file mode 100644 index 000000000..d308b9664 --- /dev/null +++ b/src/assistant/qhelpconverter/filespage.ui @@ -0,0 +1,79 @@ + + FilesPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Files: + + + true + + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + Remove All + + + + + + + Qt::Vertical + + + + 75 + 16 + + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + diff --git a/src/assistant/qhelpconverter/filterpage.cpp b/src/assistant/qhelpconverter/filterpage.cpp new file mode 100644 index 000000000..efe32c79e --- /dev/null +++ b/src/assistant/qhelpconverter/filterpage.cpp @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "filterpage.h" + +QT_BEGIN_NAMESPACE + +FilterPage::FilterPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Filter Settings")); + setSubTitle(tr("Specify the filter attributes for the " + "documentation. If filter attributes are used, " + "also define a custom filter for it. Both the " + "filter attributes and the custom filters are " + "optional.")); + + m_ui.setupUi(this); + m_ui.customFilterWidget->headerItem()->setText(0, tr("Filter Name")); + m_ui.customFilterWidget->headerItem()->setText(1, tr("Filter Attributes")); + m_ui.customFilterWidget->setRootIsDecorated(false); + m_ui.removeButton->setDisabled(true); + connect(m_ui.addButton, SIGNAL(clicked()), + this, SLOT(addFilter())); + connect(m_ui.removeButton, SIGNAL(clicked()), + this, SLOT(removeFilter())); +} + +bool FilterPage::validatePage() +{ + m_filterAttributes.clear(); + foreach (const QString &f, m_ui.filterLineEdit->text().split(QLatin1Char(','))) { + if (!f.trimmed().isEmpty()) + m_filterAttributes.append(f.trimmed()); + } + + m_customFilters.clear(); + QSet names; + QSet atts; + QString str; + CustomFilter customFilter; + QTreeWidgetItem *item = 0; + for (int i=0; itopLevelItemCount(); ++i) { + item = m_ui.customFilterWidget->topLevelItem(i); + str = item->text(0); + if (str.isEmpty() || names.contains(str)) { + QMessageBox::critical(this, tr("Custom Filters"), + tr("The custom filter \'%1\' is defined multiple times.") + .arg(str)); + return false; + } + names.insert(str); + customFilter.name = str; + + str.clear(); + QStringList lst; + foreach (const QString &s, item->text(1).split(QLatin1Char(','))) { + const QString st = s.trimmed(); + if (!st.isEmpty()) { + str += QLatin1Char(',') + st; + lst.append(st); + } + } + if (atts.contains(str)) { + QMessageBox::critical(this, tr("Custom Filters"), + tr("The attributes for custom filter \'%1\' are defined multiple times.") + .arg(customFilter.name)); + return false; + } + atts.insert(str); + customFilter.filterAttributes = lst; + m_customFilters.append(customFilter); + } + return true; +} + +QStringList FilterPage::filterAttributes() const +{ + return m_filterAttributes; +} + +QList FilterPage::customFilters() const +{ + return m_customFilters; +} + +void FilterPage::addFilter() +{ + QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.customFilterWidget); + item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsEditable|Qt::ItemIsSelectable); + item->setText(0, tr("unfiltered", "list of available documentation")); + item->setText(1, QLatin1String("")); + m_ui.customFilterWidget->editItem(item, 0); + m_ui.removeButton->setDisabled(false); +} + +void FilterPage::removeFilter() +{ + QModelIndex idx = m_ui.customFilterWidget->currentIndex(); + if (!idx.isValid()) + return; + QTreeWidgetItem *item = m_ui.customFilterWidget->takeTopLevelItem(idx.row()); + delete item; + if (!m_ui.customFilterWidget->topLevelItemCount()) + m_ui.removeButton->setDisabled(true); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/filterpage.h b/src/assistant/qhelpconverter/filterpage.h new file mode 100644 index 000000000..336c650de --- /dev/null +++ b/src/assistant/qhelpconverter/filterpage.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FILTERPAGE_H +#define FILTERPAGE_H + +#include +#include "ui_filterpage.h" + +QT_BEGIN_NAMESPACE + +struct CustomFilter +{ + QString name; + QStringList filterAttributes; +}; + +class FilterPage : public QWizardPage +{ + Q_OBJECT + +public: + FilterPage(QWidget *parent = 0); + QStringList filterAttributes() const; + QList customFilters() const; + +private slots: + void addFilter(); + void removeFilter(); + +private: + bool validatePage(); + + Ui::FilterPage m_ui; + QStringList m_filterAttributes; + QList m_customFilters; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/filterpage.ui b/src/assistant/qhelpconverter/filterpage.ui new file mode 100644 index 000000000..7cda3d9be --- /dev/null +++ b/src/assistant/qhelpconverter/filterpage.ui @@ -0,0 +1,125 @@ + + FilterPage + + + + 0 + 0 + 419 + 243 + + + + Form + + + + + + Filter attributes for current documentation (comma separated list): + + + + + + + + + + Custom Filters + + + + + + 2 + + + + 1 + + + + + 2 + + + + + + + + Add + + + + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + diff --git a/src/assistant/qhelpconverter/finishpage.cpp b/src/assistant/qhelpconverter/finishpage.cpp new file mode 100644 index 000000000..cdbd634e6 --- /dev/null +++ b/src/assistant/qhelpconverter/finishpage.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +#include "finishpage.h" + +QT_BEGIN_NAMESPACE + +FinishPage::FinishPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Converting File")); + setSubTitle(tr("Creating the new Qt help files from the old ADP file.")); + setFinalPage(true); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, + QSizePolicy::Fixed)); + + m_textEdit = new QTextEdit(); + layout->addWidget(m_textEdit); + + layout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, + QSizePolicy::Expanding)); +} + +void FinishPage::appendMessage(const QString &msg) +{ + m_textEdit->append(msg); + qApp->processEvents(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/finishpage.h b/src/assistant/qhelpconverter/finishpage.h new file mode 100644 index 000000000..41dec54ca --- /dev/null +++ b/src/assistant/qhelpconverter/finishpage.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FINISHPAGE_H +#define FINISHPAGE_H + +#include + +QT_BEGIN_NAMESPACE + +class QTextEdit; + +class FinishPage : public QWizardPage +{ + Q_OBJECT + +public: + FinishPage(QWidget *parent = 0); + void appendMessage(const QString &msg); + +private: + QTextEdit *m_textEdit; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/generalpage.cpp b/src/assistant/qhelpconverter/generalpage.cpp new file mode 100644 index 000000000..ad0171270 --- /dev/null +++ b/src/assistant/qhelpconverter/generalpage.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "generalpage.h" + +QT_BEGIN_NAMESPACE + +GeneralPage::GeneralPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("General Settings")); + setSubTitle(tr("Specify the namespace and the virtual " + "folder for the documentation.")); + + m_ui.setupUi(this); + connect(m_ui.namespaceLineEdit, SIGNAL(textChanged(QString)), + this, SIGNAL(completeChanged())); + connect(m_ui.folderLineEdit, SIGNAL(textChanged(QString)), + this, SIGNAL(completeChanged())); + + m_ui.namespaceLineEdit->setText(QLatin1String("mycompany.com")); + m_ui.folderLineEdit->setText(QLatin1String("product_1.0")); + + registerField(QLatin1String("namespaceName"), m_ui.namespaceLineEdit); + registerField(QLatin1String("virtualFolder"), m_ui.folderLineEdit); +} + +bool GeneralPage::isComplete() const +{ + if (m_ui.namespaceLineEdit->text().isEmpty() + || m_ui.folderLineEdit->text().isEmpty()) + return false; + return true; +} + +bool GeneralPage::validatePage() +{ + QString s = m_ui.namespaceLineEdit->text(); + if (s.contains(QLatin1Char('/')) || s.contains(QLatin1Char('\\'))) { + QMessageBox::critical(this, tr("Namespace Error"), + tr("The namespace contains some invalid characters.")); + return false; + } + s = m_ui.folderLineEdit->text(); + if (s.contains(QLatin1Char('/')) || s.contains(QLatin1Char('\\'))) { + QMessageBox::critical(this, tr("Virtual Folder Error"), + tr("The virtual folder contains some invalid characters.")); + return false; + } + return true; +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/generalpage.h b/src/assistant/qhelpconverter/generalpage.h new file mode 100644 index 000000000..c9a8b2452 --- /dev/null +++ b/src/assistant/qhelpconverter/generalpage.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GENERALPAGE_H +#define GENERALPAGE_H + +#include +#include "ui_generalpage.h" + +QT_BEGIN_NAMESPACE + +class GeneralPage : public QWizardPage +{ + Q_OBJECT + +public: + GeneralPage(QWidget *parent = 0); + +private: + bool validatePage(); + bool isComplete() const; + + Ui::GeneralPage m_ui; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/generalpage.ui b/src/assistant/qhelpconverter/generalpage.ui new file mode 100644 index 000000000..9c2babb0a --- /dev/null +++ b/src/assistant/qhelpconverter/generalpage.ui @@ -0,0 +1,69 @@ + + GeneralPage + + + + 0 + 0 + 417 + 243 + + + + Form + + + + + + Namespace: + + + + + + + + + + Virtual Folder: + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/src/assistant/qhelpconverter/helpwindow.cpp b/src/assistant/qhelpconverter/helpwindow.cpp new file mode 100644 index 000000000..5212092f7 --- /dev/null +++ b/src/assistant/qhelpconverter/helpwindow.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "helpwindow.h" + +QT_BEGIN_NAMESPACE + +HelpWindow::HelpWindow(QWidget *parent) + : QWidget(parent, 0) +{ + setAutoFillBackground(true); + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setMargin(0); + QFrame *frame = new QFrame(this); + QPalette p = palette(); + p.setColor(QPalette::Background, Qt::white); + setPalette(p); + frame->setFrameStyle(QFrame::Box | QFrame::Plain); + layout->addWidget(frame); + + layout = new QVBoxLayout(frame); + layout->setMargin(2); + QLabel *l = new QLabel(tr("
Wizard Assistant
")); + layout->addWidget(l); + m_textEdit = new QTextEdit(); + m_textEdit->setFrameStyle(QFrame::NoFrame); + m_textEdit->setReadOnly(true); + layout->addWidget(m_textEdit); +} + +void HelpWindow::setHelp(const QString &topic) +{ + QLatin1String fileStr(":/trolltech/qhelpconverter/doc/%1.html"); + QFile f(QString(fileStr).arg(topic.toLower())); + f.open(QIODevice::ReadOnly); + QTextStream s(&f); + m_textEdit->setText(s.readAll()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/helpwindow.h b/src/assistant/qhelpconverter/helpwindow.h new file mode 100644 index 000000000..9a45f06e0 --- /dev/null +++ b/src/assistant/qhelpconverter/helpwindow.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPWINDOW_H +#define HELPWINDOW_H + +#include + +QT_BEGIN_NAMESPACE + +class QTextEdit; + +class HelpWindow : public QWidget +{ + Q_OBJECT + +public: + HelpWindow(QWidget *parent = 0); + void setHelp(const QString &topic); + +private: + QTextEdit *m_textEdit; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/identifierpage.cpp b/src/assistant/qhelpconverter/identifierpage.cpp new file mode 100644 index 000000000..fb8310a61 --- /dev/null +++ b/src/assistant/qhelpconverter/identifierpage.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "identifierpage.h" + +QT_BEGIN_NAMESPACE + +IdentifierPage::IdentifierPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Identifiers")); + setSubTitle(tr("This page allows you to create identifiers from " + "the keywords found in the .adp or .dcf file.")); + + m_ui.setupUi(this); + + connect(m_ui.identifierCheckBox, SIGNAL(toggled(bool)), + this, SLOT(setupButtons(bool))); + + registerField(QLatin1String("createIdentifier"), m_ui.identifierCheckBox); + registerField(QLatin1String("globalPrefix"), m_ui.prefixLineEdit); + registerField(QLatin1String("fileNamePrefix"), m_ui.fileNameButton); +} + +void IdentifierPage::setupButtons(bool checked) +{ + m_ui.globalButton->setEnabled(checked); + m_ui.fileNameButton->setEnabled(checked); + m_ui.prefixLineEdit->setEnabled(checked + && m_ui.globalButton->isChecked()); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/identifierpage.h b/src/assistant/qhelpconverter/identifierpage.h new file mode 100644 index 000000000..05de35ca9 --- /dev/null +++ b/src/assistant/qhelpconverter/identifierpage.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IDENTIFIERPAGE_H +#define IDENTIFIERPAGE_H + +#include +#include "ui_identifierpage.h" + +QT_BEGIN_NAMESPACE + +class IdentifierPage : public QWizardPage +{ + Q_OBJECT + +public: + IdentifierPage(QWidget *parent = 0); + +private slots: + void setupButtons(bool checked); + +private: + Ui::IdentifierPage m_ui; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/identifierpage.ui b/src/assistant/qhelpconverter/identifierpage.ui new file mode 100644 index 000000000..cd0df7563 --- /dev/null +++ b/src/assistant/qhelpconverter/identifierpage.ui @@ -0,0 +1,132 @@ + + IdentifierPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Create identifiers + + + + + + + Qt::Horizontal + + + + 161 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + false + + + Global prefix: + + + true + + + + + + + false + + + + + + + false + + + Inherit prefix from file names + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + + globalButton + toggled(bool) + prefixLineEdit + setEnabled(bool) + + + 122 + 72 + + + 161 + 71 + + + + + diff --git a/src/assistant/qhelpconverter/inputpage.cpp b/src/assistant/qhelpconverter/inputpage.cpp new file mode 100644 index 000000000..9abbbe74b --- /dev/null +++ b/src/assistant/qhelpconverter/inputpage.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "inputpage.h" +#include "adpreader.h" + +QT_BEGIN_NAMESPACE + +InputPage::InputPage(AdpReader *reader, QWidget *parent) + : QWizardPage(parent) +{ + m_adpReader = reader; + setTitle(tr("Input File")); + setSubTitle(tr("Specify the .adp or .dcf file you want " + "to convert to the new Qt help project format and/or " + "collection format.")); + + m_ui.setupUi(this); + connect(m_ui.browseButton, SIGNAL(clicked()), + this, SLOT(getFileName())); + + registerField(QLatin1String("adpFileName"), m_ui.fileLineEdit); +} + +void InputPage::getFileName() +{ + QString f = QFileDialog::getOpenFileName(this, tr("Open file"), QString(), + tr("Qt Help Files (*.adp *.dcf)")); + if (!f.isEmpty()) + m_ui.fileLineEdit->setText(f); +} + +bool InputPage::validatePage() +{ + QFile f(m_ui.fileLineEdit->text().trimmed()); + if (!f.exists() || !f.open(QIODevice::ReadOnly)) { + QMessageBox::critical(this, tr("File Open Error"), + tr("The specified file could not be opened!")); + return false; + } + + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + m_adpReader->readData(f.readAll()); + QApplication::restoreOverrideCursor(); + if (m_adpReader->hasError()) { + QMessageBox::critical(this, tr("File Parsing Error"), + tr("Parsing error in line %1!").arg(m_adpReader->lineNumber())); + return false; + } + + return true; +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/inputpage.h b/src/assistant/qhelpconverter/inputpage.h new file mode 100644 index 000000000..185b7b2b2 --- /dev/null +++ b/src/assistant/qhelpconverter/inputpage.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef INPUTPAGE_H +#define INPUTPAGE_H + +#include +#include "ui_inputpage.h" + +QT_BEGIN_NAMESPACE + +class AdpReader; + +class InputPage : public QWizardPage +{ + Q_OBJECT + +public: + explicit InputPage(AdpReader *reader, QWidget *parent = 0); + +private slots: + void getFileName(); + +private: + bool validatePage(); + + Ui::InputPage m_ui; + AdpReader *m_adpReader; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/inputpage.ui b/src/assistant/qhelpconverter/inputpage.ui new file mode 100644 index 000000000..e7cd3a0fa --- /dev/null +++ b/src/assistant/qhelpconverter/inputpage.ui @@ -0,0 +1,79 @@ + + InputPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + File name: + + + + + + + 0 + + + + + + + + ... + + + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + diff --git a/src/assistant/qhelpconverter/main.cpp b/src/assistant/qhelpconverter/main.cpp new file mode 100644 index 000000000..1c2d1bf12 --- /dev/null +++ b/src/assistant/qhelpconverter/main.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "conversionwizard.h" + +QT_USE_NAMESPACE + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTranslator translator; + QTranslator qtTranslator; + QTranslator qt_helpTranslator; + QString sysLocale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (translator.load(QLatin1String("assistant_") + sysLocale, resourceDir) + && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir) + && qt_helpTranslator.load(QLatin1String("qt_help_") + sysLocale, resourceDir)) { + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); + app.installTranslator(&qt_helpTranslator); + } + + ConversionWizard w; + if (argc == 2) { + QFileInfo fi(QString::fromLocal8Bit(argv[1])); + if (fi.exists()) + w.setAdpFileName(fi.absoluteFilePath()); + } + w.show(); + return app.exec(); +} + diff --git a/src/assistant/qhelpconverter/outputpage.cpp b/src/assistant/qhelpconverter/outputpage.cpp new file mode 100644 index 000000000..434357b34 --- /dev/null +++ b/src/assistant/qhelpconverter/outputpage.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +#include "outputpage.h" + +QT_BEGIN_NAMESPACE + +OutputPage::OutputPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Output File Names")); + setSubTitle(tr("Specify the file names for the output files.")); + setButtonText(QWizard::NextButton, tr("Convert...")); + + m_ui.setupUi(this); + connect(m_ui.projectLineEdit, SIGNAL(textChanged(QString)), + this, SIGNAL(completeChanged())); + connect(m_ui.collectionLineEdit, SIGNAL(textChanged(QString)), + this, SIGNAL(completeChanged())); + + registerField(QLatin1String("ProjectFileName"), + m_ui.projectLineEdit); + registerField(QLatin1String("CollectionFileName"), + m_ui.collectionLineEdit); +} + +void OutputPage::setPath(const QString &path) +{ + m_path = path; +} + +void OutputPage::setCollectionComponentEnabled(bool enabled) +{ + m_ui.collectionLineEdit->setEnabled(enabled); + m_ui.label_2->setEnabled(enabled); +} + +bool OutputPage::isComplete() const +{ + if (m_ui.projectLineEdit->text().isEmpty() + || m_ui.collectionLineEdit->text().isEmpty()) + return false; + return true; +} + +bool OutputPage::validatePage() +{ + return checkFile(m_ui.projectLineEdit->text(), + tr("Qt Help Project File")) + && checkFile(m_ui.collectionLineEdit->text(), + tr("Qt Help Collection Project File")); +} + +bool OutputPage::checkFile(const QString &fileName, const QString &title) +{ + QFile fi(m_path + QDir::separator() + fileName); + if (!fi.exists()) + return true; + + if (QMessageBox::warning(this, title, + tr("The specified file %1 already exist.\n\nDo you want to remove it?") + .arg(fileName), tr("Remove"), tr("Cancel")) == 0) { + return fi.remove(); + } + return false; +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/outputpage.h b/src/assistant/qhelpconverter/outputpage.h new file mode 100644 index 000000000..e45afae10 --- /dev/null +++ b/src/assistant/qhelpconverter/outputpage.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef OUTPUTPAGE_H +#define OUTPUTPAGE_H + +#include +#include "ui_outputpage.h" + +QT_BEGIN_NAMESPACE + +class OutputPage : public QWizardPage +{ + Q_OBJECT + +public: + OutputPage(QWidget *parent = 0); + void setPath(const QString &path); + void setCollectionComponentEnabled(bool enabled); + +private: + bool isComplete() const; + bool validatePage(); + bool checkFile(const QString &fileName, + const QString &title); + + Ui::OutputPage m_ui; + QString m_path; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/outputpage.ui b/src/assistant/qhelpconverter/outputpage.ui new file mode 100644 index 000000000..755f81808 --- /dev/null +++ b/src/assistant/qhelpconverter/outputpage.ui @@ -0,0 +1,95 @@ + + OutputPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + Project file name: + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Collection file name: + + + + + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + diff --git a/src/assistant/qhelpconverter/pathpage.cpp b/src/assistant/qhelpconverter/pathpage.cpp new file mode 100644 index 000000000..a9ddf53a5 --- /dev/null +++ b/src/assistant/qhelpconverter/pathpage.cpp @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "pathpage.h" + +QT_BEGIN_NAMESPACE + +PathPage::PathPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Source File Paths")); + setSubTitle(tr("Specify the paths where the sources files " + "are located. By default, all files in those directories " + "matched by the file filter will be included.")); + + m_ui.setupUi(this); + connect(m_ui.addButton, SIGNAL(clicked()), + this, SLOT(addPath())); + connect(m_ui.removeButton, SIGNAL(clicked()), + this, SLOT(removePath())); + + m_ui.filterLineEdit->setText(QLatin1String("*.html, *.htm, *.png, *.jpg, *.css")); + + registerField(QLatin1String("sourcePathList"), m_ui.pathListWidget); + m_firstTime = true; +} + +void PathPage::setPath(const QString &path) +{ + if (!m_firstTime) + return; + + m_ui.pathListWidget->addItem(path); + m_firstTime = false; + m_ui.pathListWidget->setCurrentRow(0); +} + +QStringList PathPage::paths() const +{ + QStringList lst; + for (int i = 0; icount(); ++i) + lst.append(m_ui.pathListWidget->item(i)->text()); + return lst; +} + +QStringList PathPage::filters() const +{ + QStringList lst; + foreach (const QString &s, m_ui.filterLineEdit->text().split(QLatin1Char(','))) { + lst.append(s.trimmed()); + } + return lst; +} + +void PathPage::addPath() +{ + QString dir = QFileDialog::getExistingDirectory(this, + tr("Source File Path")); + if (!dir.isEmpty()) + m_ui.pathListWidget->addItem(dir); +} + +void PathPage::removePath() +{ + QListWidgetItem *i = m_ui.pathListWidget + ->takeItem(m_ui.pathListWidget->currentRow()); + delete i; + if (!m_ui.pathListWidget->count()) + m_ui.removeButton->setEnabled(false); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/pathpage.h b/src/assistant/qhelpconverter/pathpage.h new file mode 100644 index 000000000..90b24236c --- /dev/null +++ b/src/assistant/qhelpconverter/pathpage.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef PATHPAGE_H +#define PATHPAGE_H + +#include +#include "ui_pathpage.h" + +QT_BEGIN_NAMESPACE + +class PathPage : public QWizardPage +{ + Q_OBJECT + +public: + PathPage(QWidget *parent = 0); + void setPath(const QString &path); + QStringList paths() const; + QStringList filters() const; + +private slots: + void addPath(); + void removePath(); + +private: + Ui::PathPage m_ui; + bool m_firstTime; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/pathpage.ui b/src/assistant/qhelpconverter/pathpage.ui new file mode 100644 index 000000000..89083915d --- /dev/null +++ b/src/assistant/qhelpconverter/pathpage.ui @@ -0,0 +1,114 @@ + + PathPage + + + + 0 + 0 + 417 + 243 + + + + Form + + + + + + + 0 + 0 + + + + File filters: + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Documentation source file paths: + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 51 + + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + diff --git a/src/assistant/qhelpconverter/qhcpwriter.cpp b/src/assistant/qhelpconverter/qhcpwriter.cpp new file mode 100644 index 000000000..cdf9f0b3c --- /dev/null +++ b/src/assistant/qhelpconverter/qhcpwriter.cpp @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qhcpwriter.h" + +QT_BEGIN_NAMESPACE + +QhcpWriter::QhcpWriter() +{ + setAutoFormatting(true); +} + +void QhcpWriter::setHelpProjectFile(const QString &qhpFile) +{ + m_qhpFile = qhpFile; +} + +void QhcpWriter::setProperties(const QMap props) +{ + m_properties = props; +} + +void QhcpWriter::setTitlePath(const QString &path) +{ + m_titlePath = path; +} + +bool QhcpWriter::writeFile(const QString &fileName) +{ + QFile out(fileName); + if (!out.open(QIODevice::WriteOnly)) + return false; + + setDevice(&out); + writeStartDocument(); + writeStartElement(QLatin1String("QHelpCollectionProject")); + writeAttribute(QLatin1String("version"), QLatin1String("1.0")); + writeAssistantSettings(); + writeDocuments(); + writeEndDocument(); + return true; +} + +void QhcpWriter::writeAssistantSettings() +{ + if (m_properties.isEmpty()) + return; + + writeStartElement(QLatin1String("assistant")); + + if (m_properties.contains(QLatin1String("title"))) + writeTextElement(QLatin1String("title"), m_properties.value(QLatin1String("title"))); + if (m_properties.contains(QLatin1String("applicationicon"))) + writeTextElement(QLatin1String("applicationIcon"), + m_properties.value(QLatin1String("applicationicon"))); + if (m_properties.contains(QLatin1String("startpage"))) + writeTextElement(QLatin1String("startPage"), m_titlePath + QLatin1String("/") + + m_properties.value(QLatin1String("startpage"))); + if (m_properties.contains(QLatin1String("aboutmenutext"))) { + writeStartElement(QLatin1String("aboutMenuText")); + writeTextElement(QLatin1String("text"), + m_properties.value(QLatin1String("aboutmenutext"))); + writeEndElement(); + } + if (m_properties.contains(QLatin1String("abouturl"))) { + writeStartElement(QLatin1String("aboutDialog")); + writeTextElement(QLatin1String("file"), m_properties.value(QLatin1String("abouturl"))); + writeEndElement(); + } + if (m_properties.contains(QLatin1String("name"))) { + writeTextElement(QLatin1String("cacheDirectory"), + QLatin1String(".") + m_properties.value(QLatin1String("name"))); + } + + writeEndElement(); +} + +void QhcpWriter::writeDocuments() +{ + if (m_qhpFile.isEmpty()) + return; + + QString out = m_qhpFile; + int i = out.indexOf(QLatin1Char('.')); + if (i > -1) + out = out.left(i); + out.append(QLatin1String(".qch")); + + writeStartElement(QLatin1String("docFiles")); + + writeStartElement(QLatin1String("generate")); + writeStartElement(QLatin1String("file")); + writeTextElement(QLatin1String("input"), m_qhpFile); + writeTextElement(QLatin1String("output"), out); + writeEndElement(); + writeEndElement(); + + writeStartElement(QLatin1String("register")); + writeTextElement(QLatin1String("file"), out); + writeEndElement(); + + writeEndElement(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/qhcpwriter.h b/src/assistant/qhelpconverter/qhcpwriter.h new file mode 100644 index 000000000..933d15a15 --- /dev/null +++ b/src/assistant/qhelpconverter/qhcpwriter.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHCPWRITER_H +#define QHCPWRITER_H + +#include +#include "adpreader.h" + +QT_BEGIN_NAMESPACE + +class QhcpWriter : public QXmlStreamWriter +{ +public: + QhcpWriter(); + bool writeFile(const QString &fileName); + void setHelpProjectFile(const QString &qhpFile); + void setProperties(const QMap props); + void setTitlePath(const QString &path); + +private: + void writeAssistantSettings(); + void writeDocuments(); + + QString m_qhpFile; + QMap m_properties; + QString m_titlePath; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpconverter/qhelpconverter.pro b/src/assistant/qhelpconverter/qhelpconverter.pro new file mode 100644 index 000000000..712b16f61 --- /dev/null +++ b/src/assistant/qhelpconverter/qhelpconverter.pro @@ -0,0 +1,47 @@ +QT += help +TEMPLATE = app +TARGET = qhelpconverter +DESTDIR = $$QT.designer.bins +CONFIG += qt warn_on help + +target.path=$$[QT_INSTALL_BINS] +INSTALLS += target + +SOURCES += conversionwizard.cpp \ + inputpage.cpp \ + generalpage.cpp \ + filterpage.cpp \ + identifierpage.cpp \ + pathpage.cpp \ + filespage.cpp \ + outputpage.cpp \ + finishpage.cpp \ + adpreader.cpp \ + qhpwriter.cpp \ + qhcpwriter.cpp \ + helpwindow.cpp \ + main.cpp + +HEADERS += conversionwizard.h \ + inputpage.h \ + generalpage.h \ + filterpage.h \ + identifierpage.h \ + pathpage.h \ + filespage.h \ + outputpage.h \ + finishpage.h \ + adpreader.h \ + qhcpwriter.h \ + qhpwriter.h \ + helpwindow.h + +FORMS += inputpage.ui \ + generalpage.ui \ + filterpage.ui \ + identifierpage.ui \ + pathpage.ui \ + filespage.ui \ + outputpage.ui + +RESOURCES += qhelpconverter.qrc diff --git a/src/assistant/qhelpconverter/qhelpconverter.qrc b/src/assistant/qhelpconverter/qhelpconverter.qrc new file mode 100644 index 000000000..e2a68ab43 --- /dev/null +++ b/src/assistant/qhelpconverter/qhelpconverter.qrc @@ -0,0 +1,13 @@ + + + assistant-128.png + assistant.png + doc/inputpage.html + doc/generalpage.html + doc/filterpage.html + doc/identifierpage.html + doc/pathpage.html + doc/filespage.html + doc/outputpage.html + + diff --git a/src/assistant/qhelpconverter/qhpwriter.cpp b/src/assistant/qhelpconverter/qhpwriter.cpp new file mode 100644 index 000000000..51d392d32 --- /dev/null +++ b/src/assistant/qhelpconverter/qhpwriter.cpp @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "qhpwriter.h" +#include "adpreader.h" + +QT_BEGIN_NAMESPACE + +QhpWriter::QhpWriter(const QString &namespaceName, + const QString &virtualFolder) +{ + m_namespaceName = namespaceName; + m_virtualFolder = virtualFolder; + setAutoFormatting(true); +} + +void QhpWriter::setAdpReader(AdpReader *reader) +{ + m_adpReader = reader; +} + +void QhpWriter::setFilterAttributes(const QStringList &attributes) +{ + m_filterAttributes = attributes; +} + +void QhpWriter::setCustomFilters(const QList filters) +{ + m_customFilters = filters; +} + +void QhpWriter::setFiles(const QStringList &files) +{ + m_files = files; +} + +void QhpWriter::generateIdentifiers(IdentifierPrefix prefix, + const QString prefixString) +{ + m_prefix = prefix; + m_prefixString = prefixString; +} + +bool QhpWriter::writeFile(const QString &fileName) +{ + QFile out(fileName); + if (!out.open(QIODevice::WriteOnly)) + return false; + + setDevice(&out); + writeStartDocument(); + writeStartElement(QLatin1String("QtHelpProject")); + writeAttribute(QLatin1String("version"), QLatin1String("1.0")); + writeTextElement(QLatin1String("namespace"), m_namespaceName); + writeTextElement(QLatin1String("virtualFolder"), m_virtualFolder); + writeCustomFilters(); + writeFilterSection(); + writeEndDocument(); + + out.close(); + return true; +} + +void QhpWriter::writeCustomFilters() +{ + if (!m_customFilters.count()) + return; + + foreach (const CustomFilter &f, m_customFilters) { + writeStartElement(QLatin1String("customFilter")); + writeAttribute(QLatin1String("name"), f.name); + foreach (const QString &a, f.filterAttributes) + writeTextElement(QLatin1String("filterAttribute"), a); + writeEndElement(); + } +} + +void QhpWriter::writeFilterSection() +{ + writeStartElement(QLatin1String("filterSection")); + foreach (const QString &a, m_filterAttributes) + writeTextElement(QLatin1String("filterAttribute"), a); + + writeToc(); + writeKeywords(); + writeFiles(); + writeEndElement(); +} + +void QhpWriter::writeToc() +{ + QList lst = m_adpReader->contents(); + if (lst.isEmpty()) + return; + + int depth = -1; + writeStartElement(QLatin1String("toc")); + foreach (const ContentItem &i, lst) { + while (depth-- >= i.depth) + writeEndElement(); + writeStartElement(QLatin1String("section")); + writeAttribute(QLatin1String("title"), i.title); + writeAttribute(QLatin1String("ref"), i.reference); + depth = i.depth; + } + while (depth-- >= -1) + writeEndElement(); +} + +void QhpWriter::writeKeywords() +{ + QList lst = m_adpReader->keywords(); + if (lst.isEmpty()) + return; + + writeStartElement(QLatin1String("keywords")); + foreach (const KeywordItem &i, lst) { + writeEmptyElement(QLatin1String("keyword")); + writeAttribute(QLatin1String("name"), i.keyword); + writeAttribute(QLatin1String("ref"), i.reference); + if (m_prefix == FilePrefix) { + QString str = i.reference.mid( + i.reference.lastIndexOf(QLatin1Char('/'))+1); + str = str.left(str.lastIndexOf(QLatin1Char('.'))); + writeAttribute(QLatin1String("id"), str + QLatin1String("::") + i.keyword); + } else if (m_prefix == GlobalPrefix) { + writeAttribute(QLatin1String("id"), m_prefixString + i.keyword); + } + } + writeEndElement(); +} + +void QhpWriter::writeFiles() +{ + if (m_files.isEmpty()) + return; + + writeStartElement(QLatin1String("files")); + foreach (const QString &f, m_files) + writeTextElement(QLatin1String("file"), f); + writeEndElement(); +} + +QT_END_NAMESPACE diff --git a/src/assistant/qhelpconverter/qhpwriter.h b/src/assistant/qhelpconverter/qhpwriter.h new file mode 100644 index 000000000..c118d4c9f --- /dev/null +++ b/src/assistant/qhelpconverter/qhpwriter.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QHPWRITER_H +#define QHPWRITER_H + +#include +#include "filterpage.h" + +QT_BEGIN_NAMESPACE + +class AdpReader; + +class QhpWriter : public QXmlStreamWriter +{ +public: + enum IdentifierPrefix {SkipAll, FilePrefix, GlobalPrefix}; + QhpWriter(const QString &namespaceName, + const QString &virtualFolder); + void setAdpReader(AdpReader *reader); + void setFilterAttributes(const QStringList &attributes); + void setCustomFilters(const QList filters); + void setFiles(const QStringList &files); + void generateIdentifiers(IdentifierPrefix prefix, + const QString prefixString = QString()); + bool writeFile(const QString &fileName); + +private: + void writeCustomFilters(); + void writeFilterSection(); + void writeToc(); + void writeKeywords(); + void writeFiles(); + + QString m_namespaceName; + QString m_virtualFolder; + AdpReader *m_adpReader; + QStringList m_filterAttributes; + QList m_customFilters; + QStringList m_files; + IdentifierPrefix m_prefix; + QString m_prefixString; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/qhelpgenerator/main.cpp b/src/assistant/qhelpgenerator/main.cpp new file mode 100644 index 000000000..386e84c41 --- /dev/null +++ b/src/assistant/qhelpgenerator/main.cpp @@ -0,0 +1,178 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../shared/helpgenerator.h" + +#include +#include +#include +#include +#include +#include + +#include + +QT_USE_NAMESPACE + +class QHG { + Q_DECLARE_TR_FUNCTIONS(QHelpGenerator) +}; + +int main(int argc, char *argv[]) +{ + QString error; + QString arg; + QString compressedFile; + QString projectFile; + QString basePath; + bool showHelp = false; + bool showVersion = false; + bool checkLinks = false; + + QCoreApplication app(argc, argv); +#ifndef Q_OS_WIN32 + QTranslator translator; + QTranslator qtTranslator; + QTranslator qt_helpTranslator; + QString sysLocale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (translator.load(QLatin1String("assistant_") + sysLocale, resourceDir) + && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir) + && qt_helpTranslator.load(QLatin1String("qt_help_") + sysLocale, resourceDir)) { + app.installTranslator(&translator); + app.installTranslator(&qtTranslator); + app.installTranslator(&qt_helpTranslator); + } +#endif // Q_OS_WIN32 + + for (int i = 1; i < argc; ++i) { + arg = QString::fromLocal8Bit(argv[i]); + if (arg == QLatin1String("-o")) { + if (++i < argc) { + QFileInfo fi(QString::fromLocal8Bit(argv[i])); + compressedFile = fi.absoluteFilePath(); + } else { + error = QHG::tr("Missing output file name."); + } + } else if (arg == QLatin1String("-v")) { + showVersion = true; + } else if (arg == QLatin1String("-h")) { + showHelp = true; + } else if (arg == QLatin1String("-c")) { + checkLinks = true; + } else { + QFileInfo fi(arg); + projectFile = fi.absoluteFilePath(); + basePath = fi.absolutePath(); + } + } + + if (showVersion) { + fputs(qPrintable(QHG::tr("Qt Help Generator version 1.0 (Qt %1)\n") + .arg(QT_VERSION_STR)), stdout); + return 0; + } + + if (projectFile.isEmpty() && !showHelp) + error = QHG::tr("Missing Qt help project file."); + + QString help = QHG::tr("\nUsage:\n\n" + "qhelpgenerator [options]\n\n" + " -o Generates a Qt compressed help\n" + " file called .\n" + " If this option is not specified\n" + " a default name will be used.\n" + " -c Checks whether all links in HTML files\n" + " point to files in this help project.\n" + " -v Displays the version of \n" + " qhelpgenerator.\n\n"); + + if (showHelp) { + fputs(qPrintable(help), stdout); + return 0; + }else if (!error.isEmpty()) { + fprintf(stderr, "%s\n\n%s", qPrintable(error), qPrintable(help)); + return -1; + } + + QFile file(projectFile); + if (!file.open(QIODevice::ReadOnly)) { + fputs(qPrintable(QHG::tr("Could not open %1.\n").arg(projectFile)), stderr); + return -1; + } + + if (compressedFile.isEmpty()) { + if (!checkLinks) { + QFileInfo fi(projectFile); + compressedFile = basePath + QDir::separator() + + fi.baseName() + QLatin1String(".qch"); + } + } else { + // check if the output dir exists -- create if it doesn't + QFileInfo fi(compressedFile); + QDir parentDir = fi.dir(); + if (!parentDir.exists()) { + if (!parentDir.mkpath(QLatin1String("."))) { + fputs(qPrintable(QHG::tr("Could not create output directory: %1\n") + .arg(parentDir.path())), stderr); + } + } + } + + QHelpProjectData *helpData = new QHelpProjectData(); + if (!helpData->readData(projectFile)) { + fprintf(stderr, "%s\n", qPrintable(helpData->errorMessage())); + return -1; + } + + HelpGenerator generator; + bool success = true; + if (checkLinks) + success = generator.checkLinks(*helpData); + if (success && !compressedFile.isEmpty()) + success = generator.generate(helpData, compressedFile); + delete helpData; + if (!success) { + fprintf(stderr, "%s\n", qPrintable(generator.error())); + return -1; + } + return 0; +} diff --git a/src/assistant/qhelpgenerator/qhelpgenerator.pro b/src/assistant/qhelpgenerator/qhelpgenerator.pro new file mode 100644 index 000000000..f6db4fa11 --- /dev/null +++ b/src/assistant/qhelpgenerator/qhelpgenerator.pro @@ -0,0 +1,14 @@ +TEMPLATE = app +TARGET = qhelpgenerator +DESTDIR = $$QT.designer.bins +CONFIG += qt warn_on help console +CONFIG -= app_bundle +QT += network help-private + +target.path=$$[QT_INSTALL_BINS] +INSTALLS += target + +SOURCES += ../shared/helpgenerator.cpp \ + main.cpp + +HEADERS += ../shared/helpgenerator.h diff --git a/src/assistant/shared/collectionconfiguration.cpp b/src/assistant/shared/collectionconfiguration.cpp new file mode 100644 index 000000000..35d5b66df --- /dev/null +++ b/src/assistant/shared/collectionconfiguration.cpp @@ -0,0 +1,327 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "collectionconfiguration.h" + +#include + +QT_BEGIN_NAMESPACE + +namespace { + const QString AboutIconKey(QLatin1String("AboutIcon")); + const QString AboutImagesKey(QLatin1String("AboutImages")); + const QString AboutMenuTextsKey(QLatin1String("AboutMenuTexts")); + const QString AboutTextsKey(QLatin1String("AboutTexts")); + const QString ApplicationIconKey(QLatin1String("ApplicationIcon")); + const QString CacheDirKey(QLatin1String("CacheDirectory")); + const QString CacheDirRelativeToCollectionKey(QLatin1String("CacheDirRelativeToCollection")); + const QString CreationTimeKey(QLatin1String("CreationTime")); + const QString DefaultHomePageKey(QLatin1String("defaultHomepage")); + const QString EnableAddressBarKey(QLatin1String("EnableAddressBar")); + const QString EnableDocManagerKey(QLatin1String("EnableDocumentationManager")); + const QString EnableFilterKey(QLatin1String("EnableFilterFunctionality")); + const QString HideAddressBarKey(QLatin1String("HideAddressBar")); + const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); + const QString LastPageKey(QLatin1String("LastTabPage")); + const QString LastRegisterTime(QLatin1String("LastRegisterTime")); + const QString LastShownPagesKey(QLatin1String("LastShownPages")); + const QString LastZoomFactorsKey(QLatin1String( +#if !defined(QT_NO_WEBKIT) + "LastPagesZoomWebView" +#else + "LastPagesZoomTextBrowser" +#endif + )); + const QString WindowTitleKey(QLatin1String("WindowTitle")); + const QString FullTextSearchFallbackKey(QLatin1String("FullTextSearchFallback")); +} // anonymous namespace + +const QString CollectionConfiguration::DefaultZoomFactor(QLatin1String("0.0")); +const QString CollectionConfiguration::ListSeparator(QLatin1String("|")); + +uint CollectionConfiguration::creationTime(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CreationTimeKey, 0).toUInt(); +} + +void CollectionConfiguration::setCreationTime(QHelpEngineCore &helpEngine, uint time) +{ + helpEngine.setCustomValue(CreationTimeKey, time); +} + +const QString CollectionConfiguration::windowTitle(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(WindowTitleKey).toString(); +} + +void CollectionConfiguration::setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle) +{ + helpEngine.setCustomValue(WindowTitleKey, windowTitle); +} + +bool CollectionConfiguration::filterFunctionalityEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableFilterKey, true).toBool(); +} + +void CollectionConfiguration::setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableFilterKey, enabled); +} + +bool CollectionConfiguration::filterToolbarVisible(const QHelpEngineCore &helpEngine) +{ + return !helpEngine.customValue(FilterToolbarHiddenKey, true).toBool(); +} + +void CollectionConfiguration::setFilterToolbarVisible(QHelpEngineCore &helpEngine, + bool visible) +{ + helpEngine.setCustomValue(FilterToolbarHiddenKey, !visible); +} + +bool CollectionConfiguration::addressBarEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableAddressBarKey, true).toBool(); +} + +void CollectionConfiguration::setAddressBarEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableAddressBarKey, enabled); +} + +bool CollectionConfiguration::addressBarVisible(const QHelpEngineCore &helpEngine) +{ + return !helpEngine.customValue(HideAddressBarKey, true).toBool(); +} + +void CollectionConfiguration::setAddressBarVisible(QHelpEngineCore &helpEngine, + bool visible) +{ + helpEngine.setCustomValue(HideAddressBarKey, !visible); +} + +const QString CollectionConfiguration::cacheDir(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirKey).toString(); +} + +bool CollectionConfiguration::cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirRelativeToCollectionKey).toBool(); +} + +void CollectionConfiguration::setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection) +{ + helpEngine.setCustomValue(CacheDirKey, cacheDir); + helpEngine.setCustomValue(CacheDirRelativeToCollectionKey, + relativeToCollection); +} + +bool CollectionConfiguration::documentationManagerEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableDocManagerKey, true).toBool(); +} + +void CollectionConfiguration::setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableDocManagerKey, enabled); +} + +const QByteArray CollectionConfiguration::applicationIcon(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(ApplicationIconKey).toByteArray(); +} + +void CollectionConfiguration::setApplicationIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon) +{ + helpEngine.setCustomValue(ApplicationIconKey, icon); +} + +const QByteArray CollectionConfiguration::aboutMenuTexts(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutMenuTextsKey).toByteArray(); +} + +void CollectionConfiguration::setAboutMenuTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts) +{ + helpEngine.setCustomValue(AboutMenuTextsKey, texts); +} + +const QByteArray CollectionConfiguration::aboutIcon(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutIconKey).toByteArray(); +} + +void CollectionConfiguration::setAboutIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon) +{ + helpEngine.setCustomValue(AboutIconKey, icon); +} + +const QByteArray CollectionConfiguration::aboutTexts(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutTextsKey).toByteArray(); +} + +void CollectionConfiguration::setAboutTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts) +{ + helpEngine.setCustomValue(AboutTextsKey, texts); +} + +const QByteArray CollectionConfiguration::aboutImages(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutImagesKey).toByteArray(); +} + +void CollectionConfiguration::setAboutImages(QHelpEngineCore &helpEngine, + const QByteArray &images) +{ + helpEngine.setCustomValue(AboutImagesKey, images); +} + +const QString CollectionConfiguration::defaultHomePage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(DefaultHomePageKey, QLatin1String("help")). + toString(); +} + +void CollectionConfiguration::setDefaultHomePage(QHelpEngineCore &helpEngine, + const QString &page) +{ + helpEngine.setCustomValue(DefaultHomePageKey, page); +} + +const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastShownPagesKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); +} + +void CollectionConfiguration::setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages) +{ + helpEngine.setCustomValue(LastShownPagesKey, + lastShownPages.join(ListSeparator)); +} + +const QStringList CollectionConfiguration::lastZoomFactors(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastZoomFactorsKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); +} + +void CollectionConfiguration::setLastZoomFactors(QHelpEngineCore &helpEngine, + const QStringList &lastZoomFactors) +{ + helpEngine.setCustomValue(LastZoomFactorsKey, + lastZoomFactors.join(ListSeparator)); +} + +int CollectionConfiguration::lastTabPage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastPageKey, 1).toInt(); +} + +void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, + int lastPage) +{ + helpEngine.setCustomValue(LastPageKey, lastPage); +} + +const QDateTime CollectionConfiguration::lastRegisterTime(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastRegisterTime, QDateTime()).toDateTime(); +} + +void CollectionConfiguration::updateLastRegisterTime(QHelpEngineCore &helpEngine) +{ + helpEngine.setCustomValue(LastRegisterTime, QDateTime::currentDateTime()); +} + +bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer, + const QHelpEngineCore &older) +{ + return creationTime(newer) > creationTime(older); +} + +void CollectionConfiguration::copyConfiguration(const QHelpEngineCore &source, + QHelpEngineCore &target) +{ + setCreationTime(target, creationTime(source)); + setWindowTitle(target, windowTitle(source)); + target.setCurrentFilter(source.currentFilter()); + setCacheDir(target, cacheDir(source), cacheDirIsRelativeToCollection(source)); + setFilterFunctionalityEnabled(target, filterFunctionalityEnabled(source)); + setFilterToolbarVisible(target, filterToolbarVisible(source)); + setAddressBarEnabled(target, addressBarEnabled(source)); + setAddressBarVisible(target, addressBarVisible(source)); + setDocumentationManagerEnabled(target, documentationManagerEnabled(source)); + setApplicationIcon(target, applicationIcon(source)); + setAboutMenuTexts(target, aboutMenuTexts(source)); + setAboutIcon(target, aboutIcon(source)); + setAboutTexts(target, aboutTexts(source)); + setAboutImages(target, aboutImages(source)); + setDefaultHomePage(target, defaultHomePage(source)); + setFullTextSearchFallbackEnabled(target, fullTextSearchFallbackEnabled(source)); +} + +bool CollectionConfiguration:: fullTextSearchFallbackEnabled( + const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(FullTextSearchFallbackKey, false).toBool(); +} + +void CollectionConfiguration::setFullTextSearchFallbackEnabled( + QHelpEngineCore &helpEngine, bool on) +{ + helpEngine.setCustomValue(FullTextSearchFallbackKey, on); +} + +QT_END_NAMESPACE diff --git a/src/assistant/shared/collectionconfiguration.h b/src/assistant/shared/collectionconfiguration.h new file mode 100644 index 000000000..226460ef3 --- /dev/null +++ b/src/assistant/shared/collectionconfiguration.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef COLLECTIONCONFIGURATION_H +#define COLLECTIONCONFIGURATION_H + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpEngineCore; + +class CollectionConfiguration +{ +public: + static const QString windowTitle(const QHelpEngineCore &helpEngine); + static void setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle); + + static const QString cacheDir(const QHelpEngineCore &helpEngine); + static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine); + static void setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection); + + static uint creationTime(const QHelpEngineCore &helpEngine); + static void setCreationTime(QHelpEngineCore &helpEngine, uint time); + + static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine); + static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, + bool enabled); + + static bool filterToolbarVisible(const QHelpEngineCore &helpEngine); + static void setFilterToolbarVisible(QHelpEngineCore &helpEngine, + bool visible); + + static bool addressBarEnabled(const QHelpEngineCore &helpEngine); + static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled); + + static bool addressBarVisible(const QHelpEngineCore &helpEngine); + static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible); + + + static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine); + static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, + bool enabled); + + static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine); + static void setApplicationIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon); + + // TODO: Encapsulate encoding from/to QByteArray here + static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine); + static void setAboutMenuTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts); + + static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine); + static void setAboutIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon); + + // TODO: Encapsulate encoding from/to QByteArray here + static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine); + static void setAboutTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts); + + static const QByteArray aboutImages(const QHelpEngineCore &helpEngine); + static void setAboutImages(QHelpEngineCore &helpEngine, + const QByteArray &images); + + static const QString defaultHomePage(const QHelpEngineCore &helpEngine); + static void setDefaultHomePage(QHelpEngineCore &helpEngine, + const QString &page); + + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); + static void setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages); + static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); + static void setLastZoomFactors(QHelpEngineCore &helPEngine, + const QStringList &lastZoomFactors); + + static int lastTabPage(const QHelpEngineCore &helpEngine); + static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); + + static bool isNewer(const QHelpEngineCore &newer, + const QHelpEngineCore &older); + static void copyConfiguration(const QHelpEngineCore &source, + QHelpEngineCore &target); + + /* + * Note that this only reflects register actions caused by the + * "-register" command line switch, not GUI or remote control actions. + */ + static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine); + static void updateLastRegisterTime(QHelpEngineCore &helpEngine); + + static bool fullTextSearchFallbackEnabled(const QHelpEngineCore &helpEngine); + static void setFullTextSearchFallbackEnabled(QHelpEngineCore &helpEngine, + bool on); + + static const QString DefaultZoomFactor; + static const QString ListSeparator; +}; + +QT_END_NAMESPACE + +#endif // COLLECTIONCONFIGURATION_H diff --git a/src/assistant/shared/helpgenerator.cpp b/src/assistant/shared/helpgenerator.cpp new file mode 100644 index 000000000..d551548fb --- /dev/null +++ b/src/assistant/shared/helpgenerator.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "helpgenerator.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +HelpGenerator::HelpGenerator() +{ + generator = new QHelpGenerator(this); + connect(generator, SIGNAL(statusChanged(QString)), + this, SLOT(printStatus(QString))); + connect(generator, SIGNAL(warning(QString)), + this, SLOT(printWarning(QString))); +} + +bool HelpGenerator::generate(QHelpDataInterface *helpData, + const QString &outputFileName) +{ + return generator->generate(helpData, outputFileName); +} + +bool HelpGenerator::checkLinks(const QHelpDataInterface &helpData) +{ + return generator->checkLinks(helpData); +} + +QString HelpGenerator::error() const +{ + return generator->error(); +} + +void HelpGenerator::printStatus(const QString &msg) +{ + puts(qPrintable(msg)); +} + +void HelpGenerator::printWarning(const QString &msg) +{ + puts(qPrintable(tr("Warning: %1").arg(msg))); +} + +QT_END_NAMESPACE diff --git a/src/assistant/shared/helpgenerator.h b/src/assistant/shared/helpgenerator.h new file mode 100644 index 000000000..e220a2b68 --- /dev/null +++ b/src/assistant/shared/helpgenerator.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPGENERATOR_H +#define HELPGENERATOR_H + +#include + +QT_BEGIN_NAMESPACE + +class QHelpDataInterface; +class QHelpGenerator; + +class HelpGenerator : public QObject +{ + Q_OBJECT + +public: + HelpGenerator(); + bool generate(QHelpDataInterface *helpData, + const QString &outputFileName); + bool checkLinks(const QHelpDataInterface &helpData); + QString error() const; + +private slots: + void printStatus(const QString &msg); + void printWarning(const QString &msg); + +private: + QHelpGenerator *generator; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/assistant/tools/assistant/Info_mac.plist b/src/assistant/tools/assistant/Info_mac.plist deleted file mode 100644 index 76369a1c5..000000000 --- a/src/assistant/tools/assistant/Info_mac.plist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - CFBundleIconFile - @ICON@ - CFBundlePackageType - APPL - CFBundleGetInfoString - Created by Qt/QMake - CFBundleSignature - ???? - CFBundleIdentifier - com.trolltech.assistant - CFBundleExecutable - @EXECUTABLE@ - - diff --git a/src/assistant/tools/assistant/aboutdialog.cpp b/src/assistant/tools/assistant/aboutdialog.cpp deleted file mode 100644 index d306812bb..000000000 --- a/src/assistant/tools/assistant/aboutdialog.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "aboutdialog.h" - -#include "helpviewer.h" -#include "tracer.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -AboutLabel::AboutLabel(QWidget *parent) - : QTextBrowser(parent) -{ - TRACE_OBJ - setFrameStyle(QFrame::NoFrame); - QPalette p; - p.setColor(QPalette::Base, p.color(QPalette::Background)); - setPalette(p); -} - -void AboutLabel::setText(const QString &text, const QByteArray &resources) -{ - TRACE_OBJ - QDataStream in(resources); - in >> m_resourceMap; - - QTextBrowser::setText(text); -} - -QSize AboutLabel::minimumSizeHint() const -{ - TRACE_OBJ - QTextDocument *doc = document(); - doc->adjustSize(); - return QSize(int(doc->size().width()), int(doc->size().height())); -} - -QVariant AboutLabel::loadResource(int type, const QUrl &name) -{ - TRACE_OBJ - if (type == 2 || type == 3) { - if (m_resourceMap.contains(name.toString())) { - return m_resourceMap.value(name.toString()); - } - } - return QVariant(); -} - -void AboutLabel::setSource(const QUrl &url) -{ - TRACE_OBJ - if (url.isValid() && (!HelpViewer::isLocalUrl(url) - || !HelpViewer::canOpenPage(url.path()))) { - if (!QDesktopServices::openUrl(url)) { - QMessageBox::warning(this, tr("Warning"), - tr("Unable to launch external application.\n"), tr("OK")); - } - } -} - -AboutDialog::AboutDialog(QWidget *parent) - : QDialog(parent, Qt::MSWindowsFixedSizeDialogHint | - Qt::WindowTitleHint|Qt::WindowSystemMenuHint) -{ - TRACE_OBJ - m_pixmapLabel = 0; - m_aboutLabel = new AboutLabel(); - - m_closeButton = new QPushButton(); - m_closeButton->setText(tr("&Close")); - connect(m_closeButton, SIGNAL(clicked()), this, SLOT(close())); - - m_layout = new QGridLayout(this); - m_layout->addWidget(m_aboutLabel, 1, 0, 1, -1); - m_layout->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum, - QSizePolicy::Fixed), 2, 1, 1, 1); - m_layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding), 3, 0, 1, 1); - m_layout->addWidget(m_closeButton, 3, 1, 1, 1); - m_layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding), 3, 2, 1, 1); -} - -void AboutDialog::setText(const QString &text, const QByteArray &resources) -{ - TRACE_OBJ - m_aboutLabel->setText(text, resources); - updateSize(); -} - -void AboutDialog::setPixmap(const QPixmap &pixmap) -{ - TRACE_OBJ - if (!m_pixmapLabel) { - m_pixmapLabel = new QLabel(); - m_layout->addWidget(m_pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter); - } - m_pixmapLabel->setPixmap(pixmap); - updateSize(); -} - -QString AboutDialog::documentTitle() const -{ - TRACE_OBJ - return m_aboutLabel->documentTitle(); -} - -void AboutDialog::updateSize() -{ - TRACE_OBJ - QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()) - .size(); - int limit = qMin(screenSize.width()/2, 500); - -#ifdef Q_WS_MAC - limit = qMin(screenSize.width()/2, 420); -#endif - - layout()->activate(); - int width = layout()->totalMinimumSize().width(); - - if (width > limit) - width = limit; - - QFontMetrics fm(qApp->font("QWorkspaceTitleBar")); - int windowTitleWidth = qMin(fm.width(windowTitle()) + 50, limit); - if (windowTitleWidth > width) - width = windowTitleWidth; - - layout()->activate(); - int height = (layout()->hasHeightForWidth()) - ? layout()->totalHeightForWidth(width) - : layout()->totalMinimumSize().height(); - setFixedSize(width, height); - QCoreApplication::removePostedEvents(this, QEvent::LayoutRequest); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/aboutdialog.h b/src/assistant/tools/assistant/aboutdialog.h deleted file mode 100644 index 70b315714..000000000 --- a/src/assistant/tools/assistant/aboutdialog.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QLabel; -class QPushButton; -class QGridLayout; - -class AboutLabel : public QTextBrowser -{ - Q_OBJECT - -public: - AboutLabel(QWidget *parent = 0); - void setText(const QString &text, const QByteArray &resources); - QSize minimumSizeHint() const; - -private: - QVariant loadResource(int type, const QUrl &name); - void setSource(const QUrl &url); - - QMap m_resourceMap; -}; - -class AboutDialog : public QDialog -{ - Q_OBJECT - -public: - AboutDialog(QWidget *parent = 0); - void setText(const QString &text, const QByteArray &resources); - void setPixmap(const QPixmap &pixmap); - QString documentTitle() const; - -private: - void updateSize(); - - QLabel *m_pixmapLabel; - AboutLabel *m_aboutLabel; - QPushButton *m_closeButton; - QGridLayout *m_layout; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/assistant/assistant.icns b/src/assistant/tools/assistant/assistant.icns deleted file mode 100644 index 6291dd397..000000000 Binary files a/src/assistant/tools/assistant/assistant.icns and /dev/null differ diff --git a/src/assistant/tools/assistant/assistant.ico b/src/assistant/tools/assistant/assistant.ico deleted file mode 100644 index 9e1b83f1b..000000000 Binary files a/src/assistant/tools/assistant/assistant.ico and /dev/null differ diff --git a/src/assistant/tools/assistant/assistant.pro b/src/assistant/tools/assistant/assistant.pro deleted file mode 100644 index dc8928bad..000000000 --- a/src/assistant/tools/assistant/assistant.pro +++ /dev/null @@ -1,121 +0,0 @@ -include(../../../shared/fontpanel/fontpanel.pri) -TEMPLATE = app -LANGUAGE = C++ -TARGET = assistant -!isEmpty(QT.webkit.name) { - QT += webkit -} else { - DEFINES += QT_NO_WEBKIT -} -CONFIG += qt \ - warn_on \ - help -QT += widgets network help -PROJECTNAME = Assistant -DESTDIR = $$QT.designer.bins -target.path = $$[QT_INSTALL_BINS] -INSTALLS += target -DEPENDPATH += ../shared -INCLUDEPATH += $$QT.help.includes - -# ## Work around a qmake issue when statically linking to -# ## not-yet-installed plugins -QMAKE_LIBDIR += $$QT_BUILD_TREE/plugins/sqldrivers -HEADERS += aboutdialog.h \ - bookmarkdialog.h \ - bookmarkfiltermodel.h \ - bookmarkitem.h \ - bookmarkmanager.h \ - bookmarkmanagerwidget.h \ - bookmarkmodel.h \ - centralwidget.h \ - cmdlineparser.h \ - contentwindow.h \ - findwidget.h \ - filternamedialog.h \ - helpenginewrapper.h \ - helpviewer.h \ - helpviewer_p.h \ - indexwindow.h \ - installdialog.h \ - mainwindow.h \ - preferencesdialog.h \ - qtdocinstaller.h \ - remotecontrol.h \ - searchwidget.h \ - topicchooser.h \ - tracer.h \ - xbelsupport.h \ - ../shared/collectionconfiguration.h \ - openpagesmodel.h \ - globalactions.h \ - openpageswidget.h \ - openpagesmanager.h \ - openpagesswitcher.h -win32:HEADERS += remotecontrol_win.h - -SOURCES += aboutdialog.cpp \ - bookmarkdialog.cpp \ - bookmarkfiltermodel.cpp \ - bookmarkitem.cpp \ - bookmarkmanager.cpp \ - bookmarkmanagerwidget.cpp \ - bookmarkmodel.cpp \ - centralwidget.cpp \ - cmdlineparser.cpp \ - contentwindow.cpp \ - findwidget.cpp \ - filternamedialog.cpp \ - helpenginewrapper.cpp \ - helpviewer.cpp \ - indexwindow.cpp \ - installdialog.cpp \ - main.cpp \ - mainwindow.cpp \ - preferencesdialog.cpp \ - qtdocinstaller.cpp \ - remotecontrol.cpp \ - searchwidget.cpp \ - topicchooser.cpp \ - xbelsupport.cpp \ - ../shared/collectionconfiguration.cpp \ - openpagesmodel.cpp \ - globalactions.cpp \ - openpageswidget.cpp \ - openpagesmanager.cpp \ - openpagesswitcher.cpp -contains(QT_CONFIG, webkit) { - SOURCES += helpviewer_qwv.cpp -} else { - SOURCES += helpviewer_qtb.cpp -} - -FORMS += bookmarkdialog.ui \ - bookmarkmanagerwidget.ui \ - bookmarkwidget.ui \ - filternamedialog.ui \ - installdialog.ui \ - preferencesdialog.ui \ - topicchooser.ui - -RESOURCES += assistant.qrc \ - assistant_images.qrc - -win32 { - !wince*:LIBS += -lshell32 - RC_FILE = assistant.rc -} - -mac { - ICON = assistant.icns - TARGET = Assistant - QMAKE_INFO_PLIST = Info_mac.plist -} - -contains(CONFIG, static): { - SQLPLUGINS = $$unique(sql-plugins) - contains(SQLPLUGINS, sqlite): { - QTPLUGIN += qsqlite - DEFINES += USE_STATIC_SQLITE_PLUGIN - } -} diff --git a/src/assistant/tools/assistant/assistant.qch b/src/assistant/tools/assistant/assistant.qch deleted file mode 100644 index e6d52997b..000000000 Binary files a/src/assistant/tools/assistant/assistant.qch and /dev/null differ diff --git a/src/assistant/tools/assistant/assistant.qrc b/src/assistant/tools/assistant/assistant.qrc deleted file mode 100644 index dddf1be75..000000000 --- a/src/assistant/tools/assistant/assistant.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - assistant.qch - - diff --git a/src/assistant/tools/assistant/assistant.rc b/src/assistant/tools/assistant/assistant.rc deleted file mode 100644 index b1bf97b5c..000000000 --- a/src/assistant/tools/assistant/assistant.rc +++ /dev/null @@ -1,32 +0,0 @@ -#include "winver.h" - -IDI_ICON1 ICON DISCARDABLE "assistant.ico" - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,0 - PRODUCTVERSION 1,0,0,0 - FILEFLAGS 0x0L - FILEFLAGSMASK 0x3fL - FILEOS 0x00040004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)" - VALUE "FileDescription", "Qt Assistant" - VALUE "FileVersion", "1.0.0.0" - VALUE "LegalCopyright", "Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)." - VALUE "InternalName", "assistant.exe" - VALUE "OriginalFilename", "assistant.exe" - VALUE "ProductName", "Qt Assistant" - VALUE "ProductVersion", "1.0.0.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END diff --git a/src/assistant/tools/assistant/assistant_images.qrc b/src/assistant/tools/assistant/assistant_images.qrc deleted file mode 100644 index b4f25236d..000000000 --- a/src/assistant/tools/assistant/assistant_images.qrc +++ /dev/null @@ -1,37 +0,0 @@ - - - images/trolltech-logo.png - images/assistant-128.png - images/assistant.png - images/wrap.png - images/bookmark.png - images/mac/addtab.png - images/mac/book.png - images/mac/closetab.png - images/mac/editcopy.png - images/mac/find.png - images/mac/home.png - images/mac/next.png - images/mac/previous.png - images/mac/print.png - images/mac/synctoc.png - images/mac/zoomin.png - images/mac/zoomout.png - images/mac/resetzoom.png - images/win/addtab.png - images/win/book.png - images/win/closetab.png - images/win/editcopy.png - images/win/find.png - images/win/home.png - images/win/next.png - images/win/previous.png - images/win/print.png - images/win/synctoc.png - images/win/zoomin.png - images/win/zoomout.png - images/win/resetzoom.png - images/closebutton.png - images/darkclosebutton.png - - diff --git a/src/assistant/tools/assistant/bookmarkdialog.cpp b/src/assistant/tools/assistant/bookmarkdialog.cpp deleted file mode 100644 index e3cd9ac60..000000000 --- a/src/assistant/tools/assistant/bookmarkdialog.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bookmarkdialog.h" -#include "bookmarkfiltermodel.h" -#include "bookmarkitem.h" -#include "bookmarkmodel.h" -#include "helpenginewrapper.h" -#include "tracer.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -BookmarkDialog::BookmarkDialog(BookmarkModel *sourceModel, const QString &title, - const QString &url, QWidget *parent) - : QDialog(parent) - , m_url(url) - , m_title(title) - , bookmarkModel(sourceModel) -{ - TRACE_OBJ - ui.setupUi(this); - - ui.bookmarkEdit->setText(m_title); - ui.newFolderButton->setVisible(false); - ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejected())); - connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addFolder())); - connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); - connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, - SLOT(textChanged(QString))); - - bookmarkProxyModel = new BookmarkFilterModel(this); - bookmarkProxyModel->setSourceModel(bookmarkModel); - ui.bookmarkFolders->setModel(bookmarkProxyModel); - connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(int)), this, - SLOT(currentIndexChanged(int))); - - bookmarkTreeModel = new BookmarkTreeModel(this); - bookmarkTreeModel->setSourceModel(bookmarkModel); - ui.treeView->setModel(bookmarkTreeModel); - - ui.treeView->expandAll(); - ui.treeView->setVisible(false); - ui.treeView->installEventFilter(this); - ui.treeView->viewport()->installEventFilter(this); - ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(customContextMenuRequested(QPoint))); - connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, - QModelIndex)), this, SLOT(currentIndexChanged(QModelIndex))); - - ui.bookmarkFolders->setCurrentIndex(0); - ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); - - const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - if (helpEngine.usesAppFont()) - setFont(helpEngine.appFont()); -} - -BookmarkDialog::~BookmarkDialog() -{ - TRACE_OBJ -} - -bool BookmarkDialog::isRootItem(const QModelIndex &index) const -{ - return !bookmarkTreeModel->parent(index).isValid(); -} - -bool BookmarkDialog::eventFilter(QObject *object, QEvent *event) -{ - TRACE_OBJ - if (object != ui.treeView && object != ui.treeView->viewport()) - return QWidget::eventFilter(object, event); - - if (event->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(event); - switch (ke->key()) { - case Qt::Key_F2: { - const QModelIndex &index = ui.treeView->currentIndex(); - if (!isRootItem(index)) { - bookmarkModel->setItemsEditable(true); - ui.treeView->edit(index); - bookmarkModel->setItemsEditable(false); - } - } break; - default: break; - } - } - - return QObject::eventFilter(object, event); -} - -void BookmarkDialog::currentIndexChanged(int row) -{ - TRACE_OBJ - QModelIndex next = bookmarkProxyModel->index(row, 0, QModelIndex()); - if (next.isValid()) { - next = bookmarkProxyModel->mapToSource(next); - ui.treeView->setCurrentIndex(bookmarkTreeModel->mapFromSource(next)); - } -} - -void BookmarkDialog::currentIndexChanged(const QModelIndex &index) -{ - TRACE_OBJ - const QModelIndex current = bookmarkTreeModel->mapToSource(index); - if (current.isValid()) { - const int row = bookmarkProxyModel->mapFromSource(current).row(); - ui.bookmarkFolders->setCurrentIndex(row); - } -} - -void BookmarkDialog::accepted() -{ - TRACE_OBJ - QModelIndex index = ui.treeView->currentIndex(); - if (index.isValid()) { - index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index)); - bookmarkModel->setData(index, DataVector() << m_title << m_url << false); - } else - rejected(); - - accept(); -} - -void BookmarkDialog::rejected() -{ - TRACE_OBJ - foreach (const QPersistentModelIndex &index, cache) - bookmarkModel->removeItem(index); - reject(); -} - -void BookmarkDialog::addFolder() -{ - TRACE_OBJ - QModelIndex index = ui.treeView->currentIndex(); - if (index.isValid()) { - index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index), - true); - cache.append(index); - - index = bookmarkTreeModel->mapFromSource(index); - if (index.isValid()) { - bookmarkModel->setItemsEditable(true); - ui.treeView->edit(index); - ui.treeView->expand(index); - ui.treeView->setCurrentIndex(index); - bookmarkModel->setItemsEditable(false); - } - } -} - -void BookmarkDialog::toolButtonClicked() -{ - TRACE_OBJ - const bool visible = !ui.treeView->isVisible(); - ui.treeView->setVisible(visible); - ui.newFolderButton->setVisible(visible); - - if (visible) { - resize(QSize(width(), 400)); - ui.toolButton->setText(QLatin1String("-")); - } else { - resize(width(), minimumHeight()); - ui.toolButton->setText(QLatin1String("+")); - } -} - -void BookmarkDialog::textChanged(const QString& text) -{ - m_title = text; -} - -void BookmarkDialog::customContextMenuRequested(const QPoint &point) -{ - TRACE_OBJ - const QModelIndex &index = ui.treeView->currentIndex(); - if (isRootItem(index)) - return; // check if we go to rename the "Bookmarks Menu", bail - - QMenu menu(QLatin1String(""), this); - QAction *renameItem = menu.addAction(tr("Rename Folder")); - - QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); - if (picked == renameItem) { - bookmarkModel->setItemsEditable(true); - ui.treeView->edit(index); - bookmarkModel->setItemsEditable(false); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkdialog.h b/src/assistant/tools/assistant/bookmarkdialog.h deleted file mode 100644 index dfa65bbf8..000000000 --- a/src/assistant/tools/assistant/bookmarkdialog.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BOOKMARKDIALOG_H -#define BOOKMARKDIALOG_H - -#include "ui_bookmarkdialog.h" - -QT_BEGIN_NAMESPACE - -class BookmarkModel; -class BookmarkFilterModel; -class BookmarkTreeModel; - -class BookmarkDialog : public QDialog -{ - Q_OBJECT -public: - BookmarkDialog(BookmarkModel *bookmarkModel, const QString &title, - const QString &url, QWidget *parent = 0); - ~BookmarkDialog(); - -private: - bool isRootItem(const QModelIndex &index) const; - bool eventFilter(QObject *object, QEvent *event); - -private slots: - void currentIndexChanged(int index); - void currentIndexChanged(const QModelIndex &index); - - void accepted(); - void rejected(); - - void addFolder(); - void toolButtonClicked(); - void textChanged(const QString& text); - void customContextMenuRequested(const QPoint &point); - -private: - QString m_url; - QString m_title; - Ui::BookmarkDialog ui; - QList cache; - - BookmarkModel *bookmarkModel; - BookmarkTreeModel *bookmarkTreeModel; - BookmarkFilterModel *bookmarkProxyModel; -}; - -QT_END_NAMESPACE - -#endif // BOOKMARKDIALOG_H diff --git a/src/assistant/tools/assistant/bookmarkdialog.ui b/src/assistant/tools/assistant/bookmarkdialog.ui deleted file mode 100644 index 51315317b..000000000 --- a/src/assistant/tools/assistant/bookmarkdialog.ui +++ /dev/null @@ -1,156 +0,0 @@ - - - BookmarkDialog - - - - 0 - 0 - 450 - 133 - - - - - 0 - 0 - - - - Add Bookmark - - - - - - - - - - Bookmark: - - - - - - - Add in Folder: - - - - - - - - - - - - - - - - - - - - - - - - 25 - 20 - - - - + - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - true - - - true - - - true - - - - - - - - - New Folder - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - buttonBox - accepted() - BookmarkDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - BookmarkDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/assistant/tools/assistant/bookmarkfiltermodel.cpp b/src/assistant/tools/assistant/bookmarkfiltermodel.cpp deleted file mode 100644 index 412e08e5d..000000000 --- a/src/assistant/tools/assistant/bookmarkfiltermodel.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bookmarkfiltermodel.h" - -#include "bookmarkitem.h" -#include "bookmarkmodel.h" - -BookmarkFilterModel::BookmarkFilterModel(QObject *parent) - : QAbstractProxyModel(parent) - , hideBookmarks(true) - , sourceModel(0) -{ -} - -void BookmarkFilterModel::setSourceModel(QAbstractItemModel *_sourceModel) -{ - beginResetModel(); - - if (sourceModel) { - disconnect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), - this, SLOT(changed(QModelIndex, QModelIndex))); - disconnect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(rowsInserted(QModelIndex, int, int))); - disconnect(sourceModel, - SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, - SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - disconnect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), - this, SLOT(rowsRemoved(QModelIndex, int, int))); - disconnect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, - SLOT(layoutAboutToBeChanged())); - disconnect(sourceModel, SIGNAL(layoutChanged()), this, - SLOT(layoutChanged())); - disconnect(sourceModel, SIGNAL(modelAboutToBeReset()), this, - SLOT(modelAboutToBeReset())); - disconnect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); - } - - QAbstractProxyModel::setSourceModel(sourceModel); - sourceModel = qobject_cast (_sourceModel); - - connect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, - SLOT(changed(QModelIndex, QModelIndex))); - - connect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(rowsInserted(QModelIndex, int, int))); - - connect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), - this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); - connect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, - SLOT(rowsRemoved(QModelIndex, int, int))); - - connect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, - SLOT(layoutAboutToBeChanged())); - connect(sourceModel, SIGNAL(layoutChanged()), this, - SLOT(layoutChanged())); - - connect(sourceModel, SIGNAL(modelAboutToBeReset()), this, - SLOT(modelAboutToBeReset())); - connect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); - - if (sourceModel) - setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); - - endResetModel(); -} - -int BookmarkFilterModel::rowCount(const QModelIndex &index) const -{ - Q_UNUSED(index) - return cache.count(); -} - -int BookmarkFilterModel::columnCount(const QModelIndex &index) const -{ - Q_UNUSED(index) - if (sourceModel) - return sourceModel->columnCount(); - return 0; -} - -QModelIndex BookmarkFilterModel::mapToSource(const QModelIndex &proxyIndex) const -{ - const int row = proxyIndex.row(); - if (proxyIndex.isValid() && row >= 0 && row < cache.count()) - return cache[row]; - return QModelIndex(); -} - -QModelIndex BookmarkFilterModel::mapFromSource(const QModelIndex &sourceIndex) const -{ - return index(cache.indexOf(sourceIndex), 0, QModelIndex()); -} - -QModelIndex BookmarkFilterModel::parent(const QModelIndex &child) const -{ - Q_UNUSED(child) - return QModelIndex(); -} - -QModelIndex BookmarkFilterModel::index(int row, int column, - const QModelIndex &index) const -{ - Q_UNUSED(index) - if (row < 0 || column < 0 || cache.count() <= row - || !sourceModel || sourceModel->columnCount() <= column) { - return QModelIndex(); - } - return createIndex(row, 0); -} - -Qt::DropActions BookmarkFilterModel::supportedDropActions () const -{ - if (sourceModel) - return sourceModel->supportedDropActions(); - return Qt::IgnoreAction; -} - -Qt::ItemFlags BookmarkFilterModel::flags(const QModelIndex &index) const -{ - if (sourceModel) - return sourceModel->flags(index); - return Qt::NoItemFlags; -} - -QVariant BookmarkFilterModel::data(const QModelIndex &index, int role) const -{ - if (sourceModel) - return sourceModel->data(mapToSource(index), role); - return QVariant(); -} - -bool BookmarkFilterModel::setData(const QModelIndex &index, const QVariant &value, - int role) -{ - if (sourceModel) - return sourceModel->setData(mapToSource(index), value, role); - return false; -} - -void BookmarkFilterModel::filterBookmarks() -{ - if (sourceModel) { - beginResetModel(); - hideBookmarks = true; - setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); - endResetModel(); - } -} - -void BookmarkFilterModel::filterBookmarkFolders() -{ - if (sourceModel) { - beginResetModel(); - hideBookmarks = false; - setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); - endResetModel(); - } -} - -void BookmarkFilterModel::changed(const QModelIndex &topLeft, - const QModelIndex &bottomRight) -{ - emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight)); -} - -void BookmarkFilterModel::rowsInserted(const QModelIndex &parent, int start, - int end) -{ - if (!sourceModel) - return; - - QModelIndex cachePrevious = parent; - if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { - BookmarkItem *newItem = parentItem->child(start); - - // iterate over tree hirarchie to find the previous folder - for (int i = 0; i < parentItem->childCount(); ++i) { - if (BookmarkItem *child = parentItem->child(i)) { - const QModelIndex &tmp = sourceModel->indexFromItem(child); - if (tmp.data(UserRoleFolder).toBool() && child != newItem) - cachePrevious = tmp; - } - } - - const QModelIndex &newIndex = sourceModel->indexFromItem(newItem); - const bool isFolder = newIndex.data(UserRoleFolder).toBool(); - if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) { - beginInsertRows(mapFromSource(parent), start, end); - const int index = cache.indexOf(cachePrevious) + 1; - if (cache.value(index, QPersistentModelIndex()) != newIndex) - cache.insert(index, newIndex); - endInsertRows(); - } - } -} - -void BookmarkFilterModel::rowsAboutToBeRemoved(const QModelIndex &parent, - int start, int end) -{ - if (!sourceModel) - return; - - if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { - if (BookmarkItem *child = parentItem->child(start)) { - indexToRemove = sourceModel->indexFromItem(child); - if (cache.contains(indexToRemove)) - beginRemoveRows(mapFromSource(parent), start, end); - } - } -} - -void BookmarkFilterModel::rowsRemoved(const QModelIndex &/*parent*/, int, int) -{ - if (cache.contains(indexToRemove)) { - cache.removeAll(indexToRemove); - endRemoveRows(); - } -} - -void BookmarkFilterModel::layoutAboutToBeChanged() -{ - // TODO: ??? -} - -void BookmarkFilterModel::layoutChanged() -{ - // TODO: ??? -} - -void BookmarkFilterModel::modelAboutToBeReset() -{ - beginResetModel(); -} - -void BookmarkFilterModel::modelReset() -{ - if (sourceModel) - setupCache(sourceModel->index(0, 0, QModelIndex()).parent()); - endResetModel(); -} - -void BookmarkFilterModel::setupCache(const QModelIndex &parent) -{ - cache.clear(); - for (int i = 0; i < sourceModel->rowCount(parent); ++i) - collectItems(sourceModel->index(i, 0, parent)); -} - -void BookmarkFilterModel::collectItems(const QModelIndex &parent) -{ - if (parent.isValid()) { - bool isFolder = sourceModel->data(parent, UserRoleFolder).toBool(); - if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) - cache.append(parent); - - if (sourceModel->hasChildren(parent)) { - for (int i = 0; i < sourceModel->rowCount(parent); ++i) - collectItems(sourceModel->index(i, 0, parent)); - } - } -} - -// -- BookmarkTreeModel - -BookmarkTreeModel::BookmarkTreeModel(QObject *parent) - : QSortFilterProxyModel(parent) -{ -} - -int BookmarkTreeModel::columnCount(const QModelIndex &parent) const -{ - return qMin(1, QSortFilterProxyModel::columnCount(parent)); -} - -bool BookmarkTreeModel::filterAcceptsRow(int row, const QModelIndex &parent) const -{ - Q_UNUSED(row) - BookmarkModel *model = qobject_cast (sourceModel()); - if (model->rowCount(parent) > 0 - && model->data(model->index(row, 0, parent), UserRoleFolder).toBool()) - return true; - return false; -} diff --git a/src/assistant/tools/assistant/bookmarkfiltermodel.h b/src/assistant/tools/assistant/bookmarkfiltermodel.h deleted file mode 100644 index 310e27512..000000000 --- a/src/assistant/tools/assistant/bookmarkfiltermodel.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BOOKMARKFILTERMODEL_H -#define BOOKMARKFILTERMODEL_H - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class BookmarkItem; -class BookmarkModel; - -typedef QList PersistentModelIndexCache; - -class BookmarkFilterModel : public QAbstractProxyModel -{ - Q_OBJECT -public: - explicit BookmarkFilterModel(QObject *parent = 0); - - void setSourceModel(QAbstractItemModel *sourceModel); - - int rowCount(const QModelIndex &index) const; - int columnCount(const QModelIndex &index) const; - - QModelIndex mapToSource(const QModelIndex &proxyIndex) const; - QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; - - QModelIndex parent(const QModelIndex &child) const; - QModelIndex index(int row, int column, const QModelIndex &parent) const; - - Qt::DropActions supportedDropActions () const; - Qt::ItemFlags flags(const QModelIndex &index) const; - - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); - - void filterBookmarks(); - void filterBookmarkFolders(); - -private slots: - void changed(const QModelIndex &topLeft, const QModelIndex &bottomRight); - void rowsInserted(const QModelIndex &parent, int start, int end); - void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); - void rowsRemoved(const QModelIndex &parent, int start, int end); - void layoutAboutToBeChanged(); - void layoutChanged(); - void modelAboutToBeReset(); - void modelReset(); - -private: - void setupCache(const QModelIndex &parent); - void collectItems(const QModelIndex &parent); - -private: - bool hideBookmarks; - BookmarkModel *sourceModel; - PersistentModelIndexCache cache; - QPersistentModelIndex indexToRemove; -}; - -// -- BookmarkTreeModel - -class BookmarkTreeModel : public QSortFilterProxyModel -{ - Q_OBJECT -public: - BookmarkTreeModel(QObject *parent = 0); - int columnCount(const QModelIndex &parent = QModelIndex()) const; - -protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; -}; - -QT_END_NAMESPACE - -#endif // BOOKMARKFILTERMODEL_H diff --git a/src/assistant/tools/assistant/bookmarkitem.cpp b/src/assistant/tools/assistant/bookmarkitem.cpp deleted file mode 100644 index 8bcf451c1..000000000 --- a/src/assistant/tools/assistant/bookmarkitem.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "bookmarkitem.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -BookmarkItem::BookmarkItem(const DataVector &data, BookmarkItem *parent) - : m_data(data) - , m_parent(parent) -{ -} - -BookmarkItem::~BookmarkItem() -{ - qDeleteAll(m_children); -} - -BookmarkItem* -BookmarkItem::parent() const -{ - return m_parent; -} - -void -BookmarkItem::setParent(BookmarkItem *parent) -{ - m_parent = parent; -} - -void -BookmarkItem::addChild(BookmarkItem *child) -{ - child->setParent(this); - m_children.append(child); -} - -BookmarkItem* -BookmarkItem::child(int number) const -{ - if (number >= 0 && number < m_children.count()) - return m_children[number]; - return 0; -} - -int BookmarkItem::childCount() const -{ - return m_children.count(); -} - -int BookmarkItem::childNumber() const -{ - if (m_parent) - return m_parent->m_children.indexOf(const_cast(this)); - return 0; -} - -QVariant -BookmarkItem::data(int column) const -{ - if (column == 0) - return m_data[0]; - - if (column == 1 || column == UserRoleUrl) - return m_data[1]; - - if (column == UserRoleFolder) - return m_data[1].toString() == QLatin1String("Folder"); - - if (column == UserRoleExpanded) - return m_data[2]; - - return QVariant(); -} - -void -BookmarkItem::setData(const DataVector &data) -{ - m_data = data; -} - -bool -BookmarkItem::setData(int column, const QVariant &newValue) -{ - int index = -1; - if (column == 0 || column == 1) - index = column; - - if (column == UserRoleUrl || column == UserRoleFolder) - index = 1; - - if (column == UserRoleExpanded) - index = 2; - - if (index < 0) - return false; - - m_data[index] = newValue; - return true; -} - -bool -BookmarkItem::insertChildren(bool isFolder, int position, int count) -{ - if (position < 0 || position > m_children.size()) - return false; - - for (int row = 0; row < count; ++row) { - m_children.insert(position, new BookmarkItem(DataVector() - << (isFolder - ? QCoreApplication::translate("BookmarkItem", "New Folder") - : QCoreApplication::translate("BookmarkItem", "Untitled")) - << (isFolder ? "Folder" : "about:blank") << false, this)); - } - - return true; -} - -bool -BookmarkItem::removeChildren(int position, int count) -{ - if (position < 0 || position > m_children.size()) - return false; - - for (int row = 0; row < count; ++row) - delete m_children.takeAt(position); - - return true; -} - -void -BookmarkItem::dumpTree(int indent) const -{ - const QString tree(indent, ' '); - qDebug() << tree + (data(UserRoleFolder).toBool() ? "Folder" : "Bookmark") - << "Label:" << data(0).toString() << "parent:" << m_parent << "this:" - << this; - - foreach (BookmarkItem *item, m_children) - item->dumpTree(indent + 4); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkitem.h b/src/assistant/tools/assistant/bookmarkitem.h deleted file mode 100644 index 96ce786be..000000000 --- a/src/assistant/tools/assistant/bookmarkitem.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BOOKMARKITEM_H -#define BOOKMARKITEM_H - -#include -#include - -QT_BEGIN_NAMESPACE - -enum { - UserRoleUrl = Qt::UserRole + 50, - UserRoleFolder = Qt::UserRole + 100, - UserRoleExpanded = Qt::UserRole + 150 -}; - -typedef QVector DataVector; - -class BookmarkItem -{ -public: - explicit BookmarkItem(const DataVector &data, BookmarkItem *parent = 0); - ~BookmarkItem(); - - BookmarkItem *parent() const; - void setParent(BookmarkItem *parent); - - void addChild(BookmarkItem *child); - BookmarkItem *child(int number) const; - - int childCount() const; - int childNumber() const; - - QVariant data(int column) const; - void setData(const DataVector &data); - bool setData(int column, const QVariant &value); - - bool insertChildren(bool isFolder, int position, int count); - bool removeChildren(int position, int count); - - void dumpTree(int indent) const; - -private: - DataVector m_data; - - BookmarkItem *m_parent; - QList m_children; -}; - -QT_END_NAMESPACE - -#endif // BOOKMARKITEM_H diff --git a/src/assistant/tools/assistant/bookmarkmanager.cpp b/src/assistant/tools/assistant/bookmarkmanager.cpp deleted file mode 100644 index 29d8567a7..000000000 --- a/src/assistant/tools/assistant/bookmarkmanager.cpp +++ /dev/null @@ -1,559 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include "bookmarkmanager.h" -#include "bookmarkmanagerwidget.h" -#include "bookmarkdialog.h" -#include "bookmarkfiltermodel.h" -#include "bookmarkitem.h" -#include "bookmarkmodel.h" -#include "centralwidget.h" -#include "helpenginewrapper.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -// -- BookmarkManager::BookmarkWidget - -void BookmarkManager::BookmarkWidget::focusInEvent(QFocusEvent *event) -{ - TRACE_OBJ - if (event->reason() != Qt::MouseFocusReason) { - ui.lineEdit->selectAll(); - ui.lineEdit->setFocus(); - - // force the focus in event on bookmark manager - emit focusInEvent(); - } -} - -// -- BookmarkManager::BookmarkTreeView - -BookmarkManager::BookmarkTreeView::BookmarkTreeView(QWidget *parent) - : QTreeView(parent) -{ - TRACE_OBJ - setAcceptDrops(true); - setDragEnabled(true); - setAutoExpandDelay(1000); - setUniformRowHeights(true); - setDropIndicatorShown(true); - setExpandsOnDoubleClick(true); - - connect(this, SIGNAL(expanded(QModelIndex)), this, - SLOT(setExpandedData(QModelIndex))); - connect(this, SIGNAL(collapsed(QModelIndex)), this, - SLOT(setExpandedData(QModelIndex))); - -} - -void BookmarkManager::BookmarkTreeView::subclassKeyPressEvent(QKeyEvent *event) -{ - TRACE_OBJ - QTreeView::keyPressEvent(event); -} - -void BookmarkManager::BookmarkTreeView::setExpandedData(const QModelIndex &index) -{ - TRACE_OBJ - if (BookmarkModel *treeModel = qobject_cast (model())) - treeModel->setData(index, isExpanded(index), UserRoleExpanded); -} - -// -- BookmarkManager - -QMutex BookmarkManager::mutex; -BookmarkManager* BookmarkManager::bookmarkManager = 0; - -// -- public - -BookmarkManager* BookmarkManager::instance() -{ - TRACE_OBJ - if (!bookmarkManager) { - QMutexLocker _(&mutex); - if (!bookmarkManager) - bookmarkManager = new BookmarkManager(); - } - return bookmarkManager; -} - -void BookmarkManager::destroy() -{ - TRACE_OBJ - delete bookmarkManager; - bookmarkManager = 0; -} - -QWidget* BookmarkManager::bookmarkDockWidget() const -{ - TRACE_OBJ - if (bookmarkWidget) - return bookmarkWidget; - return 0; -} - -void BookmarkManager::setBookmarksMenu(QMenu* menu) -{ - TRACE_OBJ - bookmarkMenu = menu; - refreshBookmarkMenu(); -} - -void BookmarkManager::setBookmarksToolbar(QToolBar *toolBar) -{ - TRACE_OBJ - m_toolBar = toolBar; - refreshBookmarkToolBar(); -} - -// -- public slots - -void BookmarkManager::addBookmark(const QString &title, const QString &url) -{ - TRACE_OBJ - showBookmarkDialog(title.isEmpty() ? tr("Untitled") : title, - url.isEmpty() ? QLatin1String("about:blank") : url); -} - -// -- private - -BookmarkManager::BookmarkManager() - : typeAndSearch(false) - , bookmarkMenu(0) - , m_toolBar(0) - , bookmarkModel(new BookmarkModel) - , bookmarkFilterModel(0) - , typeAndSearchModel(0) - , bookmarkWidget(new BookmarkWidget) - , bookmarkTreeView(new BookmarkTreeView) - , bookmarkManagerWidget(0) -{ - TRACE_OBJ - bookmarkWidget->installEventFilter(this); - connect(bookmarkWidget->ui.add, SIGNAL(clicked()), this, - SLOT(addBookmark())); - connect(bookmarkWidget->ui.remove, SIGNAL(clicked()), this, - SLOT(removeBookmark())); - connect(bookmarkWidget->ui.lineEdit, SIGNAL(textChanged(QString)), this, - SLOT(textChanged(QString))); - connect(bookmarkWidget, SIGNAL(focusInEvent()), this, SLOT(focusInEvent())); - - bookmarkTreeView->setModel(bookmarkModel); - bookmarkTreeView->installEventFilter(this); - bookmarkTreeView->viewport()->installEventFilter(this); - bookmarkTreeView->setContextMenuPolicy(Qt::CustomContextMenu); - bookmarkWidget->ui.stackedWidget->addWidget(bookmarkTreeView); - - connect(bookmarkTreeView, SIGNAL(activated(QModelIndex)), this, - SLOT(setSourceFromIndex(QModelIndex))); - connect(bookmarkTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(customContextMenuRequested(QPoint))); - - connect(&HelpEngineWrapper::instance(), SIGNAL(setupFinished()), this, - SLOT(setupFinished())); - connect(bookmarkModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, - SLOT(refreshBookmarkMenu())); - connect(bookmarkModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, - SLOT(refreshBookmarkMenu())); - connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, - SLOT(refreshBookmarkMenu())); - - connect(bookmarkModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, - SLOT(refreshBookmarkToolBar())); - connect(bookmarkModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, - SLOT(refreshBookmarkToolBar())); - connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, - SLOT(refreshBookmarkToolBar())); -} - -BookmarkManager::~BookmarkManager() -{ - TRACE_OBJ - delete bookmarkManagerWidget; - HelpEngineWrapper::instance().setBookmarks(bookmarkModel->bookmarks()); - delete bookmarkModel; -} - -void BookmarkManager::removeItem(const QModelIndex &index) -{ - TRACE_OBJ - QModelIndex current = index; - if (typeAndSearch) { // need to map because of proxy - current = typeAndSearchModel->mapToSource(current); - current = bookmarkFilterModel->mapToSource(current); - } else if (!bookmarkModel->parent(index).isValid()) { - return; // check if we should delete the "Bookmarks Menu", bail - } - - if (bookmarkModel->hasChildren(current)) { - int value = QMessageBox::question(bookmarkTreeView, tr("Remove"), - tr("You are going to delete a Folder, this will also
" - "remove it's content. Are you sure to continue?"), - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); - if (value == QMessageBox::Cancel) - return; - } - bookmarkModel->removeItem(current); -} - -bool BookmarkManager::eventFilter(QObject *object, QEvent *event) -{ - if (object != bookmarkTreeView && object != bookmarkTreeView->viewport() - && object != bookmarkWidget) - return QObject::eventFilter(object, event); - - TRACE_OBJ - const bool isWidget = object == bookmarkWidget; - if (event->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(event); - switch (ke->key()) { - case Qt::Key_F2: { - renameBookmark(bookmarkTreeView->currentIndex()); - } break; - - case Qt::Key_Delete: { - removeItem(bookmarkTreeView->currentIndex()); - return true; - } break; - - case Qt::Key_Up: { // needs event filter on widget - case Qt::Key_Down: - if (isWidget) - bookmarkTreeView->subclassKeyPressEvent(ke); - } break; - - case Qt::Key_Escape: { - emit escapePressed(); - } break; - - default: break; - } - } - - if (event->type() == QEvent::MouseButtonRelease && !isWidget) { - QMouseEvent *me = static_cast(event); - switch (me->button()) { - case Qt::LeftButton: { - if (me->modifiers() & Qt::ControlModifier) - setSourceFromIndex(bookmarkTreeView->currentIndex(), true); - } break; - - case Qt::MidButton: { - setSourceFromIndex(bookmarkTreeView->currentIndex(), true); - } break; - - default: break; - } - } - - return QObject::eventFilter(object, event); -} - -void BookmarkManager::buildBookmarksMenu(const QModelIndex &index, QMenu* menu) -{ - TRACE_OBJ - if (!index.isValid()) - return; - - const QString &text = index.data().toString(); - const QIcon &icon = qvariant_cast(index.data(Qt::DecorationRole)); - if (index.data(UserRoleFolder).toBool()) { - if (QMenu* subMenu = menu->addMenu(icon, text)) { - for (int i = 0; i < bookmarkModel->rowCount(index); ++i) - buildBookmarksMenu(bookmarkModel->index(i, 0, index), subMenu); - } - } else { - QAction *action = menu->addAction(icon, text); - action->setData(index.data(UserRoleUrl).toString()); - } -} - -void BookmarkManager::showBookmarkDialog(const QString &name, const QString &url) -{ - TRACE_OBJ - BookmarkDialog dialog(bookmarkModel, name, url, bookmarkTreeView); - dialog.exec(); -} - -// -- private slots - -void BookmarkManager::setupFinished() -{ - TRACE_OBJ - bookmarkModel->setBookmarks(HelpEngineWrapper::instance().bookmarks()); - bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); - - refreshBookmarkMenu(); - refreshBookmarkToolBar(); - - bookmarkTreeView->hideColumn(1); - bookmarkTreeView->header()->setVisible(false); - bookmarkTreeView->header()->setStretchLastSection(true); - - if (!bookmarkFilterModel) - bookmarkFilterModel = new BookmarkFilterModel(this); - bookmarkFilterModel->setSourceModel(bookmarkModel); - bookmarkFilterModel->filterBookmarkFolders(); - - if (!typeAndSearchModel) - typeAndSearchModel = new QSortFilterProxyModel(this); - typeAndSearchModel->setDynamicSortFilter(true); - typeAndSearchModel->setSourceModel(bookmarkFilterModel); -} - -void BookmarkManager::addBookmark() -{ - TRACE_OBJ - if (CentralWidget *widget = CentralWidget::instance()) - addBookmark(widget->currentTitle(), widget->currentSource().toString()); -} - -void BookmarkManager::removeBookmark() -{ - TRACE_OBJ - removeItem(bookmarkTreeView->currentIndex()); -} - -void BookmarkManager::manageBookmarks() -{ - TRACE_OBJ - if (bookmarkManagerWidget == 0) { - bookmarkManagerWidget = new BookmarkManagerWidget(bookmarkModel); - connect(bookmarkManagerWidget, SIGNAL(setSource(QUrl)), this, - SIGNAL(setSource(QUrl))); - connect(bookmarkManagerWidget, SIGNAL(setSourceInNewTab(QUrl)) - , this, SIGNAL(setSourceInNewTab(QUrl))); - connect(bookmarkManagerWidget, SIGNAL(managerWidgetAboutToClose()) - , this, SLOT(managerWidgetAboutToClose())); - } - bookmarkManagerWidget->show(); - bookmarkManagerWidget->raise(); -} - -void BookmarkManager::refreshBookmarkMenu() -{ - TRACE_OBJ - if (!bookmarkMenu) - return; - - bookmarkMenu->clear(); - - bookmarkMenu->addAction(tr("Manage Bookmarks..."), this, - SLOT(manageBookmarks())); - bookmarkMenu->addAction(QIcon::fromTheme("bookmark-new"), - tr("Add Bookmark..."), this, SLOT(addBookmark()), QKeySequence(tr("Ctrl+D"))); - - bookmarkMenu->addSeparator(); - - QModelIndex root = bookmarkModel->index(0, 0, QModelIndex()).parent(); - buildBookmarksMenu(bookmarkModel->index(0, 0, root), bookmarkMenu); - - bookmarkMenu->addSeparator(); - - root = bookmarkModel->index(1, 0, QModelIndex()); - for (int i = 0; i < bookmarkModel->rowCount(root); ++i) - buildBookmarksMenu(bookmarkModel->index(i, 0, root), bookmarkMenu); - - connect(bookmarkMenu, SIGNAL(triggered(QAction*)), this, - SLOT(setSourceFromAction(QAction*))); -} - -void BookmarkManager::refreshBookmarkToolBar() -{ - TRACE_OBJ - if (!m_toolBar) - return; - - m_toolBar->clear(); - m_toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - - const QModelIndex &root = bookmarkModel->index(0, 0, QModelIndex()); - for (int i = 0; i < bookmarkModel->rowCount(root); ++i) { - const QModelIndex &index = bookmarkModel->index(i, 0, root); - if (index.data(UserRoleFolder).toBool()) { - QToolButton *button = new QToolButton(m_toolBar); - button->setPopupMode(QToolButton::InstantPopup); - button->setText(index.data().toString()); - QMenu *menu = new QMenu(button); - for (int j = 0; j < bookmarkModel->rowCount(index); ++j) - buildBookmarksMenu(bookmarkModel->index(j, 0, index), menu); - connect(menu, SIGNAL(triggered(QAction*)), this, - SLOT(setSourceFromAction(QAction*))); - button->setMenu(menu); - button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - button->setIcon(qvariant_cast(index.data(Qt::DecorationRole))); - QAction *a = m_toolBar->addWidget(button); - a->setText(index.data().toString()); - } else { - QAction *action = m_toolBar->addAction( - qvariant_cast(index.data(Qt::DecorationRole)), - index.data().toString(), this, SLOT(setSourceFromAction())); - action->setData(index.data(UserRoleUrl).toString()); - } - } -} - -void BookmarkManager::renameBookmark(const QModelIndex &index) -{ - // check if we should rename the "Bookmarks Menu", bail - if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) - return; - - bookmarkModel->setItemsEditable(true); - bookmarkTreeView->edit(index); - bookmarkModel->setItemsEditable(false); -} - - -void BookmarkManager::setSourceFromAction() -{ - TRACE_OBJ - setSourceFromAction(qobject_cast (sender())); -} - -void BookmarkManager::setSourceFromAction(QAction *action) -{ - TRACE_OBJ - if (action) { - const QVariant &data = action->data(); - if (data.canConvert()) - emit setSource(data.toUrl()); - } -} - -void BookmarkManager::setSourceFromIndex(const QModelIndex &index, bool newTab) -{ - TRACE_OBJ - QAbstractItemModel *base = bookmarkModel; - if (typeAndSearch) - base = typeAndSearchModel; - - if (base->data(index, UserRoleFolder).toBool()) - return; - - const QVariant &data = base->data(index, UserRoleUrl); - if (data.canConvert()) { - if (newTab) - emit setSourceInNewTab(data.toUrl()); - else - emit setSource(data.toUrl()); - } -} - -void BookmarkManager::customContextMenuRequested(const QPoint &point) -{ - TRACE_OBJ - QModelIndex index = bookmarkTreeView->indexAt(point); - if (!index.isValid()) - return; - - // check if we should open the menu on "Bookmarks Menu", bail - if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) - return; - - QAction *remove = 0; - QAction *rename = 0; - QAction *showItem = 0; - QAction *showItemInNewTab = 0; - - QMenu menu(QLatin1String("")); - if (!typeAndSearch && bookmarkModel->data(index, UserRoleFolder).toBool()) { - remove = menu.addAction(tr("Delete Folder")); - rename = menu.addAction(tr("Rename Folder")); - } else { - showItem = menu.addAction(tr("Show Bookmark")); - showItemInNewTab = menu.addAction(tr("Show Bookmark in New Tab")); - menu.addSeparator(); - remove = menu.addAction(tr("Delete Bookmark")); - rename = menu.addAction(tr("Rename Bookmark")); - } - - QAction *pickedAction = menu.exec(bookmarkTreeView->mapToGlobal(point)); - if (pickedAction == rename) - renameBookmark(index); - else if (pickedAction == remove) - removeItem(index); - else if (pickedAction == showItem || pickedAction == showItemInNewTab) - setSourceFromIndex(index, pickedAction == showItemInNewTab); -} - -void BookmarkManager::focusInEvent() -{ - TRACE_OBJ - const QModelIndex &index = bookmarkTreeView->indexAt(QPoint(2, 2)); - if (index.isValid()) - bookmarkTreeView->setCurrentIndex(index); -} - -void BookmarkManager::managerWidgetAboutToClose() -{ - delete bookmarkManagerWidget; - bookmarkManagerWidget = 0; -} - -void BookmarkManager::textChanged(const QString &text) -{ - TRACE_OBJ - if (!bookmarkWidget->ui.lineEdit->text().isEmpty()) { - if (!typeAndSearch) { - typeAndSearch = true; - bookmarkTreeView->setItemsExpandable(false); - bookmarkTreeView->setRootIsDecorated(false); - bookmarkTreeView->setModel(typeAndSearchModel); - } - typeAndSearchModel->setFilterRegExp(QRegExp(text)); - } else { - typeAndSearch = false; - bookmarkTreeView->setModel(bookmarkModel); - bookmarkTreeView->setItemsExpandable(true); - bookmarkTreeView->setRootIsDecorated(true); - bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkmanager.h b/src/assistant/tools/assistant/bookmarkmanager.h deleted file mode 100644 index 0b6275af9..000000000 --- a/src/assistant/tools/assistant/bookmarkmanager.h +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BOOKMARKMANAGER_H -#define BOOKMARKMANAGER_H - -#include -#include - -#include "ui_bookmarkwidget.h" - -QT_BEGIN_NAMESPACE - -class BookmarkManagerWidget; -class BookmarkModel; -class BookmarkFilterModel; -class QKeyEvent; -class QSortFilterProxyModel; -class QToolBar; - -class BookmarkManager : public QObject -{ - Q_OBJECT - class BookmarkWidget; - class BookmarkTreeView; - class BookmarkListView; - Q_DISABLE_COPY(BookmarkManager); - -public: - static BookmarkManager* instance(); - static void destroy(); - - QWidget* bookmarkDockWidget() const; - void setBookmarksMenu(QMenu* menu); - void setBookmarksToolbar(QToolBar *toolBar); - -public slots: - void addBookmark(const QString &title, const QString &url); - -signals: - void escapePressed(); - void setSource(const QUrl &url); - void setSourceInNewTab(const QUrl &url); - -private: - BookmarkManager(); - ~BookmarkManager(); - - void removeItem(const QModelIndex &index); - bool eventFilter(QObject *object, QEvent *event); - void buildBookmarksMenu(const QModelIndex &index, QMenu *menu); - void showBookmarkDialog(const QString &name, const QString &url); - -private slots: - void setupFinished(); - - void addBookmark(); - void removeBookmark(); - void manageBookmarks(); - void refreshBookmarkMenu(); - void refreshBookmarkToolBar(); - void renameBookmark(const QModelIndex &index); - - void setSourceFromAction(); - void setSourceFromAction(QAction *action); - void setSourceFromIndex(const QModelIndex &index, bool newTab = false); - - void focusInEvent(); - void managerWidgetAboutToClose(); - void textChanged(const QString &text); - void customContextMenuRequested(const QPoint &point); - -private: - bool typeAndSearch; - - static QMutex mutex; - static BookmarkManager *bookmarkManager; - - QMenu *bookmarkMenu; - QToolBar *m_toolBar; - - BookmarkModel *bookmarkModel; - BookmarkFilterModel *bookmarkFilterModel; - QSortFilterProxyModel *typeAndSearchModel; - - BookmarkWidget *bookmarkWidget; - BookmarkTreeView *bookmarkTreeView; - BookmarkManagerWidget *bookmarkManagerWidget; -}; - -class BookmarkManager::BookmarkWidget : public QWidget -{ - Q_OBJECT -public: - BookmarkWidget(QWidget *parent = 0) - : QWidget(parent) { ui.setupUi(this); } - virtual ~BookmarkWidget() {} - - Ui::BookmarkWidget ui; - -signals: - void focusInEvent(); - -private: - void focusInEvent(QFocusEvent *event); -}; - -class BookmarkManager::BookmarkTreeView : public QTreeView -{ - Q_OBJECT -public: - BookmarkTreeView(QWidget *parent = 0); - ~BookmarkTreeView() {} - - void subclassKeyPressEvent(QKeyEvent *event); - -private slots: - void setExpandedData(const QModelIndex &index); -}; - -QT_END_NAMESPACE - -#endif // BOOKMARKMANAGER_H diff --git a/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp b/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp deleted file mode 100644 index 87a1f65be..000000000 --- a/src/assistant/tools/assistant/bookmarkmanagerwidget.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bookmarkmanagerwidget.h" -#include "bookmarkitem.h" -#include "bookmarkmodel.h" -#include "tracer.h" -#include "xbelsupport.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace { - #define TR(x) QCoreApplication::translate("BookmarkManager", x) -} - -BookmarkManagerWidget::BookmarkManagerWidget(BookmarkModel *sourceModel, - QWidget *parent) - : QWidget(parent) - , bookmarkModel(sourceModel) -{ - TRACE_OBJ - ui.setupUi(this); - - ui.treeView->setModel(bookmarkModel); - - ui.treeView->expandAll(); - ui.treeView->installEventFilter(this); - ui.treeView->viewport()->installEventFilter(this); - ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(customContextMenuRequested(QPoint))); - - connect(ui.remove, SIGNAL(clicked()), this, SLOT(removeItem())); - connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, - SLOT(textChanged(QString))); - new QShortcut(QKeySequence::Find, ui.lineEdit, SLOT(setFocus())); - - importExportMenu.addAction(tr("Import..."), this, SLOT(importBookmarks())); - importExportMenu.addAction(tr("Export..."), this, SLOT(exportBookmarks())); - ui.importExport->setMenu(&importExportMenu); - - new QShortcut(QKeySequence::FindNext, this, SLOT(findNext())); - new QShortcut(QKeySequence::FindPrevious, this, SLOT(findPrevious())); - - connect(bookmarkModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, - SLOT(refeshBookmarkCache())); - connect(bookmarkModel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, - SLOT(refeshBookmarkCache())); - connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, - SLOT(refeshBookmarkCache())); - - ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); -} - -BookmarkManagerWidget::~BookmarkManagerWidget() -{ - TRACE_OBJ -} - -void BookmarkManagerWidget::closeEvent(QCloseEvent *event) -{ - TRACE_OBJ - event->accept(); - emit managerWidgetAboutToClose(); -} - -void BookmarkManagerWidget::renameItem(const QModelIndex &index) -{ - TRACE_OBJ - // check if we should rename the "Bookmarks Menu", bail - if (!bookmarkModel->parent(index).isValid()) - return; - - bookmarkModel->setItemsEditable(true); - ui.treeView->edit(index); - bookmarkModel->setItemsEditable(false); -} - -static int nextIndex(int current, int count, bool forward) -{ - TRACE_OBJ - if (current >= 0) - return (forward ? (current + 1) : ((current - 1) + count)) % count; - return 0; -} - -void BookmarkManagerWidget::selectNextIndex(bool direction) const -{ - QModelIndex current = ui.treeView->currentIndex(); - if (current.isValid() && !cache.isEmpty()) { - current = cache.at(nextIndex(cache.indexOf(current), cache.count(), - direction)); - } - ui.treeView->setCurrentIndex(current); -} - -bool BookmarkManagerWidget::eventFilter(QObject *object, QEvent *event) -{ - TRACE_OBJ - if (object != ui.treeView && object != ui.treeView->viewport()) - return QWidget::eventFilter(object, event); - - if (event->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(event); - switch (ke->key()) { - case Qt::Key_F2: { - renameItem(ui.treeView->currentIndex()); - } break; - - case Qt::Key_Delete: { - removeItem(ui.treeView->currentIndex()); - } break; - - default: break; - } - } - - if (event->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast(event); - switch (me->button()) { - case Qt::LeftButton: { - if (me->modifiers() & Qt::ControlModifier) - setSourceFromIndex(ui.treeView->currentIndex(), true); - } break; - - case Qt::MidButton: { - setSourceFromIndex(ui.treeView->currentIndex(), true); - } break; - - default: break; - } - } - return QObject::eventFilter(object, event); -} - -void BookmarkManagerWidget::findNext() -{ - TRACE_OBJ - selectNextIndex(true); -} - -void BookmarkManagerWidget::findPrevious() -{ - TRACE_OBJ - selectNextIndex(false); -} - -void BookmarkManagerWidget::importBookmarks() -{ - TRACE_OBJ - const QString &fileName = QFileDialog::getOpenFileName(0, TR("Open File"), - QDir::currentPath(), TR("Files (*.xbel)")); - - if (fileName.isEmpty()) - return; - - QFile file(fileName); - if (file.open(QIODevice::ReadOnly)) { - XbelReader reader(bookmarkModel); - reader.readFromFile(&file); - } -} - -void BookmarkManagerWidget::exportBookmarks() -{ - TRACE_OBJ - QString fileName = QFileDialog::getSaveFileName(0, TR("Save File"), - QLatin1String("untitled.xbel"), TR("Files (*.xbel)")); - - const QLatin1String suffix(".xbel"); - if (!fileName.endsWith(suffix)) - fileName.append(suffix); - - QFile file(fileName); - if (file.open(QIODevice::WriteOnly)) { - XbelWriter writer(bookmarkModel); - writer.writeToFile(&file); - } else { - QMessageBox::information(this, TR("Qt Assistant"), - TR("Unable to save bookmarks."), TR("OK")); - } -} - -void BookmarkManagerWidget::refeshBookmarkCache() -{ - TRACE_OBJ - cache.clear(); - - const QString &text = ui.lineEdit->text(); - if (!text.isEmpty()) - cache = bookmarkModel->indexListFor(text); -} - -void BookmarkManagerWidget::textChanged(const QString &/*text*/) -{ - TRACE_OBJ - refeshBookmarkCache(); - if (!cache.isEmpty()) - ui.treeView->setCurrentIndex(cache.at(0)); -} - -void BookmarkManagerWidget::removeItem(const QModelIndex &index) -{ - TRACE_OBJ - QModelIndex current = index.isValid() ? index : ui.treeView->currentIndex(); - if (!bookmarkModel->parent(current).isValid()) - return; // check if we should delete the "Bookmarks Menu", bail - - if (bookmarkModel->hasChildren(current)) { - int value = QMessageBox::question(this, TR("Remove"), TR("You are going" - "to delete a Folder, this will also
remove it's content. Are " - "you sure to continue?"), - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); - if (value == QMessageBox::Cancel) - return; - } - bookmarkModel->removeItem(current); -} - -void BookmarkManagerWidget::customContextMenuRequested(const QPoint &point) -{ - TRACE_OBJ - const QModelIndex &index = ui.treeView->indexAt(point); - if (!index.isValid()) - return; - - // check if we should open the menu on "Bookmarks Menu", bail - if (!bookmarkModel->parent(index).isValid()) - return; - - QAction *remove = 0; - QAction *rename = 0; - QAction *showItem = 0; - QAction *showItemInNewTab = 0; - - QMenu menu(QLatin1String("")); - if (bookmarkModel->data(index, UserRoleFolder).toBool()) { - remove = menu.addAction(TR("Delete Folder")); - rename = menu.addAction(TR("Rename Folder")); - } else { - showItem = menu.addAction(TR("Show Bookmark")); - showItemInNewTab = menu.addAction(TR("Show Bookmark in New Tab")); - menu.addSeparator(); - remove = menu.addAction(TR("Delete Bookmark")); - rename = menu.addAction(TR("Rename Bookmark")); - } - - QAction *pickedAction = menu.exec(ui.treeView->mapToGlobal(point)); - if (pickedAction == rename) - renameItem(index); - else if (pickedAction == remove) - removeItem(index); - else if (pickedAction == showItem || pickedAction == showItemInNewTab) - setSourceFromIndex(index, pickedAction == showItemInNewTab); -} - -void -BookmarkManagerWidget::setSourceFromIndex(const QModelIndex &index, bool newTab) -{ - TRACE_OBJ - if (bookmarkModel->data(index, UserRoleFolder).toBool()) - return; - - const QVariant &data = bookmarkModel->data(index, UserRoleUrl); - if (data.canConvert()) { - if (newTab) - emit setSourceInNewTab(data.toUrl()); - else - emit setSource(data.toUrl()); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/bookmarkmanagerwidget.h b/src/assistant/tools/assistant/bookmarkmanagerwidget.h deleted file mode 100644 index 5c461b937..000000000 --- a/src/assistant/tools/assistant/bookmarkmanagerwidget.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BOOKMARKMANAGERWIDGET_H -#define BOOKMARKMANAGERWIDGET_H - -#include "ui_bookmarkmanagerwidget.h" - -#include - -#include - -QT_BEGIN_NAMESPACE - -class BookmarkModel; -class QCloseEvent; -class QString; - -class BookmarkManagerWidget : public QWidget -{ - Q_OBJECT -public: - explicit BookmarkManagerWidget(BookmarkModel *bookmarkModel, - QWidget *parent = 0); - ~BookmarkManagerWidget(); - -protected: - void closeEvent(QCloseEvent *event); - -signals: - void setSource(const QUrl &url); - void setSourceInNewTab(const QUrl &url); - - void managerWidgetAboutToClose(); - -private: - void renameItem(const QModelIndex &index); - void selectNextIndex(bool direction) const; - bool eventFilter(QObject *object, QEvent *event); - -private slots: - void findNext(); - void findPrevious(); - - void importBookmarks(); - void exportBookmarks(); - - void refeshBookmarkCache(); - void textChanged(const QString &text); - - void removeItem(const QModelIndex &index = QModelIndex()); - - void customContextMenuRequested(const QPoint &point); - void setSourceFromIndex(const QModelIndex &index, bool newTab = false); - -private: - QMenu importExportMenu; - Ui::BookmarkManagerWidget ui; - QList cache; - - BookmarkModel *bookmarkModel; -}; - -QT_END_NAMESPACE - -#endif // BOOKMARKMANAGERWIDGET_H diff --git a/src/assistant/tools/assistant/bookmarkmanagerwidget.ui b/src/assistant/tools/assistant/bookmarkmanagerwidget.ui deleted file mode 100644 index dc965d94e..000000000 --- a/src/assistant/tools/assistant/bookmarkmanagerwidget.ui +++ /dev/null @@ -1,137 +0,0 @@ - - - BookmarkManagerWidget - - - - 0 - 0 - 517 - 348 - - - - Manage Bookmarks - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Search: - - - - - - - - - - - - true - - - true - - - true - - - 1000 - - - true - - - true - - - 225 - - - 50 - - - 225 - - - 50 - - - - - - - - - Remove - - - - - - - Import and Backup - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - - - - - pushButton_5 - clicked() - BookmarkManagerWidget - close() - - - 445 - 328 - - - 340 - 313 - - - - - diff --git a/src/assistant/tools/assistant/bookmarkmodel.cpp b/src/assistant/tools/assistant/bookmarkmodel.cpp deleted file mode 100644 index d27731642..000000000 --- a/src/assistant/tools/assistant/bookmarkmodel.cpp +++ /dev/null @@ -1,461 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bookmarkmodel.h" -#include "bookmarkitem.h" - -#include -#include - -#include -#include -#include - -const quint32 VERSION = 0xe53798; -const QLatin1String MIMETYPE("application/bookmarks.assistant"); - -BookmarkModel::BookmarkModel() - : QAbstractItemModel() - , m_folder(false) - , m_editable(false) - , rootItem(0) -{ -} - -BookmarkModel::~BookmarkModel() -{ - delete rootItem; -} - -QByteArray -BookmarkModel::bookmarks() const -{ - QByteArray ba; - QDataStream stream(&ba, QIODevice::WriteOnly); - stream << qint32(VERSION); - - const QModelIndex &root = index(0,0, QModelIndex()).parent(); - for (int i = 0; i < rowCount(root); ++i) - collectItems(index(i, 0, root), 0, &stream); - - return ba; -} - -void -BookmarkModel::setBookmarks(const QByteArray &bookmarks) -{ - beginResetModel(); - - delete rootItem; - folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); - bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); - - rootItem = new BookmarkItem(DataVector() << tr("Name") << tr("Address") - << true); - - QStack parents; - QDataStream stream(bookmarks); - - quint32 version; - stream >> version; - if (version < VERSION) { - stream.device()->seek(0); - BookmarkItem* toolbar = new BookmarkItem(DataVector() << tr("Toolbar Menu") - << QLatin1String("Folder") << true); - rootItem->addChild(toolbar); - - BookmarkItem* menu = new BookmarkItem(DataVector() << tr("Bookmarks Menu") - << QLatin1String("Folder") << true); - rootItem->addChild(menu); - parents.push(menu); - } else { - parents.push(rootItem); - } - - qint32 depth; - bool expanded; - QString name, url; - while (!stream.atEnd()) { - stream >> depth >> name >> url >> expanded; - while ((parents.count() - 1) != depth) - parents.pop(); - - BookmarkItem *item = new BookmarkItem(DataVector() << name << url << expanded); - if (url == QLatin1String("Folder")) { - parents.top()->addChild(item); - parents.push(item); - } else { - parents.top()->addChild(item); - } - } - - cache.clear(); - setupCache(index(0,0, QModelIndex().parent())); - endResetModel(); -} - -void -BookmarkModel::setItemsEditable(bool editable) -{ - m_editable = editable; -} - -void -BookmarkModel::expandFoldersIfNeeeded(QTreeView *treeView) -{ - foreach (const QModelIndex &index, cache) - treeView->setExpanded(index, index.data(UserRoleExpanded).toBool()); -} - -QModelIndex -BookmarkModel::addItem(const QModelIndex &parent, bool isFolder) -{ - m_folder = isFolder; - QModelIndex next; - if (insertRow(rowCount(parent), parent)) - next = index(rowCount(parent) - 1, 0, parent); - m_folder = false; - - return next; -} - -bool -BookmarkModel::removeItem(const QModelIndex &index) -{ - if (!index.isValid()) - return false; - - QModelIndexList indexes; - if (rowCount(index) > 0) - indexes = collectItems(index); - indexes.append(index); - - foreach (const QModelIndex &itemToRemove, indexes) { - if (!removeRow(itemToRemove.row(), itemToRemove.parent())) - return false; - cache.remove(itemFromIndex(itemToRemove)); - } - return true; -} - -int -BookmarkModel::rowCount(const QModelIndex &index) const -{ - if (BookmarkItem *item = itemFromIndex(index)) - return item->childCount(); - return 0; -} - -int -BookmarkModel::columnCount(const QModelIndex &/*index*/) const -{ - return 2; -} - -QModelIndex -BookmarkModel::parent(const QModelIndex &index) const -{ - if (!index.isValid()) - return QModelIndex(); - - if (BookmarkItem *childItem = itemFromIndex(index)) { - if (BookmarkItem *parent = childItem->parent()) { - if (parent != rootItem) - return createIndex(parent->childNumber(), 0, parent); - } - } - return QModelIndex(); -} - -QModelIndex -BookmarkModel::index(int row, int column, const QModelIndex &index) const -{ - if (index.isValid() && (index.column() != 0 && index.column() != 1)) - return QModelIndex(); - - if (BookmarkItem *parent = itemFromIndex(index)) { - if (BookmarkItem *childItem = parent->child(row)) - return createIndex(row, column, childItem); - } - return QModelIndex(); -} - -Qt::DropActions -BookmarkModel::supportedDropActions () const -{ - return /* Qt::CopyAction | */Qt::MoveAction; -} - -Qt::ItemFlags -BookmarkModel::flags(const QModelIndex &index) const -{ - if (!index.isValid()) - return Qt::NoItemFlags; - - Qt::ItemFlags defaultFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable; - - if (m_editable) - defaultFlags |= Qt::ItemIsEditable; - - if (itemFromIndex(index) && index.data(UserRoleFolder).toBool()) { - if (index.column() > 0) - return defaultFlags &~ Qt::ItemIsEditable; - return defaultFlags | Qt::ItemIsDropEnabled; - } - - return defaultFlags | Qt::ItemIsDragEnabled; -} - -QVariant -BookmarkModel::data(const QModelIndex &index, int role) const -{ - if (index.isValid()) { - if (BookmarkItem *item = itemFromIndex(index)) { - switch (role) { - case Qt::EditRole: { - case Qt::DisplayRole: - if (index.data(UserRoleFolder).toBool() && index.column() == 1) - return QLatin1String(""); - return item->data(index.column()); - } break; - - case Qt::DecorationRole: { - if (index.column() == 0) - return index.data(UserRoleFolder).toBool() - ? folderIcon : bookmarkIcon; - } break; - - default:; - return item->data(role); - } - } - } - return QVariant(); -} - -void BookmarkModel::setData(const QModelIndex &index, const DataVector &data) -{ - if (BookmarkItem *item = itemFromIndex(index)) { - item->setData(data); - emit dataChanged(index, index); - } -} - -bool -BookmarkModel::setData(const QModelIndex &index, const QVariant &value, int role) -{ - bool result = false; - if (role != Qt::EditRole && role != UserRoleExpanded) - return result; - - if (BookmarkItem *item = itemFromIndex(index)) { - if (role == Qt::EditRole) { - const bool isFolder = index.data(UserRoleFolder).toBool(); - if (!isFolder || (isFolder && index.column() == 0)) - result = item->setData(index.column(), value); - } else if (role == UserRoleExpanded) { - result = item->setData(UserRoleExpanded, value); - } - } - - if (result) - emit dataChanged(index, index); - return result; -} - -QVariant -BookmarkModel::headerData(int section, Qt::Orientation orientation, - int role) const -{ - if (rootItem && orientation == Qt::Horizontal && role == Qt::DisplayRole) - return rootItem->data(section); - return QVariant(); -} - -QModelIndex -BookmarkModel::indexFromItem(BookmarkItem *item) const -{ - return cache.value(item, QModelIndex()); -} - -BookmarkItem* -BookmarkModel::itemFromIndex(const QModelIndex &index) const -{ - if (index.isValid()) - return static_cast(index.internalPointer()); - return rootItem; -} - -QList -BookmarkModel::indexListFor(const QString &label) const -{ - QList hits; - const QModelIndexList &list = collectItems(QModelIndex()); - foreach(const QModelIndex &index, list) { - if (index.data().toString().contains(label, Qt::CaseInsensitive)) - hits.prepend(index); // list is reverse sorted - } - return hits; -} - -bool -BookmarkModel::insertRows(int position, int rows, const QModelIndex &parent) -{ - if (!parent.data(UserRoleFolder).toBool()) - return false; - - bool success = false; - if (BookmarkItem *parentItem = itemFromIndex(parent)) { - beginInsertRows(parent, position, position + rows - 1); - success = parentItem->insertChildren(m_folder, position, rows); - if (success) { - const QModelIndex ¤t = index(position, 0, parent); - cache.insert(itemFromIndex(current), current); - } - endInsertRows(); - } - return success; -} - -bool -BookmarkModel::removeRows(int position, int rows, const QModelIndex &index) -{ - bool success = false; - if (BookmarkItem *parent = itemFromIndex(index)) { - beginRemoveRows(index, position, position + rows - 1); - success = parent->removeChildren(position, rows); - endRemoveRows(); - } - return success; -} - -QStringList -BookmarkModel::mimeTypes() const -{ - return QStringList() << MIMETYPE; -} - -QMimeData* -BookmarkModel::mimeData(const QModelIndexList &indexes) const -{ - if (indexes.isEmpty()) - return 0; - - QByteArray data; - QDataStream stream(&data, QIODevice::WriteOnly); - - foreach (const QModelIndex &index, indexes) { - if (index.column() == 0) - collectItems(index, 0, &stream); - } - - QMimeData *mimeData = new QMimeData(); - mimeData->setData(MIMETYPE, data); - return mimeData; -} - -bool -BookmarkModel::dropMimeData(const QMimeData *data, Qt::DropAction action, - int row, int column, const QModelIndex &parent) -{ - if (action == Qt::IgnoreAction) - return true; - - if (!data->hasFormat(MIMETYPE) || column > 0) - return false; - - QByteArray ba = data->data(MIMETYPE); - QDataStream stream(&ba, QIODevice::ReadOnly); - while (stream.atEnd()) - return false; - - qint32 depth; - bool expanded; - QString name, url; - while (!stream.atEnd()) { - stream >> depth >> name >> url >> expanded; - if (insertRow(qMax(0, row), parent)) { - const QModelIndex ¤t = index(qMax(0, row), 0, parent); - if (current.isValid()) { - BookmarkItem* item = itemFromIndex(current); - item->setData(DataVector() << name << url << expanded); - } - } - } - return true; -} - -void -BookmarkModel::setupCache(const QModelIndex &parent) -{ - const QModelIndexList &list = collectItems(parent); - foreach (const QModelIndex &index, list) - cache.insert(itemFromIndex(index), index); -} - -QModelIndexList -BookmarkModel::collectItems(const QModelIndex &parent) const -{ - QModelIndexList list; - for (int i = rowCount(parent) - 1; i >= 0 ; --i) { - const QModelIndex &next = index(i, 0, parent); - if (data(next, UserRoleFolder).toBool()) - list += collectItems(next); - list.append(next); - } - return list; -} - -void -BookmarkModel::collectItems(const QModelIndex &parent, qint32 depth, - QDataStream *stream) const -{ - if (parent.isValid()) { - *stream << depth; - *stream << parent.data().toString(); - *stream << parent.data(UserRoleUrl).toString(); - *stream << parent.data(UserRoleExpanded).toBool(); - - for (int i = 0; i < rowCount(parent); ++i) { - if (parent.data(UserRoleFolder).toBool()) - collectItems(index(i, 0 , parent), depth + 1, stream); - } - } -} diff --git a/src/assistant/tools/assistant/bookmarkmodel.h b/src/assistant/tools/assistant/bookmarkmodel.h deleted file mode 100644 index e23e9c41a..000000000 --- a/src/assistant/tools/assistant/bookmarkmodel.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BOOKMARKMODEL_H -#define BOOKMARKMODEL_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -class BookmarkItem; -class QMimeData; -class QTreeView; - -typedef QMap ItemModelIndexCache; - -class BookmarkModel : public QAbstractItemModel -{ - Q_OBJECT -public: - BookmarkModel(); - ~BookmarkModel(); - - QByteArray bookmarks() const; - void setBookmarks(const QByteArray &bookmarks); - - void setItemsEditable(bool editable); - void expandFoldersIfNeeeded(QTreeView *treeView); - - QModelIndex addItem(const QModelIndex &parent, bool isFolder = false); - bool removeItem(const QModelIndex &index); - - int rowCount(const QModelIndex &index = QModelIndex()) const; - int columnCount(const QModelIndex &index = QModelIndex()) const; - - QModelIndex parent(const QModelIndex &index) const; - QModelIndex index(int row, int column, const QModelIndex &index) const; - - Qt::DropActions supportedDropActions () const; - Qt::ItemFlags flags(const QModelIndex &index) const; - - QVariant data(const QModelIndex &index, int role) const; - void setData(const QModelIndex &index, const QVector &data); - bool setData(const QModelIndex &index, const QVariant &value, int role); - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - - QModelIndex indexFromItem(BookmarkItem *item) const; - BookmarkItem *itemFromIndex(const QModelIndex &index) const; - QList indexListFor(const QString &label) const; - - bool insertRows(int position, int rows, const QModelIndex &parent); - bool removeRows(int position, int rows, const QModelIndex &parent); - - QStringList mimeTypes() const; - QMimeData* mimeData(const QModelIndexList &indexes) const; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, - int column, const QModelIndex &parent); - -private: - void setupCache(const QModelIndex &parent); - QModelIndexList collectItems(const QModelIndex &parent) const; - void collectItems(const QModelIndex &parent, qint32 depth, - QDataStream *stream) const; - -private: - int columns; - bool m_folder; - bool m_editable; - QIcon folderIcon; - QIcon bookmarkIcon; - QTreeView *treeView; - BookmarkItem *rootItem; - ItemModelIndexCache cache; -}; - -QT_END_NAMESPACE - -#endif // BOOKMARKMODEL_H diff --git a/src/assistant/tools/assistant/bookmarkwidget.ui b/src/assistant/tools/assistant/bookmarkwidget.ui deleted file mode 100644 index a31a2779c..000000000 --- a/src/assistant/tools/assistant/bookmarkwidget.ui +++ /dev/null @@ -1,85 +0,0 @@ - - - BookmarkWidget - - - - 0 - 0 - 235 - 606 - - - - Bookmarks - - - - 4 - - - - - - - Filter: - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Add - - - - - - - Remove - - - - - - - - - - diff --git a/src/assistant/tools/assistant/centralwidget.cpp b/src/assistant/tools/assistant/centralwidget.cpp deleted file mode 100644 index da27f033d..000000000 --- a/src/assistant/tools/assistant/centralwidget.cpp +++ /dev/null @@ -1,636 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "centralwidget.h" - -#include "findwidget.h" -#include "helpenginewrapper.h" -#include "helpviewer.h" -#include "openpagesmanager.h" -#include "tracer.h" -#include "../shared/collectionconfiguration.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace { - CentralWidget *staticCentralWidget = 0; -} - -// -- TabBar - -TabBar::TabBar(QWidget *parent) - : QTabBar(parent) -{ - TRACE_OBJ -#ifdef Q_OS_MAC - setDocumentMode(true); -#endif - setMovable(true); - setShape(QTabBar::RoundedNorth); - setContextMenuPolicy(Qt::CustomContextMenu); - setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred, - QSizePolicy::TabWidget)); - connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); - connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int))); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(slotCustomContextMenuRequested(QPoint))); -} - -TabBar::~TabBar() -{ - TRACE_OBJ -} - -int TabBar::addNewTab(const QString &title) -{ - TRACE_OBJ - const int index = addTab(title); - setTabsClosable(count() > 1); - return index; -} - -void TabBar::setCurrent(HelpViewer *viewer) -{ - TRACE_OBJ - for (int i = 0; i < count(); ++i) { - HelpViewer *data = tabData(i).value(); - if (data == viewer) { - setCurrentIndex(i); - break; - } - } -} - -void TabBar::removeTabAt(HelpViewer *viewer) -{ - TRACE_OBJ - for (int i = 0; i < count(); ++i) { - HelpViewer *data = tabData(i).value(); - if (data == viewer) { - removeTab(i); - break; - } - } - setTabsClosable(count() > 1); -} - -void TabBar::titleChanged() -{ - TRACE_OBJ - for (int i = 0; i < count(); ++i) { - HelpViewer *data = tabData(i).value(); - QString title = data->title(); - title.replace(QLatin1Char('&'), QLatin1String("&&")); - setTabText(i, title.isEmpty() ? tr("(Untitled)") : title); - } -} - -void TabBar::slotCurrentChanged(int index) -{ - TRACE_OBJ - emit currentTabChanged(tabData(index).value()); -} - -void TabBar::slotTabCloseRequested(int index) -{ - TRACE_OBJ - OpenPagesManager::instance()->closePage(tabData(index).value()); -} - -void TabBar::slotCustomContextMenuRequested(const QPoint &pos) -{ - TRACE_OBJ - const int tab = tabAt(pos); - if (tab < 0) - return; - - QMenu menu(QLatin1String(""), this); - menu.addAction(tr("New &Tab"), OpenPagesManager::instance(), SLOT(createPage())); - - const bool enableAction = count() > 1; - QAction *closePage = menu.addAction(tr("&Close Tab")); - closePage->setEnabled(enableAction); - - QAction *closePages = menu.addAction(tr("Close Other Tabs")); - closePages->setEnabled(enableAction); - - menu.addSeparator(); - - HelpViewer *viewer = tabData(tab).value(); - QAction *newBookmark = menu.addAction(tr("Add Bookmark for this Page...")); - const QString &url = viewer->source().toString(); - if (url.isEmpty() || url == QLatin1String("about:blank")) - newBookmark->setEnabled(false); - - QAction *pickedAction = menu.exec(mapToGlobal(pos)); - if (pickedAction == closePage) - slotTabCloseRequested(tab); - else if (pickedAction == closePages) { - for (int i = count() - 1; i >= 0; --i) { - if (i != tab) - slotTabCloseRequested(i); - } - } else if (pickedAction == newBookmark) - emit addBookmark(viewer->title(), url); -} - -// -- CentralWidget - -CentralWidget::CentralWidget(QWidget *parent) - : QWidget(parent) -#ifndef QT_NO_PRINTER - , m_printer(0) -#endif - , m_findWidget(new FindWidget(this)) - , m_stackedWidget(new QStackedWidget(this)) - , m_tabBar(new TabBar(this)) -{ - TRACE_OBJ - staticCentralWidget = this; - QVBoxLayout *vboxLayout = new QVBoxLayout(this); - - vboxLayout->setMargin(0); - vboxLayout->setSpacing(0); - vboxLayout->addWidget(m_tabBar); - m_tabBar->setVisible(HelpEngineWrapper::instance().showTabs()); - vboxLayout->addWidget(m_stackedWidget); - vboxLayout->addWidget(m_findWidget); - m_findWidget->hide(); - - connect(m_findWidget, SIGNAL(findNext()), this, SLOT(findNext())); - connect(m_findWidget, SIGNAL(findPrevious()), this, SLOT(findPrevious())); - connect(m_findWidget, SIGNAL(find(QString, bool, bool)), this, - SLOT(find(QString, bool, bool))); - connect(m_findWidget, SIGNAL(escapePressed()), this, SLOT(activateTab())); - connect(m_tabBar, SIGNAL(addBookmark(QString, QString)), this, - SIGNAL(addBookmark(QString, QString))); -} - -CentralWidget::~CentralWidget() -{ - TRACE_OBJ - QStringList zoomFactors; - QStringList currentPages; - for (int i = 0; i < m_stackedWidget->count(); ++i) { - const HelpViewer * const viewer = viewerAt(i); - const QUrl &source = viewer->source(); - if (source.isValid()) { - currentPages << source.toString(); - zoomFactors << QString::number(viewer->scale()); - } - } - - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - helpEngine.setLastShownPages(currentPages); - helpEngine.setLastZoomFactors(zoomFactors); - helpEngine.setLastTabPage(m_stackedWidget->currentIndex()); - -#ifndef QT_NO_PRINTER - delete m_printer; -#endif -} - -CentralWidget *CentralWidget::instance() -{ - TRACE_OBJ - return staticCentralWidget; -} - -QUrl CentralWidget::currentSource() const -{ - TRACE_OBJ - return currentHelpViewer()->source(); -} - -QString CentralWidget::currentTitle() const -{ - TRACE_OBJ - return currentHelpViewer()->title(); -} - -bool CentralWidget::hasSelection() const -{ - TRACE_OBJ - return !currentHelpViewer()->selectedText().isEmpty(); -} - -bool CentralWidget::isForwardAvailable() const -{ - TRACE_OBJ - return currentHelpViewer()->isForwardAvailable(); -} - -bool CentralWidget::isBackwardAvailable() const -{ - TRACE_OBJ - return currentHelpViewer()->isBackwardAvailable(); -} - -HelpViewer* CentralWidget::viewerAt(int index) const -{ - TRACE_OBJ - return static_cast(m_stackedWidget->widget(index)); -} - -HelpViewer* CentralWidget::currentHelpViewer() const -{ - TRACE_OBJ - return static_cast(m_stackedWidget->currentWidget()); -} - -void CentralWidget::addPage(HelpViewer *page, bool fromSearch) -{ - TRACE_OBJ - page->installEventFilter(this); - page->setFocus(Qt::OtherFocusReason); - connectSignals(page); - const int index = m_stackedWidget->addWidget(page); - m_tabBar->setTabData(m_tabBar->addNewTab(page->title()), - QVariant::fromValue(viewerAt(index))); - connect (page, SIGNAL(titleChanged()), m_tabBar, SLOT(titleChanged())); - - if (fromSearch) { - connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, - SLOT(highlightSearchTerms())); - } -} - -void CentralWidget::removePage(int index) -{ - TRACE_OBJ - const bool currentChanged = index == currentIndex(); - m_tabBar->removeTabAt(viewerAt(index)); - m_stackedWidget->removeWidget(m_stackedWidget->widget(index)); - if (currentChanged) - emit currentViewerChanged(); -} - -int CentralWidget::currentIndex() const -{ - TRACE_OBJ - return m_stackedWidget->currentIndex(); -} - -void CentralWidget::setCurrentPage(HelpViewer *page) -{ - TRACE_OBJ - m_tabBar->setCurrent(page); - m_stackedWidget->setCurrentWidget(page); - emit currentViewerChanged(); -} - -void CentralWidget::connectTabBar() -{ - TRACE_OBJ - connect(m_tabBar, SIGNAL(currentTabChanged(HelpViewer*)), - OpenPagesManager::instance(), SLOT(setCurrentPage(HelpViewer*))); -} - -// -- public slots - -void CentralWidget::copy() -{ - TRACE_OBJ - currentHelpViewer()->copy(); -} - -void CentralWidget::home() -{ - TRACE_OBJ - currentHelpViewer()->home(); -} - -void CentralWidget::zoomIn() -{ - TRACE_OBJ - currentHelpViewer()->scaleUp(); -} - -void CentralWidget::zoomOut() -{ - TRACE_OBJ - currentHelpViewer()->scaleDown(); -} - -void CentralWidget::resetZoom() -{ - TRACE_OBJ - currentHelpViewer()->resetScale(); -} - -void CentralWidget::forward() -{ - TRACE_OBJ - currentHelpViewer()->forward(); -} - -void CentralWidget::nextPage() -{ - TRACE_OBJ - m_stackedWidget->setCurrentIndex((m_stackedWidget->currentIndex() + 1) - % m_stackedWidget->count()); -} - -void CentralWidget::backward() -{ - TRACE_OBJ - currentHelpViewer()->backward(); -} - -void CentralWidget::previousPage() -{ - TRACE_OBJ - m_stackedWidget->setCurrentIndex((m_stackedWidget->currentIndex() - 1) - % m_stackedWidget->count()); -} - -void CentralWidget::print() -{ - TRACE_OBJ -#ifndef QT_NO_PRINTER - initPrinter(); - QPrintDialog dlg(m_printer, this); - - if (!currentHelpViewer()->selectedText().isEmpty()) - dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection); - dlg.addEnabledOption(QAbstractPrintDialog::PrintPageRange); - dlg.addEnabledOption(QAbstractPrintDialog::PrintCollateCopies); - dlg.setWindowTitle(tr("Print Document")); - if (dlg.exec() == QDialog::Accepted) - currentHelpViewer()->print(m_printer); -#endif -} - -void CentralWidget::pageSetup() -{ - TRACE_OBJ -#ifndef QT_NO_PRINTER - initPrinter(); - QPageSetupDialog dlg(m_printer); - dlg.exec(); -#endif -} - -void CentralWidget::printPreview() -{ - TRACE_OBJ -#ifndef QT_NO_PRINTER - initPrinter(); - QPrintPreviewDialog preview(m_printer, this); - connect(&preview, SIGNAL(paintRequested(QPrinter*)), - SLOT(printPreview(QPrinter*))); - preview.exec(); -#endif -} - -void CentralWidget::setSource(const QUrl &url) -{ - TRACE_OBJ - HelpViewer *viewer = currentHelpViewer(); - viewer->setSource(url); - viewer->setFocus(Qt::OtherFocusReason); -} - -void CentralWidget::setSourceFromSearch(const QUrl &url) -{ - TRACE_OBJ - connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, - SLOT(highlightSearchTerms())); - currentHelpViewer()->setSource(url); - currentHelpViewer()->setFocus(Qt::OtherFocusReason); -} - -void CentralWidget::findNext() -{ - TRACE_OBJ - find(m_findWidget->text(), true, false); -} - -void CentralWidget::findPrevious() -{ - TRACE_OBJ - find(m_findWidget->text(), false, false); -} - -void CentralWidget::find(const QString &ttf, bool forward, bool incremental) -{ - TRACE_OBJ - bool found = false; - if (HelpViewer *viewer = currentHelpViewer()) { - HelpViewer::FindFlags flags = 0; - if (!forward) - flags |= HelpViewer::FindBackward; - if (m_findWidget->caseSensitive()) - flags |= HelpViewer::FindCaseSensitively; - found = viewer->findText(ttf, flags, incremental, false); - } - - if (!found && ttf.isEmpty()) - found = true; // the line edit is empty, no need to mark it red... - - if (!m_findWidget->isVisible()) - m_findWidget->show(); - m_findWidget->setPalette(found); -} - -void CentralWidget::activateTab() -{ - TRACE_OBJ - currentHelpViewer()->setFocus(); -} - -void CentralWidget::showTextSearch() -{ - TRACE_OBJ - m_findWidget->show(); -} - -void CentralWidget::updateBrowserFont() -{ - TRACE_OBJ - const int count = m_stackedWidget->count(); - const QFont &font = viewerAt(count - 1)->viewerFont(); - for (int i = 0; i < count; ++i) - viewerAt(i)->setViewerFont(font); -} - -void CentralWidget::updateUserInterface() -{ - m_tabBar->setVisible(HelpEngineWrapper::instance().showTabs()); -} - -// -- protected - -void CentralWidget::keyPressEvent(QKeyEvent *e) -{ - TRACE_OBJ - const QString &text = e->text(); - if (text.startsWith(QLatin1Char('/'))) { - if (!m_findWidget->isVisible()) { - m_findWidget->showAndClear(); - } else { - m_findWidget->show(); - } - } else { - QWidget::keyPressEvent(e); - } -} - -void CentralWidget::focusInEvent(QFocusEvent * /* event */) -{ - TRACE_OBJ - // If we have a current help viewer then this is the 'focus proxy', - // otherwise it's the central widget. This is needed, so an embedding - // program can just set the focus to the central widget and it does - // The Right Thing(TM) - QObject *receiver = m_stackedWidget; - if (HelpViewer *viewer = currentHelpViewer()) - receiver = viewer; - QTimer::singleShot(1, receiver, SLOT(setFocus())); -} - -// -- private slots - -void CentralWidget::highlightSearchTerms() -{ - TRACE_OBJ - QHelpSearchEngine *searchEngine = - HelpEngineWrapper::instance().searchEngine(); - QList queryList = searchEngine->query(); - - QStringList terms; - foreach (const QHelpSearchQuery &query, queryList) { - switch (query.fieldName) { - default: break; - case QHelpSearchQuery::ALL: { - case QHelpSearchQuery::PHRASE: - case QHelpSearchQuery::DEFAULT: - case QHelpSearchQuery::ATLEAST: - foreach (QString term, query.wordList) - terms.append(term.remove(QLatin1Char('"'))); - } - } - } - - HelpViewer *viewer = currentHelpViewer(); - foreach (const QString& term, terms) - viewer->findText(term, 0, false, true); - disconnect(viewer, SIGNAL(loadFinished(bool)), this, - SLOT(highlightSearchTerms())); -} - -void CentralWidget::printPreview(QPrinter *p) -{ - TRACE_OBJ -#ifndef QT_NO_PRINTER - currentHelpViewer()->print(p); -#endif -} - -void CentralWidget::handleSourceChanged(const QUrl &url) -{ - TRACE_OBJ - if (sender() == currentHelpViewer()) - emit sourceChanged(url); -} - -// -- private - -void CentralWidget::initPrinter() -{ - TRACE_OBJ -#ifndef QT_NO_PRINTER - if (!m_printer) - m_printer = new QPrinter(QPrinter::HighResolution); -#endif -} - -void CentralWidget::connectSignals(HelpViewer *page) -{ - TRACE_OBJ - connect(page, SIGNAL(copyAvailable(bool)), this, - SIGNAL(copyAvailable(bool))); - connect(page, SIGNAL(forwardAvailable(bool)), this, - SIGNAL(forwardAvailable(bool))); - connect(page, SIGNAL(backwardAvailable(bool)), this, - SIGNAL(backwardAvailable(bool))); - connect(page, SIGNAL(sourceChanged(QUrl)), this, - SLOT(handleSourceChanged(QUrl))); - connect(page, SIGNAL(highlighted(QString)), this, - SIGNAL(highlighted(QString))); - connect(page, SIGNAL(printRequested()), this, SLOT(print())); -} - -bool CentralWidget::eventFilter(QObject *object, QEvent *e) -{ - TRACE_OBJ - if (e->type() != QEvent::KeyPress) - return QWidget::eventFilter(object, e); - - HelpViewer *viewer = currentHelpViewer(); - QKeyEvent *keyEvent = static_cast (e); - if (viewer == object && keyEvent->key() == Qt::Key_Backspace) { - if (viewer->isBackwardAvailable()) { -#if !defined(QT_NO_WEBKIT) - // this helps in case there is an html field - if (!viewer->hasFocus()) -#endif - viewer->backward(); - } - } - return QWidget::eventFilter(object, e); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/centralwidget.h b/src/assistant/tools/assistant/centralwidget.h deleted file mode 100644 index cdf132a1f..000000000 --- a/src/assistant/tools/assistant/centralwidget.h +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CENTRALWIDGET_H -#define CENTRALWIDGET_H - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class FindWidget; -class HelpViewer; -class QStackedWidget; - -class TabBar : public QTabBar -{ - Q_OBJECT -public: - TabBar(QWidget *parent = 0); - ~TabBar(); - - int addNewTab(const QString &title); - void setCurrent(HelpViewer *viewer); - void removeTabAt(HelpViewer *viewer); - -public slots: - void titleChanged(); - -signals: - void currentTabChanged(HelpViewer *viewer); - void addBookmark(const QString &title, const QString &url); - -private slots: - void slotCurrentChanged(int index); - void slotTabCloseRequested(int index); - void slotCustomContextMenuRequested(const QPoint &pos); -}; - -class CentralWidget : public QWidget -{ - Q_OBJECT - -public: - CentralWidget(QWidget *parent = 0); - ~CentralWidget(); - - static CentralWidget *instance(); - - QUrl currentSource() const; - QString currentTitle() const; - - bool hasSelection() const; - bool isForwardAvailable() const; - bool isBackwardAvailable() const; - - HelpViewer *viewerAt(int index) const; - HelpViewer *currentHelpViewer() const; - - void addPage(HelpViewer *page, bool fromSearch = false); - void removePage(int index); - - int currentIndex() const; - void setCurrentPage(HelpViewer *page); - - void connectTabBar(); - -public slots: - void copy(); - void home(); - - void zoomIn(); - void zoomOut(); - void resetZoom(); - - void forward(); - void nextPage(); - - void backward(); - void previousPage(); - - void print(); - void pageSetup(); - void printPreview(); - - void setSource(const QUrl &url); - void setSourceFromSearch(const QUrl &url); - - void findNext(); - void findPrevious(); - void find(const QString &text, bool forward, bool incremental); - - void activateTab(); - void showTextSearch(); - void updateBrowserFont(); - void updateUserInterface(); - -signals: - void currentViewerChanged(); - void copyAvailable(bool yes); - void sourceChanged(const QUrl &url); - void highlighted(const QString &link); - void forwardAvailable(bool available); - void backwardAvailable(bool available); - void addBookmark(const QString &title, const QString &url); - -protected: - void keyPressEvent(QKeyEvent *); - void focusInEvent(QFocusEvent *event); - -private slots: - void highlightSearchTerms(); - void printPreview(QPrinter *printer); - void handleSourceChanged(const QUrl &url); - -private: - void initPrinter(); - void connectSignals(HelpViewer *page); - bool eventFilter(QObject *object, QEvent *e); - -private: -#ifndef QT_NO_PRINTER - QPrinter *m_printer; -#endif - FindWidget *m_findWidget; - QStackedWidget *m_stackedWidget; - TabBar *m_tabBar; -}; - -QT_END_NAMESPACE - -#endif // CENTRALWIDGET_H diff --git a/src/assistant/tools/assistant/cmdlineparser.cpp b/src/assistant/tools/assistant/cmdlineparser.cpp deleted file mode 100644 index bc498a9d3..000000000 --- a/src/assistant/tools/assistant/cmdlineparser.cpp +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include -#include -#include - -#include "cmdlineparser.h" - -QT_BEGIN_NAMESPACE - -static const char helpMessage[] = QT_TRANSLATE_NOOP("CmdLineParser", - "Usage: assistant [Options]\n\n" - "-collectionFile file Uses the specified collection\n" - " file instead of the default one\n" - "-showUrl url Shows the document with the\n" - " url.\n" - "-enableRemoteControl Enables Assistant to be\n" - " remotely controlled.\n" - "-show widget Shows the specified dockwidget\n" - " which can be \"contents\", \"index\",\n" - " \"bookmarks\" or \"search\".\n" - "-activate widget Activates the specified dockwidget\n" - " which can be \"contents\", \"index\",\n" - " \"bookmarks\" or \"search\".\n" - "-hide widget Hides the specified dockwidget\n" - " which can be \"contents\", \"index\"\n" - " \"bookmarks\" or \"search\".\n" - "-register helpFile Registers the specified help file\n" - " (.qch) in the given collection\n" - " file.\n" - "-unregister helpFile Unregisters the specified help file\n" - " (.qch) from the give collection\n" - " file.\n" - "-setCurrentFilter filter Set the filter as the active filter.\n" - "-remove-search-index Removes the full text search index.\n" - "-rebuild-search-index Re-builds the full text search index (potentially slow).\n" - "-quiet Does not display any error or\n" - " status message.\n" - "-help Displays this help.\n" - ); - - -CmdLineParser::CmdLineParser(const QStringList &arguments) - : m_pos(0), - m_enableRemoteControl(false), - m_contents(Untouched), - m_index(Untouched), - m_bookmarks(Untouched), - m_search(Untouched), - m_register(None), - m_removeSearchIndex(false), - m_rebuildSearchIndex(false), - m_quiet(false) -{ - TRACE_OBJ - for (int i = 1; i < arguments.count(); ++i) { - const QString &arg = arguments.at(i); - if (arg.toLower() == "-quiet") - m_quiet = true; - else - m_arguments.append(arg); - } -} - -CmdLineParser::Result CmdLineParser::parse() -{ - TRACE_OBJ - bool showHelp = false; - - while (m_error.isEmpty() && hasMoreArgs()) { - const QString &arg = nextArg().toLower(); - if (arg == QLatin1String("-collectionfile")) - handleCollectionFileOption(); - else if (arg == QLatin1String("-showurl")) - handleShowUrlOption(); - else if (arg == QLatin1String("-enableremotecontrol")) - m_enableRemoteControl = true; - else if (arg == QLatin1String("-show")) - handleShowOption(); - else if (arg == QLatin1String("-hide")) - handleHideOption(); - else if (arg == QLatin1String("-activate")) - handleActivateOption(); - else if (arg == QLatin1String("-register")) - handleRegisterOption(); - else if (arg == QLatin1String("-unregister")) - handleUnregisterOption(); - else if (arg == QLatin1String("-setcurrentfilter")) - handleSetCurrentFilterOption(); - else if (arg == QLatin1String("-remove-search-index")) - m_removeSearchIndex = true; - else if (arg == QLatin1String("-rebuild-search-index")) - m_rebuildSearchIndex = true; - else if (arg == QLatin1String("-help")) - showHelp = true; - else - m_error = tr("Unknown option: %1").arg(arg); - } - - if (!m_error.isEmpty()) { - showMessage(m_error + QLatin1String("\n\n\n") + tr(helpMessage), true); - return Error; - } else if (showHelp) { - showMessage(tr(helpMessage), false); - return Help; - } - return Ok; -} - -bool CmdLineParser::hasMoreArgs() const -{ - TRACE_OBJ - return m_pos < m_arguments.count(); -} - -const QString &CmdLineParser::nextArg() -{ - TRACE_OBJ - Q_ASSERT(hasMoreArgs()); - return m_arguments.at(m_pos++); -} - -void CmdLineParser::handleCollectionFileOption() -{ - TRACE_OBJ - if (hasMoreArgs()) { - const QString &fileName = nextArg(); - m_collectionFile = getFileName(fileName); - if (m_collectionFile.isEmpty()) - m_error = tr("The collection file '%1' does not exist."). - arg(fileName); - } else { - m_error = tr("Missing collection file."); - } -} - -void CmdLineParser::handleShowUrlOption() -{ - TRACE_OBJ - if (hasMoreArgs()) { - const QString &urlString = nextArg(); - QUrl url(urlString); - if (url.isValid()) { - m_url = url; - } else - m_error = tr("Invalid URL '%1'.").arg(urlString); - } else { - m_error = tr("Missing URL."); - } -} - -void CmdLineParser::handleShowOption() -{ - TRACE_OBJ - handleShowOrHideOrActivateOption(Show); -} - -void CmdLineParser::handleHideOption() -{ - TRACE_OBJ - handleShowOrHideOrActivateOption(Hide); -} - -void CmdLineParser::handleActivateOption() -{ - TRACE_OBJ - handleShowOrHideOrActivateOption(Activate); -} - -void CmdLineParser::handleShowOrHideOrActivateOption(ShowState state) -{ - TRACE_OBJ - if (hasMoreArgs()) { - const QString &widget = nextArg().toLower(); - if (widget == QLatin1String("contents")) - m_contents = state; - else if (widget == QLatin1String("index")) - m_index = state; - else if (widget == QLatin1String("bookmarks")) - m_bookmarks = state; - else if (widget == QLatin1String("search")) - m_search = state; - else - m_error = tr("Unknown widget: %1").arg(widget); - } else { - m_error = tr("Missing widget."); - } -} - -void CmdLineParser::handleRegisterOption() -{ - TRACE_OBJ - handleRegisterOrUnregisterOption(Register); -} - -void CmdLineParser::handleUnregisterOption() -{ - TRACE_OBJ - handleRegisterOrUnregisterOption(Unregister); -} - -void CmdLineParser::handleRegisterOrUnregisterOption(RegisterState state) -{ - TRACE_OBJ - if (hasMoreArgs()) { - const QString &fileName = nextArg(); - m_helpFile = getFileName(fileName); - if (m_helpFile.isEmpty()) - m_error = tr("The Qt help file '%1' does not exist.").arg(fileName); - else - m_register = state; - } else { - m_error = tr("Missing help file."); - } -} - -void CmdLineParser::handleSetCurrentFilterOption() -{ - TRACE_OBJ - if (hasMoreArgs()) - m_currentFilter = nextArg(); - else - m_error = tr("Missing filter argument."); -} - -QString CmdLineParser::getFileName(const QString &fileName) -{ - TRACE_OBJ - QFileInfo fi(fileName); - if (!fi.exists()) - return QString(); - return fi.absoluteFilePath(); -} - -void CmdLineParser::showMessage(const QString &msg, bool error) -{ - TRACE_OBJ - if (m_quiet) - return; -#ifdef Q_OS_WIN - QString message = QLatin1String("
") % msg % QLatin1String("
"); - if (error) - QMessageBox::critical(0, tr("Error"), message); - else - QMessageBox::information(0, tr("Notice"), message); -#else - fprintf(error ? stderr : stdout, "%s\n", qPrintable(msg)); -#endif -} - -void CmdLineParser::setCollectionFile(const QString &file) -{ - TRACE_OBJ - m_collectionFile = file; -} - -QString CmdLineParser::collectionFile() const -{ - TRACE_OBJ - return m_collectionFile; -} - -bool CmdLineParser::collectionFileGiven() const -{ - TRACE_OBJ - return m_arguments.contains(QLatin1String("-collectionfile"), - Qt::CaseInsensitive); -} - -QUrl CmdLineParser::url() const -{ - TRACE_OBJ - return m_url; -} - -bool CmdLineParser::enableRemoteControl() const -{ - TRACE_OBJ - return m_enableRemoteControl; -} - -CmdLineParser::ShowState CmdLineParser::contents() const -{ - TRACE_OBJ - return m_contents; -} - -CmdLineParser::ShowState CmdLineParser::index() const -{ - TRACE_OBJ - return m_index; -} - -CmdLineParser::ShowState CmdLineParser::bookmarks() const -{ - TRACE_OBJ - return m_bookmarks; -} - -CmdLineParser::ShowState CmdLineParser::search() const -{ - TRACE_OBJ - return m_search; -} - -QString CmdLineParser::currentFilter() const -{ - TRACE_OBJ - return m_currentFilter; -} - -bool CmdLineParser::removeSearchIndex() const -{ - TRACE_OBJ - return m_removeSearchIndex; -} - -bool CmdLineParser::rebuildSearchIndex() const -{ - TRACE_OBJ - return m_rebuildSearchIndex; -} - -CmdLineParser::RegisterState CmdLineParser::registerRequest() const -{ - TRACE_OBJ - return m_register; -} - -QString CmdLineParser::helpFile() const -{ - TRACE_OBJ - return m_helpFile; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/cmdlineparser.h b/src/assistant/tools/assistant/cmdlineparser.h deleted file mode 100644 index f45679f66..000000000 --- a/src/assistant/tools/assistant/cmdlineparser.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CMDLINEPARSER_H -#define CMDLINEPARSER_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class CmdLineParser -{ - Q_DECLARE_TR_FUNCTIONS(CmdLineParser) -public: - enum Result {Ok, Help, Error}; - enum ShowState {Untouched, Show, Hide, Activate}; - enum RegisterState {None, Register, Unregister}; - - CmdLineParser(const QStringList &arguments); - Result parse(); - - void setCollectionFile(const QString &file); - QString collectionFile() const; - bool collectionFileGiven() const; - QString cloneFile() const; - QUrl url() const; - bool enableRemoteControl() const; - ShowState contents() const; - ShowState index() const; - ShowState bookmarks() const; - ShowState search() const; - QString currentFilter() const; - bool removeSearchIndex() const; - bool rebuildSearchIndex() const; - RegisterState registerRequest() const; - QString helpFile() const; - - void showMessage(const QString &msg, bool error); - -private: - QString getFileName(const QString &fileName); - bool hasMoreArgs() const; - const QString &nextArg(); - void handleCollectionFileOption(); - void handleShowUrlOption(); - void handleShowOption(); - void handleHideOption(); - void handleActivateOption(); - void handleShowOrHideOrActivateOption(ShowState state); - void handleRegisterOption(); - void handleUnregisterOption(); - void handleRegisterOrUnregisterOption(RegisterState state); - void handleSetCurrentFilterOption(); - - QStringList m_arguments; - int m_pos; - QString m_collectionFile; - QString m_cloneFile; - QString m_helpFile; - QUrl m_url; - bool m_enableRemoteControl; - - ShowState m_contents; - ShowState m_index; - ShowState m_bookmarks; - ShowState m_search; - RegisterState m_register; - QString m_currentFilter; - bool m_removeSearchIndex; - bool m_rebuildSearchIndex; - bool m_quiet; - QString m_error; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/assistant/contentwindow.cpp b/src/assistant/tools/assistant/contentwindow.cpp deleted file mode 100644 index 3fb1555e0..000000000 --- a/src/assistant/tools/assistant/contentwindow.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "contentwindow.h" - -#include "centralwidget.h" -#include "helpenginewrapper.h" -#include "helpviewer.h" -#include "openpagesmanager.h" -#include "tracer.h" - -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -ContentWindow::ContentWindow() - : m_contentWidget(HelpEngineWrapper::instance().contentWidget()) - , m_expandDepth(-2) -{ - TRACE_OBJ - m_contentWidget->viewport()->installEventFilter(this); - m_contentWidget->setContextMenuPolicy(Qt::CustomContextMenu); - - QVBoxLayout *layout = new QVBoxLayout(this); - layout->setMargin(4); - layout->addWidget(m_contentWidget); - - connect(m_contentWidget, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(showContextMenu(QPoint))); - connect(m_contentWidget, SIGNAL(linkActivated(QUrl)), this, - SIGNAL(linkActivated(QUrl))); - - QHelpContentModel *contentModel = - qobject_cast(m_contentWidget->model()); - connect(contentModel, SIGNAL(contentsCreated()), this, SLOT(expandTOC())); -} - -ContentWindow::~ContentWindow() -{ - TRACE_OBJ -} - -bool ContentWindow::syncToContent(const QUrl& url) -{ - TRACE_OBJ - QModelIndex idx = m_contentWidget->indexOf(url); - if (!idx.isValid()) - return false; - m_contentWidget->setCurrentIndex(idx); - return true; -} - -void ContentWindow::expandTOC() -{ - TRACE_OBJ - Q_ASSERT(m_expandDepth >= -2); - if (m_expandDepth > -2) { - expandToDepth(m_expandDepth); - m_expandDepth = -2; - } -} - -void ContentWindow::expandToDepth(int depth) -{ - TRACE_OBJ - Q_ASSERT(depth >= -2); - m_expandDepth = depth; - if (depth == -1) - m_contentWidget->expandAll(); - else if (depth == 0) - m_contentWidget->collapseAll(); - else - m_contentWidget->expandToDepth(depth - 1); -} - -void ContentWindow::focusInEvent(QFocusEvent *e) -{ - TRACE_OBJ - if (e->reason() != Qt::MouseFocusReason) - m_contentWidget->setFocus(); -} - -void ContentWindow::keyPressEvent(QKeyEvent *e) -{ - TRACE_OBJ - if (e->key() == Qt::Key_Escape) - emit escapePressed(); -} - -bool ContentWindow::eventFilter(QObject *o, QEvent *e) -{ - TRACE_OBJ - if (m_contentWidget && o == m_contentWidget->viewport() - && e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast(e); - const QModelIndex &index = m_contentWidget->indexAt(me->pos()); - if (!index.isValid()) - return QWidget::eventFilter(o, e); - - const Qt::MouseButtons button = me->button(); - QItemSelectionModel *sm = m_contentWidget->selectionModel(); - if (sm->isSelected(index)) { - if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier)) - || (button == Qt::MidButton)) { - QHelpContentModel *contentModel = - qobject_cast(m_contentWidget->model()); - if (contentModel) { - QHelpContentItem *itm = contentModel->contentItemAt(index); - if (itm && HelpViewer::canOpenPage(itm->url().path())) - OpenPagesManager::instance()->createPage(itm->url()); - } - } else if (button == Qt::LeftButton) { - itemClicked(index); - } - } - } - return QWidget::eventFilter(o, e); -} - - -void ContentWindow::showContextMenu(const QPoint &pos) -{ - TRACE_OBJ - if (!m_contentWidget->indexAt(pos).isValid()) - return; - - QHelpContentModel *contentModel = - qobject_cast(m_contentWidget->model()); - QHelpContentItem *itm = - contentModel->contentItemAt(m_contentWidget->currentIndex()); - - QMenu menu; - QAction *curTab = menu.addAction(tr("Open Link")); - QAction *newTab = menu.addAction(tr("Open Link in New Tab")); - if (!HelpViewer::canOpenPage(itm->url().path())) - newTab->setEnabled(false); - - menu.move(m_contentWidget->mapToGlobal(pos)); - - QAction *action = menu.exec(); - if (curTab == action) - emit linkActivated(itm->url()); - else if (newTab == action) - OpenPagesManager::instance()->createPage(itm->url()); -} - -void ContentWindow::itemClicked(const QModelIndex &index) -{ - TRACE_OBJ - QHelpContentModel *contentModel = - qobject_cast(m_contentWidget->model()); - - if (contentModel) { - if (QHelpContentItem *itm = contentModel->contentItemAt(index)) { - const QUrl &url = itm->url(); - if (url != CentralWidget::instance()->currentSource()) - emit linkActivated(url); - } - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/contentwindow.h b/src/assistant/tools/assistant/contentwindow.h deleted file mode 100644 index 9c7f4c24f..000000000 --- a/src/assistant/tools/assistant/contentwindow.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CONTENTWINDOW_H -#define CONTENTWINDOW_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpEngine; -class QHelpContentItem; -class QHelpContentWidget; - -class ContentWindow : public QWidget -{ - Q_OBJECT - -public: - ContentWindow(); - ~ContentWindow(); - - bool syncToContent(const QUrl &url); - void expandToDepth(int depth); - -signals: - void linkActivated(const QUrl &link); - void escapePressed(); - -private slots: - void showContextMenu(const QPoint &pos); - void expandTOC(); - void itemClicked(const QModelIndex &index); - -private: - void focusInEvent(QFocusEvent *e); - void keyPressEvent(QKeyEvent *e); - bool eventFilter(QObject *o, QEvent *e); - - QHelpContentWidget * const m_contentWidget; - int m_expandDepth; -}; - -QT_END_NAMESPACE - -#endif // CONTENTWINDOW_H diff --git a/src/assistant/tools/assistant/doc/HOWTO b/src/assistant/tools/assistant/doc/HOWTO deleted file mode 100644 index a0143479e..000000000 --- a/src/assistant/tools/assistant/doc/HOWTO +++ /dev/null @@ -1,16 +0,0 @@ -How to build/ update a new assistant.qch for Assistant internal help - -- update: - - open assistant.qdocconf, update year and qt version - - - ..\..\..\..\qdoc3\debug\qdoc3.exe assistant.qdocconf - will generate an folder html containing all required stuff - - - cp assistant.qhp to generated html folder - - run qhelpgenerator html\assistant.qhp -o ..\assistant.qch - - - rebuild assistant - -- to test your changes: - - remove assistant.qch in your cache directory - - restart assistant diff --git a/src/assistant/tools/assistant/doc/assistant.qdoc b/src/assistant/tools/assistant/doc/assistant.qdoc deleted file mode 100644 index 8bd7432ec..000000000 --- a/src/assistant/tools/assistant/doc/assistant.qdoc +++ /dev/null @@ -1,461 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Free Documentation License -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of this -** file. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page assistant.html - \title Qt Assistant - - \chapter Introduction - - This document introduces \e{Qt Assistant}, a tool for presenting on-line - documentation. It also introduces the Qt Reference Documentation which - is accessible using \e{Qt Assistant}, or with a web browser. The document is - divided into the following sections: - - Table of contents: - - \list - \o \l{Introduction} - \o \l{The One-Minute Guide to Using Qt Assistant} - \o \l{Introduction to the Qt Reference Documentation} - \o \l{Qt Assistant in More Detail} - \o \l{Full Text Searching} - \endlist - - \chapter The One-Minute Guide to Using Qt Assistant - - Once you have installed Qt, \QA should be ready to run: - - \list - \o On Windows, \QA is available as a menu option on the Qt menu. - \o On Mac OS X, \QA is installed in the /Developer/Applications/Qt directory. - \o On Unix/Linux, open a terminal, type \c{assistant} and press \key{Enter}. - \endlist - - When you start up \QA, you will be presented with a standard main window - application, with a menu bar and toolbar. Below these, on the left hand - side are navigation windows called \e{Contents}, \e{Index} and \e{Bookmarks}. - On the right, taking up most of the space, is the \e{Documentation} window. - By default, \QA loads the Qt reference documentation along with the manuals - of other Qt tools, like \QD or \QL. - - \QA works in a similar way to a Web browser. If you click hyperlinks - (cross-references), the \e{Documentation} window will present the relevant - page. You can bookmark pages of particular interest and you can click the - \gui{Previous} and \gui{Next} toolbar buttons to navigate within the pages - you have visited. - - Although \QA can be used just like a Web browser to navigate through - the documentation, \QA offers a powerful means of navigation that Web - browsers do not provide. \QA uses an advanced full text search engine - to index all the pages in each compressed help file so that you can - search for particular words and phrases. - - To perform an index search, click the \gui{Index} tab on the Sidebar - (or press \key{Alt+I}). In the \gui{'Look For'} line edit enter a word; - e.g., 'homedirpath'. As you type, words are found and highlighted in a list - beneath the line edit. If the highlighted text matches what you're - looking for, double click it, (or press \key{Enter}) and the - \e{Documentation} window will display the relevant page. You rarely have - to type in the whole word before \QA finds a match. Note that for some - words there may be more than one possible page that is relevant. - - \QA also provides full text searching for finding specific words in - the documentation. To activate the full text search, either press \key(Alt+S) - or click on the \gui{Search} tab in the \e{Documentation} window. Then - enter the term you're looking for and hit the \gui{Search} button. All - documents containing the specified term will then be listed in the list box - below. - - \chapter Introduction to the Qt Reference Documentation - - The documentation for the Qt library is written in-line in the \c - .cpp files by the developers themselves. The documentation team - revises the documentation to ensure that it is accurate and usable, - and to provide quality control. The documentation team also writes the - larger texts, such as the class descriptions that introduce a class - along with the concepts the class uses, as well as introducing the - functions and properties that the class provides. - - The documentation focuses on the API rather than the internals, since - we make great efforts to keep our API consistent and compatible with - each new version, but we may change the internals considerably to improve - performance and enhance functionality. - - The Qt Reference Documentation consists of almost 1,500 HTML pages - (over 2,500 printed pages). The overwhelming majority of pages - document Qt classes. Since developers differ in the way they - think and work we provide a variety of approaches to navigating the - documentation set: - - \list - \i The \menu{Qt's Classes} page lists every class - in Qt's public API, and consists of several hundred classes. - \i The \menu{Qt's Main Classes} page lists the - classes you're most likely to use most often, and provides a much - shorter and more managable list than the All Classes list. - \i The \menu{Grouped Classes} page presents a list - of groups, each of which leads to a list of related classes, for - example, the \menu{Advanced Widgets} list. - \i The \menu{Class Inheritance Hierarchy} page - presents a list of classes in terms of the hierarchy of Qt classes. - \i The \menu{Member Function Index} page lists all the - functions provided by Qt classes, each one with links to the class(es) - in which it appears. - \endlist - - No matter where you find yourself in the Qt documentation, you will - find extensive cross-referencing. Even snippets of example code - contain clickable links, so that for example, if you come across a - class declaration in a code example, the class name will be a - clickable link to the class's documentation. - - In addition to the class documentation some of Qt's modules have - extensive descriptions, and there are many overview documents which - describe various aspects of the Qt library; all these are linked from - the reference documentation home page. There are also two tutorials - and numerous example programs in the examples subdirectory of the Qt - distribution. - - \chapter Qt Assistant in More Detail - - \img assistant-assistant.png - - \section1 Command Line Options - - \QA handles the following command line options: - - \table - \header - \o Command Line Option - \o Brief Description - \row - \o -collectionFile - \o Uses the specified collection file instead of the default one. - \row - \o -showUrl URL - \o Shows the document referenced by URL. - \row - \o -enableRemoteControl - \o Enables \QA to be remotly controlled. - \row - \o -show - \o Shows the specified dockwidget which can be "contents", "index", - "bookmarks" or "search". - \row - \o -hide - \o Hides the specified dockwidget which can be "contents", "index", - "bookmarks" or "search. - \row - \o -activate - \o Activates the specified dockwidget which can be "contents", - "index", "bookmarks" or "search. - \row - \o -register - \o Registers the specified compressed help file in the given help - collection. - \row - \o -unregister - \o Unregisters the specified compressed help file from the given - collection file. - \row - \o -quiet - \o Doesn't show any error, warning or success messages. - \endtable - - \section1 Tool Windows - - \img assistant-dockwidgets.png - - The tool windows provide four ways to navigate the documentation: - - \list - \o The \gui{Contents} window presents a table of contents implemented as a - tree view for the documentation that is available. If you click an item, - its documentation will appear in the \e{Documentation} window. If you double - click an item or click on the control to the left of it, the item's sub-items - will appear. Click a sub-item to make its page appear in the \e{Documentation} - window. Click on the control next to an open item to hide its sub-items. - \o The \gui{Index} window is used to look up key words or phrases. - See \l{The One-Minute Guide to Using Qt Assistant} for how to use this - window. - \o The \gui{Bookmarks} window lists any bookmarks you have made. Double - click a bookmark to make its page appear in the \e{Documentation} window. - The \gui{Bookmarks} window provides a context menu with \gui{Show Item}, - \gui{Delete Item} as well as \gui{Rename Item}. Click in the main menu - \menu{Bookmark|Add Bookmark...} (or press \key{Ctrl+B}) to bookmark the - page that is currently showing in the \e{Documentation} window. Right click - a bookmark in the list to rename or delete the highlighted bookmark. - \endlist - - If you want the \gui{Documentation} window to use as much space as possible, - you can easily group, move or hide the tool windows. To group the windows, - drag one on top of the other and release the mouse. If one or all tool - windows are not shown, press \key{Alt+C}, \key{Alt+I} or \key{Alt+O} to show - the required window. - - The tool windows can be docked into the main window, so you can drag them - to the top, left, right or bottom of \e{Qt Assistant's} window, or you can - drag them outside \QA to float them as independent windows. - - \section1 Documentation Window - - \img assistant-docwindow.png - - The \gui{Documentation} window lets you create a tab for each - documentation page that you view. Click the \gui{Add Tab} button and a new - tab will appear with the page name as the tab's caption. This makes it - convenient to switch between pages when you are working with different - documentation. You can delete a tab by clicking the \gui{Close Tab} button - located on the right side of the \gui{Documentation} window. - - \section1 Toolbars - - \img assistant-toolbar.png - - The main toolbar provides fast access to the most common actions. - - \table - \header \o Action \o Description \o Menu Item \o Shortcut - \row \o \gui{Previous} \o Takes you to the previous page in the history. - \o \menu{Go|Previous} \o \key{Alt+Left Arrow} - \row \o \gui{Next} \o Takes you to the next page in the history. - \o \menu{Go|Next} \o \key{Alt+Right Arrow} - \row \o \gui{Home} - \o Takes you to the home page as specified in the Preferences Dialog. - \o \menu{Go|Home} \o \key{Ctrl+Home}. - \row \o \gui{Sync with Table of Contents} - \o Synchronizes the \gui{Contents} tool window with the page currently - shown in the \gui{Documentation} window. - \o \menu{Go|Sync with Table of Contents} \o - \row \o \gui{Copy} \o Copies any selected text to the clipboard. - \o \menu{Edit|Copy} \o \key{Ctrl+C} - \row \o \gui{Print} \o Opens the \gui{Print} dialog. - \o \menu{File|Print} \o \key{Ctrl+P} - \row \o \gui{Find in Text} \o Opens the \gui{Find Text} dialog. - \o \menu{Edit|Find in Text} \o \key{Ctrl+F} - \row \o \gui{Zoom in} - \o Increases the font size used to display text in the current tab. - \o \menu{View|Zoom in} \o \key{Ctrl++} - \row \o \gui{Zoom out} - \o Decreases the font size used to display text in the current tab. - \o \menu{View|Zoom out} \o \key{Ctrl+-} - \row \o \gui{Normal Size} - \o Resets the font size to its normal size in the current tab. - \o \menu{View|Normal Size} \o \key{Ctrl+0} - \endtable - - \img assistant-address-toolbar.png - - The address toolbar provides a fast way to enter a specific URL for a - documentation file. By default, the address toolbar is not shown, so it - has to be activated via \menu{View|Toolbars|Address Toolbar}. - - \img assistant-filter-toolbar.png - - The filter toolbar allows you to apply a filter to the currently installed - documentation. As with the address toolbar, the filter toolbar is not visible - by default and has to be activated via \menu{View|Toolbars|Filter Toolbar}. - - \section1 Menus - - \section2 File Menu - - \list - \o \menu{File|Page Setup...} invokes a dialog allowing you to define - page layout properties, such as margin sizes, page orientation and paper size. - \o \menu{File|Print Preview...} provides a preview of the printed pages. - \o \menu{File|Print...} opens the \l{#Print Dialog}{\gui{Print} dialog}. - \o \menu{File|New Tab} opens a new empty tab in the \gui{Documentation} - window. - \o \menu{File|Close Tab} closes the current tab of the - \gui{Documentation} window. - \o \menu{File|Exit} closes the \QA application. - \endlist - - \section2 Edit Menu - - \list - \o \menu{Edit|Copy} copies any selected text to the clipboard. - \o \menu{Edit|Find in Text} invokes the \l{#Find Text Control}{\gui{Find Text} - control} at the lower end of the \gui{Documentation} window. - \o \menu{Edit|Find Next} looks for the next occurance of the specified - text in the \gui{Find Text} control. - \o \menu{Edit|Find Previous} looks for the previous occurance of - the specified text in the \l{#Find Text Control}{\gui{Find Text} control}. - \o \menu{Edit|Preferences} invokes the \l{#Preferences Dialog}{\gui{Preferences} dialog}. - \endlist - - \section2 View Menu - - \list - \o \menu{View|Zoom in} increases the font size in the current tab. - \o \menu{View|Zoom out} decreases the font size in the current tab. - \o \menu{View|Normal Size} resets the font size in the current tab. - \o \menu{View|Contents} toggles the display of the \gui{Contents} tool window. - \o \menu{View|Index} toggles the display of the \gui{Index} tool window. - \o \menu{View|Bookmarks} toggles the display of the \gui{Bookmarks} tool window. - \o \menu{View|Search} toggles the display of the Search in the \gui{Documentation} window. - \endlist - - \section2 Go Menu - - \list - \o \menu{Go|Home} goes to the home page. - \o \menu{Go|Back} displays the previous page in the history. - \o \menu{Go|Forward} displays the next page in the history. - \o \menu{Go|Sync with Table of Contents} syncs the \gui{Contents} tool window to the currently shown page. - \o \menu{Go|Next Page} selects the next tab in the \gui{Documentation} window. - \o \menu{Go|Previous Page} selects the previous tab in the \gui{Documentation} window. - \endlist - - \section2 Bookmarks Menu - - \list - \o \menu{Bookmarks|Add} adds the current page to the list of bookmarks. - \endlist - - \section1 Dialogs - - \section2 Print Dialog - - This dialog is platform-specific. It gives access to various printer - options and can be used to print the document shown in the current tab. - - \section2 Preferences Dialog - - \img assistant-preferences-fonts.png - - The \menu{Fonts} page allows you to change the font family and font sizes of the - browser window displaying the documentation or the application itself. - - \img assistant-preferences-filters.png - - The \menu{Filters} page lets you create and remove documentation - filters. To add a new filter, click the \gui{Add} button, specify a - filter name in the pop-up dialog and click \gui{OK}, then select - the filter attributes in the list box on the right hand side. - You can delete a filter by selecting it and clicking the \gui{Remove} - button. - - \img assistant-preferences-documentation.png - - The \menu{Documentation} page lets you install and remove compressed help - files. Click the \gui{Install} button and choose the path of the compressed - help file (*.qch) you would like to install. - To delete a help file, select a documentation set in the list and click - \gui{Remove}. - - \img assistant-preferences-options.png - - The \menu{Options} page lets you specify the homepage \QA will display when - you click the \gui{Home} button in \QA's main user interface. You can specify - the hompage by typing it here or clicking on one of the buttons below the - textbox. \gui{Current Page} sets the currently displayed page as your home - page while \gui{Restore to default} will reset your home page to the default - home page. - - \section1 Find Text Control - - This control is used to find text in the current page. Enter the text you want - to find in the line edit. The search is incremental, meaning that the most - relevant result is shown as you enter characters into the line edit. - - If you check the \gui{Whole words only} checkbox, the search will only consider - whole words; for example, if you search for "spin" with this checkbox checked it will - not match "spinbox", but will match "spin". If you check the \gui{Case sensitive} - checkbox then, for example, "spin" will match "spin" but not "Spin". You can - search forwards or backwards from your current position in the page by clicking - the \gui{Previous} or \gui{Next} buttons. To hide the find control, either click the - \gui{Close} button or hit the \key{Esc} key. - - \section1 Filtering Help Contents - - \QA allows you to install any kind of documentation as long as it is organized - in Qt compressed help files (*.qch). For example, it is possible to install the - Qt reference documentation for Qt 4.4.0 and Qt 4.4.1 at the same time. In many - respects, this is very convenient since only one version of \QA is needed. - However, at the same time it becomes more complicated when performing tasks like - searching the index because nearly every keyword is defined in Qt 4.4.0 as well - as in Qt 4.4.1. This means that \QA will always ask the user to choose which one - should be displayed. - - We use documentation filters to solve this issue. A filter is identified by its - name, and contains a list of filter attributes. An attribute is just a string and - can be freely chosen. Attributes are defined by the documentation itself, this - means that every documentation set usually has one or more attributes. - - For example, the Qt 4.4.0 \QA documentation defines the attributes \c {assistant}, - \c{tools} and \c{4.4.0}, \QD defines \c{designer}, \c{tools} and \c{4.4.0}. - The filter to display all tools would then define only the attribute - \c{tools} since this attribute is part of both documentation sets. - Adding the attribute \c{assistant} to the filter would then only show \QA - documentation since the \QD documentation does not contain this - attribute. Having an empty list of attributes in a filter will match all - documentation; i.e., it is equivalent to requesting unfiltered documentation. - - \section1 Full Text Searching - - \img assistant-search.png - - \QA provides a powerful full text search engine. To search - for certain words or text, click the \gui{Search} tab in the \gui{Documentation} - window. Then enter the text you want to look for and press \key{Enter} - or click the \gui{Search} button. The search is not case sensitive, so, - for example, Foo, fOo and FOO are all treated as the same. The following are - examples of common search patterns: - - \list - \o \c deep -- lists all the documents that contain the word 'deep' - \o \c{deep*} -- lists all the documents that contain a word beginning - with 'deep' - \o \c{deep copy} -- lists all documents that contain both 'deep' \e - and 'copy' - \o \c{"deep copy"} -- list all documents that contain the phrase 'deep copy' - \endlist - - It is also possible to use the \gui{Advanced search} to get more flexibility. - You can specify some words so that hits containing these are excluded from the - result, or you can search for an exact phrase. Searching for similar words will - give results like these: - - \list - \o \c{QStin} -- lists all the documents with titles that are similar, such as \c{QString} - \o \c{QSting} -- lists all the documents with titles that are similar, such as \c{QString} - \o \c{QStrin} -- lists all the documents with titles that are similar, such as \c{QString} - \endlist - - Options can be combined to improve the search results. - - The list of documents found is ordered according to the number of - occurrences of the search text which they contain, with those containing - the highest number of occurrences appearing first. Simply click any - document in the list to display it in the \gui{Documentation} window. - - If the documentation has changed \mdash for example, if documents have been added - or removed \mdash \QA will index them again. -*/ diff --git a/src/assistant/tools/assistant/doc/assistant.qdocconf b/src/assistant/tools/assistant/doc/assistant.qdocconf deleted file mode 100644 index 4319b03f3..000000000 --- a/src/assistant/tools/assistant/doc/assistant.qdocconf +++ /dev/null @@ -1,16 +0,0 @@ -include(../../../../qdoc3/test/qt.qdocconf) - -version = - -sourcedirs = $QTDIR/tools/assistant/tools/assistant/doc -imagedirs = $QTDIR/tools/assistant/tools/assistant/doc/images -outputdir = $QTDIR/tools/assistant/tools/assistant/doc/html -project = assistant -description = "Qt Assistant" -HTML.{postheader,address} = "" -HTML.footer = "


\n" \ - "\n" \ - "\n" \ - "\n" \ - "\n" \ - "
Copyright © 2011 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt 5.0.0
" diff --git a/src/assistant/tools/assistant/doc/assistant.qhp b/src/assistant/tools/assistant/doc/assistant.qhp deleted file mode 100644 index 7ea4cdd46..000000000 --- a/src/assistant/tools/assistant/doc/assistant.qhp +++ /dev/null @@ -1,22 +0,0 @@ - - - assistant - com.trolltech.com.assistantinternal-1.0.0 - - - assistant.html - classic.css - images/assistant-address-toolbar.png - images/assistant-assistant.png - images/assistant-dockwidgets.png - images/assistant-docwindow.png - images/assistant-filter-toolbar.png - images/assistant-preferences-documentation.png - images/assistant-preferences-filters.png - images/assistant-preferences-fonts.png - images/assistant-preferences-options.png - images/assistant-search.png - images/assistant-toolbar.png - - - diff --git a/src/assistant/tools/assistant/doc/classic.css b/src/assistant/tools/assistant/doc/classic.css deleted file mode 100644 index 911354035..000000000 --- a/src/assistant/tools/assistant/doc/classic.css +++ /dev/null @@ -1,92 +0,0 @@ -h3.fn,span.fn -{ - margin-left: 1cm; - text-indent: -1cm; -} - -a:link -{ - color: #004faf; - text-decoration: none -} - -a:visited -{ - color: #672967; - text-decoration: none -} - -td.postheader -{ - font-family: sans-serif -} - -tr.address -{ - font-family: sans-serif -} - -body -{ - background: #ffffff; - color: black -} - -table tr.odd { - background: #f0f0f0; - color: black; -} - -table tr.even { - background: #e4e4e4; - color: black; -} - -table.annotated th { - padding: 3px; - text-align: left -} - -table.annotated td { - padding: 3px; -} - -table tr pre -{ - padding-top: none; - padding-bottom: none; - padding-left: none; - padding-right: none; - border: none; - background: none -} - -tr.qt-style -{ - background: #a2c511; - color: black -} - -body pre -{ - padding: 0.2em; - border: #e7e7e7 1px solid; - background: #f1f1f1; - color: black -} - -span.preprocessor, span.preprocessor a -{ - color: darkblue; -} - -span.comment -{ - color: darkred; - font-style: italic -} - -span.string,span.char -{ - color: darkgreen; -} diff --git a/src/assistant/tools/assistant/doc/images/assistant-address-toolbar.png b/src/assistant/tools/assistant/doc/images/assistant-address-toolbar.png deleted file mode 100644 index 847b7debb..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-address-toolbar.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-assistant.png b/src/assistant/tools/assistant/doc/images/assistant-assistant.png deleted file mode 100644 index 1ff5cc976..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-assistant.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-dockwidgets.png b/src/assistant/tools/assistant/doc/images/assistant-dockwidgets.png deleted file mode 100644 index 17bc064c5..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-dockwidgets.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-docwindow.png b/src/assistant/tools/assistant/doc/images/assistant-docwindow.png deleted file mode 100644 index c5bac581f..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-docwindow.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-examples.png b/src/assistant/tools/assistant/doc/images/assistant-examples.png deleted file mode 100644 index 47c01bcda..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-examples.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-filter-toolbar.png b/src/assistant/tools/assistant/doc/images/assistant-filter-toolbar.png deleted file mode 100644 index 4e89a79b9..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-filter-toolbar.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-preferences-documentation.png b/src/assistant/tools/assistant/doc/images/assistant-preferences-documentation.png deleted file mode 100644 index 790fd9a1a..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-preferences-documentation.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-preferences-filters.png b/src/assistant/tools/assistant/doc/images/assistant-preferences-filters.png deleted file mode 100644 index 7453dd66d..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-preferences-filters.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-preferences-fonts.png b/src/assistant/tools/assistant/doc/images/assistant-preferences-fonts.png deleted file mode 100644 index d42d190d0..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-preferences-fonts.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-preferences-options.png b/src/assistant/tools/assistant/doc/images/assistant-preferences-options.png deleted file mode 100644 index d6624151a..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-preferences-options.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-search.png b/src/assistant/tools/assistant/doc/images/assistant-search.png deleted file mode 100644 index ef75c3329..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-search.png and /dev/null differ diff --git a/src/assistant/tools/assistant/doc/images/assistant-toolbar.png b/src/assistant/tools/assistant/doc/images/assistant-toolbar.png deleted file mode 100644 index 1b41825c6..000000000 Binary files a/src/assistant/tools/assistant/doc/images/assistant-toolbar.png and /dev/null differ diff --git a/src/assistant/tools/assistant/filternamedialog.cpp b/src/assistant/tools/assistant/filternamedialog.cpp deleted file mode 100644 index d1424ee2a..000000000 --- a/src/assistant/tools/assistant/filternamedialog.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include - -#include "filternamedialog.h" - -QT_BEGIN_NAMESPACE - -FilterNameDialog::FilterNameDialog(QWidget *parent) - : QDialog(parent) -{ - TRACE_OBJ - m_ui.setupUi(this); - connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), - SIGNAL(clicked()), this, SLOT(accept())); - connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), - SIGNAL(clicked()), this, SLOT(reject())); - connect(m_ui.lineEdit, SIGNAL(textChanged(QString)), - this, SLOT(updateOkButton())); - m_ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true); - -} - -QString FilterNameDialog::filterName() const -{ - TRACE_OBJ - return m_ui.lineEdit->text(); -} - -void FilterNameDialog::updateOkButton() -{ - TRACE_OBJ - m_ui.buttonBox->button(QDialogButtonBox::Ok) - ->setDisabled(m_ui.lineEdit->text().isEmpty()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/filternamedialog.h b/src/assistant/tools/assistant/filternamedialog.h deleted file mode 100644 index bf65a7e15..000000000 --- a/src/assistant/tools/assistant/filternamedialog.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILTERNAMEDIALOG_H -#define FILTERNAMEDIALOG_H - -#include -#include "ui_filternamedialog.h" - -QT_BEGIN_NAMESPACE - -class FilterNameDialog : public QDialog -{ - Q_OBJECT - -public: - FilterNameDialog(QWidget *parent = 0); - QString filterName() const; - -private slots: - void updateOkButton(); - -private: - Ui::FilterNameDialogClass m_ui; -}; - -QT_END_NAMESPACE - -#endif // FILTERNAMEDIALOG_H diff --git a/src/assistant/tools/assistant/filternamedialog.ui b/src/assistant/tools/assistant/filternamedialog.ui deleted file mode 100644 index 755a93479..000000000 --- a/src/assistant/tools/assistant/filternamedialog.ui +++ /dev/null @@ -1,67 +0,0 @@ - - FilterNameDialogClass - - - - 0 - 0 - 312 - 95 - - - - Add Filter Name - - - - 9 - - - 6 - - - - - Filter Name: - - - - - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - - diff --git a/src/assistant/tools/assistant/findwidget.cpp b/src/assistant/tools/assistant/findwidget.cpp deleted file mode 100644 index 296da0c8d..000000000 --- a/src/assistant/tools/assistant/findwidget.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" -#include "findwidget.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -FindWidget::FindWidget(QWidget *parent) - : QWidget(parent) - , appPalette(qApp->palette()) -{ - TRACE_OBJ - installEventFilter(this); - QHBoxLayout *hboxLayout = new QHBoxLayout(this); - QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); - -#ifndef Q_OS_MAC - hboxLayout->setMargin(0); - hboxLayout->setSpacing(6); - resourcePath.append(QLatin1String("win")); -#else - resourcePath.append(QLatin1String("mac")); -#endif - - toolClose = setupToolButton(QLatin1String(""), - resourcePath + QLatin1String("/closetab.png")); - hboxLayout->addWidget(toolClose); - connect(toolClose, SIGNAL(clicked()), SLOT(hide())); - - editFind = new QLineEdit(this); - hboxLayout->addWidget(editFind); - editFind->setMinimumSize(QSize(150, 0)); - connect(editFind, SIGNAL(textChanged(QString)), this, - SLOT(textChanged(QString))); - connect(editFind, SIGNAL(returnPressed()), this, SIGNAL(findNext())); - connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); - - toolPrevious = setupToolButton(tr("Previous"), - resourcePath + QLatin1String("/previous.png")); - connect(toolPrevious, SIGNAL(clicked()), this, SIGNAL(findPrevious())); - - hboxLayout->addWidget(toolPrevious); - - toolNext = setupToolButton(tr("Next"), - resourcePath + QLatin1String("/next.png")); - hboxLayout->addWidget(toolNext); - connect(toolNext, SIGNAL(clicked()), this, SIGNAL(findNext())); - - checkCase = new QCheckBox(tr("Case Sensitive"), this); - hboxLayout->addWidget(checkCase); - - labelWrapped = new QLabel(this); - labelWrapped->setScaledContents(true); - labelWrapped->setTextFormat(Qt::RichText); - labelWrapped->setMinimumSize(QSize(0, 20)); - labelWrapped->setMaximumSize(QSize(105, 20)); - labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - labelWrapped->setText(tr(" Search wrapped")); - hboxLayout->addWidget(labelWrapped); - - QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, - QSizePolicy::Minimum); - hboxLayout->addItem(spacerItem); - setMinimumWidth(minimumSizeHint().width()); - labelWrapped->hide(); - - updateButtons(); -} - -FindWidget::~FindWidget() -{ - TRACE_OBJ -} - -void FindWidget::show() -{ - TRACE_OBJ - QWidget::show(); - editFind->selectAll(); - editFind->setFocus(Qt::ShortcutFocusReason); -} - -void FindWidget::showAndClear() -{ - TRACE_OBJ - show(); - editFind->clear(); -} - -QString FindWidget::text() const -{ - TRACE_OBJ - return editFind->text(); -} - -bool FindWidget::caseSensitive() const -{ - TRACE_OBJ - return checkCase->isChecked(); -} - -void FindWidget::setPalette(bool found) -{ - TRACE_OBJ - QPalette palette = editFind->palette(); - palette.setColor(QPalette::Active, QPalette::Base, found ? Qt::white - : QColor(255, 102, 102)); - editFind->setPalette(palette); -} - -void FindWidget::setTextWrappedVisible(bool visible) -{ - TRACE_OBJ - labelWrapped->setVisible(visible); -} - -void FindWidget::hideEvent(QHideEvent* event) -{ - TRACE_OBJ -#if !defined(QT_NO_WEBKIT) - // TODO: remove this once webkit supports setting the palette - if (!event->spontaneous()) - qApp->setPalette(appPalette); -#else - Q_UNUSED(event); -#endif -} - -void FindWidget::showEvent(QShowEvent* event) -{ - TRACE_OBJ -#if !defined(QT_NO_WEBKIT) - // TODO: remove this once webkit supports setting the palette - if (!event->spontaneous()) { - QPalette p = appPalette; - p.setColor(QPalette::Inactive, QPalette::Highlight, - p.color(QPalette::Active, QPalette::Highlight)); - p.setColor(QPalette::Inactive, QPalette::HighlightedText, - p.color(QPalette::Active, QPalette::HighlightedText)); - qApp->setPalette(p); - } -#else - Q_UNUSED(event); -#endif -} - -void FindWidget::updateButtons() -{ - TRACE_OBJ - const bool enable = !editFind->text().isEmpty(); - toolNext->setEnabled(enable); - toolPrevious->setEnabled(enable); -} - -void FindWidget::textChanged(const QString &text) -{ - TRACE_OBJ - emit find(text, true, true); -} - -bool FindWidget::eventFilter(QObject *object, QEvent *e) -{ - TRACE_OBJ - if (e->type() == QEvent::KeyPress) { - if ((static_cast(e))->key() == Qt::Key_Escape) { - hide(); - emit escapePressed(); - } - } - return QWidget::eventFilter(object, e); -} - -QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) -{ - TRACE_OBJ - QToolButton *toolButton = new QToolButton(this); - - toolButton->setText(text); - toolButton->setAutoRaise(true); - toolButton->setIcon(QIcon(icon)); - toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - - return toolButton; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/findwidget.h b/src/assistant/tools/assistant/findwidget.h deleted file mode 100644 index b24e88019..000000000 --- a/src/assistant/tools/assistant/findwidget.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef FINDWIDGET_H -#define FINDWIDGET_H - -#include - -QT_BEGIN_NAMESPACE - -class QCheckBox; -class QLabel; -class QLineEdit; -class QToolButton; - -class FindWidget : public QWidget -{ - Q_OBJECT -public: - FindWidget(QWidget *parent = 0); - ~FindWidget(); - - void show(); - void showAndClear(); - - QString text() const; - bool caseSensitive() const; - - void setPalette(bool found); - void setTextWrappedVisible(bool visible); - -signals: - void findNext(); - void findPrevious(); - void escapePressed(); - void find(const QString &text, bool forward, bool incremental); - -protected: - void hideEvent(QHideEvent* event); - void showEvent(QShowEvent * event); - -private slots: - void updateButtons(); - void textChanged(const QString &text); - -private: - bool eventFilter(QObject *object, QEvent *e); - QToolButton* setupToolButton(const QString &text, const QString &icon); - -private: - QPalette appPalette; - - QLineEdit *editFind; - QCheckBox *checkCase; - QLabel *labelWrapped; - QToolButton *toolNext; - QToolButton *toolClose; - QToolButton *toolPrevious; -}; - -QT_END_NAMESPACE - -#endif // FINDWIDGET_H diff --git a/src/assistant/tools/assistant/globalactions.cpp b/src/assistant/tools/assistant/globalactions.cpp deleted file mode 100644 index 6b8b8ea29..000000000 --- a/src/assistant/tools/assistant/globalactions.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "globalactions.h" - -#include "centralwidget.h" -#include "helpviewer.h" -#include "tracer.h" - -#include -#include - -#if !defined(QT_NO_WEBKIT) -#include -#endif - -GlobalActions *GlobalActions::instance(QObject *parent) -{ - Q_ASSERT(!m_instance != !parent); - if (!m_instance) - m_instance = new GlobalActions(parent); - return m_instance; -} - -GlobalActions::GlobalActions(QObject *parent) : QObject(parent) -{ - TRACE_OBJ - - // TODO: Put resource path in misc class - QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); -#ifdef Q_OS_MAC - resourcePath.append(QLatin1String("mac")); -#else - resourcePath.append(QLatin1String("win")); -#endif - CentralWidget *centralWidget = CentralWidget::instance(); - - m_backAction = new QAction(tr("&Back"), parent); - m_backAction->setEnabled(false); - m_backAction->setShortcuts(QKeySequence::Back); - m_backAction->setIcon(QIcon(resourcePath + QLatin1String("/previous.png"))); - connect(m_backAction, SIGNAL(triggered()), centralWidget, SLOT(backward())); - m_actionList << m_backAction; - - m_nextAction = new QAction(tr("&Forward"), parent); - m_nextAction->setPriority(QAction::LowPriority); - m_nextAction->setEnabled(false); - m_nextAction->setShortcuts(QKeySequence::Forward); - m_nextAction->setIcon(QIcon(resourcePath + QLatin1String("/next.png"))); - connect(m_nextAction, SIGNAL(triggered()), centralWidget, SLOT(forward())); - m_actionList << m_nextAction; - - setupNavigationMenus(m_backAction, m_nextAction, centralWidget); - - m_homeAction = new QAction(tr("&Home"), parent); - m_homeAction->setShortcut(tr("ALT+Home")); - m_homeAction->setIcon(QIcon(resourcePath + QLatin1String("/home.png"))); - connect(m_homeAction, SIGNAL(triggered()), centralWidget, SLOT(home())); - m_actionList << m_homeAction; - - QAction *separator = new QAction(parent); - separator->setSeparator(true); - m_actionList << separator; - - m_zoomInAction = new QAction(tr("Zoom &in"), parent); - m_zoomInAction->setPriority(QAction::LowPriority); - m_zoomInAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomin.png"))); - m_zoomInAction->setShortcut(QKeySequence::ZoomIn); - connect(m_zoomInAction, SIGNAL(triggered()), centralWidget, SLOT(zoomIn())); - m_actionList << m_zoomInAction; - - m_zoomOutAction = new QAction(tr("Zoom &out"), parent); - m_zoomOutAction->setPriority(QAction::LowPriority); - m_zoomOutAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomout.png"))); - m_zoomOutAction->setShortcut(QKeySequence::ZoomOut); - connect(m_zoomOutAction, SIGNAL(triggered()), centralWidget, SLOT(zoomOut())); - m_actionList << m_zoomOutAction; - - separator = new QAction(parent); - separator->setSeparator(true); - m_actionList << separator; - - m_copyAction = new QAction(tr("&Copy selected Text"), parent); - m_copyAction->setPriority(QAction::LowPriority); - m_copyAction->setIconText("&Copy"); - m_copyAction->setIcon(QIcon(resourcePath + QLatin1String("/editcopy.png"))); - m_copyAction->setShortcuts(QKeySequence::Copy); - m_copyAction->setEnabled(false); - connect(m_copyAction, SIGNAL(triggered()), centralWidget, SLOT(copy())); - m_actionList << m_copyAction; - - m_printAction = new QAction(tr("&Print..."), parent); - m_printAction->setPriority(QAction::LowPriority); - m_printAction->setIcon(QIcon(resourcePath + QLatin1String("/print.png"))); - m_printAction->setShortcut(QKeySequence::Print); - connect(m_printAction, SIGNAL(triggered()), centralWidget, SLOT(print())); - m_actionList << m_printAction; - - m_findAction = new QAction(tr("&Find in Text..."), parent); - m_findAction->setIconText(tr("&Find")); - m_findAction->setIcon(QIcon(resourcePath + QLatin1String("/find.png"))); - m_findAction->setShortcuts(QKeySequence::Find); - connect(m_findAction, SIGNAL(triggered()), centralWidget, SLOT(showTextSearch())); - m_actionList << m_findAction; - -#ifdef Q_WS_X11 - m_backAction->setIcon(QIcon::fromTheme("go-previous" , m_backAction->icon())); - m_nextAction->setIcon(QIcon::fromTheme("go-next" , m_nextAction->icon())); - m_zoomInAction->setIcon(QIcon::fromTheme("zoom-in" , m_zoomInAction->icon())); - m_zoomOutAction->setIcon(QIcon::fromTheme("zoom-out" , m_zoomOutAction->icon())); - m_copyAction->setIcon(QIcon::fromTheme("edit-copy" , m_copyAction->icon())); - m_findAction->setIcon(QIcon::fromTheme("edit-find" , m_findAction->icon())); - m_homeAction->setIcon(QIcon::fromTheme("go-home" , m_homeAction->icon())); - m_printAction->setIcon(QIcon::fromTheme("document-print" , m_printAction->icon())); -#endif -} - -void GlobalActions::updateActions() -{ - TRACE_OBJ - CentralWidget *centralWidget = CentralWidget::instance(); - m_copyAction->setEnabled(centralWidget->hasSelection()); - m_nextAction->setEnabled(centralWidget->isForwardAvailable()); - m_backAction->setEnabled(centralWidget->isBackwardAvailable()); -} - -void GlobalActions::setCopyAvailable(bool available) -{ - TRACE_OBJ - m_copyAction->setEnabled(available); -} - -#if !defined(QT_NO_WEBKIT) - -void GlobalActions::slotAboutToShowBackMenu() -{ - TRACE_OBJ - m_backMenu->clear(); - if (QWebHistory *history = CentralWidget::instance()->currentHelpViewer()->history()) { - const int currentItemIndex = history->currentItemIndex(); - QList items = history->backItems(history->count()); - for (int i = items.count() - 1; i >= 0; --i) { - QAction *action = new QAction(this); - action->setText(items.at(i).title()); - action->setData(-1 * (currentItemIndex - i)); - m_backMenu->addAction(action); - } - } -} - -void GlobalActions::slotAboutToShowNextMenu() -{ - TRACE_OBJ - m_nextMenu->clear(); - if (QWebHistory *history = CentralWidget::instance()->currentHelpViewer()->history()) { - const int count = history->count(); - QList items = history->forwardItems(count); - for (int i = 0; i < items.count(); ++i) { - QAction *action = new QAction(this); - action->setData(count - i); - action->setText(items.at(i).title()); - m_nextMenu->addAction(action); - } - } -} - -void GlobalActions::slotOpenActionUrl(QAction *action) -{ - TRACE_OBJ - if (HelpViewer* viewer = CentralWidget::instance()->currentHelpViewer()) { - const int offset = action->data().toInt(); - QWebHistory *history = viewer->history(); - if (offset > 0) { - history->goToItem(history->forwardItems(history->count() - - offset + 1).back()); // forward - } else if (offset < 0) { - history->goToItem(history->backItems(-1 * offset).first()); // back - } - } -} - -#endif - -void GlobalActions::setupNavigationMenus(QAction *back, QAction *next, - QWidget *parent) -{ -#if !defined(QT_NO_WEBKIT) - m_backMenu = new QMenu(parent); - connect(m_backMenu, SIGNAL(aboutToShow()), this, - SLOT(slotAboutToShowBackMenu())); - connect(m_backMenu, SIGNAL(triggered(QAction*)), this, - SLOT(slotOpenActionUrl(QAction*))); - back->setMenu(m_backMenu); - - m_nextMenu = new QMenu(parent); - connect(m_nextMenu, SIGNAL(aboutToShow()), this, - SLOT(slotAboutToShowNextMenu())); - connect(m_nextMenu, SIGNAL(triggered(QAction*)), this, - SLOT(slotOpenActionUrl(QAction*))); - next->setMenu(m_nextMenu); -#else - Q_UNUSED(back) - Q_UNUSED(next) - Q_UNUSED(parent) -#endif -} - -GlobalActions *GlobalActions::m_instance = 0; diff --git a/src/assistant/tools/assistant/globalactions.h b/src/assistant/tools/assistant/globalactions.h deleted file mode 100644 index a9059a9a4..000000000 --- a/src/assistant/tools/assistant/globalactions.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GLOBALACTION_H -#define GLOBALACTION_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class QAction; -class QMenu; - -class GlobalActions : public QObject -{ - Q_OBJECT - Q_DISABLE_COPY(GlobalActions) -public: - static GlobalActions *instance(QObject *parent = 0); - - QList actionList() const { return m_actionList; } - QAction *backAction() const { return m_backAction; } - QAction *nextAction() const { return m_nextAction; } - QAction *homeAction() const { return m_homeAction; } - QAction *zoomInAction() const { return m_zoomInAction; } - QAction *zoomOutAction() const { return m_zoomOutAction; } - QAction *copyAction() const { return m_copyAction; } - QAction *printAction() const { return m_printAction; } - QAction *findAction() const { return m_findAction; } - - Q_SLOT void updateActions(); - Q_SLOT void setCopyAvailable(bool available); - -#if !defined(QT_NO_WEBKIT) -private slots: - void slotAboutToShowBackMenu(); - void slotAboutToShowNextMenu(); - void slotOpenActionUrl(QAction *action); -#endif - -private: - void setupNavigationMenus(QAction *back, QAction *next, QWidget *parent); - -private: - GlobalActions(QObject *parent); - - static GlobalActions *m_instance; - - QAction *m_backAction; - QAction *m_nextAction; - QAction *m_homeAction; - QAction *m_zoomInAction; - QAction *m_zoomOutAction; - QAction *m_copyAction; - QAction *m_printAction; - QAction *m_findAction; - - QList m_actionList; - - QMenu *m_backMenu; - QMenu *m_nextMenu; -}; - -QT_END_NAMESPACE - -#endif // GLOBALACTION_H diff --git a/src/assistant/tools/assistant/helpenginewrapper.cpp b/src/assistant/tools/assistant/helpenginewrapper.cpp deleted file mode 100644 index 4c7ff5b30..000000000 --- a/src/assistant/tools/assistant/helpenginewrapper.cpp +++ /dev/null @@ -1,844 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include "helpenginewrapper.h" -#include "../shared/collectionconfiguration.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace { - const QString Unfiltered; - const QString AppFontKey(QLatin1String("appFont")); - const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); - const QString BookmarksKey(QLatin1String("Bookmarks")); - const QString BrowserFontKey(QLatin1String("browserFont")); - const QString BrowserWritingSystemKey(QLatin1String("browserWritingSystem")); - const QString HomePageKey(QLatin1String("homepage")); - const QString MainWindowKey(QLatin1String("MainWindow")); - const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); - const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); - const QString StartOptionKey(QLatin1String("StartOption")); - const QString UseAppFontKey(QLatin1String("useAppFont")); - const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); - const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). - arg(QLatin1String(QT_VERSION_STR))); - const QString ShowTabsKey(QLatin1String("showTabs")); -} // anonymous namespace - -class TimeoutForwarder : public QObject -{ - Q_OBJECT -public: - TimeoutForwarder(const QString &fileName); -private slots: - void forward(); -private: - friend class HelpEngineWrapperPrivate; - - const QString m_fileName; -}; - -class HelpEngineWrapperPrivate : public QObject -{ - Q_OBJECT - friend class HelpEngineWrapper; - friend class TimeoutForwarder; -private slots: - void qchFileChanged(const QString &fileName); - -signals: - void documentationRemoved(const QString &namespaceName); - void documentationUpdated(const QString &namespaceName); - -private: - HelpEngineWrapperPrivate(const QString &collectionFile); - - void initFileSystemWatchers(); - void checkDocFilesWatched(); - void qchFileChanged(const QString &fileName, bool fromTimeout); - - static const int UpdateGracePeriod = 2000; - - QHelpEngine * const m_helpEngine; - QFileSystemWatcher * const m_qchWatcher; - typedef QPair > RecentSignal; - QMap m_recentQchUpdates; -}; - -const QString HelpEngineWrapper::TrUnfiltered = HelpEngineWrapper::tr("Unfiltered"); - -HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; - -HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) -{ - TRACE_OBJ - /* - * Note that this Singleton cannot be static, because it has to be - * deleted before the QApplication. - */ - if (helpEngineWrapper == 0) - helpEngineWrapper = new HelpEngineWrapper(collectionFile); - return *helpEngineWrapper; -} - -void HelpEngineWrapper::removeInstance() -{ - TRACE_OBJ - delete helpEngineWrapper; - helpEngineWrapper = 0; -} - -HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) - : d(new HelpEngineWrapperPrivate(collectionFile)) -{ - TRACE_OBJ - - /* - * Otherwise we will waste time if several new docs are found, - * because we will start to index them, only to be interrupted - * by the next request. Also, there is a nasty SQLITE bug that will - * cause the application to hang for minutes in that case. - * This call is reverted by initialDocSetupDone(), which must be - * called after the new docs have been installed. - */ - disconnect(d->m_helpEngine, SIGNAL(setupFinished()), - searchEngine(), SLOT(indexDocumentation())); - - connect(d, SIGNAL(documentationRemoved(QString)), - this, SIGNAL(documentationRemoved(QString))); - connect(d, SIGNAL(documentationUpdated(QString)), - this, SIGNAL(documentationUpdated(QString))); - connect(d->m_helpEngine, SIGNAL(currentFilterChanged(QString)), - this, SLOT(handleCurrentFilterChanged(QString))); - connect(d->m_helpEngine, SIGNAL(setupFinished()), - this, SIGNAL(setupFinished())); -} - -HelpEngineWrapper::~HelpEngineWrapper() -{ - TRACE_OBJ - const QStringList &namespaces = d->m_helpEngine->registeredDocumentations(); - foreach (const QString &nameSpace, namespaces) { - const QString &docFile - = d->m_helpEngine->documentationFileName(nameSpace); - d->m_qchWatcher->removePath(docFile); - } - - delete d; -} - -void HelpEngineWrapper::initialDocSetupDone() -{ - TRACE_OBJ - connect(d->m_helpEngine, SIGNAL(setupFinished()), - searchEngine(), SLOT(indexDocumentation())); - setupData(); -} - -QHelpSearchEngine *HelpEngineWrapper::searchEngine() const -{ - TRACE_OBJ - return d->m_helpEngine->searchEngine(); -} - -QHelpContentModel *HelpEngineWrapper::contentModel() const -{ - TRACE_OBJ - return d->m_helpEngine->contentModel(); -} - -QHelpIndexModel *HelpEngineWrapper::indexModel() const -{ - TRACE_OBJ - return d->m_helpEngine->indexModel(); -} - -QHelpContentWidget *HelpEngineWrapper::contentWidget() -{ - TRACE_OBJ - return d->m_helpEngine->contentWidget(); -} - -QHelpIndexWidget *HelpEngineWrapper::indexWidget() -{ - TRACE_OBJ - return d->m_helpEngine->indexWidget(); -} - -const QStringList HelpEngineWrapper::registeredDocumentations() const -{ - TRACE_OBJ - return d->m_helpEngine->registeredDocumentations(); -} - -const QString HelpEngineWrapper::collectionFile() const -{ - TRACE_OBJ - return d->m_helpEngine->collectionFile(); -} - -bool HelpEngineWrapper::registerDocumentation(const QString &docFile) -{ - TRACE_OBJ - d->checkDocFilesWatched(); - if (!d->m_helpEngine->registerDocumentation(docFile)) - return false; - d->m_qchWatcher->addPath(docFile); - d->checkDocFilesWatched(); - return true; -} - -bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) -{ - TRACE_OBJ - d->checkDocFilesWatched(); - const QString &file = d->m_helpEngine->documentationFileName(namespaceName); - if (!d->m_helpEngine->unregisterDocumentation(namespaceName)) - return false; - d->m_qchWatcher->removePath(file); - d->checkDocFilesWatched(); - return true; -} - -bool HelpEngineWrapper::setupData() -{ - TRACE_OBJ - return d->m_helpEngine->setupData(); -} - -bool HelpEngineWrapper::addCustomFilter(const QString &filterName, - const QStringList &attributes) -{ - TRACE_OBJ - return d->m_helpEngine->addCustomFilter(filterName, attributes); -} - -bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) -{ - TRACE_OBJ - return d->m_helpEngine->removeCustomFilter(filterName); -} - -void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) -{ - TRACE_OBJ - const QString &filter - = currentFilter == TrUnfiltered ? Unfiltered : currentFilter; - d->m_helpEngine->setCurrentFilter(filter); -} - -const QString HelpEngineWrapper::currentFilter() const -{ - TRACE_OBJ - const QString &filter = d->m_helpEngine->currentFilter(); - return filter == Unfiltered ? TrUnfiltered : filter; -} - -const QStringList HelpEngineWrapper::customFilters() const -{ - TRACE_OBJ - QStringList filters = d->m_helpEngine->customFilters(); - filters.removeOne(Unfiltered); - filters.prepend(TrUnfiltered); - return filters; -} - -QUrl HelpEngineWrapper::findFile(const QUrl &url) const -{ - TRACE_OBJ - return d->m_helpEngine->findFile(url); -} - -QByteArray HelpEngineWrapper::fileData(const QUrl &url) const -{ - TRACE_OBJ - return d->m_helpEngine->fileData(url); -} - -QMap HelpEngineWrapper::linksForIdentifier(const QString &id) const -{ - TRACE_OBJ - return d->m_helpEngine->linksForIdentifier(id); -} - -const QStringList HelpEngineWrapper::filterAttributes() const -{ - TRACE_OBJ - return d->m_helpEngine->filterAttributes(); -} - -const QStringList HelpEngineWrapper::filterAttributes(const QString &filterName) const -{ - TRACE_OBJ - return d->m_helpEngine->filterAttributes(filterName); -} - -QString HelpEngineWrapper::error() const -{ - TRACE_OBJ - return d->m_helpEngine->error(); -} - -const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(VersionKey.arg(component)).toString(). - split(CollectionConfiguration::ListSeparator); -} - -void HelpEngineWrapper::setQtDocInfo(const QString &component, - const QStringList &doc) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(VersionKey.arg(component), - doc.join(CollectionConfiguration::ListSeparator)); -} - -const QStringList HelpEngineWrapper::lastShownPages() const -{ - TRACE_OBJ - return CollectionConfiguration::lastShownPages(*d->m_helpEngine); -} - -void HelpEngineWrapper::setLastShownPages(const QStringList &lastShownPages) -{ - TRACE_OBJ - CollectionConfiguration::setLastShownPages(*d->m_helpEngine, lastShownPages); -} - -const QStringList HelpEngineWrapper::lastZoomFactors() const -{ - TRACE_OBJ - return CollectionConfiguration::lastZoomFactors(*d->m_helpEngine); -} - -void HelpEngineWrapper::setLastZoomFactors(const QStringList &lastZoomFactors) -{ - TRACE_OBJ - CollectionConfiguration::setLastZoomFactors(*d->m_helpEngine, lastZoomFactors); -} - -const QString HelpEngineWrapper::cacheDir() const -{ - TRACE_OBJ - return CollectionConfiguration::cacheDir(*d->m_helpEngine); -} - -bool HelpEngineWrapper::cacheDirIsRelativeToCollection() const -{ - TRACE_OBJ - return CollectionConfiguration::cacheDirIsRelativeToCollection(*d->m_helpEngine); -} - -void HelpEngineWrapper::setCacheDir(const QString &cacheDir, - bool relativeToCollection) -{ - TRACE_OBJ - CollectionConfiguration::setCacheDir(*d->m_helpEngine, cacheDir, - relativeToCollection); -} - -bool HelpEngineWrapper::filterFunctionalityEnabled() const -{ - TRACE_OBJ - return CollectionConfiguration::filterFunctionalityEnabled(*d->m_helpEngine); -} - -void HelpEngineWrapper::setFilterFunctionalityEnabled(bool enabled) -{ - TRACE_OBJ - CollectionConfiguration::setFilterFunctionalityEnabled(*d->m_helpEngine, - enabled); -} - -bool HelpEngineWrapper::filterToolbarVisible() const -{ - TRACE_OBJ - return CollectionConfiguration::filterToolbarVisible(*d->m_helpEngine); -} - -void HelpEngineWrapper::setFilterToolbarVisible(bool visible) -{ - TRACE_OBJ - CollectionConfiguration::setFilterToolbarVisible(*d->m_helpEngine, visible); -} - -bool HelpEngineWrapper::addressBarEnabled() const -{ - TRACE_OBJ - return CollectionConfiguration::addressBarEnabled(*d->m_helpEngine); -} - -void HelpEngineWrapper::setAddressBarEnabled(bool enabled) -{ - TRACE_OBJ - CollectionConfiguration::setAddressBarEnabled(*d->m_helpEngine, enabled); -} - -bool HelpEngineWrapper::addressBarVisible() const -{ - TRACE_OBJ - return CollectionConfiguration::addressBarVisible(*d->m_helpEngine); -} - -void HelpEngineWrapper::setAddressBarVisible(bool visible) -{ - TRACE_OBJ - CollectionConfiguration::setAddressBarVisible(*d->m_helpEngine, visible); -} - -bool HelpEngineWrapper::documentationManagerEnabled() const -{ - TRACE_OBJ - return CollectionConfiguration::documentationManagerEnabled(*d->m_helpEngine); -} - -void HelpEngineWrapper::setDocumentationManagerEnabled(bool enabled) -{ - TRACE_OBJ - CollectionConfiguration::setDocumentationManagerEnabled(*d->m_helpEngine, - enabled); -} - -const QByteArray HelpEngineWrapper::aboutMenuTexts() const -{ - TRACE_OBJ - return CollectionConfiguration::aboutMenuTexts(*d->m_helpEngine); -} - -void HelpEngineWrapper::setAboutMenuTexts(const QByteArray &texts) -{ - TRACE_OBJ - CollectionConfiguration::setAboutMenuTexts(*d->m_helpEngine, texts); -} - -const QByteArray HelpEngineWrapper::aboutIcon() const -{ - TRACE_OBJ - return CollectionConfiguration::aboutIcon(*d->m_helpEngine); -} - -void HelpEngineWrapper::setAboutIcon(const QByteArray &icon) -{ - TRACE_OBJ - CollectionConfiguration::setAboutIcon(*d->m_helpEngine, icon); -} - -const QByteArray HelpEngineWrapper::aboutImages() const -{ - TRACE_OBJ - return CollectionConfiguration::aboutImages(*d->m_helpEngine); -} - -void HelpEngineWrapper::setAboutImages(const QByteArray &images) -{ - TRACE_OBJ - CollectionConfiguration::setAboutImages(*d->m_helpEngine, images); -} - -const QByteArray HelpEngineWrapper::aboutTexts() const -{ - TRACE_OBJ - return CollectionConfiguration::aboutTexts(*d->m_helpEngine); -} - -void HelpEngineWrapper::setAboutTexts(const QByteArray &texts) -{ - TRACE_OBJ - CollectionConfiguration::setAboutTexts(*d->m_helpEngine, texts); -} - -const QString HelpEngineWrapper::windowTitle() const -{ - TRACE_OBJ - return CollectionConfiguration::windowTitle(*d->m_helpEngine); -} - -void HelpEngineWrapper::setWindowTitle(const QString &windowTitle) -{ - TRACE_OBJ - CollectionConfiguration::setWindowTitle(*d->m_helpEngine, windowTitle); -} - -const QByteArray HelpEngineWrapper::applicationIcon() const -{ - TRACE_OBJ - return CollectionConfiguration::applicationIcon(*d->m_helpEngine); -} - -void HelpEngineWrapper::setApplicationIcon(const QByteArray &icon) -{ - TRACE_OBJ - CollectionConfiguration::setApplicationIcon(*d->m_helpEngine, icon); -} - -const QByteArray HelpEngineWrapper::mainWindow() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(MainWindowKey).toByteArray(); -} - -void HelpEngineWrapper::setMainWindow(const QByteArray &mainWindow) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(MainWindowKey, mainWindow); -} - -const QByteArray HelpEngineWrapper::mainWindowGeometry() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); -} - -void HelpEngineWrapper::setMainWindowGeometry(const QByteArray &geometry) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); -} - -const QByteArray HelpEngineWrapper::bookmarks() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(BookmarksKey).toByteArray(); -} - -void HelpEngineWrapper::setBookmarks(const QByteArray &bookmarks) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(BookmarksKey, bookmarks); -} - -int HelpEngineWrapper::lastTabPage() const -{ - TRACE_OBJ - return CollectionConfiguration::lastTabPage(*d->m_helpEngine); -} - -void HelpEngineWrapper::setLastTabPage(int lastPage) -{ - TRACE_OBJ - CollectionConfiguration::setLastTabPage(*d->m_helpEngine, lastPage); -} - -int HelpEngineWrapper::startOption() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); -} - -void HelpEngineWrapper::setStartOption(int option) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(StartOptionKey, option); -} - -const QString HelpEngineWrapper::homePage() const -{ - TRACE_OBJ - const QString &homePage - = d->m_helpEngine->customValue(HomePageKey).toString(); - if (!homePage.isEmpty()) - return homePage; - return defaultHomePage(); -} - -void HelpEngineWrapper::setHomePage(const QString &page) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(HomePageKey, page); - -} - -const QString HelpEngineWrapper::defaultHomePage() const -{ - TRACE_OBJ - return CollectionConfiguration::defaultHomePage(*d->m_helpEngine); -} - -void HelpEngineWrapper::setDefaultHomePage(const QString &page) -{ - TRACE_OBJ - CollectionConfiguration::setDefaultHomePage(*d->m_helpEngine, page); -} - -bool HelpEngineWrapper::hasFontSettings() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(UseAppFontKey).isValid(); -} - -bool HelpEngineWrapper::usesAppFont() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(UseAppFontKey).toBool(); -} - -void HelpEngineWrapper::setUseAppFont(bool useAppFont) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); -} - -bool HelpEngineWrapper::usesBrowserFont() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); -} - -void HelpEngineWrapper::setUseBrowserFont(bool useBrowserFont) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); -} - -const QFont HelpEngineWrapper::appFont() const -{ - TRACE_OBJ - return qvariant_cast(d->m_helpEngine->customValue(AppFontKey)); -} - -void HelpEngineWrapper::setAppFont(const QFont &font) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(AppFontKey, font); -} - -QFontDatabase::WritingSystem HelpEngineWrapper::appWritingSystem() const -{ - TRACE_OBJ - return static_cast( - d->m_helpEngine->customValue(AppWritingSystemKey).toInt()); -} - -void HelpEngineWrapper::setAppWritingSystem(QFontDatabase::WritingSystem system) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(AppWritingSystemKey, system); -} - -const QFont HelpEngineWrapper::browserFont() const -{ - TRACE_OBJ - return qvariant_cast(d->m_helpEngine->customValue(BrowserFontKey)); -} - -void HelpEngineWrapper::setBrowserFont(const QFont &font) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(BrowserFontKey, font); -} - -QFontDatabase::WritingSystem HelpEngineWrapper::browserWritingSystem() const -{ - TRACE_OBJ - return static_cast( - d->m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); -} - -void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem system) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); -} - -void HelpEngineWrapper::handleCurrentFilterChanged(const QString &filter) -{ - TRACE_OBJ - const QString &filterToReport - = filter == Unfiltered ? TrUnfiltered : filter; - emit currentFilterChanged(filterToReport); -} - -bool HelpEngineWrapper::showTabs() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(ShowTabsKey, false).toBool(); -} - -void HelpEngineWrapper::setShowTabs(bool show) -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(ShowTabsKey, show); -} - -bool HelpEngineWrapper::fullTextSearchFallbackEnabled() const -{ - TRACE_OBJ - return CollectionConfiguration::fullTextSearchFallbackEnabled(*d->m_helpEngine); -} - -// -- TimeoutForwarder - -TimeoutForwarder::TimeoutForwarder(const QString &fileName) - : m_fileName(fileName) -{ - TRACE_OBJ -} - -void TimeoutForwarder::forward() -{ - TRACE_OBJ - HelpEngineWrapper::instance().d->qchFileChanged(m_fileName, true); -} - -// -- HelpEngineWrapperPrivate - -HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile) - : m_helpEngine(new QHelpEngine(collectionFile, this)), - m_qchWatcher(new QFileSystemWatcher(this)) -{ - TRACE_OBJ - if (!m_helpEngine->customFilters().contains(Unfiltered)) - m_helpEngine->addCustomFilter(Unfiltered, QStringList()); - initFileSystemWatchers(); -} - -void HelpEngineWrapperPrivate::initFileSystemWatchers() -{ - TRACE_OBJ - foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { - const QString &docFile = m_helpEngine->documentationFileName(ns); - m_qchWatcher->addPath(docFile); - connect(m_qchWatcher, SIGNAL(fileChanged(QString)), - this, SLOT(qchFileChanged(QString))); - } - checkDocFilesWatched(); -} - -void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName) -{ - TRACE_OBJ - qchFileChanged(fileName, false); -} - -void HelpEngineWrapperPrivate::checkDocFilesWatched() -{ - TRACE_OBJ - const int watchedFilesCount = m_qchWatcher->files().count(); - const int docFilesCount = m_helpEngine->registeredDocumentations().count(); - if (watchedFilesCount != docFilesCount) { - qWarning("Strange: Have %d docs, but %d are being watched", - watchedFilesCount, docFilesCount); - } -} - -void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName, - bool fromTimeout) -{ - TRACE_OBJ - - /* - * We don't use QHelpEngineCore::namespaceName(fileName), because the file - * may not exist anymore or contain a different namespace. - */ - QString ns; - foreach (const QString &curNs, m_helpEngine->registeredDocumentations()) { - if (m_helpEngine->documentationFileName(curNs) == fileName) { - ns = curNs; - break; - } - } - - /* - * We can't do an assertion here, because QFileSystemWatcher may send the - * signal more than once. - */ - if (ns.isEmpty()) { - m_recentQchUpdates.remove(fileName); - return; - } - - /* - * Since the QFileSystemWatcher typically sends the signal more than once, - * we repeatedly delay our reaction a bit until we think the last signal - * was sent. - */ - - QMap::Iterator it = m_recentQchUpdates.find(fileName); - const QDateTime &now = QDateTime::currentDateTime(); - - // Case 1: This is the first recent signal for the file. - if (it == m_recentQchUpdates.end()) { - QSharedPointer forwarder(new TimeoutForwarder(fileName)); - m_recentQchUpdates.insert(fileName, RecentSignal(now, forwarder)); - QTimer::singleShot(UpdateGracePeriod, forwarder.data(), SLOT(forward())); - return; - } - - // Case 2: The last signal for this file has not expired yet. - if (it.value().first > now.addMSecs(-UpdateGracePeriod)) { - if (!fromTimeout) - it.value().first = now; - else - QTimer::singleShot(UpdateGracePeriod, it.value().second.data(), - SLOT(forward())); - return; - } - - // Case 3: The last signal for this file has expired. - if (m_helpEngine->unregisterDocumentation(ns)) { - if (!QFileInfo(fileName).exists() - || !m_helpEngine->registerDocumentation(fileName)) { - m_qchWatcher->removePath(fileName); - emit documentationRemoved(ns); - } else { - emit documentationUpdated(ns); - } - m_helpEngine->setupData(); - } - m_recentQchUpdates.erase(it); -} - -QT_END_NAMESPACE - -#include "helpenginewrapper.moc" diff --git a/src/assistant/tools/assistant/helpenginewrapper.h b/src/assistant/tools/assistant/helpenginewrapper.h deleted file mode 100644 index ff825b04a..000000000 --- a/src/assistant/tools/assistant/helpenginewrapper.h +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPENGINEWRAPPER_H -#define HELPENGINEWRAPPER_H - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QFileSystemWatcher; -class QHelpContentModel; -class QHelpContentWidget; -class QHelpIndexModel; -class QHelpIndexWidget; -class QHelpSearchEngine; - -enum { - ShowHomePage = 0, - ShowBlankPage = 1, - ShowLastPages = 2 -}; - -class HelpEngineWrapperPrivate; -class TimeoutForwarder; - -class HelpEngineWrapper : public QObject -{ - Q_OBJECT - Q_DISABLE_COPY(HelpEngineWrapper) - friend class TimeoutForwarder; -public: - static HelpEngineWrapper &instance(const QString &collectionFile = QString()); - static void removeInstance(); - - // Forwarded help engine member functions, possibly enriched. - QHelpSearchEngine *searchEngine() const; - QHelpContentModel *contentModel() const; - QHelpIndexModel *indexModel() const; - QHelpContentWidget *contentWidget(); - QHelpIndexWidget *indexWidget(); - bool setupData(); - const QStringList registeredDocumentations() const; - const QString collectionFile() const; - bool registerDocumentation(const QString &docFile); - bool unregisterDocumentation(const QString &namespaceName); - bool addCustomFilter(const QString &filterName, - const QStringList &attributes); - bool removeCustomFilter(const QString &filterName); - void setCurrentFilter(const QString &filterName); - const QString currentFilter() const; - const QStringList customFilters() const; - QUrl findFile(const QUrl &url) const; - QByteArray fileData(const QUrl &url) const; - QMap linksForIdentifier(const QString &id) const; - const QStringList filterAttributes() const; - const QStringList filterAttributes(const QString &filterName) const; - QString error() const; - - /* - * To be called after assistant has finished looking for new documentation. - * This will mainly cause the search index to be updated, if necessary. - */ - void initialDocSetupDone(); - - const QStringList qtDocInfo(const QString &component) const; - void setQtDocInfo(const QString &component, const QStringList &doc); - - const QString homePage() const; - void setHomePage(const QString &page); - const QString defaultHomePage() const; - void setDefaultHomePage(const QString &page); - - int lastTabPage() const; - void setLastTabPage(int lastPage); - - // TODO: Don't allow last pages and zoom factors to be set in isolation - // Perhaps also fill up missing elements automatically or assert. - const QStringList lastShownPages() const; - void setLastShownPages(const QStringList &lastShownPages); - const QStringList lastZoomFactors() const; - void setLastZoomFactors(const QStringList &lastZoomFactors); - - const QString cacheDir() const; - bool cacheDirIsRelativeToCollection() const; - void setCacheDir(const QString &cacheDir, bool relativeToCollection); - - bool filterFunctionalityEnabled() const; - void setFilterFunctionalityEnabled(bool enabled); - - bool filterToolbarVisible() const; - void setFilterToolbarVisible(bool visible); - - bool addressBarEnabled() const; - void setAddressBarEnabled(bool enabled); - - bool addressBarVisible() const; - void setAddressBarVisible(bool visible); - - bool documentationManagerEnabled() const; - void setDocumentationManagerEnabled(bool enabled); - - const QByteArray aboutMenuTexts() const; - void setAboutMenuTexts(const QByteArray &texts); - const QByteArray aboutTexts() const; - void setAboutTexts(const QByteArray &texts); - const QByteArray aboutIcon() const; - void setAboutIcon(const QByteArray &icon); - const QByteArray aboutImages() const; - void setAboutImages(const QByteArray &images); - - const QString windowTitle() const; - void setWindowTitle(const QString &windowTitle); - - const QByteArray applicationIcon() const; - void setApplicationIcon(const QByteArray &icon); - - const QByteArray mainWindow() const; - void setMainWindow(const QByteArray &mainWindow); - const QByteArray mainWindowGeometry() const; - void setMainWindowGeometry(const QByteArray &geometry); - - const QByteArray bookmarks() const; - void setBookmarks(const QByteArray &bookmarks); - - int startOption() const; - void setStartOption(int option); - - bool hasFontSettings() const; - bool usesAppFont() const; - void setUseAppFont(bool useAppFont); - bool usesBrowserFont() const; - void setUseBrowserFont(bool useBrowserFont); - const QFont appFont() const; - void setAppFont(const QFont &font); - QFontDatabase::WritingSystem appWritingSystem() const; - void setAppWritingSystem(QFontDatabase::WritingSystem system); - const QFont browserFont() const; - void setBrowserFont(const QFont &font); - QFontDatabase::WritingSystem browserWritingSystem() const; - void setBrowserWritingSystem(QFontDatabase::WritingSystem system); - - bool showTabs() const; - void setShowTabs(bool show); - - static const QString TrUnfiltered; - - bool fullTextSearchFallbackEnabled() const; - -signals: - - // For asynchronous doc updates triggered by external actions. - void documentationRemoved(const QString &namespaceName); - void documentationUpdated(const QString &namespaceName); - - // Forwarded from QHelpEngineCore. - void currentFilterChanged(const QString ¤tFilter); - void setupFinished(); - -private slots: - void handleCurrentFilterChanged(const QString &filter); - -private: - HelpEngineWrapper(const QString &collectionFile); - ~HelpEngineWrapper(); - - static HelpEngineWrapper *helpEngineWrapper; - - HelpEngineWrapperPrivate *d; -}; - -QT_END_NAMESPACE - -#endif // HELPENGINEWRAPPER_H diff --git a/src/assistant/tools/assistant/helpviewer.cpp b/src/assistant/tools/assistant/helpviewer.cpp deleted file mode 100644 index 7bed4965a..000000000 --- a/src/assistant/tools/assistant/helpviewer.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpviewer.h" -#include "helpviewer_p.h" - -#include "helpenginewrapper.h" -#include "tracer.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -const QString HelpViewer::DocPath = QLatin1String("qthelp://com.trolltech."); - -const QString HelpViewer::AboutBlank = - QCoreApplication::translate("HelpViewer", "about:blank"); - -const QString HelpViewer::LocalHelpFile = QLatin1String("qthelp://" - "com.trolltech.com.assistantinternal-1.0.0/assistant/assistant.html"); - -const QString HelpViewer::PageNotFoundMessage = - QCoreApplication::translate("HelpViewer", "Error 404...


The page could not be found


'%1'" - "

"); - -struct ExtensionMap { - const char *extension; - const char *mimeType; -} extensionMap[] = { - { ".bmp", "image/bmp" }, - { ".css", "text/css" }, - { ".gif", "image/gif" }, - { ".html", "text/html" }, - { ".htm", "text/html" }, - { ".ico", "image/x-icon" }, - { ".jpeg", "image/jpeg" }, - { ".jpg", "image/jpeg" }, - { ".js", "application/x-javascript" }, - { ".mng", "video/x-mng" }, - { ".pbm", "image/x-portable-bitmap" }, - { ".pgm", "image/x-portable-graymap" }, - { ".pdf", "application/pdf" }, - { ".png", "image/png" }, - { ".ppm", "image/x-portable-pixmap" }, - { ".rss", "application/rss+xml" }, - { ".svg", "image/svg+xml" }, - { ".svgz", "image/svg+xml" }, - { ".text", "text/plain" }, - { ".tif", "image/tiff" }, - { ".tiff", "image/tiff" }, - { ".txt", "text/plain" }, - { ".xbm", "image/x-xbitmap" }, - { ".xml", "text/xml" }, - { ".xpm", "image/x-xpm" }, - { ".xsl", "text/xsl" }, - { ".xhtml", "application/xhtml+xml" }, - { ".wml", "text/vnd.wap.wml" }, - { ".wmlc", "application/vnd.wap.wmlc" }, - { "about:blank", 0 }, - { 0, 0 } -}; - -HelpViewer::~HelpViewer() -{ - TRACE_OBJ - delete d; -} - -bool HelpViewer::isLocalUrl(const QUrl &url) -{ - TRACE_OBJ - const QString &scheme = url.scheme(); - return scheme.isEmpty() - || scheme == QLatin1String("file") - || scheme == QLatin1String("qrc") - || scheme == QLatin1String("data") - || scheme == QLatin1String("qthelp") - || scheme == QLatin1String("about"); -} - -bool HelpViewer::canOpenPage(const QString &url) -{ - TRACE_OBJ - return !mimeFromUrl(url).isEmpty(); -} - -QString HelpViewer::mimeFromUrl(const QUrl &url) -{ - TRACE_OBJ - const QString &path = url.path(); - const int index = path.lastIndexOf(QLatin1Char('.')); - const QByteArray &ext = path.mid(index).toUtf8().toLower(); - - const ExtensionMap *e = extensionMap; - while (e->extension) { - if (ext == e->extension) - return QLatin1String(e->mimeType); - ++e; - } - return QLatin1String(""); -} - -bool HelpViewer::launchWithExternalApp(const QUrl &url) -{ - TRACE_OBJ - if (isLocalUrl(url)) { - const HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - const QUrl &resolvedUrl = helpEngine.findFile(url); - if (!resolvedUrl.isValid()) - return false; - - const QString& path = resolvedUrl.path(); - if (!canOpenPage(path)) { - QTemporaryFile tmpTmpFile; - if (!tmpTmpFile.open()) - return false; - - const QString &extension = QFileInfo(path).completeSuffix(); - QFile actualTmpFile(tmpTmpFile.fileName() % QLatin1String(".") - % extension); - if (!actualTmpFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) - return false; - - actualTmpFile.write(helpEngine.fileData(resolvedUrl)); - actualTmpFile.close(); - return QDesktopServices::openUrl(QUrl(actualTmpFile.fileName())); - } - } else if (url.scheme() == QLatin1String("http")) { - return QDesktopServices::openUrl(url); - } - return false; -} - -// -- public slots - -void HelpViewer::home() -{ - TRACE_OBJ - setSource(HelpEngineWrapper::instance().homePage()); -} - -// -- private slots - -void HelpViewer::setLoadStarted() -{ - d->m_loadFinished = false; -} - -void HelpViewer::setLoadFinished(bool ok) -{ - d->m_loadFinished = ok; - emit sourceChanged(source()); -} - -// -- private - -bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *event) -{ - TRACE_OBJ - if (event->button() == Qt::XButton1) { - backward(); - return true; - } - - if (event->button() == Qt::XButton2) { - forward(); - return true; - } - - return false; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/helpviewer.h b/src/assistant/tools/assistant/helpviewer.h deleted file mode 100644 index a5f4de668..000000000 --- a/src/assistant/tools/assistant/helpviewer.h +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPVIEWER_H -#define HELPVIEWER_H - -#include -#include -#include -#include - -#include -#include - -#if defined(QT_NO_WEBKIT) -#include -#else -#include -#endif - -QT_BEGIN_NAMESPACE - -#if !defined(QT_NO_WEBKIT) -class HelpViewer : public QWebView -#else -class HelpViewer : public QTextBrowser -#endif -{ - Q_OBJECT - class HelpViewerPrivate; - Q_DISABLE_COPY(HelpViewer) - -public: - enum FindFlag { - FindBackward = 0x01, - FindCaseSensitively = 0x02 - }; - Q_DECLARE_FLAGS(FindFlags, FindFlag) - - HelpViewer(qreal zoom, QWidget *parent = 0); - ~HelpViewer(); - - QFont viewerFont() const; - void setViewerFont(const QFont &font); - - void scaleUp(); - void scaleDown(); - - void resetScale(); - qreal scale() const; - - QString title() const; - void setTitle(const QString &title); - - QUrl source() const; - void setSource(const QUrl &url); - - QString selectedText() const; - bool isForwardAvailable() const; - bool isBackwardAvailable() const; - - bool findText(const QString &text, FindFlags flags, bool incremental, - bool fromSearch); - - static const QString DocPath; - static const QString AboutBlank; - static const QString LocalHelpFile; - static const QString PageNotFoundMessage; - - static bool isLocalUrl(const QUrl &url); - static bool canOpenPage(const QString &url); - static QString mimeFromUrl(const QUrl &url); - static bool launchWithExternalApp(const QUrl &url); - -public slots: - void copy(); - void home(); - - void forward(); - void backward(); - -signals: - void titleChanged(); -#if !defined(QT_NO_WEBKIT) - void copyAvailable(bool yes); - void sourceChanged(const QUrl &url); - void forwardAvailable(bool enabled); - void backwardAvailable(bool enabled); - void highlighted(const QString &link); - void printRequested(); -#else - void loadStarted(); - void loadFinished(bool finished); -#endif - -protected: - void keyPressEvent(QKeyEvent *e); - void wheelEvent(QWheelEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - -private slots: - void actionChanged(); - void setLoadStarted(); - void setLoadFinished(bool ok); - -private: - bool eventFilter(QObject *obj, QEvent *event); - void contextMenuEvent(QContextMenuEvent *event); - QVariant loadResource(int type, const QUrl &name); - bool handleForwardBackwardMouseButtons(QMouseEvent *e); - -private: - HelpViewerPrivate *d; -}; - -QT_END_NAMESPACE -Q_DECLARE_METATYPE(HelpViewer*) - -#endif // HELPVIEWER_H diff --git a/src/assistant/tools/assistant/helpviewer_p.h b/src/assistant/tools/assistant/helpviewer_p.h deleted file mode 100644 index 8beeb94b2..000000000 --- a/src/assistant/tools/assistant/helpviewer_p.h +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPVIEWERPRIVATE_H -#define HELPVIEWERPRIVATE_H - -#include "centralwidget.h" -#include "helpviewer.h" -#include "openpagesmanager.h" - -#include -#ifdef QT_NO_WEBKIT -#include -#endif - -QT_BEGIN_NAMESPACE - -class HelpViewer::HelpViewerPrivate : public QObject -{ - Q_OBJECT - -public: -#ifdef QT_NO_WEBKIT - HelpViewerPrivate(int zoom) - : zoomCount(zoom) - , forceFont(false) - , lastAnchor(QString()) -#else - HelpViewerPrivate() -#endif - { - m_loadFinished = false; - } - -#ifdef QT_NO_WEBKIT - bool hasAnchorAt(QTextBrowser *browser, const QPoint& pos) - { - lastAnchor = browser->anchorAt(pos); - if (lastAnchor.isEmpty()) - return false; - - lastAnchor = browser->source().resolved(lastAnchor).toString(); - if (lastAnchor.at(0) == QLatin1Char('#')) { - QString src = browser->source().toString(); - int hsh = src.indexOf(QLatin1Char('#')); - lastAnchor = (hsh >= 0 ? src.left(hsh) : src) + lastAnchor; - } - return true; - } - - void openLink(bool newPage) - { - if(lastAnchor.isEmpty()) - return; - if (newPage) - OpenPagesManager::instance()->createPage(lastAnchor); - else - CentralWidget::instance()->setSource(lastAnchor); - lastAnchor.clear(); - } - -public slots: - void openLink() - { - openLink(false); - } - - void openLinkInNewPage() - { - openLink(true); - } - -public: - int zoomCount; - bool forceFont; - QString lastAnchor; -#endif // QT_NO_WEBKIT - -public: - bool m_loadFinished; -}; - -QT_END_NAMESPACE - -#endif // HELPVIEWERPRIVATE_H diff --git a/src/assistant/tools/assistant/helpviewer_qtb.cpp b/src/assistant/tools/assistant/helpviewer_qtb.cpp deleted file mode 100644 index d3d128b74..000000000 --- a/src/assistant/tools/assistant/helpviewer_qtb.cpp +++ /dev/null @@ -1,384 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpviewer.h" - -#include "globalactions.h" -#include "helpenginewrapper.h" -#include "helpviewer_p.h" -#include "openpagesmanager.h" -#include "tracer.h" - -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -HelpViewer::HelpViewer(qreal zoom, QWidget *parent) - : QTextBrowser(parent) - , d(new HelpViewerPrivate(zoom)) -{ - TRACE_OBJ - QPalette p = palette(); - p.setColor(QPalette::Inactive, QPalette::Highlight, - p.color(QPalette::Active, QPalette::Highlight)); - p.setColor(QPalette::Inactive, QPalette::HighlightedText, - p.color(QPalette::Active, QPalette::HighlightedText)); - setPalette(p); - - installEventFilter(this); - document()->setDocumentMargin(8); - - QFont font = viewerFont(); - font.setPointSize(int(font.pointSize() + zoom)); - setViewerFont(font); - - connect(this, SIGNAL(sourceChanged(QUrl)), this, SIGNAL(titleChanged())); - connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); -} - -QFont HelpViewer::viewerFont() const -{ - TRACE_OBJ - if (HelpEngineWrapper::instance().usesBrowserFont()) - return HelpEngineWrapper::instance().browserFont(); - return qApp->font(); -} - -void HelpViewer::setViewerFont(const QFont &newFont) -{ - TRACE_OBJ - if (font() != newFont) { - d->forceFont = true; - setFont(newFont); - d->forceFont = false; - } -} - -void HelpViewer::scaleUp() -{ - TRACE_OBJ - if (d->zoomCount < 10) { - d->zoomCount++; - d->forceFont = true; - zoomIn(); - d->forceFont = false; - } -} - -void HelpViewer::scaleDown() -{ - TRACE_OBJ - if (d->zoomCount > -5) { - d->zoomCount--; - d->forceFont = true; - zoomOut(); - d->forceFont = false; - } -} - -void HelpViewer::resetScale() -{ - TRACE_OBJ - if (d->zoomCount != 0) { - d->forceFont = true; - zoomOut(d->zoomCount); - d->forceFont = false; - } - d->zoomCount = 0; -} - -qreal HelpViewer::scale() const -{ - TRACE_OBJ - return d->zoomCount; -} - -QString HelpViewer::title() const -{ - TRACE_OBJ - return documentTitle(); -} - -void HelpViewer::setTitle(const QString &title) -{ - TRACE_OBJ - setDocumentTitle(title); -} - -QUrl HelpViewer::source() const -{ - TRACE_OBJ - return QTextBrowser::source(); -} - -void HelpViewer::setSource(const QUrl &url) -{ - TRACE_OBJ - if (launchWithExternalApp(url)) - return; - - emit loadStarted(); - QString string = url.toString(); - const HelpEngineWrapper &engine = HelpEngineWrapper::instance(); - const QUrl &resolvedUrl = (string == QLatin1String("help") ? LocalHelpFile : - engine.findFile(string)); - QTextBrowser::setSource(resolvedUrl); - if (!url.isValid()) { - setHtml(string == QLatin1String("about:blank") ? AboutBlank - : PageNotFoundMessage.arg(url.toString())); - } - emit loadFinished(true); -} - -QString HelpViewer::selectedText() const -{ - TRACE_OBJ - return textCursor().selectedText(); -} - -bool HelpViewer::isForwardAvailable() const -{ - TRACE_OBJ - return QTextBrowser::isForwardAvailable(); -} - -bool HelpViewer::isBackwardAvailable() const -{ - TRACE_OBJ - return QTextBrowser::isBackwardAvailable(); -} - -bool HelpViewer::findText(const QString &text, FindFlags flags, bool incremental, - bool fromSearch) -{ - TRACE_OBJ - QTextDocument *doc = document(); - QTextCursor cursor = textCursor(); - if (!doc || cursor.isNull()) - return false; - - const int position = cursor.selectionStart(); - if (incremental) - cursor.setPosition(position); - - QTextDocument::FindFlags textDocFlags; - if (flags & HelpViewer::FindBackward) - textDocFlags |= QTextDocument::FindBackward; - if (flags & HelpViewer::FindCaseSensitively) - textDocFlags |= QTextDocument::FindCaseSensitively; - - QTextCursor found = doc->find(text, cursor, textDocFlags); - if (found.isNull()) { - if ((flags & HelpViewer::FindBackward) == 0) - cursor.movePosition(QTextCursor::Start); - else - cursor.movePosition(QTextCursor::End); - found = doc->find(text, cursor, textDocFlags); - } - - if (fromSearch) { - cursor.beginEditBlock(); - viewport()->setUpdatesEnabled(false); - - QTextCharFormat marker; - marker.setForeground(Qt::red); - cursor.movePosition(QTextCursor::Start); - setTextCursor(cursor); - - while (find(text)) { - QTextCursor hit = textCursor(); - hit.mergeCharFormat(marker); - } - - viewport()->setUpdatesEnabled(true); - cursor.endEditBlock(); - } - - bool cursorIsNull = found.isNull(); - if (cursorIsNull) { - found = textCursor(); - found.setPosition(position); - } - setTextCursor(found); - return !cursorIsNull; -} - -// -- public slots - -void HelpViewer::copy() -{ - TRACE_OBJ - QTextBrowser::copy(); -} - -void HelpViewer::forward() -{ - TRACE_OBJ - QTextBrowser::forward(); -} - -void HelpViewer::backward() -{ - TRACE_OBJ - QTextBrowser::backward(); -} - -// -- protected - -void HelpViewer::keyPressEvent(QKeyEvent *e) -{ - TRACE_OBJ - if ((e->key() == Qt::Key_Home && e->modifiers() != Qt::NoModifier) - || (e->key() == Qt::Key_End && e->modifiers() != Qt::NoModifier)) { - QKeyEvent* event = new QKeyEvent(e->type(), e->key(), Qt::NoModifier, - e->text(), e->isAutoRepeat(), e->count()); - e = event; - } - QTextBrowser::keyPressEvent(e); -} - - -void HelpViewer::wheelEvent(QWheelEvent *e) -{ - TRACE_OBJ - if (e->modifiers() == Qt::ControlModifier) { - e->accept(); - e->delta() > 0 ? scaleUp() : scaleDown(); - } else { - QTextBrowser::wheelEvent(e); - } -} - -void HelpViewer::mousePressEvent(QMouseEvent *e) -{ - TRACE_OBJ -#ifdef Q_OS_LINUX - if (handleForwardBackwardMouseButtons(e)) - return; -#endif - - QTextBrowser::mousePressEvent(e); -} - -void HelpViewer::mouseReleaseEvent(QMouseEvent *e) -{ - TRACE_OBJ -#ifndef Q_OS_LINUX - if (handleForwardBackwardMouseButtons(e)) - return; -#endif - - bool controlPressed = e->modifiers() & Qt::ControlModifier; - if ((controlPressed && d->hasAnchorAt(this, e->pos())) || - (e->button() == Qt::MidButton && d->hasAnchorAt(this, e->pos()))) { - d->openLinkInNewPage(); - return; - } - - QTextBrowser::mouseReleaseEvent(e); -} - -// -- private slots - -void HelpViewer::actionChanged() -{ - // stub - TRACE_OBJ -} - -// -- private - -bool HelpViewer::eventFilter(QObject *obj, QEvent *event) -{ - TRACE_OBJ - if (event->type() == QEvent::FontChange && !d->forceFont) - return true; - return QTextBrowser::eventFilter(obj, event); -} - -void HelpViewer::contextMenuEvent(QContextMenuEvent *event) -{ - TRACE_OBJ - - QMenu menu(QString(), 0); - QUrl link; - QAction *copyAnchorAction = 0; - if (d->hasAnchorAt(this, event->pos())) { - link = anchorAt(event->pos()); - if (link.isRelative()) - link = source().resolved(link); - menu.addAction(tr("Open Link"), d, SLOT(openLink())); - menu.addAction(tr("Open Link in New Tab\tCtrl+LMB"), d, SLOT(openLinkInNewPage())); - - if (!link.isEmpty() && link.isValid()) - copyAnchorAction = menu.addAction(tr("Copy &Link Location")); - } else if (!selectedText().isEmpty()) { - menu.addAction(tr("Copy"), this, SLOT(copy())); - } else { - menu.addAction(tr("Reload"), this, SLOT(reload())); - } - - if (copyAnchorAction == menu.exec(event->globalPos())) - QApplication::clipboard()->setText(link.toString()); -} - -QVariant HelpViewer::loadResource(int type, const QUrl &name) -{ - TRACE_OBJ - QByteArray ba; - if (type < 4) { - ba = HelpEngineWrapper::instance().fileData(name); - if (name.toString().endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)) { - QImage image; - image.loadFromData(ba, "svg"); - if (!image.isNull()) - return image; - } - } - return ba; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/helpviewer_qwv.cpp b/src/assistant/tools/assistant/helpviewer_qwv.cpp deleted file mode 100644 index 662177631..000000000 --- a/src/assistant/tools/assistant/helpviewer_qwv.cpp +++ /dev/null @@ -1,495 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpviewer.h" -#include "helpviewer_p.h" - -#include "centralwidget.h" -#include "helpenginewrapper.h" -#include "openpagesmanager.h" -#include "tracer.h" - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -// -- HelpNetworkReply - -class HelpNetworkReply : public QNetworkReply -{ -public: - HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData, - const QString &mimeType); - - virtual void abort(); - - virtual qint64 bytesAvailable() const - { return data.length() + QNetworkReply::bytesAvailable(); } - -protected: - virtual qint64 readData(char *data, qint64 maxlen); - -private: - QByteArray data; - qint64 origLen; -}; - -HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, - const QByteArray &fileData, const QString& mimeType) - : data(fileData), origLen(fileData.length()) -{ - TRACE_OBJ - setRequest(request); - setOpenMode(QIODevice::ReadOnly); - - setHeader(QNetworkRequest::ContentTypeHeader, mimeType); - setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen)); - QTimer::singleShot(0, this, SIGNAL(metaDataChanged())); - QTimer::singleShot(0, this, SIGNAL(readyRead())); -} - -void HelpNetworkReply::abort() -{ - TRACE_OBJ -} - -qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) -{ - TRACE_OBJ - qint64 len = qMin(qint64(data.length()), maxlen); - if (len) { - memcpy(buffer, data.constData(), len); - data.remove(0, len); - } - if (!data.length()) - QTimer::singleShot(0, this, SIGNAL(finished())); - return len; -} - -// -- HelpNetworkAccessManager - -class HelpNetworkAccessManager : public QNetworkAccessManager -{ -public: - HelpNetworkAccessManager(QObject *parent); - -protected: - virtual QNetworkReply *createRequest(Operation op, - const QNetworkRequest &request, QIODevice *outgoingData = 0); -}; - -HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) - : QNetworkAccessManager(parent) -{ - TRACE_OBJ -} - -QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, - const QNetworkRequest &request, QIODevice* /*outgoingData*/) -{ - TRACE_OBJ - QString url = request.url().toString(); - const HelpEngineWrapper &engine = HelpEngineWrapper::instance(); - // TODO: For some reason the url to load is already wrong (passed from webkit) - // though the css file and the references inside should work that way. One - // possible problem might be that the css is loaded at the same level as the - // html, thus a path inside the css like (../images/foo.png) might cd out of - // the virtual folder - if (!engine.findFile(url).isValid()) { - if (url.startsWith(HelpViewer::DocPath)) { - QUrl newUrl = request.url(); - if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) { - newUrl.setPath(QLatin1String("qdoc") + newUrl.path()); - url = newUrl.toString(); - } - } - } - - const QString &mimeType = HelpViewer::mimeFromUrl(url); - const QByteArray &data = engine.findFile(url).isValid() ? engine.fileData(url) - : HelpViewer::PageNotFoundMessage.arg(url).toUtf8(); - - return new HelpNetworkReply(request, data, mimeType.isEmpty() - ? QLatin1String("application/octet-stream") : mimeType); -} - -// -- HelpPage - -class HelpPage : public QWebPage -{ -public: - HelpPage(QObject *parent); - -protected: - virtual QWebPage *createWindow(QWebPage::WebWindowType); - virtual void triggerAction(WebAction action, bool checked = false); - - virtual bool acceptNavigationRequest(QWebFrame *frame, - const QNetworkRequest &request, NavigationType type); - -private: - bool closeNewTabIfNeeded; - - friend class HelpViewer; - QUrl m_loadingUrl; - Qt::MouseButtons m_pressedButtons; - Qt::KeyboardModifiers m_keyboardModifiers; -}; - -HelpPage::HelpPage(QObject *parent) - : QWebPage(parent) - , closeNewTabIfNeeded(false) - , m_pressedButtons(Qt::NoButton) - , m_keyboardModifiers(Qt::NoModifier) -{ - TRACE_OBJ -} - -QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) -{ - TRACE_OBJ - HelpPage* newPage = static_cast(OpenPagesManager::instance() - ->createPage()->page()); - newPage->closeNewTabIfNeeded = closeNewTabIfNeeded; - closeNewTabIfNeeded = false; - return newPage; -} - -void HelpPage::triggerAction(WebAction action, bool checked) -{ - TRACE_OBJ - switch (action) { - case OpenLinkInNewWindow: - closeNewTabIfNeeded = true; - default: // fall through - QWebPage::triggerAction(action, checked); - break; - } -} - -bool HelpPage::acceptNavigationRequest(QWebFrame *, - const QNetworkRequest &request, QWebPage::NavigationType type) -{ - TRACE_OBJ - const bool closeNewTab = closeNewTabIfNeeded; - closeNewTabIfNeeded = false; - - const QUrl &url = request.url(); - if (HelpViewer::launchWithExternalApp(url)) { - if (closeNewTab) - QMetaObject::invokeMethod(OpenPagesManager::instance(), "closeCurrentPage"); - return false; - } - - if (type == QWebPage::NavigationTypeLinkClicked - && (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton)) { - m_pressedButtons = Qt::NoButton; - m_keyboardModifiers = Qt::NoModifier; - OpenPagesManager::instance()->createPage(url); - return false; - } - - m_loadingUrl = url; // because of async page loading, we will hit some kind - // of race condition while using a remote command, like a combination of - // SetSource; SyncContent. SetSource would be called and SyncContents shortly - // afterwards, but the page might not have finished loading and the old url - // would be returned. - return true; -} - -// -- HelpViewer - -HelpViewer::HelpViewer(qreal zoom, QWidget *parent) - : QWebView(parent) - , d(new HelpViewerPrivate) -{ - TRACE_OBJ - setAcceptDrops(false); - settings()->setAttribute(QWebSettings::JavaEnabled, false); - settings()->setAttribute(QWebSettings::PluginsEnabled, false); - - setPage(new HelpPage(this)); - page()->setNetworkAccessManager(new HelpNetworkAccessManager(this)); - - QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); - action->setText(tr("Open Link in New Page")); - - pageAction(QWebPage::DownloadLinkToDisk)->setVisible(false); - pageAction(QWebPage::DownloadImageToDisk)->setVisible(false); - pageAction(QWebPage::OpenImageInNewWindow)->setVisible(false); - - connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this, - SLOT(actionChanged())); - connect(pageAction(QWebPage::Back), SIGNAL(changed()), this, - SLOT(actionChanged())); - connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, - SLOT(actionChanged())); - connect(page(), SIGNAL(linkHovered(QString, QString, QString)), this, - SIGNAL(highlighted(QString))); - connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl))); - connect(this, SIGNAL(loadStarted()), this, SLOT(setLoadStarted())); - connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); - connect(this, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged())); - connect(page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested())); - - setFont(viewerFont()); - setTextSizeMultiplier(zoom == 0.0 ? 1.0 : zoom); -} - -QFont HelpViewer::viewerFont() const -{ - TRACE_OBJ - if (HelpEngineWrapper::instance().usesBrowserFont()) - return HelpEngineWrapper::instance().browserFont(); - - QWebSettings *webSettings = QWebSettings::globalSettings(); - return QFont(webSettings->fontFamily(QWebSettings::StandardFont), - webSettings->fontSize(QWebSettings::DefaultFontSize)); -} - -void HelpViewer::setViewerFont(const QFont &font) -{ - TRACE_OBJ - QWebSettings *webSettings = settings(); - webSettings->setFontFamily(QWebSettings::StandardFont, font.family()); - webSettings->setFontSize(QWebSettings::DefaultFontSize, font.pointSize()); -} - -void HelpViewer::scaleUp() -{ - TRACE_OBJ - setTextSizeMultiplier(textSizeMultiplier() + 0.1); -} - -void HelpViewer::scaleDown() -{ - TRACE_OBJ - setTextSizeMultiplier(qMax(0.0, textSizeMultiplier() - 0.1)); -} - -void HelpViewer::resetScale() -{ - TRACE_OBJ - setTextSizeMultiplier(1.0); -} - -qreal HelpViewer::scale() const -{ - TRACE_OBJ - return textSizeMultiplier(); -} - -QString HelpViewer::title() const -{ - TRACE_OBJ - return QWebView::title(); -} - -void HelpViewer::setTitle(const QString &title) -{ - TRACE_OBJ - Q_UNUSED(title) -} - -QUrl HelpViewer::source() const -{ - TRACE_OBJ - HelpPage *currentPage = static_cast (page()); - if (currentPage && !d->m_loadFinished) { - // see HelpPage::acceptNavigationRequest(...) - return currentPage->m_loadingUrl; - } - return url(); -} - -void HelpViewer::setSource(const QUrl &url) -{ - TRACE_OBJ - load(url.toString() == QLatin1String("help") ? LocalHelpFile : url); -} - -QString HelpViewer::selectedText() const -{ - TRACE_OBJ - return QWebView::selectedText(); -} - -bool HelpViewer::isForwardAvailable() const -{ - TRACE_OBJ - return pageAction(QWebPage::Forward)->isEnabled(); -} - -bool HelpViewer::isBackwardAvailable() const -{ - TRACE_OBJ - return pageAction(QWebPage::Back)->isEnabled(); -} - -bool HelpViewer::findText(const QString &text, FindFlags flags, bool incremental, - bool fromSearch) -{ - TRACE_OBJ - Q_UNUSED(incremental); Q_UNUSED(fromSearch); - QWebPage::FindFlags options = QWebPage::FindWrapsAroundDocument; - if (flags & FindBackward) - options |= QWebPage::FindBackward; - if (flags & FindCaseSensitively) - options |= QWebPage::FindCaseSensitively; - - bool found = QWebView::findText(text, options); - options = QWebPage::HighlightAllOccurrences; - QWebView::findText(QLatin1String(""), options); // clear first - QWebView::findText(text, options); // force highlighting of all other matches - return found; -} - -// -- public slots - -void HelpViewer::copy() -{ - TRACE_OBJ - triggerPageAction(QWebPage::Copy); -} - -void HelpViewer::forward() -{ - TRACE_OBJ - QWebView::forward(); -} - -void HelpViewer::backward() -{ - TRACE_OBJ - back(); -} - -// -- protected - -void HelpViewer::keyPressEvent(QKeyEvent *e) -{ - TRACE_OBJ - // TODO: remove this once we support multiple keysequences per command - if (e->key() == Qt::Key_Insert && e->modifiers() == Qt::CTRL) { - if (!selectedText().isEmpty()) - copy(); - } - QWebView::keyPressEvent(e); -} - -void HelpViewer::wheelEvent(QWheelEvent *event) -{ - TRACE_OBJ - if (event->modifiers()& Qt::ControlModifier) { - event->accept(); - event->delta() > 0 ? scaleUp() : scaleDown(); - } else { - QWebView::wheelEvent(event); - } -} - -void HelpViewer::mousePressEvent(QMouseEvent *event) -{ - TRACE_OBJ -#ifdef Q_OS_LINUX - if (handleForwardBackwardMouseButtons(event)) - return; -#endif - - if (HelpPage *currentPage = static_cast (page())) { - currentPage->m_pressedButtons = event->buttons(); - currentPage->m_keyboardModifiers = event->modifiers(); - } - - QWebView::mousePressEvent(event); -} - -void HelpViewer::mouseReleaseEvent(QMouseEvent *event) -{ - TRACE_OBJ -#ifndef Q_OS_LINUX - if (handleForwardBackwardMouseButtons(event)) - return; -#endif - - QWebView::mouseReleaseEvent(event); -} - -// -- private slots - -void HelpViewer::actionChanged() -{ - TRACE_OBJ - QAction *a = qobject_cast(sender()); - if (a == pageAction(QWebPage::Copy)) - emit copyAvailable(a->isEnabled()); - else if (a == pageAction(QWebPage::Back)) - emit backwardAvailable(a->isEnabled()); - else if (a == pageAction(QWebPage::Forward)) - emit forwardAvailable(a->isEnabled()); -} - -// -- private - -bool HelpViewer::eventFilter(QObject *obj, QEvent *event) -{ - TRACE_OBJ - return QWebView::eventFilter(obj, event); -} - -void HelpViewer::contextMenuEvent(QContextMenuEvent *event) -{ - TRACE_OBJ - QWebView::contextMenuEvent(event); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/images/assistant-128.png b/src/assistant/tools/assistant/images/assistant-128.png deleted file mode 100644 index f05949f6d..000000000 Binary files a/src/assistant/tools/assistant/images/assistant-128.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/assistant.png b/src/assistant/tools/assistant/images/assistant.png deleted file mode 100644 index ea4d1e70c..000000000 Binary files a/src/assistant/tools/assistant/images/assistant.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/bookmark.png b/src/assistant/tools/assistant/images/bookmark.png deleted file mode 100644 index 57e57e343..000000000 Binary files a/src/assistant/tools/assistant/images/bookmark.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/closebutton.png b/src/assistant/tools/assistant/images/closebutton.png deleted file mode 100644 index c978cf51a..000000000 Binary files a/src/assistant/tools/assistant/images/closebutton.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/darkclosebutton.png b/src/assistant/tools/assistant/images/darkclosebutton.png deleted file mode 100644 index 1077663b2..000000000 Binary files a/src/assistant/tools/assistant/images/darkclosebutton.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/addtab.png b/src/assistant/tools/assistant/images/mac/addtab.png deleted file mode 100644 index 20928fb40..000000000 Binary files a/src/assistant/tools/assistant/images/mac/addtab.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/book.png b/src/assistant/tools/assistant/images/mac/book.png deleted file mode 100644 index 7a3204c87..000000000 Binary files a/src/assistant/tools/assistant/images/mac/book.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/closetab.png b/src/assistant/tools/assistant/images/mac/closetab.png deleted file mode 100644 index ab9d669ee..000000000 Binary files a/src/assistant/tools/assistant/images/mac/closetab.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/editcopy.png b/src/assistant/tools/assistant/images/mac/editcopy.png deleted file mode 100644 index f55136446..000000000 Binary files a/src/assistant/tools/assistant/images/mac/editcopy.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/find.png b/src/assistant/tools/assistant/images/mac/find.png deleted file mode 100644 index 3561745f0..000000000 Binary files a/src/assistant/tools/assistant/images/mac/find.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/home.png b/src/assistant/tools/assistant/images/mac/home.png deleted file mode 100644 index 78d94da18..000000000 Binary files a/src/assistant/tools/assistant/images/mac/home.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/next.png b/src/assistant/tools/assistant/images/mac/next.png deleted file mode 100644 index a585cab80..000000000 Binary files a/src/assistant/tools/assistant/images/mac/next.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/previous.png b/src/assistant/tools/assistant/images/mac/previous.png deleted file mode 100644 index 612fb34dc..000000000 Binary files a/src/assistant/tools/assistant/images/mac/previous.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/print.png b/src/assistant/tools/assistant/images/mac/print.png deleted file mode 100644 index 10ca56c82..000000000 Binary files a/src/assistant/tools/assistant/images/mac/print.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/resetzoom.png b/src/assistant/tools/assistant/images/mac/resetzoom.png deleted file mode 100644 index 759b38296..000000000 Binary files a/src/assistant/tools/assistant/images/mac/resetzoom.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/synctoc.png b/src/assistant/tools/assistant/images/mac/synctoc.png deleted file mode 100644 index 067fa941b..000000000 Binary files a/src/assistant/tools/assistant/images/mac/synctoc.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/zoomin.png b/src/assistant/tools/assistant/images/mac/zoomin.png deleted file mode 100644 index d46f5aff0..000000000 Binary files a/src/assistant/tools/assistant/images/mac/zoomin.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/mac/zoomout.png b/src/assistant/tools/assistant/images/mac/zoomout.png deleted file mode 100644 index 46326566d..000000000 Binary files a/src/assistant/tools/assistant/images/mac/zoomout.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/trolltech-logo.png b/src/assistant/tools/assistant/images/trolltech-logo.png deleted file mode 100644 index c53e744ca..000000000 Binary files a/src/assistant/tools/assistant/images/trolltech-logo.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/addtab.png b/src/assistant/tools/assistant/images/win/addtab.png deleted file mode 100644 index 4bb0feb92..000000000 Binary files a/src/assistant/tools/assistant/images/win/addtab.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/book.png b/src/assistant/tools/assistant/images/win/book.png deleted file mode 100644 index 09ec4d33f..000000000 Binary files a/src/assistant/tools/assistant/images/win/book.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/closetab.png b/src/assistant/tools/assistant/images/win/closetab.png deleted file mode 100644 index ef9e02086..000000000 Binary files a/src/assistant/tools/assistant/images/win/closetab.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/editcopy.png b/src/assistant/tools/assistant/images/win/editcopy.png deleted file mode 100644 index 1121b47d8..000000000 Binary files a/src/assistant/tools/assistant/images/win/editcopy.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/find.png b/src/assistant/tools/assistant/images/win/find.png deleted file mode 100644 index 6ea35e930..000000000 Binary files a/src/assistant/tools/assistant/images/win/find.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/home.png b/src/assistant/tools/assistant/images/win/home.png deleted file mode 100644 index b1c6ae191..000000000 Binary files a/src/assistant/tools/assistant/images/win/home.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/next.png b/src/assistant/tools/assistant/images/win/next.png deleted file mode 100644 index 8df4127a0..000000000 Binary files a/src/assistant/tools/assistant/images/win/next.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/previous.png b/src/assistant/tools/assistant/images/win/previous.png deleted file mode 100644 index 0780bc23d..000000000 Binary files a/src/assistant/tools/assistant/images/win/previous.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/print.png b/src/assistant/tools/assistant/images/win/print.png deleted file mode 100644 index ba7c02dc1..000000000 Binary files a/src/assistant/tools/assistant/images/win/print.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/resetzoom.png b/src/assistant/tools/assistant/images/win/resetzoom.png deleted file mode 100644 index b69ae4e7f..000000000 Binary files a/src/assistant/tools/assistant/images/win/resetzoom.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/synctoc.png b/src/assistant/tools/assistant/images/win/synctoc.png deleted file mode 100644 index da301bc59..000000000 Binary files a/src/assistant/tools/assistant/images/win/synctoc.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/zoomin.png b/src/assistant/tools/assistant/images/win/zoomin.png deleted file mode 100644 index 2e586fc7b..000000000 Binary files a/src/assistant/tools/assistant/images/win/zoomin.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/win/zoomout.png b/src/assistant/tools/assistant/images/win/zoomout.png deleted file mode 100644 index a736d3934..000000000 Binary files a/src/assistant/tools/assistant/images/win/zoomout.png and /dev/null differ diff --git a/src/assistant/tools/assistant/images/wrap.png b/src/assistant/tools/assistant/images/wrap.png deleted file mode 100644 index 90f18d9f7..000000000 Binary files a/src/assistant/tools/assistant/images/wrap.png and /dev/null differ diff --git a/src/assistant/tools/assistant/indexwindow.cpp b/src/assistant/tools/assistant/indexwindow.cpp deleted file mode 100644 index 069e821cd..000000000 --- a/src/assistant/tools/assistant/indexwindow.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "indexwindow.h" - -#include "centralwidget.h" -#include "helpenginewrapper.h" -#include "helpviewer.h" -#include "openpagesmanager.h" -#include "topicchooser.h" -#include "tracer.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -IndexWindow::IndexWindow(QWidget *parent) - : QWidget(parent) - , m_searchLineEdit(new QLineEdit) - , m_indexWidget(HelpEngineWrapper::instance().indexWidget()) -{ - TRACE_OBJ - QVBoxLayout *layout = new QVBoxLayout(this); - QLabel *l = new QLabel(tr("&Look for:")); - layout->addWidget(l); - - l->setBuddy(m_searchLineEdit); - connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, - SLOT(filterIndices(QString))); - m_searchLineEdit->installEventFilter(this); - layout->setMargin(4); - layout->addWidget(m_searchLineEdit); - - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - m_indexWidget->installEventFilter(this); - connect(helpEngine.indexModel(), SIGNAL(indexCreationStarted()), this, - SLOT(disableSearchLineEdit())); - connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, - SLOT(enableSearchLineEdit())); - connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this, - SIGNAL(linkActivated(QUrl))); - connect(m_indexWidget, SIGNAL(linksActivated(QMap,QString)), - this, SIGNAL(linksActivated(QMap,QString))); - connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget, - SLOT(activateCurrentItem())); - layout->addWidget(m_indexWidget); - - m_indexWidget->viewport()->installEventFilter(this); -} - -IndexWindow::~IndexWindow() -{ - TRACE_OBJ -} - -void IndexWindow::filterIndices(const QString &filter) -{ - TRACE_OBJ - if (filter.contains(QLatin1Char('*'))) - m_indexWidget->filterIndices(filter, filter); - else - m_indexWidget->filterIndices(filter, QString()); -} - -bool IndexWindow::eventFilter(QObject *obj, QEvent *e) -{ - TRACE_OBJ - if (obj == m_searchLineEdit && e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); - QModelIndex idx = m_indexWidget->currentIndex(); - switch (ke->key()) { - case Qt::Key_Up: - idx = m_indexWidget->model()->index(idx.row()-1, - idx.column(), idx.parent()); - if (idx.isValid()) { - m_indexWidget->setCurrentIndex(idx); - return true; - } - break; - case Qt::Key_Down: - idx = m_indexWidget->model()->index(idx.row()+1, - idx.column(), idx.parent()); - if (idx.isValid()) { - m_indexWidget->setCurrentIndex(idx); - return true; - } - break; - case Qt::Key_Escape: - emit escapePressed(); - return true; - default: ; // stop complaining - } - } else if (obj == m_indexWidget && e->type() == QEvent::ContextMenu) { - QContextMenuEvent *ctxtEvent = static_cast(e); - QModelIndex idx = m_indexWidget->indexAt(ctxtEvent->pos()); - if (idx.isValid()) { - QMenu menu; - QAction *curTab = menu.addAction(tr("Open Link")); - QAction *newTab = menu.addAction(tr("Open Link in New Tab")); - menu.move(m_indexWidget->mapToGlobal(ctxtEvent->pos())); - - QAction *action = menu.exec(); - if (curTab == action) - m_indexWidget->activateCurrentItem(); - else if (newTab == action) { - open(m_indexWidget, idx); - } - } - } else if (m_indexWidget && obj == m_indexWidget->viewport() - && e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *mouseEvent = static_cast(e); - QModelIndex idx = m_indexWidget->indexAt(mouseEvent->pos()); - if (idx.isValid()) { - Qt::MouseButtons button = mouseEvent->button(); - if (((button == Qt::LeftButton) && (mouseEvent->modifiers() & Qt::ControlModifier)) - || (button == Qt::MidButton)) { - open(m_indexWidget, idx); - } - } - } -#ifdef Q_OS_MAC - else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); - if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) - m_indexWidget->activateCurrentItem(); - } -#endif - return QWidget::eventFilter(obj, e); -} - -void IndexWindow::enableSearchLineEdit() -{ - TRACE_OBJ - m_searchLineEdit->setDisabled(false); - filterIndices(m_searchLineEdit->text()); -} - -void IndexWindow::disableSearchLineEdit() -{ - TRACE_OBJ - m_searchLineEdit->setDisabled(true); -} - -void IndexWindow::setSearchLineEditText(const QString &text) -{ - TRACE_OBJ - m_searchLineEdit->setText(text); -} - -void IndexWindow::focusInEvent(QFocusEvent *e) -{ - TRACE_OBJ - if (e->reason() != Qt::MouseFocusReason) { - m_searchLineEdit->selectAll(); - m_searchLineEdit->setFocus(); - } -} - -void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) -{ - TRACE_OBJ - QHelpIndexModel *model = qobject_cast(indexWidget->model()); - if (model) { - QString keyword = model->data(index, Qt::DisplayRole).toString(); - QMap links = model->linksForKeyword(keyword); - - QUrl url; - if (links.count() > 1) { - TopicChooser tc(this, keyword, links); - if (tc.exec() == QDialog::Accepted) - url = tc.link(); - } else if (links.count() == 1) { - url = links.constBegin().value(); - } else { - return; - } - - if (!HelpViewer::canOpenPage(url.path())) - CentralWidget::instance()->setSource(url); - else - OpenPagesManager::instance()->createPage(url); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/indexwindow.h b/src/assistant/tools/assistant/indexwindow.h deleted file mode 100644 index 1873cd6e4..000000000 --- a/src/assistant/tools/assistant/indexwindow.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef INDEXWINDOW_H -#define INDEXWINDOW_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpIndexWidget; -class QModelIndex; - -class IndexWindow : public QWidget -{ - Q_OBJECT - -public: - IndexWindow(QWidget *parent = 0); - ~IndexWindow(); - - void setSearchLineEditText(const QString &text); - QString searchLineEditText() const - { - return m_searchLineEdit->text(); - } - -signals: - void linkActivated(const QUrl &link); - void linksActivated(const QMap &links, - const QString &keyword); - void escapePressed(); - -private slots: - void filterIndices(const QString &filter); - void enableSearchLineEdit(); - void disableSearchLineEdit(); - -private: - bool eventFilter(QObject *obj, QEvent *e); - void focusInEvent(QFocusEvent *e); - void open(QHelpIndexWidget *indexWidget, const QModelIndex &index); - - QLineEdit *m_searchLineEdit; - QHelpIndexWidget *m_indexWidget; -}; - -QT_END_NAMESPACE - -#endif // INDEXWINDOW_H diff --git a/src/assistant/tools/assistant/installdialog.cpp b/src/assistant/tools/assistant/installdialog.cpp deleted file mode 100644 index 82c0ccaa9..000000000 --- a/src/assistant/tools/assistant/installdialog.cpp +++ /dev/null @@ -1,355 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include "installdialog.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE -#ifndef QT_NO_HTTP - -#define QCH_FILENAME 92943 -#define QCH_NAMESPACE 92944 -#define QCH_CHECKSUM 92945 - -InstallDialog::InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent, - const QString &host, int port) - : QDialog(parent), m_helpEngine(helpEngine), m_host(host), m_port(port) -{ - TRACE_OBJ - m_ui.setupUi(this); - - m_ui.installButton->setEnabled(false); - m_ui.cancelButton->setEnabled(false); - m_ui.pathLineEdit->setText(QFileInfo(m_helpEngine->collectionFile()).absolutePath()); - m_ui.progressBar->hide(); - - m_windowTitle = tr("Install Documentation"); - - m_http = new QHttp(this); - connect(m_http, SIGNAL(requestFinished(int,bool)), - this, SLOT(httpRequestFinished(int,bool))); - connect(m_http, SIGNAL(dataReadProgress(int,int)), - this, SLOT(updateDataReadProgress(int,int))); - connect(m_http, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), - this, SLOT(readResponseHeader(QHttpResponseHeader))); - connect(m_ui.installButton, SIGNAL(clicked()), this, SLOT(install())); - connect(m_ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelDownload())); - connect(m_ui.browseButton, SIGNAL(clicked()), this, SLOT(browseDirectories())); - - connect(m_ui.listWidget, SIGNAL(itemChanged(QListWidgetItem*)), - this, SLOT(updateInstallButton())); - - QTimer::singleShot(0, this, SLOT(init())); -} - -InstallDialog::~InstallDialog() -{ - TRACE_OBJ -} - -QStringList InstallDialog::installedDocumentations() const -{ - TRACE_OBJ - return m_installedDocumentations; -} - -void InstallDialog::init() -{ - TRACE_OBJ - m_ui.statusLabel->setText(tr("Downloading documentation info...")); - m_ui.progressBar->show(); - - QUrl url(QLatin1String("http://qt.nokia.com/doc/assistantdocs/docs.txt")); - m_buffer = new QBuffer(); - m_buffer->open(QBuffer::ReadWrite); - - if (m_port > -1) - m_http->setProxy(m_host, m_port); - m_http->setHost(url.host()); - m_httpAborted = false; - m_docInfoId = m_http->get(url.path(), m_buffer); - - m_ui.cancelButton->setEnabled(true); - m_ui.closeButton->setEnabled(false); -} - -void InstallDialog::updateInstallButton() -{ - TRACE_OBJ - QListWidgetItem *item = 0; - for (int i=0; icount(); ++i) { - item = m_ui.listWidget->item(i); - if (item->checkState() == Qt::Checked - && item->flags() & Qt::ItemIsEnabled) { - m_ui.installButton->setEnabled(true); - return; - } - } - m_ui.installButton->setEnabled(false); -} - -void InstallDialog::updateDocItemList() -{ - TRACE_OBJ - QStringList registeredDocs = m_helpEngine->registeredDocumentations(); - QListWidgetItem *item = 0; - for (int i=0; icount(); ++i) { - item = m_ui.listWidget->item(i); - QString ns = item->data(QCH_NAMESPACE).toString(); - if (!ns.isEmpty() && registeredDocs.contains(ns)) { - item->setFlags(Qt::ItemIsUserCheckable); - item->setCheckState(Qt::Checked); - } - item->setCheckState(Qt::Unchecked); - } -} - -void InstallDialog::cancelDownload() -{ - TRACE_OBJ - m_ui.statusLabel->setText(tr("Download canceled.")); - m_httpAborted = true; - m_itemsToInstall.clear(); - m_http->abort(); - m_ui.cancelButton->setEnabled(false); - m_ui.closeButton->setEnabled(true); - updateInstallButton(); -} - -void InstallDialog::install() -{ - TRACE_OBJ - QListWidgetItem *item = 0; - for (int i=0; icount(); ++i) { - item = m_ui.listWidget->item(i); - if (item->checkState() == Qt::Checked) - m_itemsToInstall.append(item); - } - m_ui.installButton->setEnabled(false); - downloadNextFile(); -} - -void InstallDialog::downloadNextFile() -{ - TRACE_OBJ - if (!m_itemsToInstall.count()) { - m_ui.cancelButton->setEnabled(false); - m_ui.closeButton->setEnabled(true); - m_ui.statusLabel->setText(tr("Done.")); - m_ui.progressBar->hide(); - updateDocItemList(); - updateInstallButton(); - return; - } - - QListWidgetItem *item = m_itemsToInstall.dequeue(); - m_currentCheckSum = item->data(QCH_CHECKSUM).toString(); - QString fileName = item->data(QCH_FILENAME).toString(); - QString saveFileName = m_ui.pathLineEdit->text() + QDir::separator() - + fileName; - - if (QFile::exists(saveFileName) - && QMessageBox::information(this, m_windowTitle, - tr("The file %1 already exists. Do you want to overwrite it?") - .arg(saveFileName), QMessageBox::Yes | QMessageBox::No, - QMessageBox::Yes) == QMessageBox::No) { - installFile(saveFileName); - downloadNextFile(); - return; - } - - m_file = new QFile(saveFileName); - if (!m_file->open(QIODevice::WriteOnly|QIODevice::Truncate)) { - QMessageBox::information(this, m_windowTitle, - tr("Unable to save the file %1: %2.") - .arg(saveFileName).arg(m_file->errorString())); - delete m_file; - m_file = 0; - downloadNextFile(); - return; - } - - m_ui.statusLabel->setText(tr("Downloading %1...").arg(fileName)); - m_ui.progressBar->show(); - - QLatin1String urlStr("http://qt.nokia.com/doc/assistantdocs/%1"); - QUrl url(QString(urlStr).arg(fileName)); - - m_httpAborted = false; - m_docId = m_http->get(url.path(), m_file); - - m_ui.cancelButton->setEnabled(true); - m_ui.closeButton->setEnabled(false); -} - -void InstallDialog::httpRequestFinished(int requestId, bool error) -{ - TRACE_OBJ - if (requestId == m_docInfoId && m_buffer) { - m_ui.progressBar->hide(); - if (error) { - QMessageBox::information(this, m_windowTitle, - tr("Download failed: %1.") - .arg(m_http->errorString())); - } else if (!m_httpAborted) { - QStringList registeredDocs = m_helpEngine->registeredDocumentations(); - m_buffer->seek(0); - while (m_buffer->canReadLine()) { - QByteArray ba = m_buffer->readLine(); - QStringList lst = QString::fromAscii(ba.constData()).split(QLatin1Char('|')); - if (lst.count() != 4) { - QMessageBox::information(this, m_windowTitle, - tr("Documentation info file is corrupt!")); - } else { - QListWidgetItem *item = new QListWidgetItem(m_ui.listWidget); - item->setText(lst.at(2).trimmed()); - item->setData(QCH_FILENAME, lst.first()); - item->setData(QCH_NAMESPACE, lst.at(1)); - item->setData(QCH_CHECKSUM, lst.last().trimmed()); - } - } - updateDocItemList(); - } - if (m_buffer) - m_buffer->close(); - delete m_buffer; - m_buffer = 0; - m_ui.statusLabel->setText(tr("Done.")); - m_ui.cancelButton->setEnabled(false); - m_ui.closeButton->setEnabled(true); - updateInstallButton(); - } else if (requestId == m_docId) { - m_file->close(); - if (!m_httpAborted) { - QString checkSum; - if (m_file->open(QIODevice::ReadOnly)) { - QByteArray digest = QCryptographicHash::hash(m_file->readAll(), - QCryptographicHash::Md5); - m_file->close(); - checkSum = QString::fromLatin1(digest.toHex()); - } - if (error) { - m_file->remove(); - QMessageBox::warning(this, m_windowTitle, - tr("Download failed: %1.") - .arg(m_http->errorString())); - } else if (checkSum.isEmpty() || m_currentCheckSum != checkSum) { - m_file->remove(); - QMessageBox::warning(this, m_windowTitle, - tr("Download failed: Downloaded file is corrupted.")); - } else { - m_ui.statusLabel->setText(tr("Installing documentation %1...") - .arg(QFileInfo(m_file->fileName()).fileName())); - m_ui.progressBar->setMaximum(0); - m_ui.statusLabel->setText(tr("Done.")); - installFile(m_file->fileName()); - } - } else { - m_file->remove(); - } - delete m_file; - m_file = 0; - downloadNextFile(); - } -} - -void InstallDialog::installFile(const QString &fileName) -{ - TRACE_OBJ - if (m_helpEngine->registerDocumentation(fileName)) { - m_installedDocumentations - .append(QHelpEngineCore::namespaceName(fileName)); - } else { - QMessageBox::information(this, m_windowTitle, - tr("Error while installing documentation:\n%1") - .arg(m_helpEngine->error())); - } -} - -void InstallDialog::readResponseHeader(const QHttpResponseHeader &responseHeader) -{ - TRACE_OBJ - if (responseHeader.statusCode() != 200) { - QMessageBox::information(this, m_windowTitle, - tr("Download failed: %1.") - .arg(responseHeader.reasonPhrase())); - m_httpAborted = true; - m_ui.progressBar->hide(); - m_http->abort(); - return; - } -} - -void InstallDialog::updateDataReadProgress(int bytesRead, int totalBytes) -{ - TRACE_OBJ - if (m_httpAborted) - return; - - m_ui.progressBar->setMaximum(totalBytes); - m_ui.progressBar->setValue(bytesRead); -} - -void InstallDialog::browseDirectories() -{ - TRACE_OBJ - QString dir = QFileDialog::getExistingDirectory(this, m_windowTitle, - m_ui.pathLineEdit->text()); - if (!dir.isEmpty()) - m_ui.pathLineEdit->setText(dir); -} - -#endif -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/installdialog.h b/src/assistant/tools/assistant/installdialog.h deleted file mode 100644 index 0f57b9ef0..000000000 --- a/src/assistant/tools/assistant/installdialog.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef INSTALLDIALOG_H -#define INSTALLDIALOG_H - -#include -#include -#include -#include "ui_installdialog.h" - -#ifndef QT_NO_HTTP - -QT_BEGIN_NAMESPACE - -class QHttp; -class QBuffer; -class QFile; -class QHelpEngineCore; - -class InstallDialog : public QDialog -{ - Q_OBJECT - -public: - explicit InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent = 0, - const QString &host = QString(), int port = -1); - ~InstallDialog(); - - QStringList installedDocumentations() const; - -private slots: - void init(); - void cancelDownload(); - void install(); - void httpRequestFinished(int requestId, bool error); - void readResponseHeader(const QHttpResponseHeader &responseHeader); - void updateDataReadProgress(int bytesRead, int totalBytes); - void updateInstallButton(); - void browseDirectories(); - -private: - void downloadNextFile(); - void updateDocItemList(); - void installFile(const QString &fileName); - - Ui::InstallDialog m_ui; - QHelpEngineCore *m_helpEngine; - QHttp *m_http; - QBuffer *m_buffer; - QFile *m_file; - bool m_httpAborted; - int m_docInfoId; - int m_docId; - QQueue m_itemsToInstall; - QString m_currentCheckSum; - QString m_windowTitle; - QStringList m_installedDocumentations; - QString m_host; - int m_port; -}; - -QT_END_NAMESPACE - -#endif - -#endif // INSTALLDIALOG_H diff --git a/src/assistant/tools/assistant/installdialog.ui b/src/assistant/tools/assistant/installdialog.ui deleted file mode 100644 index 21a05da77..000000000 --- a/src/assistant/tools/assistant/installdialog.ui +++ /dev/null @@ -1,118 +0,0 @@ - - InstallDialog - - - - 0 - 0 - 436 - 245 - - - - Install Documentation - - - - - - Available Documentation: - - - - - - - - - - Install - - - - - - - Cancel - - - - - - - Close - - - - - - - Qt::Vertical - - - - 20 - 56 - - - - - - - - Installation Path: - - - - - - - - - - ... - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - - - Qt::Horizontal - - - - - - - - - closeButton - clicked() - InstallDialog - accept() - - - 330 - 107 - - - 332 - 158 - - - - - diff --git a/src/assistant/tools/assistant/main.cpp b/src/assistant/tools/assistant/main.cpp deleted file mode 100644 index d6e78d473..000000000 --- a/src/assistant/tools/assistant/main.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include - -#include - -#include "../shared/collectionconfiguration.h" -#include "helpenginewrapper.h" -#include "mainwindow.h" -#include "cmdlineparser.h" - -// #define TRACING_REQUESTED - -QT_USE_NAMESPACE - -#if defined(USE_STATIC_SQLITE_PLUGIN) - #include - Q_IMPORT_PLUGIN(qsqlite) -#endif - -namespace { - -void -updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) -{ - TRACE_OBJ - int lastPage = CollectionConfiguration::lastTabPage(helpEngine); - QStringList currentPages = CollectionConfiguration::lastShownPages(helpEngine); - if (!currentPages.isEmpty()) { - QStringList zoomList = CollectionConfiguration::lastZoomFactors(helpEngine); - while (zoomList.count() < currentPages.count()) - zoomList.append(CollectionConfiguration::DefaultZoomFactor); - - for (int i = currentPages.count(); --i >= 0;) { - if (QUrl(currentPages.at(i)).host() == nsName) { - zoomList.removeAt(i); - currentPages.removeAt(i); - lastPage = (lastPage == (i + 1)) ? 1 : lastPage; - } - } - - CollectionConfiguration::setLastShownPages(helpEngine, currentPages); - CollectionConfiguration::setLastTabPage(helpEngine, lastPage); - CollectionConfiguration::setLastZoomFactors(helpEngine, zoomList); - } -} - -bool -updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) -{ - TRACE_OBJ - if (!CollectionConfiguration::isNewer(caller, user)) - return false; - CollectionConfiguration::copyConfiguration(caller, user); - return true; -} - -void stripNonexistingDocs(QHelpEngineCore& collection) -{ - TRACE_OBJ - const QStringList &namespaces = collection.registeredDocumentations(); - foreach (const QString &ns, namespaces) { - QFileInfo fi(collection.documentationFileName(ns)); - if (!fi.exists() || !fi.isFile()) - collection.unregisterDocumentation(ns); - } -} - -QString indexFilesFolder(const QString &collectionFile) -{ - TRACE_OBJ - QString indexFilesFolder = QLatin1String(".fulltextsearch"); - if (!collectionFile.isEmpty()) { - QFileInfo fi(collectionFile); - indexFilesFolder = QLatin1Char('.') + - fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc"))); - } - return indexFilesFolder; -} - -/* - * Returns the expected absolute file path of the cached collection file - * correspondinging to the given collection's file. - * It may or may not exist yet. - */ -QString constructCachedCollectionFilePath(const QHelpEngineCore &collection) -{ - TRACE_OBJ - const QString &filePath = collection.collectionFile(); - const QString &fileName = QFileInfo(filePath).fileName(); - const QString &cacheDir = CollectionConfiguration::cacheDir(collection); - const QString &dir = !cacheDir.isEmpty() - && CollectionConfiguration::cacheDirIsRelativeToCollection(collection) - ? QFileInfo(filePath).dir().absolutePath() - + QDir::separator() + cacheDir - : MainWindow::collectionFileDirectory(false, cacheDir); - return dir + QDir::separator() + fileName; -} - -bool synchronizeDocs(QHelpEngineCore &collection, - QHelpEngineCore &cachedCollection, - CmdLineParser &cmd) -{ - TRACE_OBJ - const QDateTime &lastCollectionRegisterTime = - CollectionConfiguration::lastRegisterTime(collection); - if (!lastCollectionRegisterTime.isValid() || lastCollectionRegisterTime - < CollectionConfiguration::lastRegisterTime(cachedCollection)) - return true; - - const QStringList &docs = collection.registeredDocumentations(); - const QStringList &cachedDocs = cachedCollection.registeredDocumentations(); - - /* - * Ensure that the cached collection contains all docs that - * the collection contains. - */ - foreach (const QString &doc, docs) { - if (!cachedDocs.contains(doc)) { - const QString &docFile = collection.documentationFileName(doc); - if (!cachedCollection.registerDocumentation(docFile)) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Error registering documentation file '%1': %2"). - arg(docFile).arg(cachedCollection.error()), true); - return false; - } - } - } - - CollectionConfiguration::updateLastRegisterTime(cachedCollection); - - return true; -} - -bool removeSearchIndex(const QString &collectionFile) -{ - TRACE_OBJ - QString path = QFileInfo(collectionFile).path(); - path += QLatin1Char('/') + indexFilesFolder(collectionFile); - - QLocalSocket localSocket; - localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) - .arg(QLatin1String(QT_VERSION_STR))); - - QDir dir(path); // check if there is no other instance ruinning - if (!dir.exists() || localSocket.waitForConnected()) - return false; - - QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); - foreach (const QString &item, lst) - dir.remove(item); - return true; -} - -bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, - CmdLineParser &cmd) -{ - TRACE_OBJ - QHelpEngine engine(collectionFile); - if (!engine.setupData()) { - cmd.showMessage(QCoreApplication::translate("Assistant", "Error: %1") - .arg(engine.error()), true); - return false; - } - - QHelpSearchEngine * const searchEngine = engine.searchEngine(); - QObject::connect(searchEngine, SIGNAL(indexingFinished()), &app, - SLOT(quit())); - searchEngine->reindexDocumentation(); - return app.exec() == 0; -} - -bool useGui(int argc, char *argv[]) -{ - TRACE_OBJ - bool gui = true; -#ifndef Q_OS_WIN - // Look for arguments that imply command-line mode. - const char * cmdModeArgs[] = { - "-help", "-register", "-unregister", "-remove-search-index", - "-rebuild-search-index" - }; - for (int i = 1; i < argc; ++i) { - for (size_t j = 0; j < sizeof cmdModeArgs/sizeof *cmdModeArgs; ++j) { - if(strcmp(argv[i], cmdModeArgs[j]) == 0) { - gui = false; - break; - } - } - } -#else - Q_UNUSED(argc) - Q_UNUSED(argv) -#endif - return gui; -} - -bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, - bool printSuccess) -{ - TRACE_OBJ - if (!collection.registerDocumentation(cmd.helpFile())) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Could not register documentation file\n%1\n\nReason:\n%2") - .arg(cmd.helpFile()).arg(collection.error()), true); - return false; - } - if (printSuccess) - cmd.showMessage(QCoreApplication::translate("Assistant", - "Documentation successfully registered."), - false); - CollectionConfiguration::updateLastRegisterTime(collection); - return true; -} - -bool unregisterDocumentation(QHelpEngineCore &collection, - const QString &namespaceName, CmdLineParser &cmd, bool printSuccess) -{ - TRACE_OBJ - if (!collection.unregisterDocumentation(namespaceName)) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Could not unregister documentation" - " file\n%1\n\nReason:\n%2"). - arg(cmd.helpFile()).arg(collection.error()), true); - return false; - } - updateLastPagesOnUnregister(collection, namespaceName); - if (printSuccess) - cmd.showMessage(QCoreApplication::translate("Assistant", - "Documentation successfully unregistered."), - false); - return true; -} - -void setupTranslation(const QString &fileName, const QString &dir) -{ - QTranslator *translator = new QTranslator(QCoreApplication::instance()); - if (translator->load(fileName, dir)) { - QCoreApplication::installTranslator(translator); - } else if (!fileName.endsWith(QLatin1String("en_US")) - && !fileName.endsWith(QLatin1String("_C"))) { - qWarning("Could not load translation file %s in directory %s.", - qPrintable(fileName), qPrintable(dir)); - } -} - -void setupTranslations() -{ - TRACE_OBJ - const QString& locale = QLocale::system().name(); - const QString &resourceDir - = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - setupTranslation(QLatin1String("assistant_") + locale, resourceDir); - setupTranslation(QLatin1String("qt_") + locale, resourceDir); - setupTranslation(QLatin1String("qt_help_") + locale, resourceDir); -} - -} // Anonymous namespace. - -int main(int argc, char *argv[]) -{ - TRACE_OBJ - QApplication a(argc, argv, useGui(argc, argv)); - a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); - setupTranslations(); - - // Parse arguments. - CmdLineParser cmd(a.arguments()); - CmdLineParser::Result res = cmd.parse(); - if (res == CmdLineParser::Help) - return 0; - else if (res == CmdLineParser::Error) - return -1; - - /* - * Create the collection objects that we need. We always have the - * cached collection file. Depending on whether the user specified - * one, we also may have an input collection file. - */ - const QString collectionFile = cmd.collectionFile(); - const bool collectionFileGiven = !collectionFile.isEmpty(); - QScopedPointer collection; - if (collectionFileGiven) { - collection.reset(new QHelpEngineCore(collectionFile)); - if (!collection->setupData()) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Error reading collection file '%1': %2."). - arg(collectionFile).arg(collection->error()), true); - return EXIT_FAILURE; - } - } - const QString &cachedCollectionFile = collectionFileGiven - ? constructCachedCollectionFilePath(*collection) - : MainWindow::defaultHelpCollectionFileName(); - if (collectionFileGiven && !QFileInfo(cachedCollectionFile).exists() - && !collection->copyCollectionFile(cachedCollectionFile)) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Error creating collection file '%1': %2."). - arg(cachedCollectionFile).arg(collection->error()), true); - return EXIT_FAILURE; - } - QHelpEngineCore cachedCollection(cachedCollectionFile); - if (!cachedCollection.setupData()) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Error reading collection file '%1': %2."). - arg(cachedCollectionFile). - arg(cachedCollection.error()), true); - return EXIT_FAILURE; - } - - stripNonexistingDocs(cachedCollection); - if (collectionFileGiven) { - if (CollectionConfiguration::isNewer(*collection, cachedCollection)) - CollectionConfiguration::copyConfiguration(*collection, - cachedCollection); - if (!synchronizeDocs(*collection, cachedCollection, cmd)) - return EXIT_FAILURE; - } - - if (cmd.registerRequest() != CmdLineParser::None) { - const QStringList &cachedDocs = - cachedCollection.registeredDocumentations(); - const QString &namespaceName = - QHelpEngineCore::namespaceName(cmd.helpFile()); - if (cmd.registerRequest() == CmdLineParser::Register) { - if (collectionFileGiven - && !registerDocumentation(*collection, cmd, true)) - return EXIT_FAILURE; - if (!cachedDocs.contains(namespaceName) - && !registerDocumentation(cachedCollection, cmd, !collectionFileGiven)) - return EXIT_FAILURE; - return EXIT_SUCCESS; - } - if (cmd.registerRequest() == CmdLineParser::Unregister) { - if (collectionFileGiven - && !unregisterDocumentation(*collection, namespaceName, cmd, true)) - return EXIT_FAILURE; - if (cachedDocs.contains(namespaceName) - && !unregisterDocumentation(cachedCollection, namespaceName, - cmd, !collectionFileGiven)) - return EXIT_FAILURE; - return EXIT_SUCCESS; - } - } - - if (cmd.removeSearchIndex()) { - return removeSearchIndex(cachedCollectionFile) - ? EXIT_SUCCESS : EXIT_FAILURE; - } - - if (cmd.rebuildSearchIndex()) { - return rebuildSearchIndex(a, cachedCollectionFile, cmd) - ? EXIT_SUCCESS : EXIT_FAILURE; - } - - if (!QSqlDatabase::isDriverAvailable(QLatin1String("QSQLITE"))) { - cmd.showMessage(QCoreApplication::translate("Assistant", - "Cannot load sqlite database driver!"), - true); - return EXIT_FAILURE; - } - - if (!cmd.currentFilter().isEmpty()) { - if (collectionFileGiven) - collection->setCurrentFilter(cmd.currentFilter()); - cachedCollection.setCurrentFilter(cmd.currentFilter()); - } - - if (collectionFileGiven) - cmd.setCollectionFile(cachedCollectionFile); - - MainWindow *w = new MainWindow(&cmd); - w->show(); - a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); - - /* - * We need to be careful here: The main window has to be deleted before - * the help engine wrapper, which has to be deleted before the - * QApplication. - */ - const int retval = a.exec(); - delete w; - HelpEngineWrapper::removeInstance(); - return retval; -} diff --git a/src/assistant/tools/assistant/mainwindow.cpp b/src/assistant/tools/assistant/mainwindow.cpp deleted file mode 100644 index 18a215ecd..000000000 --- a/src/assistant/tools/assistant/mainwindow.cpp +++ /dev/null @@ -1,1099 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" - -#include "aboutdialog.h" -#include "bookmarkmanager.h" -#include "centralwidget.h" -#include "cmdlineparser.h" -#include "contentwindow.h" -#include "globalactions.h" -#include "helpenginewrapper.h" -#include "indexwindow.h" -#include "openpagesmanager.h" -#include "preferencesdialog.h" -#include "qtdocinstaller.h" -#include "remotecontrol.h" -#include "searchwidget.h" -#include "topicchooser.h" -#include "tracer.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) - : QMainWindow(parent) - , m_bookmarkWidget(0) - , m_filterCombo(0) - , m_toolBarMenu(0) - , m_cmdLine(cmdLine) - , m_progressWidget(0) - , m_qtDocInstaller(0) - , m_connectedInitSignals(false) -{ - TRACE_OBJ - - setToolButtonStyle(Qt::ToolButtonFollowStyle); - setDockOptions(dockOptions() | AllowNestedDocks); - - QString collectionFile; - if (usesDefaultCollection()) { - MainWindow::collectionFileDirectory(true); - collectionFile = MainWindow::defaultHelpCollectionFileName(); - } else { - collectionFile = cmdLine->collectionFile(); - } - HelpEngineWrapper &helpEngineWrapper = - HelpEngineWrapper::instance(collectionFile); - BookmarkManager *bookMarkManager = BookmarkManager::instance(); - - if (!initHelpDB(!cmdLine->collectionFileGiven())) { - qDebug("Fatal error: Help engine initialization failed. " - "Error message was: %s\nAssistant will now exit.", - qPrintable(HelpEngineWrapper::instance().error())); - std::exit(1); - } - - m_centralWidget = new CentralWidget(this); - setCentralWidget(m_centralWidget); - - m_indexWindow = new IndexWindow(this); - QDockWidget *indexDock = new QDockWidget(tr("Index"), this); - indexDock->setObjectName(QLatin1String("IndexWindow")); - indexDock->setWidget(m_indexWindow); - addDockWidget(Qt::LeftDockWidgetArea, indexDock); - - m_contentWindow = new ContentWindow; - QDockWidget *contentDock = new QDockWidget(tr("Contents"), this); - contentDock->setObjectName(QLatin1String("ContentWindow")); - contentDock->setWidget(m_contentWindow); - addDockWidget(Qt::LeftDockWidgetArea, contentDock); - - m_searchWindow = new SearchWidget(helpEngineWrapper.searchEngine()); - m_searchWindow->setFont(!helpEngineWrapper.usesBrowserFont() ? qApp->font() - : helpEngineWrapper.browserFont()); - QDockWidget *searchDock = new QDockWidget(tr("Search"), this); - searchDock->setObjectName(QLatin1String("SearchWindow")); - searchDock->setWidget(m_searchWindow); - addDockWidget(Qt::LeftDockWidgetArea, searchDock); - - QDockWidget *bookmarkDock = new QDockWidget(tr("Bookmarks"), this); - bookmarkDock->setObjectName(QLatin1String("BookmarkWindow")); - bookmarkDock->setWidget(m_bookmarkWidget - = bookMarkManager->bookmarkDockWidget()); - addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); - - QDockWidget *openPagesDock = new QDockWidget(tr("Open Pages"), this); - openPagesDock->setObjectName(QLatin1String("Open Pages")); - OpenPagesManager *openPagesManager - = OpenPagesManager::createInstance(this, usesDefaultCollection(), m_cmdLine->url()); - openPagesDock->setWidget(openPagesManager->openPagesWidget()); - addDockWidget(Qt::LeftDockWidgetArea, openPagesDock); - - connect(m_centralWidget, SIGNAL(addBookmark(QString, QString)), - bookMarkManager, SLOT(addBookmark(QString, QString))); - connect(bookMarkManager, SIGNAL(escapePressed()), this, - SLOT(activateCurrentCentralWidgetTab())); - connect(bookMarkManager, SIGNAL(setSource(QUrl)), m_centralWidget, - SLOT(setSource(QUrl))); - connect(bookMarkManager, SIGNAL(setSourceInNewTab(QUrl)), - openPagesManager, SLOT(createPage(QUrl))); - - QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine(); - connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted())); - connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); - - QString defWindowTitle = tr("Qt Assistant"); - setWindowTitle(defWindowTitle); - - setupActions(); - statusBar()->show(); - m_centralWidget->connectTabBar(); - - setupFilterToolbar(); - setupAddressToolbar(); - - const QString windowTitle = helpEngineWrapper.windowTitle(); - setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle); - QByteArray iconArray = helpEngineWrapper.applicationIcon(); - if (iconArray.size() > 0) { - QPixmap pix; - pix.loadFromData(iconArray); - QIcon appIcon(pix); - qApp->setWindowIcon(appIcon); - } else { - QIcon appIcon(QLatin1String(":/trolltech/assistant/images/assistant-128.png")); - qApp->setWindowIcon(appIcon); - } - - QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar")); - toolBar->setObjectName(QLatin1String("Bookmark Toolbar")); - bookMarkManager->setBookmarksToolbar(toolBar); - - // Show the widget here, otherwise the restore geometry and state won't work - // on x11. - show(); - - toolBar->hide(); - toolBarMenu()->addAction(toolBar->toggleViewAction()); - - QByteArray ba(helpEngineWrapper.mainWindow()); - if (!ba.isEmpty()) - restoreState(ba); - - ba = helpEngineWrapper.mainWindowGeometry(); - if (!ba.isEmpty()) { - restoreGeometry(ba); - } else { - tabifyDockWidget(contentDock, indexDock); - tabifyDockWidget(indexDock, bookmarkDock); - tabifyDockWidget(bookmarkDock, searchDock); - contentDock->raise(); - const QRect screen = QApplication::desktop()->screenGeometry(); - resize(4*screen.width()/5, 4*screen.height()/5); - } - - if (!helpEngineWrapper.hasFontSettings()) { - helpEngineWrapper.setUseAppFont(false); - helpEngineWrapper.setUseBrowserFont(false); - helpEngineWrapper.setAppFont(qApp->font()); - helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin); - helpEngineWrapper.setBrowserFont(qApp->font()); - helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin); - } else { - updateApplicationFont(); - } - - updateAboutMenuText(); - - QTimer::singleShot(0, this, SLOT(insertLastPages())); - if (m_cmdLine->enableRemoteControl()) - (void)new RemoteControl(this); - - if (m_cmdLine->contents() == CmdLineParser::Show) - showContents(); - else if (m_cmdLine->contents() == CmdLineParser::Hide) - hideContents(); - - if (m_cmdLine->index() == CmdLineParser::Show) - showIndex(); - else if (m_cmdLine->index() == CmdLineParser::Hide) - hideIndex(); - - if (m_cmdLine->bookmarks() == CmdLineParser::Show) - showBookmarksDockWidget(); - else if (m_cmdLine->bookmarks() == CmdLineParser::Hide) - hideBookmarksDockWidget(); - - if (m_cmdLine->search() == CmdLineParser::Show) - showSearch(); - else if (m_cmdLine->search() == CmdLineParser::Hide) - hideSearch(); - - if (m_cmdLine->contents() == CmdLineParser::Activate) - showContents(); - else if (m_cmdLine->index() == CmdLineParser::Activate) - showIndex(); - else if (m_cmdLine->bookmarks() == CmdLineParser::Activate) - showBookmarksDockWidget(); - - if (!m_cmdLine->currentFilter().isEmpty()) { - const QString &curFilter = m_cmdLine->currentFilter(); - if (helpEngineWrapper.customFilters().contains(curFilter)) - helpEngineWrapper.setCurrentFilter(curFilter); - } - - if (usesDefaultCollection()) - QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation())); - else - checkInitState(); - - connect(&helpEngineWrapper, SIGNAL(documentationRemoved(QString)), - this, SLOT(documentationRemoved(QString))); - connect(&helpEngineWrapper, SIGNAL(documentationUpdated(QString)), - this, SLOT(documentationUpdated(QString))); - - setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); - GlobalActions::instance()->updateActions(); - if (helpEngineWrapper.addressBarEnabled()) - showNewAddress(); -} - -MainWindow::~MainWindow() -{ - TRACE_OBJ - if (m_qtDocInstaller) - delete m_qtDocInstaller; -} - -bool MainWindow::usesDefaultCollection() const -{ - TRACE_OBJ - return m_cmdLine->collectionFile().isEmpty(); -} - -void MainWindow::closeEvent(QCloseEvent *e) -{ - TRACE_OBJ - BookmarkManager::destroy(); - HelpEngineWrapper::instance().setMainWindow(saveState()); - HelpEngineWrapper::instance().setMainWindowGeometry(saveGeometry()); - QMainWindow::closeEvent(e); -} - -bool MainWindow::initHelpDB(bool registerInternalDoc) -{ - TRACE_OBJ - HelpEngineWrapper &helpEngineWrapper = HelpEngineWrapper::instance(); - if (!helpEngineWrapper.setupData()) - return false; - - if (!registerInternalDoc) { - if (helpEngineWrapper.defaultHomePage() == QLatin1String("help")) - helpEngineWrapper.setDefaultHomePage(QLatin1String("about:blank")); - return true; - } - bool assistantInternalDocRegistered = false; - QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); - foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { - if (ns.startsWith(intern)) { - intern = ns; - assistantInternalDocRegistered = true; - break; - } - } - - const QString &collectionFile = helpEngineWrapper.collectionFile(); - QFileInfo fi(collectionFile); - QString helpFile; - QTextStream(&helpFile) << fi.absolutePath() << QDir::separator() - << QLatin1String("assistant.qch.") << (QT_VERSION >> 16) - << QLatin1Char('.') << ((QT_VERSION >> 8) & 0xFF); - - bool needsSetup = false; - if (!assistantInternalDocRegistered || !QFile::exists(helpFile)) { - QFile file(helpFile); - if (file.open(QIODevice::WriteOnly)) { - QResource res(QLatin1String(":/trolltech/assistant/assistant.qch")); - if (file.write((const char*)res.data(), res.size()) != res.size()) - qDebug() << QLatin1String("could not write assistant.qch..."); - - file.close(); - } - helpEngineWrapper.unregisterDocumentation(intern); - helpEngineWrapper.registerDocumentation(helpFile); - needsSetup = true; - } - - if (needsSetup) - helpEngineWrapper.setupData(); - return true; -} - -void MainWindow::lookForNewQtDocumentation() -{ - TRACE_OBJ - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - QStringList docs; - docs << QLatin1String("assistant") - << QLatin1String("designer") - << QLatin1String("linguist") - << QLatin1String("qmake") - << QLatin1String("qt"); - QList qtDocInfos; - foreach (const QString &doc, docs) - qtDocInfos.append(QtDocInstaller::DocInfo(doc, helpEngine.qtDocInfo(doc))); - - m_qtDocInstaller = new QtDocInstaller(qtDocInfos); - connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, - SLOT(qtDocumentationInstalled())); - connect(m_qtDocInstaller, SIGNAL(qchFileNotFound(QString)), this, - SLOT(resetQtDocInfo(QString))); - connect(m_qtDocInstaller, SIGNAL(registerDocumentation(QString, QString)), - this, SLOT(registerDocumentation(QString, QString))); - if (helpEngine.qtDocInfo(QLatin1String("qt")).count() != 2) - statusBar()->showMessage(tr("Looking for Qt Documentation...")); - m_qtDocInstaller->installDocs(); -} - -void MainWindow::qtDocumentationInstalled() -{ - TRACE_OBJ - statusBar()->clearMessage(); - checkInitState(); -} - -void MainWindow::checkInitState() -{ - TRACE_OBJ - HelpEngineWrapper::instance().initialDocSetupDone(); - if (!m_cmdLine->enableRemoteControl()) - return; - - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - if (helpEngine.contentModel()->isCreatingContents() - || helpEngine.indexModel()->isCreatingIndex()) { - if (!m_connectedInitSignals) { - connect(helpEngine.contentModel(), SIGNAL(contentsCreated()), - this, SLOT(checkInitState())); - connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, - SLOT(checkInitState())); - m_connectedInitSignals = true; - } - } else { - if (m_connectedInitSignals) { - disconnect(helpEngine.contentModel(), 0, this, 0); - disconnect(helpEngine.indexModel(), 0, this, 0); - } - emit initDone(); - } -} - -void MainWindow::insertLastPages() -{ - TRACE_OBJ - if (m_cmdLine->search() == CmdLineParser::Activate) - showSearch(); -} - -void MainWindow::setupActions() -{ - TRACE_OBJ - QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); -#ifdef Q_OS_MAC - setUnifiedTitleAndToolBarOnMac(true); - resourcePath.append(QLatin1String("mac")); -#else - resourcePath.append(QLatin1String("win")); -#endif - - QMenu *menu = menuBar()->addMenu(tr("&File")); - - OpenPagesManager * const openPages = OpenPagesManager::instance(); - m_newTabAction - = menu->addAction(tr("New &Tab"), openPages, SLOT(createPage())); - m_newTabAction->setShortcut(QKeySequence::AddTab); - m_closeTabAction = menu->addAction(tr("&Close Tab"), - openPages, SLOT(closeCurrentPage())); - m_closeTabAction->setShortcuts(QKeySequence::Close); - - menu->addSeparator(); - - m_pageSetupAction = menu->addAction(tr("Page Set&up..."), m_centralWidget, - SLOT(pageSetup())); - m_printPreviewAction = menu->addAction(tr("Print Preview..."), m_centralWidget, - SLOT(printPreview())); - - GlobalActions *globalActions = GlobalActions::instance(this); - menu->addAction(globalActions->printAction()); - menu->addSeparator(); - - QIcon appExitIcon = QIcon::fromTheme("application-exit"); - QAction *tmp; -#ifdef Q_OS_WIN - tmp = menu->addAction(appExitIcon, tr("E&xit"), this, SLOT(close())); - tmp->setShortcut(QKeySequence(tr("CTRL+Q"))); -#else - tmp = menu->addAction(appExitIcon, tr("&Quit"), this, SLOT(close())); - tmp->setShortcut(QKeySequence::Quit); -#endif - tmp->setMenuRole(QAction::QuitRole); - - menu = menuBar()->addMenu(tr("&Edit")); - menu->addAction(globalActions->copyAction()); - menu->addAction(globalActions->findAction()); - - QAction *findNextAction = menu->addAction(tr("Find &Next"), m_centralWidget, - SLOT(findNext())); - findNextAction->setShortcuts(QKeySequence::FindNext); - - QAction *findPreviousAction = menu->addAction(tr("Find &Previous"), - m_centralWidget, SLOT(findPrevious())); - findPreviousAction->setShortcuts(QKeySequence::FindPrevious); - - menu->addSeparator(); - tmp = menu->addAction(tr("Preferences..."), this, SLOT(showPreferences())); - tmp->setMenuRole(QAction::PreferencesRole); - - m_viewMenu = menuBar()->addMenu(tr("&View")); - m_viewMenu->addAction(globalActions->zoomInAction()); - m_viewMenu->addAction(globalActions->zoomOutAction()); - - m_resetZoomAction = m_viewMenu->addAction(tr("Normal &Size"), m_centralWidget, - SLOT(resetZoom())); - m_resetZoomAction->setPriority(QAction::LowPriority); - m_resetZoomAction->setIcon(QIcon(resourcePath + QLatin1String("/resetzoom.png"))); - m_resetZoomAction->setShortcut(tr("Ctrl+0")); - - m_viewMenu->addSeparator(); - - m_viewMenu->addAction(tr("Contents"), this, SLOT(showContents()), - QKeySequence(tr("ALT+C"))); - m_viewMenu->addAction(tr("Index"), this, SLOT(showIndex()), - QKeySequence(tr("ALT+I"))); - m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarksDockWidget()), - QKeySequence(tr("ALT+O"))); - m_viewMenu->addAction(tr("Search"), this, SLOT(showSearch()), - QKeySequence(tr("ALT+S"))); - m_viewMenu->addAction(tr("Open Pages"), this, SLOT(showOpenPages()), - QKeySequence(tr("ALT+P"))); - - menu = menuBar()->addMenu(tr("&Go")); - menu->addAction(globalActions->homeAction()); - menu->addAction(globalActions->backAction()); - menu->addAction(globalActions->nextAction()); - - m_syncAction = menu->addAction(tr("Sync with Table of Contents"), this, - SLOT(syncContents())); - m_syncAction->setIconText(tr("Sync")); - m_syncAction->setIcon(QIcon(resourcePath + QLatin1String("/synctoc.png"))); - - menu->addSeparator(); - - tmp = menu->addAction(tr("Next Page"), openPages, SLOT(nextPage())); - tmp->setShortcuts(QList() << QKeySequence(tr("Ctrl+Alt+Right")) - << QKeySequence(Qt::CTRL + Qt::Key_PageDown)); - - tmp = menu->addAction(tr("Previous Page"), openPages, SLOT(previousPage())); - tmp->setShortcuts(QList() << QKeySequence(tr("Ctrl+Alt+Left")) - << QKeySequence(Qt::CTRL + Qt::Key_PageUp)); - -#ifdef Q_WS_MAC - QShortcut *sct = new QShortcut(QKeySequence(Qt::ALT + Qt::Key_Tab), this); - connect(sct, SIGNAL(activated()), openPages, SLOT(nextPageWithSwitcher())); - sct = new QShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + Qt::Key_Tab), this); - connect(sct, SIGNAL(activated()), openPages, SLOT(previousPageWithSwitcher())); -#else - QShortcut *sct = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Tab), this); - connect(sct, SIGNAL(activated()), openPages, SLOT(nextPageWithSwitcher())); - sct = new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab), this); - connect(sct, SIGNAL(activated()), openPages, SLOT(previousPageWithSwitcher())); -#endif - - BookmarkManager::instance()->setBookmarksMenu(menuBar()->addMenu(tr("&Bookmarks"))); - - menu = menuBar()->addMenu(tr("&Help")); - m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog())); - m_aboutAction->setMenuRole(QAction::AboutRole); - -#ifdef Q_WS_X11 - m_resetZoomAction->setIcon(QIcon::fromTheme("zoom-original" , m_resetZoomAction->icon())); - m_syncAction->setIcon(QIcon::fromTheme("view-refresh" , m_syncAction->icon())); -#endif - - QToolBar *navigationBar = addToolBar(tr("Navigation Toolbar")); - navigationBar->setObjectName(QLatin1String("NavigationToolBar")); - navigationBar->addAction(globalActions->backAction()); - navigationBar->addAction(globalActions->nextAction()); - navigationBar->addAction(globalActions->homeAction()); - navigationBar->addAction(m_syncAction); - navigationBar->addSeparator(); - navigationBar->addAction(globalActions->copyAction()); - navigationBar->addAction(globalActions->printAction()); - navigationBar->addAction(globalActions->findAction()); - navigationBar->addSeparator(); - navigationBar->addAction(globalActions->zoomInAction()); - navigationBar->addAction(globalActions->zoomOutAction()); - navigationBar->addAction(m_resetZoomAction); - -#if defined(Q_WS_MAC) - QMenu *windowMenu = new QMenu(tr("&Window"), this); - menuBar()->insertMenu(menu->menuAction(), windowMenu); - windowMenu->addAction(tr("Zoom"), this, SLOT(showMaximized())); - windowMenu->addAction(tr("Minimize"), this, SLOT(showMinimized()), - QKeySequence(tr("Ctrl+M"))); -#endif - - // content viewer connections - connect(m_centralWidget, SIGNAL(copyAvailable(bool)), globalActions, - SLOT(setCopyAvailable(bool))); - connect(m_centralWidget, SIGNAL(currentViewerChanged()), globalActions, - SLOT(updateActions())); - connect(m_centralWidget, SIGNAL(forwardAvailable(bool)), globalActions, - SLOT(updateActions())); - connect(m_centralWidget, SIGNAL(backwardAvailable(bool)), globalActions, - SLOT(updateActions())); - connect(m_centralWidget, SIGNAL(highlighted(QString)), statusBar(), - SLOT(showMessage(QString))); - - // index window - connect(m_indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, - SLOT(setSource(QUrl))); - connect(m_indexWindow, SIGNAL(linksActivated(QMap,QString)), - this, SLOT(showTopicChooser(QMap,QString))); - connect(m_indexWindow, SIGNAL(escapePressed()), this, - SLOT(activateCurrentCentralWidgetTab())); - - // content window - connect(m_contentWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, - SLOT(setSource(QUrl))); - connect(m_contentWindow, SIGNAL(escapePressed()), this, - SLOT(activateCurrentCentralWidgetTab())); - - // search window - connect(m_searchWindow, SIGNAL(requestShowLink(QUrl)), - CentralWidget::instance(), SLOT(setSourceFromSearch(QUrl))); - connect(m_searchWindow, SIGNAL(requestShowLinkInNewTab(QUrl)), - OpenPagesManager::instance(), SLOT(createNewPageFromSearch(QUrl))); - -#if defined(QT_NO_PRINTER) - m_pageSetupAction->setVisible(false); - m_printPreviewAction->setVisible(false); - m_printAction->setVisible(false); -#endif -} - -QMenu *MainWindow::toolBarMenu() -{ - TRACE_OBJ - if (!m_toolBarMenu) { - m_viewMenu->addSeparator(); - m_toolBarMenu = m_viewMenu->addMenu(tr("Toolbars")); - } - return m_toolBarMenu; -} - -void MainWindow::setupFilterToolbar() -{ - TRACE_OBJ - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - if (!helpEngine.filterFunctionalityEnabled()) - return; - - m_filterCombo = new QComboBox(this); - m_filterCombo->setMinimumWidth(QFontMetrics(QFont()). - width(QLatin1String("MakeTheComboBoxWidthEnough"))); - - QToolBar *filterToolBar = addToolBar(tr("Filter Toolbar")); - filterToolBar->setObjectName(QLatin1String("FilterToolBar")); - filterToolBar->addWidget(new QLabel(tr("Filtered by:").append(QLatin1Char(' ')), - this)); - filterToolBar->addWidget(m_filterCombo); - - if (!helpEngine.filterToolbarVisible()) - filterToolBar->hide(); - toolBarMenu()->addAction(filterToolBar->toggleViewAction()); - - connect(&helpEngine, SIGNAL(setupFinished()), this, - SLOT(setupFilterCombo()), Qt::QueuedConnection); - connect(m_filterCombo, SIGNAL(activated(QString)), this, - SLOT(filterDocumentation(QString))); - connect(&helpEngine, SIGNAL(currentFilterChanged(QString)), this, - SLOT(currentFilterChanged(QString))); - - setupFilterCombo(); -} - -void MainWindow::setupAddressToolbar() -{ - TRACE_OBJ - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - if (!helpEngine.addressBarEnabled()) - return; - - m_addressLineEdit = new QLineEdit(this); - QToolBar *addressToolBar = addToolBar(tr("Address Toolbar")); - addressToolBar->setObjectName(QLatin1String("AddressToolBar")); - insertToolBarBreak(addressToolBar); - - addressToolBar->addWidget(new QLabel(tr("Address:").append(QLatin1String(" ")), - this)); - addressToolBar->addWidget(m_addressLineEdit); - - if (!helpEngine.addressBarVisible()) - addressToolBar->hide(); - toolBarMenu()->addAction(addressToolBar->toggleViewAction()); - - // address lineedit - connect(m_addressLineEdit, SIGNAL(returnPressed()), this, - SLOT(gotoAddress())); - connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, - SLOT(showNewAddress())); - connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this, - SLOT(showNewAddress(QUrl))); -} - -void MainWindow::updateAboutMenuText() -{ - TRACE_OBJ - QByteArray ba = HelpEngineWrapper::instance().aboutMenuTexts(); - if (ba.size() > 0) { - QString lang; - QString str; - QString trStr; - QString currentLang = QLocale::system().name(); - int i = currentLang.indexOf(QLatin1Char('_')); - if (i > -1) - currentLang = currentLang.left(i); - QDataStream s(&ba, QIODevice::ReadOnly); - while (!s.atEnd()) { - s >> lang; - s >> str; - if (lang == QLatin1String("default") && trStr.isEmpty()) { - trStr = str; - } else if (lang == currentLang) { - trStr = str; - break; - } - } - if (!trStr.isEmpty()) - m_aboutAction->setText(trStr); - } -} - -void MainWindow::showNewAddress() -{ - TRACE_OBJ - showNewAddress(m_centralWidget->currentSource()); -} - -void MainWindow::showNewAddress(const QUrl &url) -{ - TRACE_OBJ - m_addressLineEdit->setText(url.toString()); -} - -void MainWindow::gotoAddress() -{ - TRACE_OBJ - m_centralWidget->setSource(m_addressLineEdit->text()); -} - -void MainWindow::showTopicChooser(const QMap &links, - const QString &keyword) -{ - TRACE_OBJ - TopicChooser tc(this, keyword, links); - if (tc.exec() == QDialog::Accepted) { - m_centralWidget->setSource(tc.link()); - } -} - -void MainWindow::showPreferences() -{ - TRACE_OBJ - PreferencesDialog dia(this); - connect(&dia, SIGNAL(updateApplicationFont()), this, - SLOT(updateApplicationFont())); - connect(&dia, SIGNAL(updateBrowserFont()), m_centralWidget, - SLOT(updateBrowserFont())); - connect(&dia, SIGNAL(updateUserInterface()), m_centralWidget, - SLOT(updateUserInterface())); - dia.showDialog(); -} - -void MainWindow::syncContents() -{ - TRACE_OBJ - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - const QUrl url = m_centralWidget->currentSource(); - showContents(); - if (!m_contentWindow->syncToContent(url)) - statusBar()->showMessage( - tr("Could not find the associated content item."), 3000); - qApp->restoreOverrideCursor(); -} - -void MainWindow::showAboutDialog() -{ - TRACE_OBJ - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - QByteArray contents; - QByteArray ba = helpEngine.aboutTexts(); - if (!ba.isEmpty()) { - QString lang; - QByteArray cba; - QString currentLang = QLocale::system().name(); - int i = currentLang.indexOf(QLatin1Char('_')); - if (i > -1) - currentLang = currentLang.left(i); - QDataStream s(&ba, QIODevice::ReadOnly); - while (!s.atEnd()) { - s >> lang; - s >> cba; - if (lang == QLatin1String("default") && contents.isEmpty()) { - contents = cba; - } else if (lang == currentLang) { - contents = cba; - break; - } - } - } - - AboutDialog aboutDia(this); - - QByteArray iconArray; - if (!contents.isEmpty()) { - iconArray = helpEngine.aboutIcon(); - QByteArray resources = helpEngine.aboutImages(); - QPixmap pix; - pix.loadFromData(iconArray); - aboutDia.setText(QString::fromUtf8(contents), resources); - if (!pix.isNull()) - aboutDia.setPixmap(pix); - aboutDia.setWindowTitle(aboutDia.documentTitle()); - } else { - QByteArray resources; - aboutDia.setText(tr("
" - "

%1

" - "

Version %2

" - "

Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).

") - .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)), - resources); - QLatin1String path(":/trolltech/assistant/images/assistant-128.png"); - aboutDia.setPixmap(QString(path)); - } - if (aboutDia.windowTitle().isEmpty()) - aboutDia.setWindowTitle(tr("About %1").arg(windowTitle())); - aboutDia.exec(); -} - -void MainWindow::setContentsVisible(bool visible) -{ - TRACE_OBJ - if (visible) - showContents(); - else - hideContents(); -} - -void MainWindow::showContents() -{ - TRACE_OBJ - activateDockWidget(m_contentWindow); -} - -void MainWindow::hideContents() -{ - TRACE_OBJ - m_contentWindow->parentWidget()->hide(); -} - -void MainWindow::setIndexVisible(bool visible) -{ - TRACE_OBJ - if (visible) - showIndex(); - else - hideIndex(); -} - -void MainWindow::showIndex() -{ - TRACE_OBJ - activateDockWidget(m_indexWindow); -} - -void MainWindow::hideIndex() -{ - TRACE_OBJ - m_indexWindow->parentWidget()->hide(); -} - -void MainWindow::setBookmarksVisible(bool visible) -{ - TRACE_OBJ - if (visible) - showBookmarksDockWidget(); - else - hideBookmarksDockWidget(); -} - -void MainWindow::showBookmarksDockWidget() -{ - TRACE_OBJ - activateDockWidget(m_bookmarkWidget); -} - -void MainWindow::hideBookmarksDockWidget() -{ - TRACE_OBJ - m_bookmarkWidget->parentWidget()->hide(); -} - -void MainWindow::setSearchVisible(bool visible) -{ - TRACE_OBJ - if (visible) - showSearch(); - else - hideSearch(); -} - -void MainWindow::showSearch() -{ - TRACE_OBJ - activateDockWidget(m_searchWindow); -} - -void MainWindow::showOpenPages() -{ - TRACE_OBJ - activateDockWidget(OpenPagesManager::instance()->openPagesWidget()); -} - -void MainWindow::hideSearch() -{ - TRACE_OBJ - m_searchWindow->parentWidget()->hide(); -} - -void MainWindow::activateDockWidget(QWidget *w) -{ - TRACE_OBJ - w->parentWidget()->show(); - w->parentWidget()->raise(); - w->setFocus(); -} - -void MainWindow::setIndexString(const QString &str) -{ - TRACE_OBJ - m_indexWindow->setSearchLineEditText(str); -} - -void MainWindow::activateCurrentBrowser() -{ - TRACE_OBJ - CentralWidget::instance()->activateTab(); -} - -void MainWindow::activateCurrentCentralWidgetTab() -{ - TRACE_OBJ - m_centralWidget->activateTab(); -} - -void MainWindow::updateApplicationFont() -{ - TRACE_OBJ - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - QFont font = qApp->font(); - if (helpEngine.usesAppFont()) - font = helpEngine.appFont(); - - const QWidgetList &widgets = qApp->allWidgets(); - foreach (QWidget* widget, widgets) - widget->setFont(font); -} - -void MainWindow::setupFilterCombo() -{ - TRACE_OBJ - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - QString curFilter = m_filterCombo->currentText(); - if (curFilter.isEmpty()) - curFilter = helpEngine.currentFilter(); - m_filterCombo->clear(); - m_filterCombo->addItems(helpEngine.customFilters()); - int idx = m_filterCombo->findText(curFilter); - if (idx < 0) - idx = 0; - m_filterCombo->setCurrentIndex(idx); -} - -void MainWindow::filterDocumentation(const QString &customFilter) -{ - TRACE_OBJ - HelpEngineWrapper::instance().setCurrentFilter(customFilter); -} - -void MainWindow::expandTOC(int depth) -{ - TRACE_OBJ - Q_ASSERT(depth >= -1); - m_contentWindow->expandToDepth(depth); -} - -void MainWindow::indexingStarted() -{ - TRACE_OBJ - if (!m_progressWidget) { - m_progressWidget = new QWidget(); - QLayout* hlayout = new QHBoxLayout(m_progressWidget); - - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); - - QLabel *label = new QLabel(tr("Updating search index")); - label->setSizePolicy(sizePolicy); - hlayout->addWidget(label); - - QProgressBar *progressBar = new QProgressBar(); - progressBar->setRange(0, 0); - progressBar->setTextVisible(false); - progressBar->setSizePolicy(sizePolicy); - - hlayout->setSpacing(6); - hlayout->setMargin(0); - hlayout->addWidget(progressBar); - - statusBar()->addPermanentWidget(m_progressWidget); - } -} - -void MainWindow::indexingFinished() -{ - TRACE_OBJ - statusBar()->removeWidget(m_progressWidget); - delete m_progressWidget; - m_progressWidget = 0; -} - -QString MainWindow::collectionFileDirectory(bool createDir, const QString &cacheDir) -{ - TRACE_OBJ - QString collectionPath = - QDesktopServices::storageLocation(QDesktopServices::DataLocation); - if (collectionPath.isEmpty()) { - if (cacheDir.isEmpty()) - collectionPath = QDir::homePath() + QDir::separator() - + QLatin1String(".assistant"); - else - collectionPath = QDir::homePath() + QLatin1String("/.") + cacheDir; - } else { - if (cacheDir.isEmpty()) - collectionPath = collectionPath + QLatin1String("/Trolltech/Assistant"); - else - collectionPath = collectionPath + QDir::separator() + cacheDir; - } - collectionPath = QDir::cleanPath(collectionPath); - if (createDir) { - QDir dir; - if (!dir.exists(collectionPath)) - dir.mkpath(collectionPath); - } - return collectionPath; -} - -QString MainWindow::defaultHelpCollectionFileName() -{ - TRACE_OBJ - // forces creation of the default collection file path - return collectionFileDirectory(true) + QDir::separator() + - QString(QLatin1String("qthelpcollection_%1.qhc")). - arg(QLatin1String(QT_VERSION_STR)); -} - -void MainWindow::currentFilterChanged(const QString &filter) -{ - TRACE_OBJ - const int index = m_filterCombo->findText(filter); - Q_ASSERT(index != -1); - m_filterCombo->setCurrentIndex(index); -} - -void MainWindow::documentationRemoved(const QString &namespaceName) -{ - TRACE_OBJ - OpenPagesManager::instance()->closePages(namespaceName); -} - -void MainWindow::documentationUpdated(const QString &namespaceName) -{ - TRACE_OBJ - OpenPagesManager::instance()->reloadPages(namespaceName); -} - -void MainWindow::resetQtDocInfo(const QString &component) -{ - TRACE_OBJ - HelpEngineWrapper::instance().setQtDocInfo(component, - QStringList(QDateTime().toString(Qt::ISODate))); -} - -void MainWindow::registerDocumentation(const QString &component, - const QString &absFileName) -{ - TRACE_OBJ - QString ns = QHelpEngineCore::namespaceName(absFileName); - if (ns.isEmpty()) - return; - - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - if (helpEngine.registeredDocumentations().contains(ns)) - helpEngine.unregisterDocumentation(ns); - if (!helpEngine.registerDocumentation(absFileName)) { - QMessageBox::warning(this, tr("Qt Assistant"), - tr("Could not register file '%1': %2"). - arg(absFileName).arg(helpEngine.error())); - } else { - QStringList docInfo; - docInfo << QFileInfo(absFileName).lastModified().toString(Qt::ISODate) - << absFileName; - helpEngine.setQtDocInfo(component, docInfo); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/mainwindow.h b/src/assistant/tools/assistant/mainwindow.h deleted file mode 100644 index 1ea0bbaf2..000000000 --- a/src/assistant/tools/assistant/mainwindow.h +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QAction; -class QComboBox; -class QFileSystemWatcher; -class QLineEdit; -class QMenu; - -class CentralWidget; -class CmdLineParser; -class ContentWindow; -class IndexWindow; -class OpenPagesWindow; -class QtDocInstaller; -class QHelpEngineCore; -class QHelpEngine; -class SearchWidget; - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindow(CmdLineParser *cmdLine, QWidget *parent = 0); - ~MainWindow(); - - static void activateCurrentBrowser(); - static QString collectionFileDirectory(bool createDir = false, - const QString &cacheDir = QString()); - static QString defaultHelpCollectionFileName(); - -public: - void setIndexString(const QString &str); - void expandTOC(int depth); - bool usesDefaultCollection() const; - -signals: - void initDone(); - -public slots: - void setContentsVisible(bool visible); - void setIndexVisible(bool visible); - void setBookmarksVisible(bool visible); - void setSearchVisible(bool visible); - void syncContents(); - void activateCurrentCentralWidgetTab(); - void currentFilterChanged(const QString &filter); - -private slots: - void showContents(); - void showIndex(); - void showSearch(); - void showOpenPages(); - void insertLastPages(); - void gotoAddress(); - void showPreferences(); - void showNewAddress(); - void showAboutDialog(); - void showNewAddress(const QUrl &url); - void showTopicChooser(const QMap &links, const QString &keyword); - void updateApplicationFont(); - void filterDocumentation(const QString &customFilter); - void setupFilterCombo(); - void lookForNewQtDocumentation(); - void indexingStarted(); - void indexingFinished(); - void qtDocumentationInstalled(); - void registerDocumentation(const QString &component, - const QString &absFileName); - void resetQtDocInfo(const QString &component); - void checkInitState(); - void documentationRemoved(const QString &namespaceName); - void documentationUpdated(const QString &namespaceName); - -private: - bool initHelpDB(bool registerInternalDoc); - void setupActions(); - void closeEvent(QCloseEvent *e); - void activateDockWidget(QWidget *w); - void updateAboutMenuText(); - void setupFilterToolbar(); - void setupAddressToolbar(); - QMenu *toolBarMenu(); - void hideContents(); - void hideIndex(); - void hideSearch(); - -private slots: - void showBookmarksDockWidget(); - void hideBookmarksDockWidget(); - -private: - QWidget *m_bookmarkWidget; - -private: - CentralWidget *m_centralWidget; - IndexWindow *m_indexWindow; - ContentWindow *m_contentWindow; - SearchWidget *m_searchWindow; - QLineEdit *m_addressLineEdit; - QComboBox *m_filterCombo; - - QAction *m_syncAction; - QAction *m_printPreviewAction; - QAction *m_pageSetupAction; - QAction *m_resetZoomAction; - QAction *m_aboutAction; - QAction *m_closeTabAction; - QAction *m_newTabAction; - - QMenu *m_viewMenu; - QMenu *m_toolBarMenu; - - CmdLineParser *m_cmdLine; - - QWidget *m_progressWidget; - QtDocInstaller *m_qtDocInstaller; - - bool m_connectedInitSignals; -}; - -QT_END_NAMESPACE - -#endif // MAINWINDOW_H diff --git a/src/assistant/tools/assistant/openpagesmanager.cpp b/src/assistant/tools/assistant/openpagesmanager.cpp deleted file mode 100644 index 7bafeeafc..000000000 --- a/src/assistant/tools/assistant/openpagesmanager.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "openpagesmanager.h" - -#include "centralwidget.h" -#include "helpenginewrapper.h" -#include "helpviewer.h" -#include "openpagesmodel.h" -#include "openpagesswitcher.h" -#include "openpageswidget.h" -#include "tracer.h" -#include "../shared/collectionconfiguration.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -OpenPagesManager *OpenPagesManager::m_instance = 0; - -OpenPagesManager *OpenPagesManager::createInstance(QObject *parent, - bool defaultCollection, const QUrl &cmdLineUrl) -{ - TRACE_OBJ - Q_ASSERT(!m_instance); - m_instance = new OpenPagesManager(parent, defaultCollection, cmdLineUrl); - return m_instance; -} - -OpenPagesManager *OpenPagesManager::instance() -{ - TRACE_OBJ - Q_ASSERT(m_instance); - return m_instance; -} - -OpenPagesManager::OpenPagesManager(QObject *parent, bool defaultCollection, - const QUrl &cmdLineUrl) - : QObject(parent) - , m_model(new OpenPagesModel(this)) - , m_openPagesWidget(0) - , m_openPagesSwitcher(0) -{ - TRACE_OBJ - m_openPagesWidget = new OpenPagesWidget(m_model); - m_openPagesWidget->setFrameStyle(QFrame::NoFrame); - connect(m_openPagesWidget, SIGNAL(setCurrentPage(QModelIndex)), this, - SLOT(setCurrentPage(QModelIndex))); - connect(m_openPagesWidget, SIGNAL(closePage(QModelIndex)), this, - SLOT(closePage(QModelIndex))); - connect(m_openPagesWidget, SIGNAL(closePagesExcept(QModelIndex)), this, - SLOT(closePagesExcept(QModelIndex))); - - m_openPagesSwitcher = new OpenPagesSwitcher(m_model); - connect(m_openPagesSwitcher, SIGNAL(closePage(QModelIndex)), this, - SLOT(closePage(QModelIndex))); - connect(m_openPagesSwitcher, SIGNAL(setCurrentPage(QModelIndex)), this, - SLOT(setCurrentPage(QModelIndex))); - - setupInitialPages(defaultCollection, cmdLineUrl); -} - -OpenPagesManager ::~OpenPagesManager() -{ - TRACE_OBJ - m_instance = 0; - delete m_openPagesSwitcher; -} - -int OpenPagesManager::pageCount() const -{ - TRACE_OBJ - return m_model->rowCount(); -} - -void OpenPagesManager::setupInitialPages(bool defaultCollection, - const QUrl &cmdLineUrl) -{ - TRACE_OBJ - if (cmdLineUrl.isValid()) { - createPage(cmdLineUrl); - return; - } - - HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - int initialPage = 0; - switch (helpEngine.startOption()) { - case ShowHomePage: - m_model->addPage(helpEngine.homePage()); - break; - case ShowBlankPage: - m_model->addPage(QUrl(QLatin1String("about:blank"))); - break; - case ShowLastPages: { - const QStringList &lastShownPageList = helpEngine.lastShownPages(); - const int pageCount = lastShownPageList.count(); - if (pageCount == 0) { - if (defaultCollection) - m_model->addPage(QUrl(QLatin1String("help"))); - else - m_model->addPage(QUrl(QLatin1String("about:blank"))); - } else { - QStringList zoomFactors = helpEngine.lastZoomFactors(); - while (zoomFactors.count() < pageCount) - zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); - initialPage = helpEngine.lastTabPage(); - if (initialPage >= pageCount) { - qWarning("Initial page set to %d, maximum possible value is %d", - initialPage, pageCount - 1); - initialPage = 0; - } - for (int curPage = 0; curPage < pageCount; ++curPage) { - const QString &curFile = lastShownPageList.at(curPage); - if (helpEngine.findFile(curFile).isValid() - || curFile == QLatin1String("about:blank")) { - m_model->addPage(curFile, zoomFactors.at(curPage).toFloat()); - } else if (curPage <= initialPage && initialPage > 0) - --initialPage; - } - } - break; - } - default: - Q_ASSERT(!"Unhandled option"); - } - - if (m_model->rowCount() == 0) - m_model->addPage(helpEngine.homePage()); - for (int i = 0; i < m_model->rowCount(); ++i) - CentralWidget::instance()->addPage(m_model->pageAt(i)); - setCurrentPage((initialPage >= m_model->rowCount()) - ? m_model->rowCount() - 1 : initialPage); - m_openPagesSwitcher->selectCurrentPage(); -} - -HelpViewer *OpenPagesManager::createPage() -{ - TRACE_OBJ - return createPage(QUrl(QLatin1String("about:blank"))); -} - -void OpenPagesManager::closeCurrentPage() -{ - TRACE_OBJ - Q_ASSERT(m_model->rowCount() > 1); - const QModelIndexList selectedIndexes - = m_openPagesWidget->selectionModel()->selectedRows(); - if (selectedIndexes.isEmpty()) - return; - Q_ASSERT(selectedIndexes.count() == 1); - removePage(selectedIndexes.first().row()); -} - -HelpViewer *OpenPagesManager::createPage(const QUrl &url, bool fromSearch) -{ - TRACE_OBJ - if (HelpViewer::launchWithExternalApp(url)) - return 0; - - m_model->addPage(url); - const int index = m_model->rowCount() - 1; - HelpViewer * const page = m_model->pageAt(index); - CentralWidget::instance()->addPage(page, fromSearch); - setCurrentPage(index); - return page; -} - -HelpViewer *OpenPagesManager::createNewPageFromSearch(const QUrl &url) -{ - TRACE_OBJ - return createPage(url, true); -} - -void OpenPagesManager::closePage(HelpViewer *viewer) -{ - TRACE_OBJ - for (int i = 0; i < m_model->rowCount(); ++i) { - if (m_model->pageAt(i) == viewer) { - removePage(i); - break; - } - } -} - -void OpenPagesManager::closePage(const QModelIndex &index) -{ - TRACE_OBJ - if (index.isValid()) - removePage(index.row()); -} - -void OpenPagesManager::closePages(const QString &nameSpace) -{ - TRACE_OBJ - closeOrReloadPages(nameSpace, false); -} - -void OpenPagesManager::reloadPages(const QString &nameSpace) -{ - TRACE_OBJ - closeOrReloadPages(nameSpace, true); - m_openPagesWidget->selectCurrentPage(); -} - -void OpenPagesManager::closeOrReloadPages(const QString &nameSpace, bool tryReload) -{ - TRACE_OBJ - for (int i = m_model->rowCount() - 1; i >= 0; --i) { - HelpViewer *page = m_model->pageAt(i); - if (page->source().host() != nameSpace) - continue; - if (tryReload && HelpEngineWrapper::instance().findFile(page->source()).isValid()) - page->reload(); - else if (m_model->rowCount() == 1) - page->setSource(QUrl(QLatin1String("about:blank"))); - else - removePage(i); - } -} - -bool OpenPagesManager::pagesOpenForNamespace(const QString &nameSpace) const -{ - TRACE_OBJ - for (int i = 0; i < m_model->rowCount(); ++i) - if (m_model->pageAt(i)->source().host() == nameSpace) - return true; - return false; -} - -void OpenPagesManager::setCurrentPage(const QModelIndex &index) -{ - TRACE_OBJ - if (index.isValid()) - setCurrentPage(index.row()); -} - -void OpenPagesManager::setCurrentPage(int index) -{ - TRACE_OBJ - setCurrentPage(m_model->pageAt(index)); -} - -void OpenPagesManager::setCurrentPage(HelpViewer *page) -{ - TRACE_OBJ - CentralWidget::instance()->setCurrentPage(page); - m_openPagesWidget->selectCurrentPage(); -} - -void OpenPagesManager::removePage(int index) -{ - TRACE_OBJ - CentralWidget::instance()->removePage(index); - m_model->removePage(index); - m_openPagesWidget->selectCurrentPage(); -} - - -void OpenPagesManager::closePagesExcept(const QModelIndex &index) -{ - TRACE_OBJ - if (!index.isValid()) - return; - - int i = 0; - HelpViewer *viewer = m_model->pageAt(index.row()); - while (m_model->rowCount() > 1) { - if (m_model->pageAt(i) != viewer) - removePage(i); - else - ++i; - } -} - -QAbstractItemView *OpenPagesManager::openPagesWidget() const -{ - TRACE_OBJ - return m_openPagesWidget; -} - -void OpenPagesManager::nextPage() -{ - TRACE_OBJ - nextOrPreviousPage(1); -} - -void OpenPagesManager::nextPageWithSwitcher() -{ - TRACE_OBJ - if (!m_openPagesSwitcher->isVisible()) { - m_openPagesSwitcher->selectCurrentPage(); - m_openPagesSwitcher->gotoNextPage(); - showSwitcherOrSelectPage(); - } else { - m_openPagesSwitcher->gotoNextPage(); - } -} - -void OpenPagesManager::previousPage() -{ - TRACE_OBJ - nextOrPreviousPage(-1); -} - -void OpenPagesManager::previousPageWithSwitcher() -{ - TRACE_OBJ - if (!m_openPagesSwitcher->isVisible()) { - m_openPagesSwitcher->selectCurrentPage(); - m_openPagesSwitcher->gotoPreviousPage(); - showSwitcherOrSelectPage(); - } else { - m_openPagesSwitcher->gotoPreviousPage(); - } -} - -void OpenPagesManager::nextOrPreviousPage(int offset) -{ - TRACE_OBJ - setCurrentPage((CentralWidget::instance()->currentIndex() + offset - + m_model->rowCount()) % m_model->rowCount()); -} - -void OpenPagesManager::showSwitcherOrSelectPage() const -{ - TRACE_OBJ - if (QApplication::keyboardModifiers() != Qt::NoModifier) { - const int width = CentralWidget::instance()->width(); - const int height = CentralWidget::instance()->height(); - const QPoint p(CentralWidget::instance()->mapToGlobal(QPoint(0, 0))); - m_openPagesSwitcher->move((width - m_openPagesSwitcher->width()) / 2 + p.x(), - (height - m_openPagesSwitcher->height()) / 2 + p.y()); - m_openPagesSwitcher->setVisible(true); - } else { - m_openPagesSwitcher->selectAndHide(); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/openpagesmanager.h b/src/assistant/tools/assistant/openpagesmanager.h deleted file mode 100644 index c34686c8c..000000000 --- a/src/assistant/tools/assistant/openpagesmanager.h +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef OPENPAGESMANAGER_H -#define OPENPAGESMANAGER_H - -#include - -QT_BEGIN_NAMESPACE - -class QAbstractItemView; -class QModelIndex; -class QUrl; - -class HelpViewer; -class OpenPagesModel; -class OpenPagesSwitcher; -class OpenPagesWidget; - -class OpenPagesManager : public QObject -{ - Q_OBJECT -public: - static OpenPagesManager *createInstance(QObject *parent, - bool defaultCollection, const QUrl &cmdLineUrl); - static OpenPagesManager *instance(); - - bool pagesOpenForNamespace(const QString &nameSpace) const; - void closePages(const QString &nameSpace); - void reloadPages(const QString &nameSpace); - - QAbstractItemView* openPagesWidget() const; - - int pageCount() const; - void setCurrentPage(int index); - -public slots: - HelpViewer *createPage(const QUrl &url, bool fromSearch = false); - HelpViewer *createNewPageFromSearch(const QUrl &url); - HelpViewer *createPage(); - void closeCurrentPage(); - - void nextPage(); - void nextPageWithSwitcher(); - void previousPage(); - void previousPageWithSwitcher(); - - void closePage(HelpViewer *page); - void setCurrentPage(HelpViewer *page); - -private slots: - void setCurrentPage(const QModelIndex &index); - void closePage(const QModelIndex &index); - void closePagesExcept(const QModelIndex &index); - -private: - OpenPagesManager(QObject *parent, bool defaultCollection, - const QUrl &cmdLineUrl); - ~OpenPagesManager(); - - void setupInitialPages(bool defaultCollection, const QUrl &cmdLineUrl); - void closeOrReloadPages(const QString &nameSpace, bool tryReload); - void removePage(int index); - - void nextOrPreviousPage(int offset); - void showSwitcherOrSelectPage() const; - - OpenPagesModel *m_model; - OpenPagesWidget *m_openPagesWidget; - OpenPagesSwitcher *m_openPagesSwitcher; - - static OpenPagesManager *m_instance; -}; - -QT_END_NAMESPACE - -#endif // OPENPAGESMANAGER_H diff --git a/src/assistant/tools/assistant/openpagesmodel.cpp b/src/assistant/tools/assistant/openpagesmodel.cpp deleted file mode 100644 index 3517693f9..000000000 --- a/src/assistant/tools/assistant/openpagesmodel.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "openpagesmodel.h" - -#include "helpenginewrapper.h" -#include "helpviewer.h" -#include "tracer.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -OpenPagesModel::OpenPagesModel(QObject *parent) : QAbstractTableModel(parent) -{ - TRACE_OBJ -} - -int OpenPagesModel::rowCount(const QModelIndex &parent) const -{ - TRACE_OBJ - return parent.isValid() ? 0 : m_pages.count(); -} - -int OpenPagesModel::columnCount(const QModelIndex &/*parent*/) const -{ - TRACE_OBJ - return 2; -} - -QVariant OpenPagesModel::data(const QModelIndex &index, int role) const -{ - TRACE_OBJ - if (!index.isValid() || index.row() >= rowCount() || index.column() > 0 - || role != Qt::DisplayRole) - return QVariant(); - QString title = m_pages.at(index.row())->title(); - title.replace(QLatin1Char('&'), QLatin1String("&&")); - return title.isEmpty() ? QLatin1String("(Untitled)") : title; -} - -void OpenPagesModel::addPage(const QUrl &url, qreal zoom) -{ - TRACE_OBJ - beginInsertRows(QModelIndex(), rowCount(), rowCount()); - HelpViewer *page = new HelpViewer(zoom); - connect(page, SIGNAL(titleChanged()), this, SLOT(handleTitleChanged())); - m_pages << page; - endInsertRows(); - page->setSource(url); -} - -void OpenPagesModel::removePage(int index) -{ - TRACE_OBJ - Q_ASSERT(index >= 0 && index < rowCount()); - beginRemoveRows(QModelIndex(), index, index); - HelpViewer *page = m_pages.at(index); - m_pages.removeAt(index); - endRemoveRows(); - page->deleteLater(); -} - -HelpViewer *OpenPagesModel::pageAt(int index) const -{ - TRACE_OBJ - Q_ASSERT(index >= 0 && index < rowCount()); - return m_pages.at(index); -} - -void OpenPagesModel::handleTitleChanged() -{ - TRACE_OBJ - HelpViewer *page = static_cast(sender()); - const int row = m_pages.indexOf(page); - Q_ASSERT(row != -1 ); - const QModelIndex &item = index(row, 0); - emit dataChanged(item, item); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/openpagesmodel.h b/src/assistant/tools/assistant/openpagesmodel.h deleted file mode 100644 index dd28a7c5f..000000000 --- a/src/assistant/tools/assistant/openpagesmodel.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef OPENPAGESMODEL_H -#define OPENPAGESMODEL_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class HelpViewer; -class QUrl; - -class OpenPagesModel : public QAbstractTableModel -{ - Q_OBJECT -public: - OpenPagesModel(QObject *parent); - - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; - virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - - void addPage(const QUrl &url, qreal zoom = 0); - void removePage(int index); - HelpViewer *pageAt(int index) const; - -private slots: - void handleTitleChanged(); - -private: - QList m_pages; -}; - -QT_END_NAMESPACE - -#endif // OPENPAGESMODEL_H diff --git a/src/assistant/tools/assistant/openpagesswitcher.cpp b/src/assistant/tools/assistant/openpagesswitcher.cpp deleted file mode 100644 index b1f70d784..000000000 --- a/src/assistant/tools/assistant/openpagesswitcher.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "openpagesswitcher.h" - -#include "centralwidget.h" -#include "openpagesmodel.h" -#include "openpageswidget.h" -#include "tracer.h" - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -const int gWidth = 300; -const int gHeight = 200; - -OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model) - : QFrame(0, Qt::Popup) - , m_openPagesModel(model) -{ - TRACE_OBJ - resize(gWidth, gHeight); - - m_openPagesWidget = new OpenPagesWidget(m_openPagesModel); - - // We disable the frame on this list view and use a QFrame around it instead. - // This improves the look with QGTKStyle. -#ifndef Q_WS_MAC - setFrameStyle(m_openPagesWidget->frameStyle()); -#endif - m_openPagesWidget->setFrameStyle(QFrame::NoFrame); - - m_openPagesWidget->allowContextMenu(false); - m_openPagesWidget->installEventFilter(this); - - QVBoxLayout *layout = new QVBoxLayout(this); - layout->setMargin(0); - layout->addWidget(m_openPagesWidget); - - connect(m_openPagesWidget, SIGNAL(closePage(QModelIndex)), this, - SIGNAL(closePage(QModelIndex))); - connect(m_openPagesWidget, SIGNAL(setCurrentPage(QModelIndex)), this, - SIGNAL(setCurrentPage(QModelIndex))); -} - -OpenPagesSwitcher::~OpenPagesSwitcher() -{ - TRACE_OBJ -} - -void OpenPagesSwitcher::gotoNextPage() -{ - TRACE_OBJ - selectPageUpDown(1); -} - -void OpenPagesSwitcher::gotoPreviousPage() -{ - TRACE_OBJ - selectPageUpDown(-1); -} - -void OpenPagesSwitcher::selectAndHide() -{ - TRACE_OBJ - setVisible(false); - emit setCurrentPage(m_openPagesWidget->currentIndex()); -} - -void OpenPagesSwitcher::selectCurrentPage() -{ - TRACE_OBJ - m_openPagesWidget->selectCurrentPage(); -} - -void OpenPagesSwitcher::setVisible(bool visible) -{ - TRACE_OBJ - QWidget::setVisible(visible); - if (visible) - setFocus(); -} - -void OpenPagesSwitcher::focusInEvent(QFocusEvent *event) -{ - TRACE_OBJ - Q_UNUSED(event) - m_openPagesWidget->setFocus(); -} - -bool OpenPagesSwitcher::eventFilter(QObject *object, QEvent *event) -{ - TRACE_OBJ - if (object == m_openPagesWidget) { - if (event->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(event); - if (ke->key() == Qt::Key_Escape) { - setVisible(false); - return true; - } - - const int key = ke->key(); - if (key == Qt::Key_Return || key == Qt::Key_Enter || key == Qt::Key_Space) { - emit setCurrentPage(m_openPagesWidget->currentIndex()); - return true; - } - - Qt::KeyboardModifier modifier = Qt::ControlModifier; -#ifdef Q_WS_MAC - modifier = Qt::AltModifier; -#endif - if (key == Qt::Key_Backtab - && (ke->modifiers() == (modifier | Qt::ShiftModifier))) - gotoPreviousPage(); - else if (key == Qt::Key_Tab && (ke->modifiers() == modifier)) - gotoNextPage(); - } else if (event->type() == QEvent::KeyRelease) { - QKeyEvent *ke = static_cast(event); - if (ke->modifiers() == 0 - /*HACK this is to overcome some event inconsistencies between platforms*/ - || (ke->modifiers() == Qt::AltModifier - && (ke->key() == Qt::Key_Alt || ke->key() == -1))) { - selectAndHide(); - } - } - } - return QWidget::eventFilter(object, event); -} - -void OpenPagesSwitcher::selectPageUpDown(int summand) -{ - TRACE_OBJ - const int pageCount = m_openPagesModel->rowCount(); - if (pageCount < 2) - return; - - const QModelIndexList &list = m_openPagesWidget->selectionModel()->selectedIndexes(); - if (list.isEmpty()) - return; - - QModelIndex index = list.first(); - if (!index.isValid()) - return; - - index = m_openPagesModel->index((index.row() + summand + pageCount) % pageCount, 0); - if (index.isValid()) { - m_openPagesWidget->setCurrentIndex(index); - m_openPagesWidget->scrollTo(index, QAbstractItemView::PositionAtCenter); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/openpagesswitcher.h b/src/assistant/tools/assistant/openpagesswitcher.h deleted file mode 100644 index c3e3a33ce..000000000 --- a/src/assistant/tools/assistant/openpagesswitcher.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef OPENPAGESSWITCHER_H -#define OPENPAGESSWITCHER_H - -#include - -QT_BEGIN_NAMESPACE - -class OpenPagesModel; -class OpenPagesWidget; -class QModelIndex; - -class OpenPagesSwitcher : public QFrame -{ - Q_OBJECT - -public: - OpenPagesSwitcher(OpenPagesModel *model); - ~OpenPagesSwitcher(); - - void gotoNextPage(); - void gotoPreviousPage(); - - void selectAndHide(); - void selectCurrentPage(); - - void setVisible(bool visible); - void focusInEvent(QFocusEvent *event); - bool eventFilter(QObject *object, QEvent *event); - -signals: - void closePage(const QModelIndex &index); - void setCurrentPage(const QModelIndex &index); - -private: - void selectPageUpDown(int summand); - -private: - OpenPagesModel *m_openPagesModel; - OpenPagesWidget *m_openPagesWidget; -}; - -QT_END_NAMESPACE - -#endif // OPENPAGESSWITCHER_H diff --git a/src/assistant/tools/assistant/openpageswidget.cpp b/src/assistant/tools/assistant/openpageswidget.cpp deleted file mode 100644 index 6947c312c..000000000 --- a/src/assistant/tools/assistant/openpageswidget.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "openpageswidget.h" - -#include "centralwidget.h" -#include "openpagesmodel.h" -#include "tracer.h" - -#include -#include -#include -#include -#include -#include - -#ifdef Q_WS_MAC -#include -#endif - -QT_BEGIN_NAMESPACE - -OpenPagesDelegate::OpenPagesDelegate(QObject *parent) - : QStyledItemDelegate(parent) -{ - TRACE_OBJ -} - -void OpenPagesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const -{ - TRACE_OBJ - if (option.state & QStyle::State_MouseOver) { - if ((QApplication::mouseButtons() & Qt::LeftButton) == 0) - pressedIndex = QModelIndex(); - QBrush brush = option.palette.alternateBase(); - if (index == pressedIndex) - brush = option.palette.dark(); - painter->fillRect(option.rect, brush); - } - - QStyledItemDelegate::paint(painter, option, index); - - if (index.column() == 1 && index.model()->rowCount() > 1 - && option.state & QStyle::State_MouseOver) { - QIcon icon((option.state & QStyle::State_Selected) - ? ":/trolltech/assistant/images/closebutton.png" - : ":/trolltech/assistant/images/darkclosebutton.png"); - - const QRect iconRect(option.rect.right() - option.rect.height(), - option.rect.top(), option.rect.height(), option.rect.height()); - icon.paint(painter, iconRect, Qt::AlignRight | Qt::AlignVCenter); - } -} - -// -- OpenPagesWidget - -OpenPagesWidget::OpenPagesWidget(OpenPagesModel *model) - : m_allowContextMenu(true) -{ - TRACE_OBJ - setModel(model); - setIndentation(0); - setItemDelegate((m_delegate = new OpenPagesDelegate(this))); - - setTextElideMode(Qt::ElideMiddle); - setAttribute(Qt::WA_MacShowFocusRect, false); - - viewport()->setAttribute(Qt::WA_Hover); - setSelectionBehavior(QAbstractItemView::SelectRows); - setSelectionMode(QAbstractItemView::SingleSelection); - - header()->hide(); - header()->setStretchLastSection(false); - header()->setResizeMode(0, QHeaderView::Stretch); - header()->setResizeMode(1, QHeaderView::Fixed); - header()->resizeSection(1, 18); - - installEventFilter(this); - setUniformRowHeights(true); - setContextMenuPolicy(Qt::CustomContextMenu); - - connect(this, SIGNAL(clicked(QModelIndex)), this, - SLOT(handleClicked(QModelIndex))); - connect(this, SIGNAL(pressed(QModelIndex)), this, - SLOT(handlePressed(QModelIndex))); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(contextMenuRequested(QPoint))); -} - -OpenPagesWidget::~OpenPagesWidget() -{ - TRACE_OBJ -} - -void OpenPagesWidget::selectCurrentPage() -{ - TRACE_OBJ - const QModelIndex ¤t = - model()->index(CentralWidget::instance()->currentIndex(), 0); - - QItemSelectionModel * const selModel = selectionModel(); - selModel->select(current, - QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); - selModel->clearSelection(); - - setCurrentIndex(current); - scrollTo(currentIndex()); -} - -void OpenPagesWidget::allowContextMenu(bool ok) -{ - TRACE_OBJ - m_allowContextMenu = ok; -} - -void OpenPagesWidget::contextMenuRequested(QPoint pos) -{ - TRACE_OBJ - QModelIndex index = indexAt(pos); - if (!index.isValid() || !m_allowContextMenu) - return; - - if (index.column() == 1) - index = index.sibling(index.row(), 0); - QMenu contextMenu; - QAction *closeEditor = contextMenu.addAction(tr("Close %1").arg(index.data() - .toString())); - QAction *closeOtherEditors = contextMenu.addAction(tr("Close All Except %1") - .arg(index.data().toString())); - - if (model()->rowCount() == 1) { - closeEditor->setEnabled(false); - closeOtherEditors->setEnabled(false); - } - - QAction *action = contextMenu.exec(mapToGlobal(pos)); - if (action == closeEditor) - emit closePage(index); - else if (action == closeOtherEditors) - emit closePagesExcept(index); -} - -void OpenPagesWidget::handlePressed(const QModelIndex &index) -{ - TRACE_OBJ - if (index.column() == 0) - emit setCurrentPage(index); - - if (index.column() == 1) - m_delegate->pressedIndex = index; -} - -void OpenPagesWidget::handleClicked(const QModelIndex &index) -{ - TRACE_OBJ - // implemented here to handle the funky close button and to work around a - // bug in item views where the delegate wouldn't get the QStyle::State_MouseOver - if (index.column() == 1) { - if (model()->rowCount() > 1) - emit closePage(index); - - QWidget *vp = viewport(); - const QPoint &cursorPos = QCursor::pos(); - QMouseEvent e(QEvent::MouseMove, vp->mapFromGlobal(cursorPos), cursorPos, - Qt::NoButton, 0, 0); - QCoreApplication::sendEvent(vp, &e); - } -} - -bool OpenPagesWidget::eventFilter(QObject *obj, QEvent *event) -{ - TRACE_OBJ - if (obj != this) - return QWidget::eventFilter(obj, event); - - if (event->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(event); - if (currentIndex().isValid() && ke->modifiers() == 0) { - const int key = ke->key(); - if (key == Qt::Key_Return || key == Qt::Key_Enter - || key == Qt::Key_Space) { - emit setCurrentPage(currentIndex()); - } else if ((key == Qt::Key_Delete || key == Qt::Key_Backspace) - && model()->rowCount() > 1) { - emit closePage(currentIndex()); - } - } - } else if (event->type() == QEvent::KeyRelease) { - QKeyEvent *ke = static_cast(event); - if (ke->modifiers() == 0 - && (ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down)) { - emit setCurrentPage(currentIndex()); - } - } - return QWidget::eventFilter(obj, event); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/openpageswidget.h b/src/assistant/tools/assistant/openpageswidget.h deleted file mode 100644 index e629e4ffe..000000000 --- a/src/assistant/tools/assistant/openpageswidget.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Assistant module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef OPENPAGESWIDGET_H -#define OPENPAGESWIDGET_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class OpenPagesModel; - -class OpenPagesDelegate : public QStyledItemDelegate -{ - Q_OBJECT -public: - explicit OpenPagesDelegate(QObject *parent = 0); - void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const; - - mutable QModelIndex pressedIndex; -}; - -class OpenPagesWidget : public QTreeView -{ - Q_OBJECT -public: - OpenPagesWidget(OpenPagesModel *model); - ~OpenPagesWidget(); - - void selectCurrentPage(); - void allowContextMenu(bool ok); - -signals: - void setCurrentPage(const QModelIndex &index); - void closePage(const QModelIndex &index); - void closePagesExcept(const QModelIndex &index); - -private slots: - void contextMenuRequested(QPoint pos); - void handlePressed(const QModelIndex &index); - void handleClicked(const QModelIndex &index); - -private: - bool eventFilter(QObject *obj, QEvent *event); - - bool m_allowContextMenu; - OpenPagesDelegate *m_delegate; -}; - -QT_END_NAMESPACE - -#endif // OPENPAGESWIDGET_H diff --git a/src/assistant/tools/assistant/preferencesdialog.cpp b/src/assistant/tools/assistant/preferencesdialog.cpp deleted file mode 100644 index 64fc3c42d..000000000 --- a/src/assistant/tools/assistant/preferencesdialog.cpp +++ /dev/null @@ -1,507 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "preferencesdialog.h" - -#include "centralwidget.h" -#include "filternamedialog.h" -#include "fontpanel.h" -#include "helpenginewrapper.h" -#include "installdialog.h" -#include "openpagesmanager.h" -#include "tracer.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -PreferencesDialog::PreferencesDialog(QWidget *parent) - : QDialog(parent) - , m_appFontChanged(false) - , m_browserFontChanged(false) - , helpEngine(HelpEngineWrapper::instance()) -{ - TRACE_OBJ - m_ui.setupUi(this); - - connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), - this, SLOT(applyChanges())); - connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), - this, SLOT(reject())); - - m_hideFiltersTab = !helpEngine.filterFunctionalityEnabled(); - m_hideDocsTab = !helpEngine.documentationManagerEnabled(); - - if (!m_hideFiltersTab) { - m_ui.attributeWidget->header()->hide(); - m_ui.attributeWidget->setRootIsDecorated(false); - - connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), - this, SLOT(updateFilterMap())); - - connect(m_ui.filterWidget, - SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, - SLOT(updateAttributes(QListWidgetItem*))); - - connect(m_ui.filterAddButton, SIGNAL(clicked()), this, - SLOT(addFilter())); - connect(m_ui.filterRemoveButton, SIGNAL(clicked()), this, - SLOT(removeFilter())); - - updateFilterPage(); - } else { - m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.filtersTab)); - } - - if (!m_hideDocsTab) { - connect(m_ui.docAddButton, SIGNAL(clicked()), this, - SLOT(addDocumentationLocal())); - connect(m_ui.docRemoveButton, SIGNAL(clicked()), this, - SLOT(removeDocumentation())); - - m_docsBackup = helpEngine.registeredDocumentations(); - m_ui.registeredDocsListWidget->addItems(m_docsBackup); - } else { - m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab)); - } - - updateFontSettingsPage(); - updateOptionsPage(); - - if (helpEngine.usesAppFont()) - setFont(helpEngine.appFont()); -} - -PreferencesDialog::~PreferencesDialog() -{ - TRACE_OBJ - if (m_appFontChanged) { - helpEngine.setAppFont(m_appFontPanel->selectedFont()); - helpEngine.setUseAppFont(m_appFontPanel->isChecked()); - helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem()); - emit updateApplicationFont(); - } - - if (m_browserFontChanged) { - helpEngine.setBrowserFont(m_browserFontPanel->selectedFont()); - helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked()); - helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem()); - emit updateBrowserFont(); - } - - QString homePage = m_ui.homePageLineEdit->text(); - if (homePage.isEmpty()) - homePage = QLatin1String("help"); - helpEngine.setHomePage(homePage); - - int option = m_ui.helpStartComboBox->currentIndex(); - helpEngine.setStartOption(option); -} - -void PreferencesDialog::showDialog() -{ - TRACE_OBJ - if (exec() != Accepted) - m_appFontChanged = m_browserFontChanged = false; -} - -void PreferencesDialog::updateFilterPage() -{ - TRACE_OBJ - m_ui.filterWidget->clear(); - m_ui.attributeWidget->clear(); - - m_filterMapBackup.clear(); - const QStringList &filters = helpEngine.customFilters(); - foreach (const QString &filter, filters) { - if (filter == HelpEngineWrapper::TrUnfiltered) - continue; - QStringList atts = helpEngine.filterAttributes(filter); - m_filterMapBackup.insert(filter, atts); - if (!m_filterMap.contains(filter)) - m_filterMap.insert(filter, atts); - } - - m_ui.filterWidget->addItems(m_filterMap.keys()); - - foreach (const QString &a, helpEngine.filterAttributes()) - new QTreeWidgetItem(m_ui.attributeWidget, QStringList() << a); - - if (!m_filterMap.keys().isEmpty()) - m_ui.filterWidget->setCurrentRow(0); -} - -void PreferencesDialog::updateAttributes(QListWidgetItem *item) -{ - TRACE_OBJ - QStringList checkedList; - if (item) - checkedList = m_filterMap.value(item->text()); - QTreeWidgetItem *itm; - for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { - itm = m_ui.attributeWidget->topLevelItem(i); - if (checkedList.contains(itm->text(0))) - itm->setCheckState(0, Qt::Checked); - else - itm->setCheckState(0, Qt::Unchecked); - } -} - -void PreferencesDialog::updateFilterMap() -{ - TRACE_OBJ - if (!m_ui.filterWidget->currentItem()) - return; - QString filter = m_ui.filterWidget->currentItem()->text(); - if (!m_filterMap.contains(filter)) - return; - - QStringList newAtts; - QTreeWidgetItem *itm = 0; - for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { - itm = m_ui.attributeWidget->topLevelItem(i); - if (itm->checkState(0) == Qt::Checked) - newAtts.append(itm->text(0)); - } - m_filterMap[filter] = newAtts; -} - -void PreferencesDialog::addFilter() -{ - TRACE_OBJ - FilterNameDialog dia(this); - if (dia.exec() == QDialog::Rejected) - return; - - QString filterName = dia.filterName(); - if (!m_filterMap.contains(filterName)) { - m_filterMap.insert(filterName, QStringList()); - m_ui.filterWidget->addItem(filterName); - } - - QList lst = m_ui.filterWidget - ->findItems(filterName, Qt::MatchCaseSensitive); - m_ui.filterWidget->setCurrentItem(lst.first()); -} - -void PreferencesDialog::removeFilter() -{ - TRACE_OBJ - QListWidgetItem *item = - m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow()); - if (!item) - return; - - m_filterMap.remove(item->text()); - m_removedFilters.append(item->text()); - delete item; - if (m_ui.filterWidget->count()) - m_ui.filterWidget->setCurrentRow(0); -} - -void PreferencesDialog::addDocumentationLocal() -{ - TRACE_OBJ - const QStringList fileNames = QFileDialog::getOpenFileNames(this, - tr("Add Documentation"), QString(), tr("Qt Compressed Help Files (*.qch)")); - if (fileNames.isEmpty()) - return; - - QStringList invalidFiles; - QStringList alreadyRegistered; - foreach (const QString &fileName, fileNames) { - const QString nameSpace = QHelpEngineCore::namespaceName(fileName); - if (nameSpace.isEmpty()) { - invalidFiles.append(fileName); - continue; - } - - if (m_ui.registeredDocsListWidget->findItems(nameSpace, - Qt::MatchFixedString).count()) { - alreadyRegistered.append(nameSpace); - continue; - } - - if (helpEngine.registerDocumentation(fileName)) { - m_ui.registeredDocsListWidget->addItem(nameSpace); - m_regDocs.append(nameSpace); - m_unregDocs.removeAll(nameSpace); - } - } - - if (!invalidFiles.isEmpty() || !alreadyRegistered.isEmpty()) { - QString message; - if (!alreadyRegistered.isEmpty()) { - foreach (const QString &ns, alreadyRegistered) { - message += tr("The namespace %1 is already registered!") - .arg(QString("%1").arg(ns)) + QLatin1String("
"); - } - if (!invalidFiles.isEmpty()) - message.append(QLatin1String("
")); - } - - if (!invalidFiles.isEmpty()) { - message += tr("The specified file is not a valid Qt Help File!"); - message.append(QLatin1String("
    ")); - foreach (const QString &file, invalidFiles) - message += QLatin1String("
  • ") + file + QLatin1String("
  • "); - message.append(QLatin1String("
")); - } - QMessageBox::warning(this, tr("Add Documentation"), message); - } - - updateFilterPage(); -} - -void PreferencesDialog::removeDocumentation() -{ - TRACE_OBJ - - bool foundBefore = false; - QList l = m_ui.registeredDocsListWidget->selectedItems(); - foreach (QListWidgetItem* item, l) { - const QString& ns = item->text(); - if (!foundBefore && OpenPagesManager::instance()->pagesOpenForNamespace(ns)) { - if (0 == QMessageBox::information(this, tr("Remove Documentation"), - tr("Some documents currently opened in Assistant reference the " - "documentation you are attempting to remove. Removing the " - "documentation will close those documents."), tr("Cancel"), - tr("OK"))) return; - foundBefore = true; - } - - m_unregDocs.append(ns); - delete m_ui.registeredDocsListWidget->takeItem( - m_ui.registeredDocsListWidget->row(item)); - } - - if (m_ui.registeredDocsListWidget->count()) { - m_ui.registeredDocsListWidget->setCurrentRow(0, - QItemSelectionModel::ClearAndSelect); - } -} - -void PreferencesDialog::applyChanges() -{ - TRACE_OBJ - bool filtersWereChanged = false; - if (!m_hideFiltersTab) { - if (m_filterMap.count() != m_filterMapBackup.count()) { - filtersWereChanged = true; - } else { - QMapIterator it(m_filterMapBackup); - while (it.hasNext() && !filtersWereChanged) { - it.next(); - if (!m_filterMap.contains(it.key())) { - filtersWereChanged = true; - } else { - QStringList a = it.value(); - QStringList b = m_filterMap.value(it.key()); - if (a.count() != b.count()) { - filtersWereChanged = true; - } else { - QStringList::const_iterator i(a.constBegin()); - while (i != a.constEnd()) { - if (!b.contains(*i)) { - filtersWereChanged = true; - break; - } - ++i; - } - } - } - } - } - } - - if (filtersWereChanged) { - foreach (const QString &filter, m_removedFilters) - helpEngine.removeCustomFilter(filter); - QMapIterator it(m_filterMap); - while (it.hasNext()) { - it.next(); - helpEngine.addCustomFilter(it.key(), it.value()); - } - } - - foreach (const QString &doc, m_unregDocs) { - OpenPagesManager::instance()->closePages(doc); - helpEngine.unregisterDocumentation(doc); - } - - if (filtersWereChanged || !m_regDocs.isEmpty() || !m_unregDocs.isEmpty()) - helpEngine.setupData(); - - helpEngine.setShowTabs(m_ui.showTabs->isChecked()); - if (m_showTabs != m_ui.showTabs->isChecked()) - emit updateUserInterface(); - - accept(); -} - -void PreferencesDialog::updateFontSettingsPage() -{ - TRACE_OBJ - m_browserFontPanel = new FontPanel(this); - m_browserFontPanel->setCheckable(true); - m_ui.stackedWidget_2->insertWidget(0, m_browserFontPanel); - - m_appFontPanel = new FontPanel(this); - m_appFontPanel->setCheckable(true); - m_ui.stackedWidget_2->insertWidget(1, m_appFontPanel); - - m_ui.stackedWidget_2->setCurrentIndex(0); - - const QString customSettings(tr("Use custom settings")); - m_appFontPanel->setTitle(customSettings); - - QFont font = helpEngine.appFont(); - m_appFontPanel->setSelectedFont(font); - - QFontDatabase::WritingSystem system = helpEngine.appWritingSystem(); - m_appFontPanel->setWritingSystem(system); - - m_appFontPanel->setChecked(helpEngine.usesAppFont()); - - m_browserFontPanel->setTitle(customSettings); - - font = helpEngine.browserFont(); - m_browserFontPanel->setSelectedFont(font); - - system = helpEngine.browserWritingSystem(); - m_browserFontPanel->setWritingSystem(system); - - m_browserFontPanel->setChecked(helpEngine.usesBrowserFont()); - - connect(m_appFontPanel, SIGNAL(toggled(bool)), this, - SLOT(appFontSettingToggled(bool))); - connect(m_browserFontPanel, SIGNAL(toggled(bool)), this, - SLOT(browserFontSettingToggled(bool))); - - QList allCombos = m_appFontPanel->findChildren(); - foreach (QComboBox* box, allCombos) { - connect(box, SIGNAL(currentIndexChanged(int)), this, - SLOT(appFontSettingChanged(int))); - } - - allCombos = m_browserFontPanel->findChildren(); - foreach (QComboBox* box, allCombos) { - connect(box, SIGNAL(currentIndexChanged(int)), this, - SLOT(browserFontSettingChanged(int))); - } -} - -void PreferencesDialog::appFontSettingToggled(bool on) -{ - TRACE_OBJ - Q_UNUSED(on) - m_appFontChanged = true; -} - -void PreferencesDialog::appFontSettingChanged(int index) -{ - TRACE_OBJ - Q_UNUSED(index) - m_appFontChanged = true; -} - -void PreferencesDialog::browserFontSettingToggled(bool on) -{ - TRACE_OBJ - Q_UNUSED(on) - m_browserFontChanged = true; -} - -void PreferencesDialog::browserFontSettingChanged(int index) -{ - TRACE_OBJ - Q_UNUSED(index) - m_browserFontChanged = true; -} - -void PreferencesDialog::updateOptionsPage() -{ - TRACE_OBJ - m_ui.homePageLineEdit->setText(helpEngine.homePage()); - - int option = helpEngine.startOption(); - m_ui.helpStartComboBox->setCurrentIndex(option); - - m_showTabs = helpEngine.showTabs(); - m_ui.showTabs->setChecked(m_showTabs); - - connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); - connect(m_ui.currentPageButton, SIGNAL(clicked()), this, SLOT(setCurrentPage())); - connect(m_ui.defaultPageButton, SIGNAL(clicked()), this, SLOT(setDefaultPage())); -} - -void PreferencesDialog::setBlankPage() -{ - TRACE_OBJ - m_ui.homePageLineEdit->setText(QLatin1String("about:blank")); -} - -void PreferencesDialog::setCurrentPage() -{ - TRACE_OBJ - QString homepage = CentralWidget::instance()->currentSource().toString(); - if (homepage.isEmpty()) - homepage = QLatin1String("help"); - - m_ui.homePageLineEdit->setText(homepage); -} - -void PreferencesDialog::setDefaultPage() -{ - TRACE_OBJ - m_ui.homePageLineEdit->setText(helpEngine.defaultHomePage()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/preferencesdialog.h b/src/assistant/tools/assistant/preferencesdialog.h deleted file mode 100644 index 04bfcf8c3..000000000 --- a/src/assistant/tools/assistant/preferencesdialog.h +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PREFERENCESDIALOG_H -#define PREFERENCESDIALOG_H - -#include -#include "ui_preferencesdialog.h" - -QT_BEGIN_NAMESPACE - -class FontPanel; -class HelpEngineWrapper; -class QFileSystemWatcher; - -class PreferencesDialog : public QDialog -{ - Q_OBJECT - -public: - PreferencesDialog(QWidget *parent = 0); - ~PreferencesDialog(); - - void showDialog(); - -private slots: - void updateAttributes(QListWidgetItem *item); - void updateFilterMap(); - void addFilter(); - void removeFilter(); - void addDocumentationLocal(); - void removeDocumentation(); - void applyChanges(); - void appFontSettingToggled(bool on); - void appFontSettingChanged(int index); - void browserFontSettingToggled(bool on); - void browserFontSettingChanged(int index); - - void setBlankPage(); - void setCurrentPage(); - void setDefaultPage(); - -signals: - void updateBrowserFont(); - void updateApplicationFont(); - void updateUserInterface(); - -private: - void updateFilterPage(); - void updateFontSettingsPage(); - void updateOptionsPage(); - - Ui::PreferencesDialogClass m_ui; - bool m_hideFiltersTab; - bool m_hideDocsTab; - QMap m_filterMapBackup; - QMap m_filterMap; - QStringList m_removedFilters; - QStringList m_docsBackup; - QStringList m_regDocs; - QStringList m_unregDocs; - FontPanel *m_appFontPanel; - FontPanel *m_browserFontPanel; - bool m_appFontChanged; - bool m_browserFontChanged; - HelpEngineWrapper &helpEngine; - bool m_showTabs; -}; - -QT_END_NAMESPACE - -#endif // SETTINGSDIALOG_H diff --git a/src/assistant/tools/assistant/preferencesdialog.ui b/src/assistant/tools/assistant/preferencesdialog.ui deleted file mode 100644 index 1c6833ad9..000000000 --- a/src/assistant/tools/assistant/preferencesdialog.ui +++ /dev/null @@ -1,400 +0,0 @@ - - - PreferencesDialogClass - - - - 0 - 0 - 375 - 275 - - - - Preferences - - - - - - 0 - - - - Fonts - - - - - - - - - 0 - 0 - - - - Font settings: - - - - - - - - Browser - - - - - Application - - - - - - - - - - 0 - - - - - - - - - Filters - - - - - - Filter: - - - - - - - QFrame::NoFrame - - - Attributes: - - - - - - - - - - - 1 - - - - - - - - Add - - - - - - - Remove - - - - - - - - Documentation - - - - - - Registered Documentation: - - - - - - - 6 - - - 0 - - - - - QAbstractItemView::ExtendedSelection - - - - - - - 6 - - - 0 - - - - - Add... - - - - - - - Remove - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - Options - - - - - - - - - - - - - 0 - 0 - - - - On help start: - - - - - - - - 0 - 0 - - - - - Show my home page - - - - - Show a blank page - - - - - Show my tabs from last session - - - - - - - - Qt::Horizontal - - - - 54 - 20 - - - - - - - - - - - - - - - - - - - Homepage - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Current Page - - - - - - - Blank Page - - - - - - - Restore to default - - - - - - - - - - - - Appearance - - - - - - Show tabs for each individual page - - - - - - - - - - Qt::Vertical - - - - 20 - 72 - - - - - - - - - - - - 6 - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - - comboBox - currentIndexChanged(int) - stackedWidget_2 - setCurrentIndex(int) - - - 375 - 32 - - - 347 - 125 - - - - - diff --git a/src/assistant/tools/assistant/qtdocinstaller.cpp b/src/assistant/tools/assistant/qtdocinstaller.cpp deleted file mode 100644 index ffe352c87..000000000 --- a/src/assistant/tools/assistant/qtdocinstaller.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include -#include -#include -#include -#include -#include "helpenginewrapper.h" -#include "qtdocinstaller.h" - -QT_BEGIN_NAMESPACE - -QtDocInstaller::QtDocInstaller(const QList &docInfos) - : m_abort(false), m_docInfos(docInfos) -{ - TRACE_OBJ -} - -QtDocInstaller::~QtDocInstaller() -{ - TRACE_OBJ - if (!isRunning()) - return; - m_mutex.lock(); - m_abort = true; - m_mutex.unlock(); - wait(); -} - -void QtDocInstaller::installDocs() -{ - TRACE_OBJ - start(LowPriority); -} - -void QtDocInstaller::run() -{ - TRACE_OBJ - m_qchDir = QLibraryInfo::location(QLibraryInfo::DocumentationPath) - + QDir::separator() + QLatin1String("qch"); - m_qchFiles = m_qchDir.entryList(QStringList() << QLatin1String("*.qch")); - - bool changes = false; - foreach (const DocInfo &docInfo, m_docInfos) { - changes |= installDoc(docInfo); - m_mutex.lock(); - if (m_abort) { - m_mutex.unlock(); - return; - } - m_mutex.unlock(); - } - emit docsInstalled(changes); -} - -bool QtDocInstaller::installDoc(const DocInfo &docInfo) -{ - TRACE_OBJ - const QString &component = docInfo.first; - const QStringList &info = docInfo.second; - QDateTime dt; - if (!info.isEmpty() && !info.first().isEmpty()) - dt = QDateTime::fromString(info.first(), Qt::ISODate); - - QString qchFile; - if (info.count() == 2) - qchFile = info.last(); - - if (m_qchFiles.isEmpty()) { - emit qchFileNotFound(component); - return false; - } - foreach (const QString &f, m_qchFiles) { - if (f.startsWith(component)) { - QFileInfo fi(m_qchDir.absolutePath() + QDir::separator() + f); - if (dt.isValid() && fi.lastModified().toTime_t() == dt.toTime_t() - && qchFile == fi.absoluteFilePath()) - return false; - emit registerDocumentation(component, fi.absoluteFilePath()); - return true; - } - } - - emit qchFileNotFound(component); - return false; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/qtdocinstaller.h b/src/assistant/tools/assistant/qtdocinstaller.h deleted file mode 100644 index 909df10ce..000000000 --- a/src/assistant/tools/assistant/qtdocinstaller.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QTDOCINSTALLER -#define QTDOCINSTALLER - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class HelpEngineWrapper; - -class QtDocInstaller : public QThread -{ - Q_OBJECT - -public: - typedef QPair DocInfo; - QtDocInstaller(const QList &docInfos); - ~QtDocInstaller(); - void installDocs(); - -signals: - void qchFileNotFound(const QString &component); - void registerDocumentation(const QString &component, - const QString &absFileName); - void docsInstalled(bool newDocsInstalled); - -private: - void run(); - bool installDoc(const DocInfo &docInfo); - - bool m_abort; - QMutex m_mutex; - QStringList m_qchFiles; - QDir m_qchDir; - QList m_docInfos; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/assistant/remotecontrol.cpp b/src/assistant/tools/assistant/remotecontrol.cpp deleted file mode 100644 index 0990a357f..000000000 --- a/src/assistant/tools/assistant/remotecontrol.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "remotecontrol.h" - -#include "centralwidget.h" -#include "helpenginewrapper.h" -#include "mainwindow.h" -#include "openpagesmanager.h" -#include "tracer.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#ifdef Q_OS_WIN -# include "remotecontrol_win.h" -#endif - -QT_BEGIN_NAMESPACE - -#ifdef Q_OS_WIN - -StdInListenerWin::StdInListenerWin(QObject *parent) - : QThread(parent) -{ - TRACE_OBJ -} - -StdInListenerWin::~StdInListenerWin() -{ - TRACE_OBJ - terminate(); - wait(); -} - -void StdInListenerWin::run() -{ - TRACE_OBJ - bool ok = true; - char chBuf[4096]; - DWORD dwRead; - -#ifndef Q_WS_WINCE - HANDLE hStdin, hStdinDup; - - hStdin = GetStdHandle(STD_INPUT_HANDLE); - if (hStdin == INVALID_HANDLE_VALUE) - return; - - DuplicateHandle(GetCurrentProcess(), hStdin, - GetCurrentProcess(), &hStdinDup, - 0, false, DUPLICATE_SAME_ACCESS); - - CloseHandle(hStdin); -#else - HANDLE hStdinDup; - hStdinDup = stdin; -#endif - - while (ok) { - ok = ReadFile(hStdinDup, chBuf, sizeof(chBuf), &dwRead, NULL); - if (ok && dwRead != 0) - emit receivedCommand(QString::fromLocal8Bit(chBuf, dwRead)); - } -} -#endif - -RemoteControl::RemoteControl(MainWindow *mainWindow) - : QObject(mainWindow) - , m_mainWindow(mainWindow) - , m_debug(false) - , m_caching(true) - , m_syncContents(false) - , m_expandTOC(-2) - , helpEngine(HelpEngineWrapper::instance()) - -{ - TRACE_OBJ - connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); -#ifdef Q_OS_WIN - StdInListenerWin *l = new StdInListenerWin(this); - connect(l, SIGNAL(receivedCommand(QString)), - this, SLOT(handleCommandString(QString))); - l->start(); -#else - QSocketNotifier *notifier = new QSocketNotifier(fileno(stdin), - QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)), this, SLOT(receivedData())); - notifier->setEnabled(true); -#endif -} - -void RemoteControl::receivedData() -{ - TRACE_OBJ - QByteArray ba; - while (true) { - char c = getc(stdin); - if (c == EOF || c == '\0') - break; - if (c) - ba.append(c); - if (c == '\n') - break; - } - handleCommandString(QString::fromLocal8Bit(ba)); -} - -void RemoteControl::handleCommandString(const QString &cmdString) -{ - TRACE_OBJ - QStringList cmds = cmdString.split(QLatin1Char(';')); - QStringList::const_iterator it = cmds.constBegin(); - while (it != cmds.constEnd()) { - QString cmd, arg; - splitInputString(*it, cmd, arg); - - if (m_debug) - QMessageBox::information(0, tr("Debugging Remote Control"), - tr("Received Command: %1 %2").arg(cmd).arg(arg)); - - if (cmd == QLatin1String("debug")) - handleDebugCommand(arg); - else if (cmd == QLatin1String("show")) - handleShowOrHideCommand(arg, true); - else if (cmd == QLatin1String("hide")) - handleShowOrHideCommand(arg, false); - else if (cmd == QLatin1String("setsource")) - handleSetSourceCommand(arg); - else if (cmd == QLatin1String("synccontents")) - handleSyncContentsCommand(); - else if (cmd == QLatin1String("activatekeyword")) - handleActivateKeywordCommand(arg); - else if (cmd == QLatin1String("activateidentifier")) - handleActivateIdentifierCommand(arg); - else if (cmd == QLatin1String("expandtoc")) - handleExpandTocCommand(arg); - else if (cmd == QLatin1String("setcurrentfilter")) - handleSetCurrentFilterCommand(arg); - else if (cmd == QLatin1String("register")) - handleRegisterCommand(arg); - else if (cmd == QLatin1String("unregister")) - handleUnregisterCommand(arg); - else - return; - - ++it; - } - m_mainWindow->raise(); - m_mainWindow->activateWindow(); -} - -void RemoteControl::splitInputString(const QString &input, QString &cmd, - QString &arg) -{ - TRACE_OBJ - QString cmdLine = input.trimmed(); - int i = cmdLine.indexOf(QLatin1Char(' ')); - cmd = cmdLine.left(i); - arg = cmdLine.mid(i+1); - cmd = cmd.toLower(); -} - -void RemoteControl::handleDebugCommand(const QString &arg) -{ - TRACE_OBJ - m_debug = arg == QLatin1String("on"); -} - -void RemoteControl::handleShowOrHideCommand(const QString &arg, bool show) -{ - TRACE_OBJ - if (arg.toLower() == QLatin1String("contents")) - m_mainWindow->setContentsVisible(show); - else if (arg.toLower() == QLatin1String("index")) - m_mainWindow->setIndexVisible(show); - else if (arg.toLower() == QLatin1String("bookmarks")) - m_mainWindow->setBookmarksVisible(show); - else if (arg.toLower() == QLatin1String("search")) - m_mainWindow->setSearchVisible(show); -} - -void RemoteControl::handleSetSourceCommand(const QString &arg) -{ - TRACE_OBJ - QUrl url(arg); - if (url.isValid()) { - if (url.isRelative()) - url = CentralWidget::instance()->currentSource().resolved(url); - if (m_caching) { - clearCache(); - m_setSource = url; - } else { - CentralWidget::instance()->setSource(url); - } - } -} - -void RemoteControl::handleSyncContentsCommand() -{ - TRACE_OBJ - if (m_caching) - m_syncContents = true; - else - m_mainWindow->syncContents(); -} - -void RemoteControl::handleActivateKeywordCommand(const QString &arg) -{ - TRACE_OBJ - if (m_caching) { - clearCache(); - m_activateKeyword = arg; - } else { - m_mainWindow->setIndexString(arg); - if (!arg.isEmpty()) { - if (!helpEngine.indexWidget()->currentIndex().isValid() - && helpEngine.fullTextSearchFallbackEnabled()) { - if (QHelpSearchEngine *se = helpEngine.searchEngine()) { - m_mainWindow->setSearchVisible(true); - if (QHelpSearchQueryWidget *w = se->queryWidget()) { - w->collapseExtendedSearch(); - QList queryList; - queryList << QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - QStringList(arg)); - w->setQuery(queryList); - se->search(queryList); - } - } - } else { - m_mainWindow->setIndexVisible(true); - helpEngine.indexWidget()->activateCurrentItem(); - } - } - } -} - -void RemoteControl::handleActivateIdentifierCommand(const QString &arg) -{ - TRACE_OBJ - if (m_caching) { - clearCache(); - m_activateIdentifier = arg; - } else { - const QMap &links = helpEngine.linksForIdentifier(arg); - if (!links.isEmpty()) - CentralWidget::instance()->setSource(links.constBegin().value()); - } -} - -void RemoteControl::handleExpandTocCommand(const QString &arg) -{ - TRACE_OBJ - bool ok = false; - int depth = -2; - if (!arg.isEmpty()) - depth = arg.toInt(&ok); - if (!ok || depth < -2) - depth = -2; - - if (m_caching) - m_expandTOC = depth; - else if (depth != -2) - m_mainWindow->expandTOC(depth); -} - -void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) -{ - TRACE_OBJ - if (helpEngine.customFilters().contains(arg)) { - if (m_caching) { - clearCache(); - m_currentFilter = arg; - } else { - helpEngine.setCurrentFilter(arg); - } - } -} - -void RemoteControl::handleRegisterCommand(const QString &arg) -{ - TRACE_OBJ - const QString &absFileName = QFileInfo(arg).absoluteFilePath(); - if (helpEngine.registeredDocumentations(). - contains(QHelpEngineCore::namespaceName(absFileName))) - return; - if (helpEngine.registerDocumentation(absFileName)) - helpEngine.setupData(); -} - -void RemoteControl::handleUnregisterCommand(const QString &arg) -{ - TRACE_OBJ - const QString &absFileName = QFileInfo(arg).absoluteFilePath(); - const QString &ns = QHelpEngineCore::namespaceName(absFileName); - if (helpEngine.registeredDocumentations().contains(ns)) { - OpenPagesManager::instance()->closePages(ns); - if (helpEngine.unregisterDocumentation(ns)) - helpEngine.setupData(); - } -} - -void RemoteControl::applyCache() -{ - TRACE_OBJ - if (m_setSource.isValid()) { - CentralWidget::instance()->setSource(m_setSource); - } else if (!m_activateKeyword.isEmpty()) { - m_mainWindow->setIndexString(m_activateKeyword); - helpEngine.indexWidget()->activateCurrentItem(); - } else if (!m_activateIdentifier.isEmpty()) { - QMap links = - helpEngine.linksForIdentifier(m_activateIdentifier); - if (!links.isEmpty()) - CentralWidget::instance()->setSource(links.constBegin().value()); - } else if (!m_currentFilter.isEmpty()) { - helpEngine.setCurrentFilter(m_currentFilter); - } - - if (m_syncContents) - m_mainWindow->syncContents(); - - Q_ASSERT(m_expandTOC >= -2); - if (m_expandTOC != -2) - m_mainWindow->expandTOC(m_expandTOC); - - m_caching = false; -} - -void RemoteControl::clearCache() -{ - TRACE_OBJ - m_currentFilter.clear(); - m_setSource.clear(); - m_syncContents = false; - m_activateKeyword.clear(); - m_activateIdentifier.clear(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/remotecontrol.h b/src/assistant/tools/assistant/remotecontrol.h deleted file mode 100644 index 4a185f050..000000000 --- a/src/assistant/tools/assistant/remotecontrol.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef REMOTECONTROL_H -#define REMOTECONTROL_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class HelpEngineWrapper; -class MainWindow; - -class RemoteControl : public QObject -{ - Q_OBJECT - -public: - RemoteControl(MainWindow *mainWindow); - -private slots: - void receivedData(); - void handleCommandString(const QString &cmdString); - void applyCache(); - -private: - void clearCache(); - void splitInputString(const QString &input, QString &cmd, QString &arg); - void handleDebugCommand(const QString &arg); - void handleShowOrHideCommand(const QString &arg, bool show); - void handleSetSourceCommand(const QString &arg); - void handleSyncContentsCommand(); - void handleActivateKeywordCommand(const QString &arg); - void handleActivateIdentifierCommand(const QString &arg); - void handleExpandTocCommand(const QString &arg); - void handleSetCurrentFilterCommand(const QString &arg); - void handleRegisterCommand(const QString &arg); - void handleUnregisterCommand(const QString &arg); - -private: - MainWindow *m_mainWindow; - bool m_debug; - - bool m_caching; - QUrl m_setSource; - bool m_syncContents; - QString m_activateKeyword; - QString m_activateIdentifier; - int m_expandTOC; - QString m_currentFilter; - HelpEngineWrapper &helpEngine; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/assistant/remotecontrol_win.h b/src/assistant/tools/assistant/remotecontrol_win.h deleted file mode 100644 index 807815df1..000000000 --- a/src/assistant/tools/assistant/remotecontrol_win.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef REMOTECONTROL_WIN_H -#define REMOTECONTROL_WIN_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class StdInListenerWin : public QThread -{ - Q_OBJECT - -public: - StdInListenerWin(QObject *parent); - ~StdInListenerWin(); - -signals: - void receivedCommand(const QString &cmd); - -private: - void run(); - bool ok; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/assistant/searchwidget.cpp b/src/assistant/tools/assistant/searchwidget.cpp deleted file mode 100644 index 31b8e739d..000000000 --- a/src/assistant/tools/assistant/searchwidget.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include "mainwindow.h" -#include "searchwidget.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) - : QWidget(parent) - , zoomCount(0) - , searchEngine(engine) -{ - TRACE_OBJ - QVBoxLayout *vLayout = new QVBoxLayout(this); - - resultWidget = searchEngine->resultWidget(); - QHelpSearchQueryWidget *queryWidget = searchEngine->queryWidget(); - - vLayout->addWidget(queryWidget); - vLayout->addWidget(resultWidget); - - setFocusProxy(queryWidget); - - connect(queryWidget, SIGNAL(search()), this, SLOT(search())); - connect(resultWidget, SIGNAL(requestShowLink(QUrl)), this, - SIGNAL(requestShowLink(QUrl))); - - connect(searchEngine, SIGNAL(searchingStarted()), this, - SLOT(searchingStarted())); - connect(searchEngine, SIGNAL(searchingFinished(int)), this, - SLOT(searchingFinished(int))); - - QTextBrowser* browser = resultWidget->findChild(); - if (browser) // Will be null if lib was configured not to use CLucene. - browser->viewport()->installEventFilter(this); -} - -SearchWidget::~SearchWidget() -{ - TRACE_OBJ - // nothing todo -} - -void SearchWidget::zoomIn() -{ - TRACE_OBJ - QTextBrowser* browser = resultWidget->findChild(); - if (browser && zoomCount != 10) { - zoomCount++; - browser->zoomIn(); - } -} - -void SearchWidget::zoomOut() -{ - TRACE_OBJ - QTextBrowser* browser = resultWidget->findChild(); - if (browser && zoomCount != -5) { - zoomCount--; - browser->zoomOut(); - } -} - -void SearchWidget::resetZoom() -{ - TRACE_OBJ - if (zoomCount == 0) - return; - - QTextBrowser* browser = resultWidget->findChild(); - if (browser) { - browser->zoomOut(zoomCount); - zoomCount = 0; - } -} - -void SearchWidget::search() const -{ - TRACE_OBJ - QList query = searchEngine->queryWidget()->query(); - searchEngine->search(query); -} - -void SearchWidget::searchingStarted() -{ - TRACE_OBJ - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); -} - -void SearchWidget::searchingFinished(int hits) -{ - TRACE_OBJ - Q_UNUSED(hits) - qApp->restoreOverrideCursor(); -} - -bool SearchWidget::eventFilter(QObject* o, QEvent *e) -{ - TRACE_OBJ - QTextBrowser* browser = resultWidget->findChild(); - if (browser && o == browser->viewport() - && e->type() == QEvent::MouseButtonRelease){ - QMouseEvent *me = static_cast(e); - QUrl link = resultWidget->linkAt(me->pos()); - if (!link.isEmpty() || link.isValid()) { - bool controlPressed = me->modifiers() & Qt::ControlModifier; - if((me->button() == Qt::LeftButton && controlPressed) - || (me->button() == Qt::MidButton)) { - emit requestShowLinkInNewTab(link); - } - } - } - return QWidget::eventFilter(o,e); -} - -void SearchWidget::keyPressEvent(QKeyEvent *keyEvent) -{ - TRACE_OBJ - if (keyEvent->key() == Qt::Key_Escape) - MainWindow::activateCurrentBrowser(); - else - keyEvent->ignore(); -} - -void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) -{ - TRACE_OBJ - QMenu menu; - QPoint point = contextMenuEvent->globalPos(); - - QTextBrowser* browser = resultWidget->findChild(); - if (!browser) - return; - - point = browser->mapFromGlobal(point); - if (!browser->rect().contains(point, true)) - return; - - QUrl link = browser->anchorAt(point); - - QKeySequence keySeq(QKeySequence::Copy); - QAction *copyAction = menu.addAction(tr("&Copy") + QLatin1String("\t") + - keySeq.toString(QKeySequence::NativeText)); - copyAction->setEnabled(QTextCursor(browser->textCursor()).hasSelection()); - - QAction *copyAnchorAction = menu.addAction(tr("Copy &Link Location")); - copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid()); - - keySeq = QKeySequence(Qt::CTRL); - QAction *newTabAction = menu.addAction(tr("Open Link in New Tab") + - QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText) + - QLatin1String("LMB")); - newTabAction->setEnabled(!link.isEmpty() && link.isValid()); - - menu.addSeparator(); - - keySeq = QKeySequence::SelectAll; - QAction *selectAllAction = menu.addAction(tr("Select All") + - QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText)); - - QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos())); - if (usedAction == copyAction) { - QTextCursor cursor = browser->textCursor(); - if (!cursor.isNull() && cursor.hasSelection()) { - QString selectedText = cursor.selectedText(); - QMimeData *data = new QMimeData(); - data->setText(selectedText); - QApplication::clipboard()->setMimeData(data); - } - } - else if (usedAction == copyAnchorAction) { - QApplication::clipboard()->setText(link.toString()); - } - else if (usedAction == newTabAction) { - emit requestShowLinkInNewTab(link); - } - else if (usedAction == selectAllAction) { - browser->selectAll(); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/searchwidget.h b/src/assistant/tools/assistant/searchwidget.h deleted file mode 100644 index c53498c94..000000000 --- a/src/assistant/tools/assistant/searchwidget.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef SEARCHWIDGET_H -#define SEARCHWIDGET_H - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QMouseEvent; -class QHelpSearchEngine; -class QHelpSearchResultWidget; - -class SearchWidget : public QWidget -{ - Q_OBJECT - -public: - explicit SearchWidget(QHelpSearchEngine *engine, QWidget *parent = 0); - ~SearchWidget(); - - void zoomIn(); - void zoomOut(); - void resetZoom(); - -signals: - void requestShowLink(const QUrl &url); - void requestShowLinkInNewTab(const QUrl &url); - -private slots: - void search() const; - void searchingStarted(); - void searchingFinished(int hits); - -private: - bool eventFilter(QObject* o, QEvent *e); - void keyPressEvent(QKeyEvent *keyEvent); - void contextMenuEvent(QContextMenuEvent *contextMenuEvent); - -private: - int zoomCount; - QHelpSearchEngine *searchEngine; - QHelpSearchResultWidget *resultWidget; -}; - -QT_END_NAMESPACE - -#endif // SEARCHWIDGET_H diff --git a/src/assistant/tools/assistant/topicchooser.cpp b/src/assistant/tools/assistant/topicchooser.cpp deleted file mode 100644 index 6f2810bf4..000000000 --- a/src/assistant/tools/assistant/topicchooser.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include "topicchooser.h" - -QT_BEGIN_NAMESPACE - -TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, - const QMap &links) - : QDialog(parent) -{ - TRACE_OBJ - ui.setupUi(this); - ui.label->setText(tr("Choose a topic for %1:").arg(keyword)); - - QMap::const_iterator it = links.constBegin(); - for (; it != links.constEnd(); ++it) { - ui.listWidget->addItem(it.key()); - m_links.append(it.value()); - } - - if (ui.listWidget->count() != 0) - ui.listWidget->setCurrentRow(0); - ui.listWidget->setFocus(); - - connect(ui.buttonDisplay, SIGNAL(clicked()), this, SLOT(accept())); - connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(ui.listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, - SLOT(accept())); -} - -QUrl TopicChooser::link() const -{ - TRACE_OBJ - QListWidgetItem *item = ui.listWidget->currentItem(); - if (!item) - return QUrl(); - - QString title = item->text(); - if (title.isEmpty()) - return QUrl(); - - const int row = ui.listWidget->row(item); - Q_ASSERT(row < m_links.count()); - return m_links.at(row); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/topicchooser.h b/src/assistant/tools/assistant/topicchooser.h deleted file mode 100644 index 6ac59f008..000000000 --- a/src/assistant/tools/assistant/topicchooser.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TOPICCHOOSER_H -#define TOPICCHOOSER_H - -#include "ui_topicchooser.h" - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class TopicChooser : public QDialog -{ - Q_OBJECT - -public: - TopicChooser(QWidget *parent, const QString &keyword, - const QMap &links); - - QUrl link() const; - -private: - Ui::TopicChooser ui; - QList m_links; -}; - -QT_END_NAMESPACE - -#endif // TOPICCHOOSER_H diff --git a/src/assistant/tools/assistant/topicchooser.ui b/src/assistant/tools/assistant/topicchooser.ui deleted file mode 100644 index d4c90bb4b..000000000 --- a/src/assistant/tools/assistant/topicchooser.ui +++ /dev/null @@ -1,116 +0,0 @@ - - TopicChooser - - - TopicChooser - - - - 0 - 0 - 391 - 223 - - - - Choose Topic - - - true - - - - unnamed - - - 11 - - - 6 - - - - - label - - - &Topics - - - listWidget - - - - - - - listWidget - - - - - - - Layout16 - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - buttonDisplay - - - &Display - - - true - - - true - - - - - - - buttonCancel - - - &Close - - - true - - - - - - - - - diff --git a/src/assistant/tools/assistant/tracer.h b/src/assistant/tools/assistant/tracer.h deleted file mode 100644 index 1ed609acb..000000000 --- a/src/assistant/tools/assistant/tracer.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TRACER_H -#define TRACER_H - -#include - -QT_BEGIN_NAMESPACE - -class Tracer -{ -public: - Tracer(const char *func) : m_func(func) - { - qDebug("Entering function %s.", m_func); - } - - ~Tracer() - { - qDebug("Leaving function %s.", m_func); - } - -private: - const char * const m_func; -}; - -QT_END_NAMESPACE - -// #define TRACING_REQUESTED -#ifdef TRACING_REQUESTED -#define TRACE_OBJ Tracer traceObj__(Q_FUNC_INFO); -#else -#define TRACE_OBJ -#endif - -#endif // TRACER_H diff --git a/src/assistant/tools/assistant/xbelsupport.cpp b/src/assistant/tools/assistant/xbelsupport.cpp deleted file mode 100644 index 2979d10c1..000000000 --- a/src/assistant/tools/assistant/xbelsupport.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "tracer.h" - -#include "xbelsupport.h" - -#include "bookmarkitem.h" -#include "bookmarkmodel.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -struct Bookmark { - QString title; - QString url; - bool folded; -}; - -XbelWriter::XbelWriter(BookmarkModel *model) - : QXmlStreamWriter() - , bookmarkModel(model) -{ - TRACE_OBJ - setAutoFormatting(true); -} - -void XbelWriter::writeToFile(QIODevice *device) -{ - TRACE_OBJ - setDevice(device); - - writeStartDocument(); - writeDTD(QLatin1String("")); - writeStartElement(QLatin1String("xbel")); - writeAttribute(QLatin1String("version"), QLatin1String("1.0")); - - const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); - for (int i = 0; i < bookmarkModel->rowCount(root); ++i) - writeData(bookmarkModel->index(i, 0, root)); - writeEndDocument(); -} - -void XbelWriter::writeData(const QModelIndex &index) -{ - TRACE_OBJ - if (index.isValid()) { - Bookmark entry; - entry.title = index.data().toString(); - entry.url = index.data(UserRoleUrl).toString(); - - if (index.data(UserRoleFolder).toBool()) { - writeStartElement(QLatin1String("folder")); - entry.folded = !index.data(UserRoleExpanded).toBool(); - writeAttribute(QLatin1String("folded"), entry.folded - ? QLatin1String("yes") : QLatin1String("no")); - writeTextElement(QLatin1String("title"), entry.title); - - for (int i = 0; i < bookmarkModel->rowCount(index); ++i) - writeData(bookmarkModel->index(i, 0 , index)); - writeEndElement(); - } else { - writeStartElement(QLatin1String("bookmark")); - writeAttribute(QLatin1String("href"), entry.url); - writeTextElement(QLatin1String("title"), entry.title); - writeEndElement(); - } - } -} - -// -- XbelReader - -XbelReader::XbelReader(BookmarkModel *model) - : QXmlStreamReader() - , bookmarkModel(model) -{ - TRACE_OBJ -} - -bool XbelReader::readFromFile(QIODevice *device) -{ - TRACE_OBJ - setDevice(device); - - while (!atEnd()) { - readNext(); - - if (isStartElement()) { - if (name() == QLatin1String("xbel") - && attributes().value(QLatin1String("version")) - == QLatin1String("1.0")) { - const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); - parents.append(bookmarkModel->addItem(root, true)); - readXBEL(); - bookmarkModel->setData(parents.first(), - QDate::currentDate().toString(Qt::ISODate), Qt::EditRole); - } else { - raiseError(QLatin1String("The file is not an XBEL version 1.0 file.")); - } - } - } - - return !error(); -} - -void XbelReader::readXBEL() -{ - TRACE_OBJ - while (!atEnd()) { - readNext(); - - if (isEndElement()) - break; - - if (isStartElement()) { - if (name() == QLatin1String("folder")) - readFolder(); - else if (name() == QLatin1String("bookmark")) - readBookmark(); - else - readUnknownElement(); - } - } -} - -void XbelReader::readFolder() -{ - TRACE_OBJ - parents.append(bookmarkModel->addItem(parents.last(), true)); - bookmarkModel->setData(parents.last(), - attributes().value(QLatin1String("folded")) == QLatin1String("no"), - UserRoleExpanded); - - while (!atEnd()) { - readNext(); - - if (isEndElement()) - break; - - if (isStartElement()) { - if (name() == QLatin1String("title")) { - bookmarkModel->setData(parents.last(), readElementText(), - Qt::EditRole); - } else if (name() == QLatin1String("folder")) - readFolder(); - else if (name() == QLatin1String("bookmark")) - readBookmark(); - else - readUnknownElement(); - } - } - - parents.removeLast(); -} - -void XbelReader::readBookmark() -{ - TRACE_OBJ - const QModelIndex &index = bookmarkModel->addItem(parents.last(), false); - if (BookmarkItem* item = bookmarkModel->itemFromIndex(index)) { - item->setData(UserRoleUrl, attributes().value(QLatin1String("href")) - .toString()); - } - - while (!atEnd()) { - readNext(); - - if (isEndElement()) - break; - - if (isStartElement()) { - if (name() == QLatin1String("title")) - bookmarkModel->setData(index, readElementText(), Qt::EditRole); - else - readUnknownElement(); - } - } -} - -void XbelReader::readUnknownElement() -{ - TRACE_OBJ - while (!atEnd()) { - readNext(); - - if (isEndElement()) - break; - - if (isStartElement()) - readUnknownElement(); - } -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/assistant/xbelsupport.h b/src/assistant/tools/assistant/xbelsupport.h deleted file mode 100644 index 4c2a211ad..000000000 --- a/src/assistant/tools/assistant/xbelsupport.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XBELSUPPORT_H -#define XBELSUPPORT_H - -#include -#include - -QT_FORWARD_DECLARE_CLASS(QIODevice) -QT_FORWARD_DECLARE_CLASS(QModelIndex) - -QT_BEGIN_NAMESPACE - -class BookmarkModel; - -class XbelWriter : public QXmlStreamWriter -{ -public: - XbelWriter(BookmarkModel *model); - void writeToFile(QIODevice *device); - -private: - void writeData(const QModelIndex &index); - -private: - BookmarkModel *bookmarkModel; -}; - -class XbelReader : public QXmlStreamReader -{ -public: - XbelReader(BookmarkModel *model); - bool readFromFile(QIODevice *device); - -private: - void readXBEL(); - void readFolder(); - void readBookmark(); - void readUnknownElement(); - -private: - BookmarkModel *bookmarkModel; - QList parents; -}; - -QT_END_NAMESPACE - -#endif // XBELSUPPORT_H diff --git a/src/assistant/tools/qcollectiongenerator/main.cpp b/src/assistant/tools/qcollectiongenerator/main.cpp deleted file mode 100644 index 058d4281a..000000000 --- a/src/assistant/tools/qcollectiongenerator/main.cpp +++ /dev/null @@ -1,615 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../shared/collectionconfiguration.h" -#include "../shared/helpgenerator.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -QT_USE_NAMESPACE - -class QCG { - Q_DECLARE_TR_FUNCTIONS(QCollectionGenerator) -}; - -class CollectionConfigReader : public QXmlStreamReader -{ -public: - void readData(const QByteArray &contents); - - QString title() const { return m_title; } - QString homePage() const { return m_homePage; } - QString startPage() const { return m_startPage; } - QString applicationIcon() const { return m_applicationIcon; } - QString currentFilter() const { return m_currentFilter; } - bool enableFilterFunctionality() const - { return m_enableFilterFunctionality; } - bool hideFilterFunctionality() const - { return m_hideFilterFunctionality; } - bool enableAddressBar() const { return m_enableAddressBar; } - bool hideAddressBar() const { return m_hideAddressBar; } - bool enableDocumentationManager() const - { return m_enableDocumentationManager; } - - QMap aboutMenuTexts() const - { return m_aboutMenuTexts; } - QString aboutIcon() const { return m_aboutIcon; } - QMap aboutTextFiles() const - { return m_aboutTextFiles; } - - QMap filesToGenerate() const - { return m_filesToGenerate; } - - QStringList filesToRegister() const { return m_filesToRegister; } - - QString cacheDirectory() const { return m_cacheDirectory; } - bool cacheDirRelativeToCollection() const { return m_cacheDirRelativeToCollection; } - - bool fullTextSearchFallbackEnabled() const { - return m_enableFullTextSearchFallback; - } - -private: - void raiseErrorWithLine(); - void readConfig(); - void readAssistantSettings(); - void readMenuTexts(); - void readAboutDialog(); - void readDocFiles(); - void readGenerate(); - void readFiles(); - void readRegister(); - - QString m_title; - QString m_homePage; - QString m_startPage; - QString m_applicationIcon; - QString m_currentFilter; - bool m_enableFilterFunctionality; - bool m_hideFilterFunctionality; - bool m_enableAddressBar; - bool m_hideAddressBar; - bool m_enableDocumentationManager; - QMap m_aboutMenuTexts; - QString m_aboutIcon; - QMap m_aboutTextFiles; - QMap m_filesToGenerate; - QStringList m_filesToRegister; - QString m_cacheDirectory; - bool m_cacheDirRelativeToCollection; - bool m_enableFullTextSearchFallback; -}; - -void CollectionConfigReader::raiseErrorWithLine() -{ - raiseError(QCG::tr("Unknown token at line %1.").arg(lineNumber())); -} - -void CollectionConfigReader::readData(const QByteArray &contents) -{ - m_enableFilterFunctionality = true; - m_hideFilterFunctionality = true; - m_enableAddressBar = true; - m_hideAddressBar = true; - m_enableDocumentationManager = true; - m_enableFullTextSearchFallback = false; - - addData(contents); - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("QHelpCollectionProject") - && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) - readConfig(); - else - raiseError(QCG::tr("Unknown token at line %1. " - "Expected \"QtHelpCollectionProject\".") - .arg(lineNumber())); - } - } -} - -void CollectionConfigReader::readConfig() -{ - bool ok = false; - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("assistant")) - readAssistantSettings(); - else if (name() == QLatin1String("docFiles")) - readDocFiles(); - else - raiseErrorWithLine(); - } else if (isEndElement() && name() == QLatin1String("QHelpCollectionProject")) { - ok = true; - } - } - if (!ok && !hasError()) - raiseError(QCG::tr("Missing end tags.")); -} - -void CollectionConfigReader::readAssistantSettings() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("title")) { - m_title = readElementText(); - } else if (name() == QLatin1String("homePage")) { - m_homePage = readElementText(); - } else if (name() == QLatin1String("startPage")) { - m_startPage = readElementText(); - } else if (name() == QLatin1String("currentFilter")) { - m_currentFilter = readElementText(); - } else if (name() == QLatin1String("applicationIcon")) { - m_applicationIcon = readElementText(); - } else if (name() == QLatin1String("enableFilterFunctionality")) { - if (attributes().value(QLatin1String("visible")) == QLatin1String("true")) - m_hideFilterFunctionality = false; - if (readElementText() == QLatin1String("false")) - m_enableFilterFunctionality = false; - } else if (name() == QLatin1String("enableDocumentationManager")) { - if (readElementText() == QLatin1String("false")) - m_enableDocumentationManager = false; - } else if (name() == QLatin1String("enableAddressBar")) { - if (attributes().value(QLatin1String("visible")) == QLatin1String("true")) - m_hideAddressBar = false; - if (readElementText() == QLatin1String("false")) - m_enableAddressBar = false; - } else if (name() == QLatin1String("aboutMenuText")) { - readMenuTexts(); - } else if (name() == QLatin1String("aboutDialog")) { - readAboutDialog(); - } else if (name() == "cacheDirectory") { - m_cacheDirRelativeToCollection = - attributes().value(QLatin1String("base")) - == QLatin1String("collection"); - m_cacheDirectory = readElementText(); - } else if (name() == QLatin1String("enableFullTextSearchFallback")) { - if (readElementText() == QLatin1String("true")) - m_enableFullTextSearchFallback = true; - } else { - raiseErrorWithLine(); - } - } else if (isEndElement() && name() == QLatin1String("assistant")) { - break; - } - } -} - -void CollectionConfigReader::readMenuTexts() -{ - while (!atEnd()) - { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("text")) { - QString lang = attributes().value(QLatin1String("language")).toString(); - if (lang.isEmpty()) - lang = QLatin1String("default"); - m_aboutMenuTexts.insert(lang, readElementText()); - } else { - raiseErrorWithLine(); - } - } else if (isEndElement() && name() == QLatin1String("aboutMenuText")) { - break; - } - } -} - -void CollectionConfigReader::readAboutDialog() -{ - while (!atEnd()) - { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("file")) { - QString lang = attributes().value(QLatin1String("language")).toString(); - if (lang.isEmpty()) - lang = QLatin1String("default"); - m_aboutTextFiles.insert(lang, readElementText()); - } else if (name() == QLatin1String("icon")) { - m_aboutIcon = readElementText(); - } else { - raiseErrorWithLine(); - } - } else if (isEndElement() && name() == QLatin1String("aboutDialog")) { - break; - } - } -} - -void CollectionConfigReader::readDocFiles() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("generate")) { - readGenerate(); - } else if (name() == QLatin1String("register")) { - readRegister(); - } else { - raiseErrorWithLine(); - } - } else if (isEndElement() && name() == QLatin1String("docFiles")) { - break; - } - } -} - -void CollectionConfigReader::readGenerate() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("file")) - readFiles(); - else - raiseErrorWithLine(); - } else if (isEndElement() && name() == QLatin1String("generate")) { - break; - } - } -} - -void CollectionConfigReader::readFiles() -{ - QString input; - QString output; - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("input")) - input = readElementText(); - else if (name() == QLatin1String("output")) - output = readElementText(); - else - raiseErrorWithLine(); - } else if (isEndElement() && name() == QLatin1String("file")) { - break; - } - } - if (input.isEmpty() || output.isEmpty()) { - raiseError(QCG::tr("Missing input or output file for help file generation.")); - return; - } - m_filesToGenerate.insert(input, output); -} - -void CollectionConfigReader::readRegister() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name() == QLatin1String("file")) - m_filesToRegister.append(readElementText()); - else - raiseErrorWithLine(); - } else if (isEndElement() && name() == QLatin1String("register")) { - break; - } - } -} - -namespace { - QString absoluteFileName(const QString &basePath, const QString &fileName) - { - return QFileInfo(fileName).isAbsolute() ? - fileName : basePath + QDir::separator() + fileName; - } -} - -int main(int argc, char *argv[]) -{ - QString error; - QString arg; - QString collectionFile; - QString configFile; - QString basePath; - bool showHelp = false; - bool showVersion = false; - - QCoreApplication app(argc, argv); -#ifndef Q_OS_WIN32 - QTranslator translator; - QTranslator qtTranslator; - QTranslator qt_helpTranslator; - QString sysLocale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - if (translator.load(QLatin1String("assistant_") + sysLocale, resourceDir) - && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir) - && qt_helpTranslator.load(QLatin1String("qt_help_") + sysLocale, resourceDir)) { - app.installTranslator(&translator); - app.installTranslator(&qtTranslator); - app.installTranslator(&qt_helpTranslator); - } -#endif // Q_OS_WIN32 - - for (int i=1; i [options]\n\n" - " -o Generates a collection file\n" - " called . If\n" - " this option is not specified\n" - " a default name will be used.\n" - " -v Displays the version of\n" - " qcollectiongenerator.\n\n"); - - if (showHelp) { - fputs(qPrintable(help), stdout); - return 0; - }else if (!error.isEmpty()) { - fprintf(stderr, "%s\n\n%s", qPrintable(error), qPrintable(help)); - return -1; - } - - QFile file(configFile); - if (!file.open(QIODevice::ReadOnly)) { - fputs(qPrintable(QCG::tr("Could not open %1.\n").arg(configFile)), stderr); - return -1; - } - - if (collectionFile.isEmpty()) { - QFileInfo fi(configFile); - collectionFile = basePath + QDir::separator() - + fi.baseName() + QLatin1String(".qhc"); - } - - fputs(qPrintable(QCG::tr("Reading collection config file...\n")), stdout); - CollectionConfigReader config; - config.readData(file.readAll()); - if (config.hasError()) { - fputs(qPrintable(QCG::tr("Collection config file error: %1\n") - .arg(config.errorString())), stderr); - return -1; - } - - QMap::const_iterator it = config.filesToGenerate().constBegin(); - while (it != config.filesToGenerate().constEnd()) { - fputs(qPrintable(QCG::tr("Generating help for %1...\n").arg(it.key())), stdout); - QHelpProjectData helpData; - if (!helpData.readData(absoluteFileName(basePath, it.key()))) { - fprintf(stderr, "%s\n", qPrintable(helpData.errorMessage())); - return -1; - } - - HelpGenerator helpGenerator; - if (!helpGenerator.generate(&helpData, absoluteFileName(basePath, it.value()))) { - fprintf(stderr, "%s\n", qPrintable(helpGenerator.error())); - return -1; - } - ++it; - } - - fputs(qPrintable(QCG::tr("Creating collection file...\n")), stdout); - - QFileInfo colFi(collectionFile); - if (colFi.exists()) { - if (!colFi.dir().remove(colFi.fileName())) { - fputs(qPrintable(QCG::tr("The file %1 cannot be overwritten.\n") - .arg(collectionFile)), stderr); - return -1; - } - } - - QHelpEngineCore helpEngine(collectionFile); - if (!helpEngine.setupData()) { - fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); - return -1; - } - - foreach (const QString &file, config.filesToRegister()) { - if (!helpEngine.registerDocumentation(absoluteFileName(basePath, file))) { - fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); - return -1; - } - } - if (!config.filesToRegister().isEmpty()) - CollectionConfiguration::updateLastRegisterTime(helpEngine); - - if (!config.title().isEmpty()) - CollectionConfiguration::setWindowTitle(helpEngine, config.title()); - - if (!config.homePage().isEmpty()) { - CollectionConfiguration::setDefaultHomePage(helpEngine, - config.homePage()); - } - - if (!config.startPage().isEmpty()) { - CollectionConfiguration::setLastShownPages(helpEngine, - QStringList(config.startPage())); - } - - if (!config.currentFilter().isEmpty()) { - helpEngine.setCurrentFilter(config.currentFilter()); - } - - if (!config.cacheDirectory().isEmpty()) { - CollectionConfiguration::setCacheDir(helpEngine, config.cacheDirectory(), - config.cacheDirRelativeToCollection()); - } - - CollectionConfiguration::setFilterFunctionalityEnabled(helpEngine, - config.enableFilterFunctionality()); - CollectionConfiguration::setFilterToolbarVisible(helpEngine, - !config.hideFilterFunctionality()); - CollectionConfiguration::setDocumentationManagerEnabled(helpEngine, - config.enableDocumentationManager()); - CollectionConfiguration::setAddressBarEnabled(helpEngine, - config.enableAddressBar()); - CollectionConfiguration::setAddressBarVisible(helpEngine, - !config.hideAddressBar()); - CollectionConfiguration::setCreationTime(helpEngine, - QDateTime::currentDateTime().toTime_t()); - CollectionConfiguration::setFullTextSearchFallbackEnabled(helpEngine, - config.fullTextSearchFallbackEnabled()); - - if (!config.applicationIcon().isEmpty()) { - QFile icon(absoluteFileName(basePath, config.applicationIcon())); - if (!icon.open(QIODevice::ReadOnly)) { - fputs(qPrintable(QCG::tr("Cannot open %1.\n").arg(icon.fileName())), stderr); - return -1; - } - CollectionConfiguration::setApplicationIcon(helpEngine, icon.readAll()); - } - - if (config.aboutMenuTexts().count()) { - QByteArray ba; - QDataStream s(&ba, QIODevice::WriteOnly); - QMap::const_iterator it = config.aboutMenuTexts().constBegin(); - while (it != config.aboutMenuTexts().constEnd()) { - s << it.key(); - s << it.value(); - ++it; - } - CollectionConfiguration::setAboutMenuTexts(helpEngine, ba); - } - - if (!config.aboutIcon().isEmpty()) { - QFile icon(absoluteFileName(basePath, config.aboutIcon())); - if (!icon.open(QIODevice::ReadOnly)) { - fputs(qPrintable(QCG::tr("Cannot open %1.\n").arg(icon.fileName())), stderr); - return -1; - } - CollectionConfiguration::setAboutIcon(helpEngine, icon.readAll()); - } - - if (config.aboutTextFiles().count()) { - QByteArray ba; - QDataStream s(&ba, QIODevice::WriteOnly); - QMap::const_iterator it = config.aboutTextFiles().constBegin(); - QMap imgData; - - QRegExp srcRegExp(QLatin1String("src=(\"(.+)\"|([^\"\\s]+)).*>")); - srcRegExp.setMinimal(true); - QRegExp imgRegExp(QLatin1String("(]+>)")); - imgRegExp.setMinimal(true); - - while (it != config.aboutTextFiles().constEnd()) { - s << it.key(); - QFileInfo fi(absoluteFileName(basePath, it.value())); - QFile f(fi.absoluteFilePath()); - if (!f.open(QIODevice::ReadOnly)) { - fputs(qPrintable(QCG::tr("Cannot open %1.\n").arg(f.fileName())), stderr); - return -1; - } - QByteArray data = f.readAll(); - s << data; - - QString contents = QString::fromUtf8(data); - int pos = 0; - while ((pos = imgRegExp.indexIn(contents, pos)) != -1) { - QString imgTag = imgRegExp.cap(1); - pos += imgRegExp.matchedLength(); - - if (srcRegExp.indexIn(imgTag, 0) != -1) { - QString src = srcRegExp.cap(2); - if (src.isEmpty()) - src = srcRegExp.cap(3); - - QFile img(fi.absolutePath() + QDir::separator() + src); - if (img.open(QIODevice::ReadOnly)) { - if (!imgData.contains(src)) - imgData.insert(src, img.readAll()); - } else { - fputs(qPrintable(QCG::tr("Cannot open referenced image file %1.\n") - .arg(img.fileName())), stderr); - } - } - } - ++it; - } - CollectionConfiguration::setAboutTexts(helpEngine, ba); - if (imgData.count()) { - QByteArray imageData; - QBuffer buffer(&imageData); - buffer.open(QIODevice::WriteOnly); - QDataStream out(&buffer); - out << imgData; - CollectionConfiguration::setAboutImages(helpEngine, imageData); - } - } - - return 0; -} diff --git a/src/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro b/src/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro deleted file mode 100644 index 23d32c698..000000000 --- a/src/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro +++ /dev/null @@ -1,18 +0,0 @@ -QT += xml \ - network \ - help-private -TEMPLATE = app -DESTDIR = $$QT.designer.bins -TARGET = qcollectiongenerator -CONFIG += qt \ - warn_on \ - help \ - console -CONFIG -= app_bundle -target.path = $$[QT_INSTALL_BINS] -INSTALLS += target -SOURCES += ../shared/helpgenerator.cpp \ - main.cpp \ - ../shared/collectionconfiguration.cpp -HEADERS += ../shared/helpgenerator.h \ - ../shared/collectionconfiguration.h diff --git a/src/assistant/tools/qhelpconverter/adpreader.cpp b/src/assistant/tools/qhelpconverter/adpreader.cpp deleted file mode 100644 index a0983755e..000000000 --- a/src/assistant/tools/qhelpconverter/adpreader.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "adpreader.h" - -static bool versionIsAtLeast320(const QString &version) -{ - return QRegExp("\\d.\\d\\.\\d").exactMatch(version) - && (version[0] > '3' || (version[0] == '3' && version[2] >= '2')); -} - -QT_BEGIN_NAMESPACE - -void AdpReader::readData(const QByteArray &contents) -{ - clear(); - m_contents.clear(); - m_keywords.clear(); - m_properties.clear(); - m_files.clear(); - addData(contents); - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name().toString().toLower() == QLatin1String("assistantconfig") - && versionIsAtLeast320(attributes().value(QLatin1String("version")).toString())) { - readProject(); - } else if (name().toString().toLower() == QLatin1String("dcf")) { - QString ref = attributes().value(QLatin1String("ref")).toString(); - addFile(ref); - m_contents.append(ContentItem(attributes().value(QLatin1String("title")).toString(), - ref, 0)); - readDCF(); - } else { - raiseError(); - } - } - } -} - -QList AdpReader::contents() const -{ - return m_contents; -} - -QList AdpReader::keywords() const -{ - return m_keywords; -} - -QSet AdpReader::files() const -{ - return m_files; -} - -QMap AdpReader::properties() const -{ - return m_properties; -} - -void AdpReader::readProject() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - QString s = name().toString().toLower(); - if (s == QLatin1String("profile")) { - readProfile(); - } else if (s == QLatin1String("dcf")) { - QString ref = attributes().value(QLatin1String("ref")).toString(); - addFile(ref); - m_contents.append(ContentItem(attributes().value(QLatin1String("title")).toString(), - ref, 0)); - readDCF(); - } else { - raiseError(); - } - } - } -} - -void AdpReader::readProfile() -{ - while (!atEnd()) { - readNext(); - if (isStartElement()) { - if (name().toString().toLower() == QLatin1String("property")) { - QString prop = attributes().value(QLatin1String("name")).toString().toLower(); - m_properties[prop] = readElementText(); - } else { - raiseError(); - } - } else if (isEndElement()) { - break; - } - } -} - -void AdpReader::readDCF() -{ - int depth = 0; - while (!atEnd()) { - readNext(); - QString str = name().toString().toLower(); - if (isStartElement()) { - if (str == QLatin1String("section")) { - QString ref = attributes().value(QLatin1String("ref")).toString(); - addFile(ref); - m_contents.append(ContentItem(attributes().value(QLatin1String("title")).toString(), - ref, ++depth)); - } else if (str == QLatin1String("keyword")) { - QString ref = attributes().value(QLatin1String("ref")).toString(); - addFile(ref); - m_keywords.append(KeywordItem(readElementText(), ref)); - } else { - raiseError(); - } - } else if (isEndElement()) { - if (str == QLatin1String("section")) - --depth; - else if (str == QLatin1String("dcf")) - break; - } - } -} - -void AdpReader::addFile(const QString &file) -{ - QString s = file; - if (s.startsWith(QLatin1String("./"))) - s = s.mid(2); - int i = s.indexOf(QLatin1Char('#')); - if (i > -1) - s = s.left(i); - if (!m_files.contains(s)) - m_files.insert(s); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/adpreader.h b/src/assistant/tools/qhelpconverter/adpreader.h deleted file mode 100644 index f0b6ae214..000000000 --- a/src/assistant/tools/qhelpconverter/adpreader.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef ADPREADER_H -#define ADPREADER_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -struct ContentItem { - ContentItem(const QString &t, const QString &r, int d) - : title(t), reference(r), depth(d) {} - QString title; - QString reference; - int depth; -}; - -struct KeywordItem { - KeywordItem(const QString &k, const QString &r) - : keyword(k), reference(r) {} - QString keyword; - QString reference; -}; - -class AdpReader : public QXmlStreamReader -{ -public: - void readData(const QByteArray &contents); - QList contents() const; - QList keywords() const; - QSet files() const; - - QMap properties() const; - -private: - void readProject(); - void readProfile(); - void readDCF(); - void addFile(const QString &file); - - QMap m_properties; - QList m_contents; - QList m_keywords; - QSet m_files; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/assistant-128.png b/src/assistant/tools/qhelpconverter/assistant-128.png deleted file mode 100644 index f05949f6d..000000000 Binary files a/src/assistant/tools/qhelpconverter/assistant-128.png and /dev/null differ diff --git a/src/assistant/tools/qhelpconverter/assistant.png b/src/assistant/tools/qhelpconverter/assistant.png deleted file mode 100644 index ea4d1e70c..000000000 Binary files a/src/assistant/tools/qhelpconverter/assistant.png and /dev/null differ diff --git a/src/assistant/tools/qhelpconverter/conversionwizard.cpp b/src/assistant/tools/qhelpconverter/conversionwizard.cpp deleted file mode 100644 index 0a80a0e71..000000000 --- a/src/assistant/tools/qhelpconverter/conversionwizard.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include "conversionwizard.h" -#include "inputpage.h" -#include "generalpage.h" -#include "filterpage.h" -#include "identifierpage.h" -#include "pathpage.h" -#include "filespage.h" -#include "outputpage.h" -#include "finishpage.h" -#include "qhpwriter.h" -#include "qhcpwriter.h" -#include "helpwindow.h" - -QT_BEGIN_NAMESPACE - -ConversionWizard::ConversionWizard() -{ - setWindowIcon(QIcon(QLatin1String(":/trolltech/qhelpconverter/assistant.png"))); - setWindowTitle(tr("Help Conversion Wizard")); - setPixmap(QWizard::WatermarkPixmap, - QPixmap(QLatin1String(":/trolltech/qhelpconverter/assistant-128.png"))) ; - setOptions(QWizard::IndependentPages|QWizard::NoBackButtonOnLastPage - |QWizard::HaveHelpButton); - - m_inputPage = new InputPage(&m_adpReader); - setPage(Input_Page, m_inputPage); - - m_generalPage = new GeneralPage(); - setPage(General_Page, m_generalPage); - - m_filterPage = new FilterPage(); - setPage(Filter_Page, m_filterPage); - m_filterPage->setMaximumHeight(240); - - m_identifierPage = new IdentifierPage(); - setPage(Identifier_Page, m_identifierPage); - - m_pathPage = new PathPage(); - setPage(Path_Page, m_pathPage); - m_pathPage->setMaximumHeight(240); - - m_filesPage = new FilesPage(); - setPage(Files_Page, m_filesPage); - m_filesPage->setMaximumHeight(240); - - m_outputPage = new OutputPage(); - setPage(Output_Page, m_outputPage); - m_outputPage->setMaximumHeight(240); - - m_finishPage = new FinishPage(); - setPage(Finish_Page, m_finishPage); - m_finishPage->setMaximumHeight(240); - - connect(this, SIGNAL(currentIdChanged(int)), - this, SLOT(pageChanged(int))); - - m_helpWindow = 0; - qApp->installEventFilter(this); - - QAbstractButton *btn = button(QWizard::HelpButton); - btn->setCheckable(true); - connect(btn, SIGNAL(toggled(bool)), this, SLOT(showHelp(bool))); -} - -void ConversionWizard::setAdpFileName(const QString &fileName) -{ - setField(QLatin1String("adpFileName"), fileName); -} - -void ConversionWizard::initializePage(int id) -{ - switch (id) { - case Path_Page: { - QFileInfo fi(field(QLatin1String("adpFileName")).toString()); - m_pathPage->setPath(fi.absolutePath()); - break; - } - case Output_Page: { - QFileInfo fi(field(QLatin1String("adpFileName")).toString()); - m_outputPage->setPath(fi.absolutePath()); - setField(QLatin1String("ProjectFileName"), fi.baseName() - + QLatin1String(".qhp")); - setField(QLatin1String("CollectionFileName"), fi.baseName() - + QLatin1String(".qhcp")); - break; - } - } -} - -void ConversionWizard::pageChanged(int id) -{ - if (id == Files_Page) { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_files.clear(); - QFileInfo fi(field(QLatin1String("adpFileName")).toString()); - QDir rootDir = fi.absolutePath(); - foreach (const QString &p, m_pathPage->paths()) { - QDir dir(p); - QString rel = rootDir.relativeFilePath(dir.absolutePath()); - if (!rel.isEmpty()) - rel.append(QLatin1Char('/')); - foreach (const QString &f, dir.entryList(m_pathPage->filters())) - m_files.append(rel + f); - } - m_filesPage->setFilesToRemove(getUnreferencedFiles(m_files)); - QApplication::restoreOverrideCursor(); - } else if (id == Output_Page) { - m_outputPage->setCollectionComponentEnabled( - !m_adpReader.properties().isEmpty()); - } else if (id == Finish_Page) { - QTimer::singleShot(300, this, SLOT(convert())); - } -} - -void ConversionWizard::showHelp(bool toggle) -{ - int w = 180; - int h = 180; - if (!m_helpWindow) { - m_helpWindow = new HelpWindow(this); - m_helpWindow->setMaximumWidth(w); - m_helpWindow->setMaximumHeight(h); - m_helpWindow->setMinimumHeight(h); - } - - if (toggle) { - m_helpWindow->setHelp(currentPage()->objectName()); - QAbstractButton *btn = button(QWizard::HelpButton); - QPoint p = btn->pos(); - int x = p.x(); - if (btn->pos().x() > w) - x = p.x() + btn->width() - w; - m_helpWindow->move(x, p.y()-h); - m_helpWindow->show(); - } else { - m_helpWindow->hide(); - } -} - -bool ConversionWizard::eventFilter(QObject *obj, QEvent *e) -{ - if (m_helpWindow && m_helpWindow->isVisible()) { - if (obj != button(QWizard::HelpButton) - && e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast(e); - if (!m_helpWindow->geometry().contains(mapFromParent(me->globalPos()))) { - m_helpWindow->hide(); - button(QWizard::HelpButton)->setChecked(false); - } - } else if (e->type() == QEvent::KeyPress) { - m_helpWindow->hide(); - button(QWizard::HelpButton)->setChecked(false); - } - } - return QWizard::eventFilter(obj, e); -} - -QStringList ConversionWizard::getUnreferencedFiles(const QStringList &files) -{ - QStringList lst; - QSet adpFiles = m_adpReader.files(); - foreach (const QString &s, files) { - if (!adpFiles.contains(s)) - lst.append(s); - } - return lst; -} - -void ConversionWizard::convert() -{ - QFileInfo fi(field(QLatin1String("adpFileName")).toString()); - m_finishPage->appendMessage(tr("Converting %1...") - .arg(fi.fileName())); - QApplication::setOverrideCursor(Qt::WaitCursor); - QString qhpFileName = field(QLatin1String("ProjectFileName")).toString(); - QhpWriter qhpWriter(field(QLatin1String("namespaceName")).toString(), - field(QLatin1String("virtualFolder")).toString()); - qhpWriter.setAdpReader(&m_adpReader); - qhpWriter.setFilterAttributes(m_filterPage->filterAttributes()); - qhpWriter.setCustomFilters(m_filterPage->customFilters()); - - foreach (const QString &f, m_filesPage->filesToRemove()) - m_files.removeAll(f); - qhpWriter.setFiles(m_files); - - if (field(QLatin1String("createIdentifier")).toBool()) { - if (field(QLatin1String("fileNamePrefix")).toBool()) - qhpWriter.generateIdentifiers(QhpWriter::FilePrefix); - else - qhpWriter.generateIdentifiers(QhpWriter::GlobalPrefix, - field(QLatin1String("globalPrefix")).toString()); - } else { - qhpWriter.generateIdentifiers(QhpWriter::SkipAll); - } - - qhpWriter.writeFile(fi.absolutePath() + QDir::separator() - + qhpFileName); - - m_finishPage->appendMessage(tr("Writing help collection file...")); - - if (!m_adpReader.properties().isEmpty()) { - QhcpWriter qhcpWriter; - qhcpWriter.setHelpProjectFile(qhpFileName); - qhcpWriter.setProperties(m_adpReader.properties()); - qhcpWriter.setTitlePath(QLatin1String("qthelp://") - + field(QLatin1String("namespaceName")).toString() - + QLatin1String("/") - +field(QLatin1String("virtualFolder")).toString()); - qhcpWriter.writeFile(fi.absolutePath() + QDir::separator() - + field(QLatin1String("CollectionFileName")).toString()); - } - - m_finishPage->appendMessage(tr("Done.")); - QApplication::restoreOverrideCursor(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/conversionwizard.h b/src/assistant/tools/qhelpconverter/conversionwizard.h deleted file mode 100644 index ff66d271e..000000000 --- a/src/assistant/tools/qhelpconverter/conversionwizard.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CONVERSIONWIZARD_H -#define CONVERSIONWIZARD_H - -#include -#include "adpreader.h" - -QT_BEGIN_NAMESPACE - -class InputPage; -class GeneralPage; -class FilterPage; -class IdentifierPage; -class PathPage; -class FilesPage; -class OutputPage; -class FinishPage; -class HelpWindow; - -class ConversionWizard : public QWizard -{ - Q_OBJECT - -public: - ConversionWizard(); - void setAdpFileName(const QString &fileName); - -private slots: - void pageChanged(int id); - void showHelp(bool toggle); - void convert(); - -private: - enum Pages {Input_Page, General_Page, Filter_Page, - Identifier_Page, Path_Page, Files_Page, Output_Page, - Finish_Page}; - void initializePage(int id); - QStringList getUnreferencedFiles(const QStringList &files); - bool eventFilter(QObject *obj, QEvent *e); - - AdpReader m_adpReader; - InputPage *m_inputPage; - GeneralPage *m_generalPage; - FilterPage *m_filterPage; - IdentifierPage *m_identifierPage; - PathPage *m_pathPage; - FilesPage *m_filesPage; - OutputPage *m_outputPage; - FinishPage *m_finishPage; - QStringList m_files; - HelpWindow *m_helpWindow; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/doc/filespage.html b/src/assistant/tools/qhelpconverter/doc/filespage.html deleted file mode 100644 index a7aac18da..000000000 --- a/src/assistant/tools/qhelpconverter/doc/filespage.html +++ /dev/null @@ -1,8 +0,0 @@ - - -

Sometimes it can happen that the previously specified paths contain -more or other files than actually needed for the documentation.

-

This page lists all files which are likely to be unused because they -are neither referenced by any keyword nor be the TOC.

- - diff --git a/src/assistant/tools/qhelpconverter/doc/filterpage.html b/src/assistant/tools/qhelpconverter/doc/filterpage.html deleted file mode 100644 index 7b3781bd5..000000000 --- a/src/assistant/tools/qhelpconverter/doc/filterpage.html +++ /dev/null @@ -1,13 +0,0 @@ - - -

The help system offers the possibility to filter all installed documentations -for certain attributes. Commonly specified attributes are e.g. the company -and product name as well as the product version.

-

The help engine and Assistant use custom filters to do the actual -documentation filtering. A custom filter is basically just a alias name for a -list of filter attributes. So, if e.g. the custom filter "MyFilter" lists -the attributes "mycompany, myproduct" then only the documentation with those -attributes will be shown.

-

Warning: The filter attributes are case sensitive!

- - diff --git a/src/assistant/tools/qhelpconverter/doc/generalpage.html b/src/assistant/tools/qhelpconverter/doc/generalpage.html deleted file mode 100644 index 8d106bec1..000000000 --- a/src/assistant/tools/qhelpconverter/doc/generalpage.html +++ /dev/null @@ -1,10 +0,0 @@ - - -

The namespace is needed to identify this documentation when having -several documentation sets installed in a collection.

-

Virtual folders are used to enable file references between all -documents. Thereby, the virtual folder acts as the root path of all -documents, even if those are part of different documentation sets, -meaning listed under different namespaces.

- - diff --git a/src/assistant/tools/qhelpconverter/doc/identifierpage.html b/src/assistant/tools/qhelpconverter/doc/identifierpage.html deleted file mode 100644 index 952b88de8..000000000 --- a/src/assistant/tools/qhelpconverter/doc/identifierpage.html +++ /dev/null @@ -1,17 +0,0 @@ - - -

Identifiers are mostly used to make keywords unique, but they can also -be used to specify keywords which should not be shown in the index. Identifiers -are especially help full when using context sensitive help and one keyword has -more links assigned to it.

-

E.g. consider the keyword "replace" in Qt. It is -included, among others, in QString and QList. To be able to retrieve the proper -documentation, there is an identifier "QString::replace" and one -"QList::replace".

-

A global prefix, e.g. "MyApp::" is set for all keywords independent -where they are located. When inheriting the prefix from the file name, -the keywords get the prefix "[filename]::" where the file name is taken from the -reference of the keyword. The file name is just the base name, i.e. without any -directory or extension.

- - diff --git a/src/assistant/tools/qhelpconverter/doc/inputpage.html b/src/assistant/tools/qhelpconverter/doc/inputpage.html deleted file mode 100644 index 4054c5472..000000000 --- a/src/assistant/tools/qhelpconverter/doc/inputpage.html +++ /dev/null @@ -1,7 +0,0 @@ - - -

Both, a .adp or .dcf file can be specified. If an .adp file is detected, -the wizard generates a Qt help collection file in addition to the help -project file.

- - diff --git a/src/assistant/tools/qhelpconverter/doc/outputpage.html b/src/assistant/tools/qhelpconverter/doc/outputpage.html deleted file mode 100644 index 332ef69fc..000000000 --- a/src/assistant/tools/qhelpconverter/doc/outputpage.html +++ /dev/null @@ -1,7 +0,0 @@ - - -

The specified output files will be located in the same directory as the -.adp or .dcf file. The collection file will only be generated if the input -file was an .adp file.

- - diff --git a/src/assistant/tools/qhelpconverter/doc/pathpage.html b/src/assistant/tools/qhelpconverter/doc/pathpage.html deleted file mode 100644 index 95449b3c3..000000000 --- a/src/assistant/tools/qhelpconverter/doc/pathpage.html +++ /dev/null @@ -1,8 +0,0 @@ - - -

The new help system uses, in contrast to the old Qt Assistant, compressed -help files containing all files (html files, images, stylesheets, ...) -necessary to display the documentation correctly.

-

To be able to find all those files, the source paths have to be given.

- - diff --git a/src/assistant/tools/qhelpconverter/filespage.cpp b/src/assistant/tools/qhelpconverter/filespage.cpp deleted file mode 100644 index e30ec42ef..000000000 --- a/src/assistant/tools/qhelpconverter/filespage.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "filespage.h" - -QT_BEGIN_NAMESPACE - -FilesPage::FilesPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("Unreferenced Files")); - setSubTitle(tr("Remove files which are neither referenced " - "by a keyword nor by the TOC.")); - - m_ui.setupUi(this); - m_ui.fileListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); - m_ui.fileListWidget->installEventFilter(this); - connect(m_ui.removeButton, SIGNAL(clicked()), - this, SLOT(removeFile())); - connect(m_ui.removeAllButton, SIGNAL(clicked()), - this, SLOT(removeAllFiles())); - - m_ui.fileLabel->setText(tr("

Warning: " - "When removing images or stylesheets, be aware that those files " - "are not directly referenced by the .adp or .dcf " - "file.

")); -} - -void FilesPage::setFilesToRemove(const QStringList &files) -{ - m_files = files; - m_ui.fileListWidget->clear(); - m_ui.fileListWidget->addItems(files); -} - -QStringList FilesPage::filesToRemove() const -{ - return m_filesToRemove; -} - -void FilesPage::removeFile() -{ - int row = m_ui.fileListWidget->currentRow() - - m_ui.fileListWidget->selectedItems().count() + 1; - foreach (const QListWidgetItem *item, m_ui.fileListWidget->selectedItems()) { - m_filesToRemove.append(item->text()); - delete item; - } - if (m_ui.fileListWidget->count() > row && row >= 0) - m_ui.fileListWidget->setCurrentRow(row); - else - m_ui.fileListWidget->setCurrentRow(m_ui.fileListWidget->count()); -} - -void FilesPage::removeAllFiles() -{ - m_ui.fileListWidget->clear(); - m_filesToRemove = m_files; -} - -bool FilesPage::eventFilter(QObject *obj, QEvent *event) -{ - if (obj == m_ui.fileListWidget && event->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(event); - if (ke->key() == Qt::Key_Delete) { - removeFile(); - return true; - } - } - return QWizardPage::eventFilter(obj, event); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/filespage.h b/src/assistant/tools/qhelpconverter/filespage.h deleted file mode 100644 index 07022e898..000000000 --- a/src/assistant/tools/qhelpconverter/filespage.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILESPAGE_H -#define FILESPAGE_H - -#include -#include "ui_filespage.h" - -QT_BEGIN_NAMESPACE - -class FilesPage : public QWizardPage -{ - Q_OBJECT - -public: - FilesPage(QWidget *parent = 0); - void setFilesToRemove(const QStringList &files); - QStringList filesToRemove() const; - -private slots: - void removeFile(); - void removeAllFiles(); - -private: - bool eventFilter(QObject *obj, QEvent *event); - - Ui::FilesPage m_ui; - QStringList m_files; - QStringList m_filesToRemove; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/filespage.ui b/src/assistant/tools/qhelpconverter/filespage.ui deleted file mode 100644 index d308b9664..000000000 --- a/src/assistant/tools/qhelpconverter/filespage.ui +++ /dev/null @@ -1,79 +0,0 @@ - - FilesPage - - - - 0 - 0 - 417 - 242 - - - - Form - - - - - - Files: - - - true - - - - - - - - - - - 0 - 0 - - - - Remove - - - - - - - Remove All - - - - - - - Qt::Vertical - - - - 75 - 16 - - - - - - - - Qt::Vertical - - - - 20 - 31 - - - - - - - - - diff --git a/src/assistant/tools/qhelpconverter/filterpage.cpp b/src/assistant/tools/qhelpconverter/filterpage.cpp deleted file mode 100644 index efe32c79e..000000000 --- a/src/assistant/tools/qhelpconverter/filterpage.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "filterpage.h" - -QT_BEGIN_NAMESPACE - -FilterPage::FilterPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("Filter Settings")); - setSubTitle(tr("Specify the filter attributes for the " - "documentation. If filter attributes are used, " - "also define a custom filter for it. Both the " - "filter attributes and the custom filters are " - "optional.")); - - m_ui.setupUi(this); - m_ui.customFilterWidget->headerItem()->setText(0, tr("Filter Name")); - m_ui.customFilterWidget->headerItem()->setText(1, tr("Filter Attributes")); - m_ui.customFilterWidget->setRootIsDecorated(false); - m_ui.removeButton->setDisabled(true); - connect(m_ui.addButton, SIGNAL(clicked()), - this, SLOT(addFilter())); - connect(m_ui.removeButton, SIGNAL(clicked()), - this, SLOT(removeFilter())); -} - -bool FilterPage::validatePage() -{ - m_filterAttributes.clear(); - foreach (const QString &f, m_ui.filterLineEdit->text().split(QLatin1Char(','))) { - if (!f.trimmed().isEmpty()) - m_filterAttributes.append(f.trimmed()); - } - - m_customFilters.clear(); - QSet names; - QSet atts; - QString str; - CustomFilter customFilter; - QTreeWidgetItem *item = 0; - for (int i=0; itopLevelItemCount(); ++i) { - item = m_ui.customFilterWidget->topLevelItem(i); - str = item->text(0); - if (str.isEmpty() || names.contains(str)) { - QMessageBox::critical(this, tr("Custom Filters"), - tr("The custom filter \'%1\' is defined multiple times.") - .arg(str)); - return false; - } - names.insert(str); - customFilter.name = str; - - str.clear(); - QStringList lst; - foreach (const QString &s, item->text(1).split(QLatin1Char(','))) { - const QString st = s.trimmed(); - if (!st.isEmpty()) { - str += QLatin1Char(',') + st; - lst.append(st); - } - } - if (atts.contains(str)) { - QMessageBox::critical(this, tr("Custom Filters"), - tr("The attributes for custom filter \'%1\' are defined multiple times.") - .arg(customFilter.name)); - return false; - } - atts.insert(str); - customFilter.filterAttributes = lst; - m_customFilters.append(customFilter); - } - return true; -} - -QStringList FilterPage::filterAttributes() const -{ - return m_filterAttributes; -} - -QList FilterPage::customFilters() const -{ - return m_customFilters; -} - -void FilterPage::addFilter() -{ - QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.customFilterWidget); - item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsEditable|Qt::ItemIsSelectable); - item->setText(0, tr("unfiltered", "list of available documentation")); - item->setText(1, QLatin1String("")); - m_ui.customFilterWidget->editItem(item, 0); - m_ui.removeButton->setDisabled(false); -} - -void FilterPage::removeFilter() -{ - QModelIndex idx = m_ui.customFilterWidget->currentIndex(); - if (!idx.isValid()) - return; - QTreeWidgetItem *item = m_ui.customFilterWidget->takeTopLevelItem(idx.row()); - delete item; - if (!m_ui.customFilterWidget->topLevelItemCount()) - m_ui.removeButton->setDisabled(true); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/filterpage.h b/src/assistant/tools/qhelpconverter/filterpage.h deleted file mode 100644 index 336c650de..000000000 --- a/src/assistant/tools/qhelpconverter/filterpage.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILTERPAGE_H -#define FILTERPAGE_H - -#include -#include "ui_filterpage.h" - -QT_BEGIN_NAMESPACE - -struct CustomFilter -{ - QString name; - QStringList filterAttributes; -}; - -class FilterPage : public QWizardPage -{ - Q_OBJECT - -public: - FilterPage(QWidget *parent = 0); - QStringList filterAttributes() const; - QList customFilters() const; - -private slots: - void addFilter(); - void removeFilter(); - -private: - bool validatePage(); - - Ui::FilterPage m_ui; - QStringList m_filterAttributes; - QList m_customFilters; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/filterpage.ui b/src/assistant/tools/qhelpconverter/filterpage.ui deleted file mode 100644 index 7cda3d9be..000000000 --- a/src/assistant/tools/qhelpconverter/filterpage.ui +++ /dev/null @@ -1,125 +0,0 @@ - - FilterPage - - - - 0 - 0 - 419 - 243 - - - - Form - - - - - - Filter attributes for current documentation (comma separated list): - - - - - - - - - - Custom Filters - - - - - - 2 - - - - 1 - - - - - 2 - - - - - - - - Add - - - - - - - Remove - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - - diff --git a/src/assistant/tools/qhelpconverter/finishpage.cpp b/src/assistant/tools/qhelpconverter/finishpage.cpp deleted file mode 100644 index cdbd634e6..000000000 --- a/src/assistant/tools/qhelpconverter/finishpage.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include - -#include "finishpage.h" - -QT_BEGIN_NAMESPACE - -FinishPage::FinishPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("Converting File")); - setSubTitle(tr("Creating the new Qt help files from the old ADP file.")); - setFinalPage(true); - - QVBoxLayout *layout = new QVBoxLayout(this); - layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, - QSizePolicy::Fixed)); - - m_textEdit = new QTextEdit(); - layout->addWidget(m_textEdit); - - layout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, - QSizePolicy::Expanding)); -} - -void FinishPage::appendMessage(const QString &msg) -{ - m_textEdit->append(msg); - qApp->processEvents(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/finishpage.h b/src/assistant/tools/qhelpconverter/finishpage.h deleted file mode 100644 index 41dec54ca..000000000 --- a/src/assistant/tools/qhelpconverter/finishpage.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FINISHPAGE_H -#define FINISHPAGE_H - -#include - -QT_BEGIN_NAMESPACE - -class QTextEdit; - -class FinishPage : public QWizardPage -{ - Q_OBJECT - -public: - FinishPage(QWidget *parent = 0); - void appendMessage(const QString &msg); - -private: - QTextEdit *m_textEdit; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/generalpage.cpp b/src/assistant/tools/qhelpconverter/generalpage.cpp deleted file mode 100644 index ad0171270..000000000 --- a/src/assistant/tools/qhelpconverter/generalpage.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "generalpage.h" - -QT_BEGIN_NAMESPACE - -GeneralPage::GeneralPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("General Settings")); - setSubTitle(tr("Specify the namespace and the virtual " - "folder for the documentation.")); - - m_ui.setupUi(this); - connect(m_ui.namespaceLineEdit, SIGNAL(textChanged(QString)), - this, SIGNAL(completeChanged())); - connect(m_ui.folderLineEdit, SIGNAL(textChanged(QString)), - this, SIGNAL(completeChanged())); - - m_ui.namespaceLineEdit->setText(QLatin1String("mycompany.com")); - m_ui.folderLineEdit->setText(QLatin1String("product_1.0")); - - registerField(QLatin1String("namespaceName"), m_ui.namespaceLineEdit); - registerField(QLatin1String("virtualFolder"), m_ui.folderLineEdit); -} - -bool GeneralPage::isComplete() const -{ - if (m_ui.namespaceLineEdit->text().isEmpty() - || m_ui.folderLineEdit->text().isEmpty()) - return false; - return true; -} - -bool GeneralPage::validatePage() -{ - QString s = m_ui.namespaceLineEdit->text(); - if (s.contains(QLatin1Char('/')) || s.contains(QLatin1Char('\\'))) { - QMessageBox::critical(this, tr("Namespace Error"), - tr("The namespace contains some invalid characters.")); - return false; - } - s = m_ui.folderLineEdit->text(); - if (s.contains(QLatin1Char('/')) || s.contains(QLatin1Char('\\'))) { - QMessageBox::critical(this, tr("Virtual Folder Error"), - tr("The virtual folder contains some invalid characters.")); - return false; - } - return true; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/generalpage.h b/src/assistant/tools/qhelpconverter/generalpage.h deleted file mode 100644 index c9a8b2452..000000000 --- a/src/assistant/tools/qhelpconverter/generalpage.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GENERALPAGE_H -#define GENERALPAGE_H - -#include -#include "ui_generalpage.h" - -QT_BEGIN_NAMESPACE - -class GeneralPage : public QWizardPage -{ - Q_OBJECT - -public: - GeneralPage(QWidget *parent = 0); - -private: - bool validatePage(); - bool isComplete() const; - - Ui::GeneralPage m_ui; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/generalpage.ui b/src/assistant/tools/qhelpconverter/generalpage.ui deleted file mode 100644 index 9c2babb0a..000000000 --- a/src/assistant/tools/qhelpconverter/generalpage.ui +++ /dev/null @@ -1,69 +0,0 @@ - - GeneralPage - - - - 0 - 0 - 417 - 243 - - - - Form - - - - - - Namespace: - - - - - - - - - - Virtual Folder: - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - diff --git a/src/assistant/tools/qhelpconverter/helpwindow.cpp b/src/assistant/tools/qhelpconverter/helpwindow.cpp deleted file mode 100644 index 5212092f7..000000000 --- a/src/assistant/tools/qhelpconverter/helpwindow.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "helpwindow.h" - -QT_BEGIN_NAMESPACE - -HelpWindow::HelpWindow(QWidget *parent) - : QWidget(parent, 0) -{ - setAutoFillBackground(true); - QVBoxLayout *layout = new QVBoxLayout(this); - layout->setMargin(0); - QFrame *frame = new QFrame(this); - QPalette p = palette(); - p.setColor(QPalette::Background, Qt::white); - setPalette(p); - frame->setFrameStyle(QFrame::Box | QFrame::Plain); - layout->addWidget(frame); - - layout = new QVBoxLayout(frame); - layout->setMargin(2); - QLabel *l = new QLabel(tr("
Wizard Assistant
")); - layout->addWidget(l); - m_textEdit = new QTextEdit(); - m_textEdit->setFrameStyle(QFrame::NoFrame); - m_textEdit->setReadOnly(true); - layout->addWidget(m_textEdit); -} - -void HelpWindow::setHelp(const QString &topic) -{ - QLatin1String fileStr(":/trolltech/qhelpconverter/doc/%1.html"); - QFile f(QString(fileStr).arg(topic.toLower())); - f.open(QIODevice::ReadOnly); - QTextStream s(&f); - m_textEdit->setText(s.readAll()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/helpwindow.h b/src/assistant/tools/qhelpconverter/helpwindow.h deleted file mode 100644 index 9a45f06e0..000000000 --- a/src/assistant/tools/qhelpconverter/helpwindow.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPWINDOW_H -#define HELPWINDOW_H - -#include - -QT_BEGIN_NAMESPACE - -class QTextEdit; - -class HelpWindow : public QWidget -{ - Q_OBJECT - -public: - HelpWindow(QWidget *parent = 0); - void setHelp(const QString &topic); - -private: - QTextEdit *m_textEdit; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/identifierpage.cpp b/src/assistant/tools/qhelpconverter/identifierpage.cpp deleted file mode 100644 index fb8310a61..000000000 --- a/src/assistant/tools/qhelpconverter/identifierpage.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "identifierpage.h" - -QT_BEGIN_NAMESPACE - -IdentifierPage::IdentifierPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("Identifiers")); - setSubTitle(tr("This page allows you to create identifiers from " - "the keywords found in the .adp or .dcf file.")); - - m_ui.setupUi(this); - - connect(m_ui.identifierCheckBox, SIGNAL(toggled(bool)), - this, SLOT(setupButtons(bool))); - - registerField(QLatin1String("createIdentifier"), m_ui.identifierCheckBox); - registerField(QLatin1String("globalPrefix"), m_ui.prefixLineEdit); - registerField(QLatin1String("fileNamePrefix"), m_ui.fileNameButton); -} - -void IdentifierPage::setupButtons(bool checked) -{ - m_ui.globalButton->setEnabled(checked); - m_ui.fileNameButton->setEnabled(checked); - m_ui.prefixLineEdit->setEnabled(checked - && m_ui.globalButton->isChecked()); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/identifierpage.h b/src/assistant/tools/qhelpconverter/identifierpage.h deleted file mode 100644 index 05de35ca9..000000000 --- a/src/assistant/tools/qhelpconverter/identifierpage.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef IDENTIFIERPAGE_H -#define IDENTIFIERPAGE_H - -#include -#include "ui_identifierpage.h" - -QT_BEGIN_NAMESPACE - -class IdentifierPage : public QWizardPage -{ - Q_OBJECT - -public: - IdentifierPage(QWidget *parent = 0); - -private slots: - void setupButtons(bool checked); - -private: - Ui::IdentifierPage m_ui; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/identifierpage.ui b/src/assistant/tools/qhelpconverter/identifierpage.ui deleted file mode 100644 index cd0df7563..000000000 --- a/src/assistant/tools/qhelpconverter/identifierpage.ui +++ /dev/null @@ -1,132 +0,0 @@ - - IdentifierPage - - - - 0 - 0 - 417 - 242 - - - - Form - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Create identifiers - - - - - - - Qt::Horizontal - - - - 161 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 30 - 20 - - - - - - - - false - - - Global prefix: - - - true - - - - - - - false - - - - - - - false - - - Inherit prefix from file names - - - - - - - Qt::Vertical - - - - 20 - 31 - - - - - - - - - - globalButton - toggled(bool) - prefixLineEdit - setEnabled(bool) - - - 122 - 72 - - - 161 - 71 - - - - - diff --git a/src/assistant/tools/qhelpconverter/inputpage.cpp b/src/assistant/tools/qhelpconverter/inputpage.cpp deleted file mode 100644 index 9abbbe74b..000000000 --- a/src/assistant/tools/qhelpconverter/inputpage.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "inputpage.h" -#include "adpreader.h" - -QT_BEGIN_NAMESPACE - -InputPage::InputPage(AdpReader *reader, QWidget *parent) - : QWizardPage(parent) -{ - m_adpReader = reader; - setTitle(tr("Input File")); - setSubTitle(tr("Specify the .adp or .dcf file you want " - "to convert to the new Qt help project format and/or " - "collection format.")); - - m_ui.setupUi(this); - connect(m_ui.browseButton, SIGNAL(clicked()), - this, SLOT(getFileName())); - - registerField(QLatin1String("adpFileName"), m_ui.fileLineEdit); -} - -void InputPage::getFileName() -{ - QString f = QFileDialog::getOpenFileName(this, tr("Open file"), QString(), - tr("Qt Help Files (*.adp *.dcf)")); - if (!f.isEmpty()) - m_ui.fileLineEdit->setText(f); -} - -bool InputPage::validatePage() -{ - QFile f(m_ui.fileLineEdit->text().trimmed()); - if (!f.exists() || !f.open(QIODevice::ReadOnly)) { - QMessageBox::critical(this, tr("File Open Error"), - tr("The specified file could not be opened!")); - return false; - } - - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - m_adpReader->readData(f.readAll()); - QApplication::restoreOverrideCursor(); - if (m_adpReader->hasError()) { - QMessageBox::critical(this, tr("File Parsing Error"), - tr("Parsing error in line %1!").arg(m_adpReader->lineNumber())); - return false; - } - - return true; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/inputpage.h b/src/assistant/tools/qhelpconverter/inputpage.h deleted file mode 100644 index 185b7b2b2..000000000 --- a/src/assistant/tools/qhelpconverter/inputpage.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef INPUTPAGE_H -#define INPUTPAGE_H - -#include -#include "ui_inputpage.h" - -QT_BEGIN_NAMESPACE - -class AdpReader; - -class InputPage : public QWizardPage -{ - Q_OBJECT - -public: - explicit InputPage(AdpReader *reader, QWidget *parent = 0); - -private slots: - void getFileName(); - -private: - bool validatePage(); - - Ui::InputPage m_ui; - AdpReader *m_adpReader; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/inputpage.ui b/src/assistant/tools/qhelpconverter/inputpage.ui deleted file mode 100644 index e7cd3a0fa..000000000 --- a/src/assistant/tools/qhelpconverter/inputpage.ui +++ /dev/null @@ -1,79 +0,0 @@ - - InputPage - - - - 0 - 0 - 417 - 242 - - - - Form - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 0 - 0 - - - - File name: - - - - - - - 0 - - - - - - - - ... - - - - - - - - - Qt::Vertical - - - - 20 - 31 - - - - - - - - - diff --git a/src/assistant/tools/qhelpconverter/main.cpp b/src/assistant/tools/qhelpconverter/main.cpp deleted file mode 100644 index 1c2d1bf12..000000000 --- a/src/assistant/tools/qhelpconverter/main.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "conversionwizard.h" - -QT_USE_NAMESPACE - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QTranslator translator; - QTranslator qtTranslator; - QTranslator qt_helpTranslator; - QString sysLocale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - if (translator.load(QLatin1String("assistant_") + sysLocale, resourceDir) - && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir) - && qt_helpTranslator.load(QLatin1String("qt_help_") + sysLocale, resourceDir)) { - app.installTranslator(&translator); - app.installTranslator(&qtTranslator); - app.installTranslator(&qt_helpTranslator); - } - - ConversionWizard w; - if (argc == 2) { - QFileInfo fi(QString::fromLocal8Bit(argv[1])); - if (fi.exists()) - w.setAdpFileName(fi.absoluteFilePath()); - } - w.show(); - return app.exec(); -} - diff --git a/src/assistant/tools/qhelpconverter/outputpage.cpp b/src/assistant/tools/qhelpconverter/outputpage.cpp deleted file mode 100644 index 434357b34..000000000 --- a/src/assistant/tools/qhelpconverter/outputpage.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#include "outputpage.h" - -QT_BEGIN_NAMESPACE - -OutputPage::OutputPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("Output File Names")); - setSubTitle(tr("Specify the file names for the output files.")); - setButtonText(QWizard::NextButton, tr("Convert...")); - - m_ui.setupUi(this); - connect(m_ui.projectLineEdit, SIGNAL(textChanged(QString)), - this, SIGNAL(completeChanged())); - connect(m_ui.collectionLineEdit, SIGNAL(textChanged(QString)), - this, SIGNAL(completeChanged())); - - registerField(QLatin1String("ProjectFileName"), - m_ui.projectLineEdit); - registerField(QLatin1String("CollectionFileName"), - m_ui.collectionLineEdit); -} - -void OutputPage::setPath(const QString &path) -{ - m_path = path; -} - -void OutputPage::setCollectionComponentEnabled(bool enabled) -{ - m_ui.collectionLineEdit->setEnabled(enabled); - m_ui.label_2->setEnabled(enabled); -} - -bool OutputPage::isComplete() const -{ - if (m_ui.projectLineEdit->text().isEmpty() - || m_ui.collectionLineEdit->text().isEmpty()) - return false; - return true; -} - -bool OutputPage::validatePage() -{ - return checkFile(m_ui.projectLineEdit->text(), - tr("Qt Help Project File")) - && checkFile(m_ui.collectionLineEdit->text(), - tr("Qt Help Collection Project File")); -} - -bool OutputPage::checkFile(const QString &fileName, const QString &title) -{ - QFile fi(m_path + QDir::separator() + fileName); - if (!fi.exists()) - return true; - - if (QMessageBox::warning(this, title, - tr("The specified file %1 already exist.\n\nDo you want to remove it?") - .arg(fileName), tr("Remove"), tr("Cancel")) == 0) { - return fi.remove(); - } - return false; -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/outputpage.h b/src/assistant/tools/qhelpconverter/outputpage.h deleted file mode 100644 index e45afae10..000000000 --- a/src/assistant/tools/qhelpconverter/outputpage.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef OUTPUTPAGE_H -#define OUTPUTPAGE_H - -#include -#include "ui_outputpage.h" - -QT_BEGIN_NAMESPACE - -class OutputPage : public QWizardPage -{ - Q_OBJECT - -public: - OutputPage(QWidget *parent = 0); - void setPath(const QString &path); - void setCollectionComponentEnabled(bool enabled); - -private: - bool isComplete() const; - bool validatePage(); - bool checkFile(const QString &fileName, - const QString &title); - - Ui::OutputPage m_ui; - QString m_path; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/outputpage.ui b/src/assistant/tools/qhelpconverter/outputpage.ui deleted file mode 100644 index 755f81808..000000000 --- a/src/assistant/tools/qhelpconverter/outputpage.ui +++ /dev/null @@ -1,95 +0,0 @@ - - OutputPage - - - - 0 - 0 - 417 - 242 - - - - Form - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 0 - 0 - - - - Project file name: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Collection file name: - - - - - - - - 0 - 0 - - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - diff --git a/src/assistant/tools/qhelpconverter/pathpage.cpp b/src/assistant/tools/qhelpconverter/pathpage.cpp deleted file mode 100644 index a9ddf53a5..000000000 --- a/src/assistant/tools/qhelpconverter/pathpage.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "pathpage.h" - -QT_BEGIN_NAMESPACE - -PathPage::PathPage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle(tr("Source File Paths")); - setSubTitle(tr("Specify the paths where the sources files " - "are located. By default, all files in those directories " - "matched by the file filter will be included.")); - - m_ui.setupUi(this); - connect(m_ui.addButton, SIGNAL(clicked()), - this, SLOT(addPath())); - connect(m_ui.removeButton, SIGNAL(clicked()), - this, SLOT(removePath())); - - m_ui.filterLineEdit->setText(QLatin1String("*.html, *.htm, *.png, *.jpg, *.css")); - - registerField(QLatin1String("sourcePathList"), m_ui.pathListWidget); - m_firstTime = true; -} - -void PathPage::setPath(const QString &path) -{ - if (!m_firstTime) - return; - - m_ui.pathListWidget->addItem(path); - m_firstTime = false; - m_ui.pathListWidget->setCurrentRow(0); -} - -QStringList PathPage::paths() const -{ - QStringList lst; - for (int i = 0; icount(); ++i) - lst.append(m_ui.pathListWidget->item(i)->text()); - return lst; -} - -QStringList PathPage::filters() const -{ - QStringList lst; - foreach (const QString &s, m_ui.filterLineEdit->text().split(QLatin1Char(','))) { - lst.append(s.trimmed()); - } - return lst; -} - -void PathPage::addPath() -{ - QString dir = QFileDialog::getExistingDirectory(this, - tr("Source File Path")); - if (!dir.isEmpty()) - m_ui.pathListWidget->addItem(dir); -} - -void PathPage::removePath() -{ - QListWidgetItem *i = m_ui.pathListWidget - ->takeItem(m_ui.pathListWidget->currentRow()); - delete i; - if (!m_ui.pathListWidget->count()) - m_ui.removeButton->setEnabled(false); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/pathpage.h b/src/assistant/tools/qhelpconverter/pathpage.h deleted file mode 100644 index 90b24236c..000000000 --- a/src/assistant/tools/qhelpconverter/pathpage.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PATHPAGE_H -#define PATHPAGE_H - -#include -#include "ui_pathpage.h" - -QT_BEGIN_NAMESPACE - -class PathPage : public QWizardPage -{ - Q_OBJECT - -public: - PathPage(QWidget *parent = 0); - void setPath(const QString &path); - QStringList paths() const; - QStringList filters() const; - -private slots: - void addPath(); - void removePath(); - -private: - Ui::PathPage m_ui; - bool m_firstTime; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/pathpage.ui b/src/assistant/tools/qhelpconverter/pathpage.ui deleted file mode 100644 index 89083915d..000000000 --- a/src/assistant/tools/qhelpconverter/pathpage.ui +++ /dev/null @@ -1,114 +0,0 @@ - - PathPage - - - - 0 - 0 - 417 - 243 - - - - Form - - - - - - - 0 - 0 - - - - File filters: - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Documentation source file paths: - - - - - - - - - - - 0 - 0 - - - - Add - - - - - - - - 0 - 0 - - - - Remove - - - - - - - Qt::Vertical - - - - 20 - 51 - - - - - - - - Qt::Vertical - - - - 20 - 31 - - - - - - - - - diff --git a/src/assistant/tools/qhelpconverter/qhcpwriter.cpp b/src/assistant/tools/qhelpconverter/qhcpwriter.cpp deleted file mode 100644 index cdf9f0b3c..000000000 --- a/src/assistant/tools/qhelpconverter/qhcpwriter.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "qhcpwriter.h" - -QT_BEGIN_NAMESPACE - -QhcpWriter::QhcpWriter() -{ - setAutoFormatting(true); -} - -void QhcpWriter::setHelpProjectFile(const QString &qhpFile) -{ - m_qhpFile = qhpFile; -} - -void QhcpWriter::setProperties(const QMap props) -{ - m_properties = props; -} - -void QhcpWriter::setTitlePath(const QString &path) -{ - m_titlePath = path; -} - -bool QhcpWriter::writeFile(const QString &fileName) -{ - QFile out(fileName); - if (!out.open(QIODevice::WriteOnly)) - return false; - - setDevice(&out); - writeStartDocument(); - writeStartElement(QLatin1String("QHelpCollectionProject")); - writeAttribute(QLatin1String("version"), QLatin1String("1.0")); - writeAssistantSettings(); - writeDocuments(); - writeEndDocument(); - return true; -} - -void QhcpWriter::writeAssistantSettings() -{ - if (m_properties.isEmpty()) - return; - - writeStartElement(QLatin1String("assistant")); - - if (m_properties.contains(QLatin1String("title"))) - writeTextElement(QLatin1String("title"), m_properties.value(QLatin1String("title"))); - if (m_properties.contains(QLatin1String("applicationicon"))) - writeTextElement(QLatin1String("applicationIcon"), - m_properties.value(QLatin1String("applicationicon"))); - if (m_properties.contains(QLatin1String("startpage"))) - writeTextElement(QLatin1String("startPage"), m_titlePath + QLatin1String("/") - + m_properties.value(QLatin1String("startpage"))); - if (m_properties.contains(QLatin1String("aboutmenutext"))) { - writeStartElement(QLatin1String("aboutMenuText")); - writeTextElement(QLatin1String("text"), - m_properties.value(QLatin1String("aboutmenutext"))); - writeEndElement(); - } - if (m_properties.contains(QLatin1String("abouturl"))) { - writeStartElement(QLatin1String("aboutDialog")); - writeTextElement(QLatin1String("file"), m_properties.value(QLatin1String("abouturl"))); - writeEndElement(); - } - if (m_properties.contains(QLatin1String("name"))) { - writeTextElement(QLatin1String("cacheDirectory"), - QLatin1String(".") + m_properties.value(QLatin1String("name"))); - } - - writeEndElement(); -} - -void QhcpWriter::writeDocuments() -{ - if (m_qhpFile.isEmpty()) - return; - - QString out = m_qhpFile; - int i = out.indexOf(QLatin1Char('.')); - if (i > -1) - out = out.left(i); - out.append(QLatin1String(".qch")); - - writeStartElement(QLatin1String("docFiles")); - - writeStartElement(QLatin1String("generate")); - writeStartElement(QLatin1String("file")); - writeTextElement(QLatin1String("input"), m_qhpFile); - writeTextElement(QLatin1String("output"), out); - writeEndElement(); - writeEndElement(); - - writeStartElement(QLatin1String("register")); - writeTextElement(QLatin1String("file"), out); - writeEndElement(); - - writeEndElement(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/qhcpwriter.h b/src/assistant/tools/qhelpconverter/qhcpwriter.h deleted file mode 100644 index de0c6f8e1..000000000 --- a/src/assistant/tools/qhelpconverter/qhcpwriter.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHCPWRITER_H -#define QHCPWRITER_H - -#include -#include "adpreader.h" - -QT_BEGIN_NAMESPACE - -class QhcpWriter : public QXmlStreamWriter -{ -public: - QhcpWriter(); - bool writeFile(const QString &fileName); - void setHelpProjectFile(const QString &qhpFile); - void setProperties(const QMap props); - void setTitlePath(const QString &path); - -private: - void writeAssistantSettings(); - void writeDocuments(); - - QString m_qhpFile; - QMap m_properties; - QString m_titlePath; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpconverter/qhelpconverter.pro b/src/assistant/tools/qhelpconverter/qhelpconverter.pro deleted file mode 100644 index f8754767d..000000000 --- a/src/assistant/tools/qhelpconverter/qhelpconverter.pro +++ /dev/null @@ -1,47 +0,0 @@ -QT += xml help -TEMPLATE = app -TARGET = qhelpconverter -DESTDIR = $$QT.designer.bins -CONFIG += qt warn_on help - -target.path=$$[QT_INSTALL_BINS] -INSTALLS += target - -SOURCES += conversionwizard.cpp \ - inputpage.cpp \ - generalpage.cpp \ - filterpage.cpp \ - identifierpage.cpp \ - pathpage.cpp \ - filespage.cpp \ - outputpage.cpp \ - finishpage.cpp \ - adpreader.cpp \ - qhpwriter.cpp \ - qhcpwriter.cpp \ - helpwindow.cpp \ - main.cpp - -HEADERS += conversionwizard.h \ - inputpage.h \ - generalpage.h \ - filterpage.h \ - identifierpage.h \ - pathpage.h \ - filespage.h \ - outputpage.h \ - finishpage.h \ - adpreader.h \ - qhcpwriter.h \ - qhpwriter.h \ - helpwindow.h - -FORMS += inputpage.ui \ - generalpage.ui \ - filterpage.ui \ - identifierpage.ui \ - pathpage.ui \ - filespage.ui \ - outputpage.ui - -RESOURCES += qhelpconverter.qrc diff --git a/src/assistant/tools/qhelpconverter/qhelpconverter.qrc b/src/assistant/tools/qhelpconverter/qhelpconverter.qrc deleted file mode 100644 index e2a68ab43..000000000 --- a/src/assistant/tools/qhelpconverter/qhelpconverter.qrc +++ /dev/null @@ -1,13 +0,0 @@ - - - assistant-128.png - assistant.png - doc/inputpage.html - doc/generalpage.html - doc/filterpage.html - doc/identifierpage.html - doc/pathpage.html - doc/filespage.html - doc/outputpage.html - - diff --git a/src/assistant/tools/qhelpconverter/qhpwriter.cpp b/src/assistant/tools/qhelpconverter/qhpwriter.cpp deleted file mode 100644 index 51d392d32..000000000 --- a/src/assistant/tools/qhelpconverter/qhpwriter.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "qhpwriter.h" -#include "adpreader.h" - -QT_BEGIN_NAMESPACE - -QhpWriter::QhpWriter(const QString &namespaceName, - const QString &virtualFolder) -{ - m_namespaceName = namespaceName; - m_virtualFolder = virtualFolder; - setAutoFormatting(true); -} - -void QhpWriter::setAdpReader(AdpReader *reader) -{ - m_adpReader = reader; -} - -void QhpWriter::setFilterAttributes(const QStringList &attributes) -{ - m_filterAttributes = attributes; -} - -void QhpWriter::setCustomFilters(const QList filters) -{ - m_customFilters = filters; -} - -void QhpWriter::setFiles(const QStringList &files) -{ - m_files = files; -} - -void QhpWriter::generateIdentifiers(IdentifierPrefix prefix, - const QString prefixString) -{ - m_prefix = prefix; - m_prefixString = prefixString; -} - -bool QhpWriter::writeFile(const QString &fileName) -{ - QFile out(fileName); - if (!out.open(QIODevice::WriteOnly)) - return false; - - setDevice(&out); - writeStartDocument(); - writeStartElement(QLatin1String("QtHelpProject")); - writeAttribute(QLatin1String("version"), QLatin1String("1.0")); - writeTextElement(QLatin1String("namespace"), m_namespaceName); - writeTextElement(QLatin1String("virtualFolder"), m_virtualFolder); - writeCustomFilters(); - writeFilterSection(); - writeEndDocument(); - - out.close(); - return true; -} - -void QhpWriter::writeCustomFilters() -{ - if (!m_customFilters.count()) - return; - - foreach (const CustomFilter &f, m_customFilters) { - writeStartElement(QLatin1String("customFilter")); - writeAttribute(QLatin1String("name"), f.name); - foreach (const QString &a, f.filterAttributes) - writeTextElement(QLatin1String("filterAttribute"), a); - writeEndElement(); - } -} - -void QhpWriter::writeFilterSection() -{ - writeStartElement(QLatin1String("filterSection")); - foreach (const QString &a, m_filterAttributes) - writeTextElement(QLatin1String("filterAttribute"), a); - - writeToc(); - writeKeywords(); - writeFiles(); - writeEndElement(); -} - -void QhpWriter::writeToc() -{ - QList lst = m_adpReader->contents(); - if (lst.isEmpty()) - return; - - int depth = -1; - writeStartElement(QLatin1String("toc")); - foreach (const ContentItem &i, lst) { - while (depth-- >= i.depth) - writeEndElement(); - writeStartElement(QLatin1String("section")); - writeAttribute(QLatin1String("title"), i.title); - writeAttribute(QLatin1String("ref"), i.reference); - depth = i.depth; - } - while (depth-- >= -1) - writeEndElement(); -} - -void QhpWriter::writeKeywords() -{ - QList lst = m_adpReader->keywords(); - if (lst.isEmpty()) - return; - - writeStartElement(QLatin1String("keywords")); - foreach (const KeywordItem &i, lst) { - writeEmptyElement(QLatin1String("keyword")); - writeAttribute(QLatin1String("name"), i.keyword); - writeAttribute(QLatin1String("ref"), i.reference); - if (m_prefix == FilePrefix) { - QString str = i.reference.mid( - i.reference.lastIndexOf(QLatin1Char('/'))+1); - str = str.left(str.lastIndexOf(QLatin1Char('.'))); - writeAttribute(QLatin1String("id"), str + QLatin1String("::") + i.keyword); - } else if (m_prefix == GlobalPrefix) { - writeAttribute(QLatin1String("id"), m_prefixString + i.keyword); - } - } - writeEndElement(); -} - -void QhpWriter::writeFiles() -{ - if (m_files.isEmpty()) - return; - - writeStartElement(QLatin1String("files")); - foreach (const QString &f, m_files) - writeTextElement(QLatin1String("file"), f); - writeEndElement(); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/qhelpconverter/qhpwriter.h b/src/assistant/tools/qhelpconverter/qhpwriter.h deleted file mode 100644 index 70fd04aca..000000000 --- a/src/assistant/tools/qhelpconverter/qhpwriter.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QHPWRITER_H -#define QHPWRITER_H - -#include -#include "filterpage.h" - -QT_BEGIN_NAMESPACE - -class AdpReader; - -class QhpWriter : public QXmlStreamWriter -{ -public: - enum IdentifierPrefix {SkipAll, FilePrefix, GlobalPrefix}; - QhpWriter(const QString &namespaceName, - const QString &virtualFolder); - void setAdpReader(AdpReader *reader); - void setFilterAttributes(const QStringList &attributes); - void setCustomFilters(const QList filters); - void setFiles(const QStringList &files); - void generateIdentifiers(IdentifierPrefix prefix, - const QString prefixString = QString()); - bool writeFile(const QString &fileName); - -private: - void writeCustomFilters(); - void writeFilterSection(); - void writeToc(); - void writeKeywords(); - void writeFiles(); - - QString m_namespaceName; - QString m_virtualFolder; - AdpReader *m_adpReader; - QStringList m_filterAttributes; - QList m_customFilters; - QStringList m_files; - IdentifierPrefix m_prefix; - QString m_prefixString; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/qhelpgenerator/main.cpp b/src/assistant/tools/qhelpgenerator/main.cpp deleted file mode 100644 index 386e84c41..000000000 --- a/src/assistant/tools/qhelpgenerator/main.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../shared/helpgenerator.h" - -#include -#include -#include -#include -#include -#include - -#include - -QT_USE_NAMESPACE - -class QHG { - Q_DECLARE_TR_FUNCTIONS(QHelpGenerator) -}; - -int main(int argc, char *argv[]) -{ - QString error; - QString arg; - QString compressedFile; - QString projectFile; - QString basePath; - bool showHelp = false; - bool showVersion = false; - bool checkLinks = false; - - QCoreApplication app(argc, argv); -#ifndef Q_OS_WIN32 - QTranslator translator; - QTranslator qtTranslator; - QTranslator qt_helpTranslator; - QString sysLocale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - if (translator.load(QLatin1String("assistant_") + sysLocale, resourceDir) - && qtTranslator.load(QLatin1String("qt_") + sysLocale, resourceDir) - && qt_helpTranslator.load(QLatin1String("qt_help_") + sysLocale, resourceDir)) { - app.installTranslator(&translator); - app.installTranslator(&qtTranslator); - app.installTranslator(&qt_helpTranslator); - } -#endif // Q_OS_WIN32 - - for (int i = 1; i < argc; ++i) { - arg = QString::fromLocal8Bit(argv[i]); - if (arg == QLatin1String("-o")) { - if (++i < argc) { - QFileInfo fi(QString::fromLocal8Bit(argv[i])); - compressedFile = fi.absoluteFilePath(); - } else { - error = QHG::tr("Missing output file name."); - } - } else if (arg == QLatin1String("-v")) { - showVersion = true; - } else if (arg == QLatin1String("-h")) { - showHelp = true; - } else if (arg == QLatin1String("-c")) { - checkLinks = true; - } else { - QFileInfo fi(arg); - projectFile = fi.absoluteFilePath(); - basePath = fi.absolutePath(); - } - } - - if (showVersion) { - fputs(qPrintable(QHG::tr("Qt Help Generator version 1.0 (Qt %1)\n") - .arg(QT_VERSION_STR)), stdout); - return 0; - } - - if (projectFile.isEmpty() && !showHelp) - error = QHG::tr("Missing Qt help project file."); - - QString help = QHG::tr("\nUsage:\n\n" - "qhelpgenerator [options]\n\n" - " -o Generates a Qt compressed help\n" - " file called .\n" - " If this option is not specified\n" - " a default name will be used.\n" - " -c Checks whether all links in HTML files\n" - " point to files in this help project.\n" - " -v Displays the version of \n" - " qhelpgenerator.\n\n"); - - if (showHelp) { - fputs(qPrintable(help), stdout); - return 0; - }else if (!error.isEmpty()) { - fprintf(stderr, "%s\n\n%s", qPrintable(error), qPrintable(help)); - return -1; - } - - QFile file(projectFile); - if (!file.open(QIODevice::ReadOnly)) { - fputs(qPrintable(QHG::tr("Could not open %1.\n").arg(projectFile)), stderr); - return -1; - } - - if (compressedFile.isEmpty()) { - if (!checkLinks) { - QFileInfo fi(projectFile); - compressedFile = basePath + QDir::separator() - + fi.baseName() + QLatin1String(".qch"); - } - } else { - // check if the output dir exists -- create if it doesn't - QFileInfo fi(compressedFile); - QDir parentDir = fi.dir(); - if (!parentDir.exists()) { - if (!parentDir.mkpath(QLatin1String("."))) { - fputs(qPrintable(QHG::tr("Could not create output directory: %1\n") - .arg(parentDir.path())), stderr); - } - } - } - - QHelpProjectData *helpData = new QHelpProjectData(); - if (!helpData->readData(projectFile)) { - fprintf(stderr, "%s\n", qPrintable(helpData->errorMessage())); - return -1; - } - - HelpGenerator generator; - bool success = true; - if (checkLinks) - success = generator.checkLinks(*helpData); - if (success && !compressedFile.isEmpty()) - success = generator.generate(helpData, compressedFile); - delete helpData; - if (!success) { - fprintf(stderr, "%s\n", qPrintable(generator.error())); - return -1; - } - return 0; -} diff --git a/src/assistant/tools/qhelpgenerator/qhelpgenerator.pro b/src/assistant/tools/qhelpgenerator/qhelpgenerator.pro deleted file mode 100644 index f6db4fa11..000000000 --- a/src/assistant/tools/qhelpgenerator/qhelpgenerator.pro +++ /dev/null @@ -1,14 +0,0 @@ -TEMPLATE = app -TARGET = qhelpgenerator -DESTDIR = $$QT.designer.bins -CONFIG += qt warn_on help console -CONFIG -= app_bundle -QT += network help-private - -target.path=$$[QT_INSTALL_BINS] -INSTALLS += target - -SOURCES += ../shared/helpgenerator.cpp \ - main.cpp - -HEADERS += ../shared/helpgenerator.h diff --git a/src/assistant/tools/shared/collectionconfiguration.cpp b/src/assistant/tools/shared/collectionconfiguration.cpp deleted file mode 100644 index 35d5b66df..000000000 --- a/src/assistant/tools/shared/collectionconfiguration.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "collectionconfiguration.h" - -#include - -QT_BEGIN_NAMESPACE - -namespace { - const QString AboutIconKey(QLatin1String("AboutIcon")); - const QString AboutImagesKey(QLatin1String("AboutImages")); - const QString AboutMenuTextsKey(QLatin1String("AboutMenuTexts")); - const QString AboutTextsKey(QLatin1String("AboutTexts")); - const QString ApplicationIconKey(QLatin1String("ApplicationIcon")); - const QString CacheDirKey(QLatin1String("CacheDirectory")); - const QString CacheDirRelativeToCollectionKey(QLatin1String("CacheDirRelativeToCollection")); - const QString CreationTimeKey(QLatin1String("CreationTime")); - const QString DefaultHomePageKey(QLatin1String("defaultHomepage")); - const QString EnableAddressBarKey(QLatin1String("EnableAddressBar")); - const QString EnableDocManagerKey(QLatin1String("EnableDocumentationManager")); - const QString EnableFilterKey(QLatin1String("EnableFilterFunctionality")); - const QString HideAddressBarKey(QLatin1String("HideAddressBar")); - const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); - const QString LastPageKey(QLatin1String("LastTabPage")); - const QString LastRegisterTime(QLatin1String("LastRegisterTime")); - const QString LastShownPagesKey(QLatin1String("LastShownPages")); - const QString LastZoomFactorsKey(QLatin1String( -#if !defined(QT_NO_WEBKIT) - "LastPagesZoomWebView" -#else - "LastPagesZoomTextBrowser" -#endif - )); - const QString WindowTitleKey(QLatin1String("WindowTitle")); - const QString FullTextSearchFallbackKey(QLatin1String("FullTextSearchFallback")); -} // anonymous namespace - -const QString CollectionConfiguration::DefaultZoomFactor(QLatin1String("0.0")); -const QString CollectionConfiguration::ListSeparator(QLatin1String("|")); - -uint CollectionConfiguration::creationTime(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(CreationTimeKey, 0).toUInt(); -} - -void CollectionConfiguration::setCreationTime(QHelpEngineCore &helpEngine, uint time) -{ - helpEngine.setCustomValue(CreationTimeKey, time); -} - -const QString CollectionConfiguration::windowTitle(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(WindowTitleKey).toString(); -} - -void CollectionConfiguration::setWindowTitle(QHelpEngineCore &helpEngine, - const QString &windowTitle) -{ - helpEngine.setCustomValue(WindowTitleKey, windowTitle); -} - -bool CollectionConfiguration::filterFunctionalityEnabled(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(EnableFilterKey, true).toBool(); -} - -void CollectionConfiguration::setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, - bool enabled) -{ - helpEngine.setCustomValue(EnableFilterKey, enabled); -} - -bool CollectionConfiguration::filterToolbarVisible(const QHelpEngineCore &helpEngine) -{ - return !helpEngine.customValue(FilterToolbarHiddenKey, true).toBool(); -} - -void CollectionConfiguration::setFilterToolbarVisible(QHelpEngineCore &helpEngine, - bool visible) -{ - helpEngine.setCustomValue(FilterToolbarHiddenKey, !visible); -} - -bool CollectionConfiguration::addressBarEnabled(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(EnableAddressBarKey, true).toBool(); -} - -void CollectionConfiguration::setAddressBarEnabled(QHelpEngineCore &helpEngine, - bool enabled) -{ - helpEngine.setCustomValue(EnableAddressBarKey, enabled); -} - -bool CollectionConfiguration::addressBarVisible(const QHelpEngineCore &helpEngine) -{ - return !helpEngine.customValue(HideAddressBarKey, true).toBool(); -} - -void CollectionConfiguration::setAddressBarVisible(QHelpEngineCore &helpEngine, - bool visible) -{ - helpEngine.setCustomValue(HideAddressBarKey, !visible); -} - -const QString CollectionConfiguration::cacheDir(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(CacheDirKey).toString(); -} - -bool CollectionConfiguration::cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(CacheDirRelativeToCollectionKey).toBool(); -} - -void CollectionConfiguration::setCacheDir(QHelpEngineCore &helpEngine, - const QString &cacheDir, bool relativeToCollection) -{ - helpEngine.setCustomValue(CacheDirKey, cacheDir); - helpEngine.setCustomValue(CacheDirRelativeToCollectionKey, - relativeToCollection); -} - -bool CollectionConfiguration::documentationManagerEnabled(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(EnableDocManagerKey, true).toBool(); -} - -void CollectionConfiguration::setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, - bool enabled) -{ - helpEngine.setCustomValue(EnableDocManagerKey, enabled); -} - -const QByteArray CollectionConfiguration::applicationIcon(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(ApplicationIconKey).toByteArray(); -} - -void CollectionConfiguration::setApplicationIcon(QHelpEngineCore &helpEngine, - const QByteArray &icon) -{ - helpEngine.setCustomValue(ApplicationIconKey, icon); -} - -const QByteArray CollectionConfiguration::aboutMenuTexts(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(AboutMenuTextsKey).toByteArray(); -} - -void CollectionConfiguration::setAboutMenuTexts(QHelpEngineCore &helpEngine, - const QByteArray &texts) -{ - helpEngine.setCustomValue(AboutMenuTextsKey, texts); -} - -const QByteArray CollectionConfiguration::aboutIcon(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(AboutIconKey).toByteArray(); -} - -void CollectionConfiguration::setAboutIcon(QHelpEngineCore &helpEngine, - const QByteArray &icon) -{ - helpEngine.setCustomValue(AboutIconKey, icon); -} - -const QByteArray CollectionConfiguration::aboutTexts(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(AboutTextsKey).toByteArray(); -} - -void CollectionConfiguration::setAboutTexts(QHelpEngineCore &helpEngine, - const QByteArray &texts) -{ - helpEngine.setCustomValue(AboutTextsKey, texts); -} - -const QByteArray CollectionConfiguration::aboutImages(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(AboutImagesKey).toByteArray(); -} - -void CollectionConfiguration::setAboutImages(QHelpEngineCore &helpEngine, - const QByteArray &images) -{ - helpEngine.setCustomValue(AboutImagesKey, images); -} - -const QString CollectionConfiguration::defaultHomePage(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(DefaultHomePageKey, QLatin1String("help")). - toString(); -} - -void CollectionConfiguration::setDefaultHomePage(QHelpEngineCore &helpEngine, - const QString &page) -{ - helpEngine.setCustomValue(DefaultHomePageKey, page); -} - -const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastShownPagesKey).toString(). - split(ListSeparator, QString::SkipEmptyParts); -} - -void CollectionConfiguration::setLastShownPages(QHelpEngineCore &helpEngine, - const QStringList &lastShownPages) -{ - helpEngine.setCustomValue(LastShownPagesKey, - lastShownPages.join(ListSeparator)); -} - -const QStringList CollectionConfiguration::lastZoomFactors(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastZoomFactorsKey).toString(). - split(ListSeparator, QString::SkipEmptyParts); -} - -void CollectionConfiguration::setLastZoomFactors(QHelpEngineCore &helpEngine, - const QStringList &lastZoomFactors) -{ - helpEngine.setCustomValue(LastZoomFactorsKey, - lastZoomFactors.join(ListSeparator)); -} - -int CollectionConfiguration::lastTabPage(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastPageKey, 1).toInt(); -} - -void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, - int lastPage) -{ - helpEngine.setCustomValue(LastPageKey, lastPage); -} - -const QDateTime CollectionConfiguration::lastRegisterTime(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastRegisterTime, QDateTime()).toDateTime(); -} - -void CollectionConfiguration::updateLastRegisterTime(QHelpEngineCore &helpEngine) -{ - helpEngine.setCustomValue(LastRegisterTime, QDateTime::currentDateTime()); -} - -bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer, - const QHelpEngineCore &older) -{ - return creationTime(newer) > creationTime(older); -} - -void CollectionConfiguration::copyConfiguration(const QHelpEngineCore &source, - QHelpEngineCore &target) -{ - setCreationTime(target, creationTime(source)); - setWindowTitle(target, windowTitle(source)); - target.setCurrentFilter(source.currentFilter()); - setCacheDir(target, cacheDir(source), cacheDirIsRelativeToCollection(source)); - setFilterFunctionalityEnabled(target, filterFunctionalityEnabled(source)); - setFilterToolbarVisible(target, filterToolbarVisible(source)); - setAddressBarEnabled(target, addressBarEnabled(source)); - setAddressBarVisible(target, addressBarVisible(source)); - setDocumentationManagerEnabled(target, documentationManagerEnabled(source)); - setApplicationIcon(target, applicationIcon(source)); - setAboutMenuTexts(target, aboutMenuTexts(source)); - setAboutIcon(target, aboutIcon(source)); - setAboutTexts(target, aboutTexts(source)); - setAboutImages(target, aboutImages(source)); - setDefaultHomePage(target, defaultHomePage(source)); - setFullTextSearchFallbackEnabled(target, fullTextSearchFallbackEnabled(source)); -} - -bool CollectionConfiguration:: fullTextSearchFallbackEnabled( - const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(FullTextSearchFallbackKey, false).toBool(); -} - -void CollectionConfiguration::setFullTextSearchFallbackEnabled( - QHelpEngineCore &helpEngine, bool on) -{ - helpEngine.setCustomValue(FullTextSearchFallbackKey, on); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/shared/collectionconfiguration.h b/src/assistant/tools/shared/collectionconfiguration.h deleted file mode 100644 index 226460ef3..000000000 --- a/src/assistant/tools/shared/collectionconfiguration.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef COLLECTIONCONFIGURATION_H -#define COLLECTIONCONFIGURATION_H - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QHelpEngineCore; - -class CollectionConfiguration -{ -public: - static const QString windowTitle(const QHelpEngineCore &helpEngine); - static void setWindowTitle(QHelpEngineCore &helpEngine, - const QString &windowTitle); - - static const QString cacheDir(const QHelpEngineCore &helpEngine); - static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine); - static void setCacheDir(QHelpEngineCore &helpEngine, - const QString &cacheDir, bool relativeToCollection); - - static uint creationTime(const QHelpEngineCore &helpEngine); - static void setCreationTime(QHelpEngineCore &helpEngine, uint time); - - static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine); - static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, - bool enabled); - - static bool filterToolbarVisible(const QHelpEngineCore &helpEngine); - static void setFilterToolbarVisible(QHelpEngineCore &helpEngine, - bool visible); - - static bool addressBarEnabled(const QHelpEngineCore &helpEngine); - static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled); - - static bool addressBarVisible(const QHelpEngineCore &helpEngine); - static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible); - - - static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine); - static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, - bool enabled); - - static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine); - static void setApplicationIcon(QHelpEngineCore &helpEngine, - const QByteArray &icon); - - // TODO: Encapsulate encoding from/to QByteArray here - static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine); - static void setAboutMenuTexts(QHelpEngineCore &helpEngine, - const QByteArray &texts); - - static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine); - static void setAboutIcon(QHelpEngineCore &helpEngine, - const QByteArray &icon); - - // TODO: Encapsulate encoding from/to QByteArray here - static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine); - static void setAboutTexts(QHelpEngineCore &helpEngine, - const QByteArray &texts); - - static const QByteArray aboutImages(const QHelpEngineCore &helpEngine); - static void setAboutImages(QHelpEngineCore &helpEngine, - const QByteArray &images); - - static const QString defaultHomePage(const QHelpEngineCore &helpEngine); - static void setDefaultHomePage(QHelpEngineCore &helpEngine, - const QString &page); - - // TODO: Don't allow last pages and zoom factors to be set in isolation - // Perhaps also fill up missing elements automatically or assert. - static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); - static void setLastShownPages(QHelpEngineCore &helpEngine, - const QStringList &lastShownPages); - static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); - static void setLastZoomFactors(QHelpEngineCore &helPEngine, - const QStringList &lastZoomFactors); - - static int lastTabPage(const QHelpEngineCore &helpEngine); - static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); - - static bool isNewer(const QHelpEngineCore &newer, - const QHelpEngineCore &older); - static void copyConfiguration(const QHelpEngineCore &source, - QHelpEngineCore &target); - - /* - * Note that this only reflects register actions caused by the - * "-register" command line switch, not GUI or remote control actions. - */ - static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine); - static void updateLastRegisterTime(QHelpEngineCore &helpEngine); - - static bool fullTextSearchFallbackEnabled(const QHelpEngineCore &helpEngine); - static void setFullTextSearchFallbackEnabled(QHelpEngineCore &helpEngine, - bool on); - - static const QString DefaultZoomFactor; - static const QString ListSeparator; -}; - -QT_END_NAMESPACE - -#endif // COLLECTIONCONFIGURATION_H diff --git a/src/assistant/tools/shared/helpgenerator.cpp b/src/assistant/tools/shared/helpgenerator.cpp deleted file mode 100644 index d551548fb..000000000 --- a/src/assistant/tools/shared/helpgenerator.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpgenerator.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -HelpGenerator::HelpGenerator() -{ - generator = new QHelpGenerator(this); - connect(generator, SIGNAL(statusChanged(QString)), - this, SLOT(printStatus(QString))); - connect(generator, SIGNAL(warning(QString)), - this, SLOT(printWarning(QString))); -} - -bool HelpGenerator::generate(QHelpDataInterface *helpData, - const QString &outputFileName) -{ - return generator->generate(helpData, outputFileName); -} - -bool HelpGenerator::checkLinks(const QHelpDataInterface &helpData) -{ - return generator->checkLinks(helpData); -} - -QString HelpGenerator::error() const -{ - return generator->error(); -} - -void HelpGenerator::printStatus(const QString &msg) -{ - puts(qPrintable(msg)); -} - -void HelpGenerator::printWarning(const QString &msg) -{ - puts(qPrintable(tr("Warning: %1").arg(msg))); -} - -QT_END_NAMESPACE diff --git a/src/assistant/tools/shared/helpgenerator.h b/src/assistant/tools/shared/helpgenerator.h deleted file mode 100644 index e220a2b68..000000000 --- a/src/assistant/tools/shared/helpgenerator.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPGENERATOR_H -#define HELPGENERATOR_H - -#include - -QT_BEGIN_NAMESPACE - -class QHelpDataInterface; -class QHelpGenerator; - -class HelpGenerator : public QObject -{ - Q_OBJECT - -public: - HelpGenerator(); - bool generate(QHelpDataInterface *helpData, - const QString &outputFileName); - bool checkLinks(const QHelpDataInterface &helpData); - QString error() const; - -private slots: - void printStatus(const QString &msg); - void printWarning(const QString &msg); - -private: - QHelpGenerator *generator; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/assistant/tools/tools.pro b/src/assistant/tools/tools.pro deleted file mode 100644 index 8bb8cd700..000000000 --- a/src/assistant/tools/tools.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = subdirs -CONFIG += ordered - -SUBDIRS += assistant \ - qhelpgenerator \ - qcollectiongenerator \ - qhelpconverter - diff --git a/src/designer/src/lib/extension/default_extensionfactory.cpp b/src/designer/src/lib/extension/default_extensionfactory.cpp index a90886695..3d143b2cd 100644 --- a/src/designer/src/lib/extension/default_extensionfactory.cpp +++ b/src/designer/src/lib/extension/default_extensionfactory.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include "default_extensionfactory.h" #include "qextensionmanager.h" #include #include diff --git a/src/designer/src/lib/extension/default_extensionfactory.h b/src/designer/src/lib/extension/default_extensionfactory.h index 370e69aae..f2ef78ee1 100644 --- a/src/designer/src/lib/extension/default_extensionfactory.h +++ b/src/designer/src/lib/extension/default_extensionfactory.h @@ -42,7 +42,7 @@ #ifndef DEFAULT_EXTENSIONFACTORY_H #define DEFAULT_EXTENSIONFACTORY_H -#include +#include "extension_global.h" #include #include diff --git a/src/designer/src/lib/extension/qextensionmanager.h b/src/designer/src/lib/extension/qextensionmanager.h index a387924e6..e80cddaf9 100644 --- a/src/designer/src/lib/extension/qextensionmanager.h +++ b/src/designer/src/lib/extension/qextensionmanager.h @@ -42,7 +42,7 @@ #ifndef QEXTENSIONMANAGER_H #define QEXTENSIONMANAGER_H -#include +#include "extension_global.h" #include #include diff --git a/src/designer/src/lib/lib.pro b/src/designer/src/lib/lib.pro index 55522d42b..a23e16417 100644 --- a/src/designer/src/lib/lib.pro +++ b/src/designer/src/lib/lib.pro @@ -1,33 +1,30 @@ load(qt_module) -TEMPLATE=lib -TARGET=QtDesigner -QT += core-private gui-private widgets widgets-private xml uilib-private +TARGET = QtDesigner +QT += core-private gui-private widgets widgets-private xml uilib uilib-private + contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols -CONFIG += qt -win32|mac: CONFIG += debug_and_release -DESTDIR = $$QT_BUILD_TREE/lib -!wince*:DLLDESTDIR = $$QT.designer.bins -INCLUDEPATH += $$QT.designer.includes \ - $$QT.designer.private_includes \ - $$QT.designer.private_includes/QtDesigner +#win32|mac: CONFIG += debug_and_release +#DESTDIR = $$QT_BUILD_TREE/lib +#!wince*:DLLDESTDIR = $$QT.designer.bins -isEmpty(QT_MAJOR_VERSION) { - VERSION=4.3.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} +#INCLUDEPATH += $$QT.designer.includes \ +# $$QT.designer.private_includes \ +# $$QT.designer.private_includes/QtDesigner + +#isEmpty(QT_MAJOR_VERSION) { +# VERSION=4.3.0 +#} else { +# VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} +#} unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml -include($$QT_SOURCE_TREE/src/qt_targets.pri) +load(qt_module_config) HEADERS += qtdesignerversion.h -QMAKE_TARGET_PRODUCT = Designer -QMAKE_TARGET_DESCRIPTION = Graphical user interface designer. - !contains(CONFIG, static) { CONFIG += dll @@ -40,13 +37,11 @@ QMAKE_TARGET_DESCRIPTION = Graphical user interface designer. DEFINES += QT_DESIGNER_STATIC } -#load up the headers info -CONFIG += qt_install_headers -#headers.pri is loaded from the last include path -LAST_MODULE_INCLUDE=$$INCLUDEPATH -for(include_path, INCLUDEPATH):LAST_MODULE_INCLUDE=$${include_path} -HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri -include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) +##headers.pri is loaded from the last include path +#LAST_MODULE_INCLUDE=$$INCLUDEPATH +#for(include_path, INCLUDEPATH):LAST_MODULE_INCLUDE=$${include_path} +#HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri +#include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) #mac frameworks mac:CONFIG += explicitlib @@ -68,24 +63,22 @@ mac:!static:contains(QT_CONFIG, qt_framework) { include(extension/extension.pri) include(sdk/sdk.pri) -include($$QT_SOURCE_TREE/tools/uilib/uilib.pri) -INCLUDEPATH += $$QT_SOURCE_TREE/tools/uilib include(shared/shared.pri) PRECOMPILED_HEADER=lib_pch.h include(../sharedcomponents.pri) include(../components/component.pri) -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget -} +#target.path=$$[QT_INSTALL_LIBS] +#INSTALLS += target +#win32 { +# dlltarget.path=$$[QT_INSTALL_BINS] +# INSTALLS += dlltarget +#} -qt_install_headers { - designer_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - designer_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner - INSTALLS += designer_headers -} +#qt_install_headers { +# designer_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES +# designer_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner +# INSTALLS += designer_headers +#} diff --git a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp index 8c63ac990..5b9f1d11b 100644 --- a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp +++ b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp @@ -45,7 +45,7 @@ #include "widgetfactory_p.h" #include "qdesigner_introspection_p.h" -#include +#include #include // sdk #include diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp index 771306e9f..7a846c52b 100644 --- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -46,7 +46,7 @@ #include "qlayout_widget_p.h" #include "qdesigner_introspection_p.h" -#include +#include #include #include diff --git a/src/designer/src/lib/shared/shared.pri b/src/designer/src/lib/shared/shared.pri index 9cba7d7bf..d46d170f0 100644 --- a/src/designer/src/lib/shared/shared.pri +++ b/src/designer/src/lib/shared/shared.pri @@ -4,7 +4,7 @@ contains(QT_CONFIG, script): QT += script include(../../../../shared/qtpropertybrowser/qtpropertybrowserutils.pri) include(../../../../shared/deviceskin/deviceskin.pri) -include($$QT_SOURCE_TREE/src/tools/rcc/rcc.pri) +include($$QT_MODULE_BASE/src/tools/rcc/rcc.pri) include(../../../../shared/findwidget/findwidget.pri) include(../../../../shared/qtgradienteditor/qtgradienteditor.pri) diff --git a/src/shared/qtgradienteditor/qtcolorline.cpp b/src/shared/qtgradienteditor/qtcolorline.cpp index 2f241f82d..22039b398 100644 --- a/src/shared/qtgradienteditor/qtcolorline.cpp +++ b/src/shared/qtgradienteditor/qtcolorline.cpp @@ -682,11 +682,12 @@ void QtColorLinePrivate::paintEvent(QPaintEvent *) pmp.end(); p.setBrushOrigin((rect.width() % pixSize + pixSize) / 2, (rect.height() % pixSize + pixSize) / 2); - p.setClipRect(r[1].adjusted(4, 4, -4, -4)); - p.setClipRect(QRect(rect.topLeft(), QPoint(r[1].left() + 0, rect.bottom())), Qt::UniteClip); - p.setClipRect(QRect(QPoint(r[1].right() - 0, rect.top()), rect.bottomRight()), Qt::UniteClip); - p.setClipRect(QRect(rect.topLeft(), QPoint(rect.right(), r[1].top() + 0)), Qt::UniteClip); - p.setClipRect(QRect(QPoint(rect.left(), r[1].bottom() - 0), rect.bottomRight()), Qt::UniteClip); + QRegion region = r[1].adjusted(4, 4, -4, -4); + region |= QRect(rect.topLeft(), QPoint(r[1].left() + 0, rect.bottom())); + region |= QRect(QPoint(r[1].right() - 0, rect.top()), rect.bottomRight()); + region |= QRect(rect.topLeft(), QPoint(rect.right(), r[1].top() + 0)); + region |= QRect(QPoint(rect.left(), r[1].bottom() - 0), rect.bottomRight()); + p.setClipRegion(region); /* p.setClipRect(r[1].adjusted(3, 3, -3, -3)); p.setClipRect(QRect(rect.topLeft(), QPoint(r[1].left() + 1, rect.bottom())), Qt::UniteClip); @@ -842,11 +843,13 @@ void QtColorLinePrivate::paintEvent(QPaintEvent *) } p.setBrush(m_alphalessPixmap); if (m_orientation == Qt::Horizontal) { - p.setClipRect(r[1].adjusted(0, qRound(r[1].height() * coef), 0, 0)); - p.setClipRect(r[1].adjusted(0, 0, 0, -qRound(r[1].height() * coef)), Qt::UniteClip); + QRegion region = r[1].adjusted(0, qRound(r[1].height() * coef), 0, 0); + region |= r[1].adjusted(0, 0, 0, -qRound(r[1].height() * coef)); + p.setClipRegion(region); } else { - p.setClipRect(r[1].adjusted(qRound(r[1].width() * coef), 0, 0, 0)); - p.setClipRect(r[1].adjusted(0, 0, -qRound(r[1].width() * coef), 0), Qt::UniteClip); + QRegion region = r[1].adjusted(qRound(r[1].width() * coef), 0, 0, 0); + region |= r[1].adjusted(0, 0, -qRound(r[1].width() * coef), 0); + p.setClipRegion(region); } p.setBrush(Qt::NoBrush); p.setPen(QPen(QColor(c.rgb()))); diff --git a/src/shared/qtgradienteditor/qtgradientwidget.cpp b/src/shared/qtgradienteditor/qtgradientwidget.cpp index bf9ea0da6..c32f23841 100644 --- a/src/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientwidget.cpp @@ -592,9 +592,10 @@ void QtGradientWidget::paintEvent(QPaintEvent *e) central.y() - d_ptr->m_radiusRadial * size().height(), 2 * d_ptr->m_radiusRadial * size().width(), 2 * d_ptr->m_radiusRadial * size().height()); - p.setClipRect(r1); - p.setClipRect(r2, Qt::UniteClip); - p.setClipRect(r3, Qt::UniteClip); + QRegion region = r1.toRect(); + region |= r2.toRect(); + region |= r3.toRect(); + p.setClipRegion(region); p.drawEllipse(rect); if (d_ptr->m_dragHandle == QtGradientWidgetPrivate::RadiusRadialHandle) { p.save(); diff --git a/sync.profile b/sync.profile index f89300826..e748d5ecc 100644 --- a/sync.profile +++ b/sync.profile @@ -1,6 +1,6 @@ %modules = ( # path to module name map - "QtCLucene" => "$basedir/src/assistant/lib/fulltextsearch", - "QtHelp" => "$basedir/src/assistant/lib", + "QtCLucene" => "$basedir/src/assistant/clucene", + "QtHelp" => "$basedir/src/assistant/help", "QtDesigner" => "$basedir/src/designer/src/lib", ); %moduleheaders = ( # restrict the module headers to those found in relative path @@ -15,7 +15,6 @@ "xml" => "#include \n", "network" => "#include \n", "script" => "#include \n", - "qt3support" => "#include \n", "declarative" => "#include \n", "clucene" => "#include \n", "help" => "#include \n", @@ -27,47 +26,8 @@ "QtHelp" => "$basedir/modules/qt_help.pri", "QtDesigner" => "$basedir/modules/qt_designer.pri", ); -# Modules and programs, and their dependencies. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - "LATEST_REVISION", to always test against the latest revision. -# - "LATEST_RELEASE", to always test against the latest public release. -# - "THIS_REPOSITORY", to indicate that the module is in this repository. %dependencies = ( - "QtHelp" => { - "QtCore" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtGui" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtSql" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtXml" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - }, - "linguist" => { - "QtGui" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtDesigner" => "THIS_REPOSITORY", - "QtUiTools" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtXml" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtCore" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - }, - "designer" => { - "QtNetwork" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtGui" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtXml" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtDesigner" => "THIS_REPOSITORY", - "QtScript" => "4d15ca64fc7ca81bdadba9fbeb84d4e98a6c0edc", - "QtCore" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - }, - "assistant" => { - "QtWebKit" => "LATEST_REVISION", - "QtHelp" => "THIS_REPOSITORY", - "QtNetwork" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtGui" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtSql" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtXml" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtCore" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - }, - "QtDesigner" => { - "QtCore" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtGui" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - "QtScript" => "4d15ca64fc7ca81bdadba9fbeb84d4e98a6c0edc", - "QtXml" => "0c637cb07ba3c9b353e7e483a209537485cc4e2a", - }, + "qtbase" => "refs/heads/master", + "qtsvg" => "refs/heads/master", + "qtxmlpatterns" => "refs/heads/master", ); -- cgit v1.2.1 From 37a8e98cd004601623476fc0a390fc156c0b52f5 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 13 Sep 2011 14:43:51 +0200 Subject: Add QtUiTools and uilib This code used to live in qtbase. It doesn't belong there however and since there are no dependencies in qtbase left that require it move it here. This significantly simplifies the build system with regards to the code in uilib. Change-Id: I41c8687bd071a1c253eb55594986f3e1424bc6cf Reviewed-on: http://codereview.qt-project.org/4830 Reviewed-by: Lars Knoll --- examples/examples.pro | 2 +- .../uitools/multipleinheritance/calculatorform.cpp | 65 + .../uitools/multipleinheritance/calculatorform.h | 62 + .../uitools/multipleinheritance/calculatorform.ui | 303 + examples/uitools/multipleinheritance/main.cpp | 56 + .../multipleinheritance.desktop | 11 + .../multipleinheritance/multipleinheritance.pro | 19 + examples/uitools/textfinder/main.cpp | 55 + examples/uitools/textfinder/textfinder.cpp | 155 + examples/uitools/textfinder/textfinder.desktop | 11 + examples/uitools/textfinder/textfinder.h | 74 + examples/uitools/textfinder/textfinder.pro | 17 + examples/uitools/textfinder/textfinder.qrc | 6 + examples/uitools/uitools.pro | 14 + modules/qt_designer.pri | 4 +- modules/qt_uitools.pri | 17 + src/designer/src/lib/lib.pro | 64 +- src/designer/src/lib/shared/widgetdatabase.cpp | 2 +- src/designer/src/lib/uilib/abstractformbuilder.cpp | 3154 +++++++ src/designer/src/lib/uilib/abstractformbuilder.h | 283 + src/designer/src/lib/uilib/container.h | 82 + src/designer/src/lib/uilib/container.qdoc | 199 + src/designer/src/lib/uilib/customwidget.h | 101 + src/designer/src/lib/uilib/customwidget.qdoc | 295 + src/designer/src/lib/uilib/extension.h | 109 + src/designer/src/lib/uilib/formbuilder.cpp | 550 ++ src/designer/src/lib/uilib/formbuilder.h | 110 + src/designer/src/lib/uilib/formbuilderextra.cpp | 533 ++ src/designer/src/lib/uilib/formbuilderextra_p.h | 276 + src/designer/src/lib/uilib/formscriptrunner.cpp | 208 + src/designer/src/lib/uilib/formscriptrunner_p.h | 120 + src/designer/src/lib/uilib/properties.cpp | 681 ++ src/designer/src/lib/uilib/properties_p.h | 176 + src/designer/src/lib/uilib/qdesignerexportwidget.h | 66 + src/designer/src/lib/uilib/resourcebuilder.cpp | 180 + src/designer/src/lib/uilib/resourcebuilder_p.h | 104 + src/designer/src/lib/uilib/textbuilder.cpp | 84 + src/designer/src/lib/uilib/textbuilder_p.h | 93 + src/designer/src/lib/uilib/ui4.cpp | 8907 ++++++++++++++++++++ src/designer/src/lib/uilib/ui4_p.h | 3603 ++++++++ src/designer/src/lib/uilib/uilib.pri | 34 + src/designer/src/lib/uilib/uilib_global.h | 64 + src/designer/src/lib/uilib/widgets.table | 148 + src/designer/src/src.pro | 1 + src/designer/src/uitools/quiloader.cpp | 954 +++ src/designer/src/uitools/quiloader.h | 105 + src/designer/src/uitools/quiloader_p.h | 109 + src/designer/src/uitools/uitools.pro | 50 + sync.profile | 3 + tests/auto/auto.pro | 2 +- tests/auto/uiloader/.gitignore | 1 + tests/auto/uiloader/README.TXT | 93 + tests/auto/uiloader/WTC0090dca226c8.ini | 11 + .../baseline/Dialog_with_Buttons_Bottom.ui | 71 + .../uiloader/baseline/Dialog_with_Buttons_Right.ui | 71 + .../uiloader/baseline/Dialog_without_Buttons.ui | 18 + tests/auto/uiloader/baseline/Main_Window.ui | 27 + tests/auto/uiloader/baseline/Widget.ui | 41 + tests/auto/uiloader/baseline/addlinkdialog.ui | 112 + tests/auto/uiloader/baseline/addtorrentform.ui | 266 + .../auto/uiloader/baseline/authenticationdialog.ui | 129 + tests/auto/uiloader/baseline/backside.ui | 208 + tests/auto/uiloader/baseline/batchtranslation.ui | 236 + tests/auto/uiloader/baseline/bookmarkdialog.ui | 161 + tests/auto/uiloader/baseline/bookwindow.ui | 149 + tests/auto/uiloader/baseline/browserwidget.ui | 199 + tests/auto/uiloader/baseline/calculator.ui | 406 + tests/auto/uiloader/baseline/calculatorform.ui | 303 + tests/auto/uiloader/baseline/certificateinfo.ui | 85 + tests/auto/uiloader/baseline/chatdialog.ui | 79 + tests/auto/uiloader/baseline/chatmainwindow.ui | 185 + tests/auto/uiloader/baseline/chatsetnickname.ui | 149 + tests/auto/uiloader/baseline/config.ui | 2528 ++++++ tests/auto/uiloader/baseline/connectdialog.ui | 150 + tests/auto/uiloader/baseline/controller.ui | 64 + tests/auto/uiloader/baseline/cookies.ui | 106 + tests/auto/uiloader/baseline/cookiesexceptions.ui | 184 + tests/auto/uiloader/baseline/css_borderimage.ui | 125 + .../baseline/css_borderimage_allwidgets.ui | 247 + .../baseline/css_borderradius_allwidgets.ui | 458 + .../uiloader/baseline/css_buttons_background.ui | 271 + .../uiloader/baseline/css_combobox_background.ui | 306 + tests/auto/uiloader/baseline/css_exemple_coffee.ui | 469 ++ .../auto/uiloader/baseline/css_exemple_pagefold.ui | 656 ++ tests/auto/uiloader/baseline/css_exemple_usage.ui | 91 + tests/auto/uiloader/baseline/css_frames.ui | 319 + tests/auto/uiloader/baseline/css_groupboxes.ui | 150 + .../uiloader/baseline/css_itemview_task258382.ui | 179 + tests/auto/uiloader/baseline/css_qprogressbar.ui | 125 + tests/auto/uiloader/baseline/css_qtabwidget.ui | 224 + tests/auto/uiloader/baseline/css_qtbug6855.ui | 57 + .../baseline/css_qtbug7737_borderimageradius.ui | 44 + tests/auto/uiloader/baseline/css_scroll.ui | 601 ++ .../auto/uiloader/baseline/css_scrollarea_base.ui | 197 + tests/auto/uiloader/baseline/css_splitter.ui | 63 + tests/auto/uiloader/baseline/css_tab_border.ui | 104 + .../auto/uiloader/baseline/css_tab_closebutton.ui | 128 + tests/auto/uiloader/baseline/css_tab_task213374.ui | 306 + .../uiloader/baseline/css_task255849_downarrow.ui | 144 + .../uiloader/baseline/css_task259226_spinboxes.ui | 83 + tests/auto/uiloader/baseline/default.ui | 329 + tests/auto/uiloader/baseline/dialog.ui | 47 + tests/auto/uiloader/baseline/downloaditem.ui | 134 + tests/auto/uiloader/baseline/downloads.ui | 83 + tests/auto/uiloader/baseline/embeddeddialog.ui | 87 + tests/auto/uiloader/baseline/filespage.ui | 79 + tests/auto/uiloader/baseline/filternamedialog.ui | 67 + tests/auto/uiloader/baseline/filterpage.ui | 125 + tests/auto/uiloader/baseline/finddialog.ui | 265 + tests/auto/uiloader/baseline/formwindowsettings.ui | 311 + tests/auto/uiloader/baseline/generalpage.ui | 69 + tests/auto/uiloader/baseline/gridpanel.ui | 144 + tests/auto/uiloader/baseline/helpdialog.ui | 404 + tests/auto/uiloader/baseline/history.ui | 106 + tests/auto/uiloader/baseline/identifierpage.ui | 132 + tests/auto/uiloader/baseline/imagedialog.ui | 389 + tests/auto/uiloader/baseline/images/arrow-down.png | Bin 0 -> 1006 bytes tests/auto/uiloader/baseline/images/arrow-up.png | Bin 0 -> 927 bytes .../auto/uiloader/baseline/images/borderimage.png | Bin 0 -> 1672 bytes .../uiloader/baseline/images/checkbox_checked.png | Bin 0 -> 263 bytes .../baseline/images/checkbox_checked_hover.png | Bin 0 -> 266 bytes .../baseline/images/checkbox_checked_pressed.png | Bin 0 -> 425 bytes .../baseline/images/checkbox_unchecked.png | Bin 0 -> 159 bytes .../baseline/images/checkbox_unchecked_hover.png | Bin 0 -> 159 bytes .../baseline/images/checkbox_unchecked_pressed.png | Bin 0 -> 320 bytes tests/auto/uiloader/baseline/images/down_arrow.png | Bin 0 -> 175 bytes .../baseline/images/down_arrow_disabled.png | Bin 0 -> 174 bytes tests/auto/uiloader/baseline/images/frame.png | Bin 0 -> 253 bytes tests/auto/uiloader/baseline/images/pagefold.png | Bin 0 -> 1545 bytes tests/auto/uiloader/baseline/images/pushbutton.png | Bin 0 -> 533 bytes .../uiloader/baseline/images/pushbutton_hover.png | Bin 0 -> 525 bytes .../baseline/images/pushbutton_pressed.png | Bin 0 -> 513 bytes .../baseline/images/radiobutton_checked.png | Bin 0 -> 355 bytes .../baseline/images/radiobutton_checked_hover.png | Bin 0 -> 532 bytes .../images/radiobutton_checked_pressed.png | Bin 0 -> 599 bytes .../baseline/images/radiobutton_unchecked.png | Bin 0 -> 240 bytes .../images/radiobutton_unchecked_hover.png | Bin 0 -> 492 bytes .../images/radiobutton_unchecked_pressed.png | Bin 0 -> 556 bytes tests/auto/uiloader/baseline/images/sizegrip.png | Bin 0 -> 129 bytes tests/auto/uiloader/baseline/images/spindown.png | Bin 0 -> 276 bytes .../uiloader/baseline/images/spindown_hover.png | Bin 0 -> 268 bytes .../auto/uiloader/baseline/images/spindown_off.png | Bin 0 -> 249 bytes .../uiloader/baseline/images/spindown_pressed.png | Bin 0 -> 264 bytes tests/auto/uiloader/baseline/images/spinup.png | Bin 0 -> 283 bytes .../auto/uiloader/baseline/images/spinup_hover.png | Bin 0 -> 277 bytes tests/auto/uiloader/baseline/images/spinup_off.png | Bin 0 -> 274 bytes .../uiloader/baseline/images/spinup_pressed.png | Bin 0 -> 277 bytes .../baseline/images/splitter_horizontal.png | Bin 0 -> 199 bytes .../uiloader/baseline/images/splitter_vertical.png | Bin 0 -> 193 bytes tests/auto/uiloader/baseline/images/up_arrow.png | Bin 0 -> 197 bytes .../uiloader/baseline/images/up_arrow_disabled.png | Bin 0 -> 172 bytes tests/auto/uiloader/baseline/inputpage.ui | 79 + tests/auto/uiloader/baseline/installdialog.ui | 118 + tests/auto/uiloader/baseline/languagesdialog.ui | 160 + tests/auto/uiloader/baseline/listwidgeteditor.ui | 226 + tests/auto/uiloader/baseline/mainwindow.ui | 502 ++ tests/auto/uiloader/baseline/mainwindowbase.ui | 1214 +++ tests/auto/uiloader/baseline/mydialog.ui | 47 + tests/auto/uiloader/baseline/myform.ui | 130 + tests/auto/uiloader/baseline/newactiondialog.ui | 202 + .../uiloader/baseline/newdynamicpropertydialog.ui | 106 + tests/auto/uiloader/baseline/newform.ui | 153 + tests/auto/uiloader/baseline/orderdialog.ui | 198 + tests/auto/uiloader/baseline/outputpage.ui | 95 + tests/auto/uiloader/baseline/pagefold.ui | 349 + tests/auto/uiloader/baseline/paletteeditor.ui | 264 + .../uiloader/baseline/paletteeditoradvancedbase.ui | 617 ++ tests/auto/uiloader/baseline/passworddialog.ui | 111 + tests/auto/uiloader/baseline/pathpage.ui | 114 + tests/auto/uiloader/baseline/phrasebookbox.ui | 211 + tests/auto/uiloader/baseline/plugindialog.ui | 153 + tests/auto/uiloader/baseline/preferencesdialog.ui | 165 + .../baseline/previewconfigurationwidget.ui | 91 + tests/auto/uiloader/baseline/previewdialogbase.ui | 224 + tests/auto/uiloader/baseline/previewwidget.ui | 238 + tests/auto/uiloader/baseline/previewwidgetbase.ui | 340 + tests/auto/uiloader/baseline/proxy.ui | 104 + tests/auto/uiloader/baseline/qfiledialog.ui | 320 + tests/auto/uiloader/baseline/qpagesetupwidget.ui | 353 + .../uiloader/baseline/qprintpropertieswidget.ui | 70 + .../auto/uiloader/baseline/qprintsettingsoutput.ui | 371 + tests/auto/uiloader/baseline/qprintwidget.ui | 116 + .../auto/uiloader/baseline/qsqlconnectiondialog.ui | 224 + tests/auto/uiloader/baseline/qtgradientdialog.ui | 121 + tests/auto/uiloader/baseline/qtgradienteditor.ui | 1377 +++ tests/auto/uiloader/baseline/qtgradientview.ui | 135 + .../auto/uiloader/baseline/qtgradientviewdialog.ui | 121 + .../uiloader/baseline/qtresourceeditordialog.ui | 180 + tests/auto/uiloader/baseline/qttoolbardialog.ui | 207 + tests/auto/uiloader/baseline/querywidget.ui | 163 + tests/auto/uiloader/baseline/remotecontrol.ui | 228 + tests/auto/uiloader/baseline/saveformastemplate.ui | 166 + tests/auto/uiloader/baseline/settings.ui | 262 + tests/auto/uiloader/baseline/signalslotdialog.ui | 129 + tests/auto/uiloader/baseline/sslclient.ui | 190 + tests/auto/uiloader/baseline/sslerrors.ui | 110 + tests/auto/uiloader/baseline/statistics.ui | 242 + tests/auto/uiloader/baseline/stringlisteditor.ui | 265 + tests/auto/uiloader/baseline/stylesheeteditor.ui | 171 + tests/auto/uiloader/baseline/tabbedbrowser.ui | 233 + tests/auto/uiloader/baseline/tablewidgeteditor.ui | 403 + tests/auto/uiloader/baseline/tetrixwindow.ui | 164 + tests/auto/uiloader/baseline/textfinder.ui | 89 + tests/auto/uiloader/baseline/topicchooser.ui | 116 + tests/auto/uiloader/baseline/translatedialog.ui | 301 + .../auto/uiloader/baseline/translationsettings.ui | 107 + tests/auto/uiloader/baseline/treewidgeteditor.ui | 379 + tests/auto/uiloader/baseline/trpreviewtool.ui | 189 + tests/auto/uiloader/baseline/validators.ui | 467 + .../auto/uiloader/baseline/wateringconfigdialog.ui | 446 + tests/auto/uiloader/desert.ini | 11 + tests/auto/uiloader/dole.ini | 11 + tests/auto/uiloader/gravlaks.ini | 11 + tests/auto/uiloader/jackychan.ini | 11 + tests/auto/uiloader/jeunehomme.ini | 11 + tests/auto/uiloader/kangaroo.ini | 11 + tests/auto/uiloader/kayak.ini | 11 + tests/auto/uiloader/scruffy.ini | 11 + tests/auto/uiloader/troll15.ini | 11 + tests/auto/uiloader/tundra.ini | 11 + tests/auto/uiloader/uiloader.pro | 3 + tests/auto/uiloader/uiloader/tst_uiloader.cpp | 107 + tests/auto/uiloader/uiloader/uiloader.cpp | 814 ++ tests/auto/uiloader/uiloader/uiloader.h | 109 + tests/auto/uiloader/uiloader/uiloader.pro | 30 + tests/auto/uiloader/wartburg.ini | 11 + 226 files changed, 52230 insertions(+), 51 deletions(-) create mode 100644 examples/uitools/multipleinheritance/calculatorform.cpp create mode 100644 examples/uitools/multipleinheritance/calculatorform.h create mode 100644 examples/uitools/multipleinheritance/calculatorform.ui create mode 100644 examples/uitools/multipleinheritance/main.cpp create mode 100644 examples/uitools/multipleinheritance/multipleinheritance.desktop create mode 100644 examples/uitools/multipleinheritance/multipleinheritance.pro create mode 100644 examples/uitools/textfinder/main.cpp create mode 100644 examples/uitools/textfinder/textfinder.cpp create mode 100644 examples/uitools/textfinder/textfinder.desktop create mode 100644 examples/uitools/textfinder/textfinder.h create mode 100644 examples/uitools/textfinder/textfinder.pro create mode 100644 examples/uitools/textfinder/textfinder.qrc create mode 100644 examples/uitools/uitools.pro create mode 100644 modules/qt_uitools.pri create mode 100644 src/designer/src/lib/uilib/abstractformbuilder.cpp create mode 100644 src/designer/src/lib/uilib/abstractformbuilder.h create mode 100644 src/designer/src/lib/uilib/container.h create mode 100644 src/designer/src/lib/uilib/container.qdoc create mode 100644 src/designer/src/lib/uilib/customwidget.h create mode 100644 src/designer/src/lib/uilib/customwidget.qdoc create mode 100644 src/designer/src/lib/uilib/extension.h create mode 100644 src/designer/src/lib/uilib/formbuilder.cpp create mode 100644 src/designer/src/lib/uilib/formbuilder.h create mode 100644 src/designer/src/lib/uilib/formbuilderextra.cpp create mode 100644 src/designer/src/lib/uilib/formbuilderextra_p.h create mode 100644 src/designer/src/lib/uilib/formscriptrunner.cpp create mode 100644 src/designer/src/lib/uilib/formscriptrunner_p.h create mode 100644 src/designer/src/lib/uilib/properties.cpp create mode 100644 src/designer/src/lib/uilib/properties_p.h create mode 100644 src/designer/src/lib/uilib/qdesignerexportwidget.h create mode 100644 src/designer/src/lib/uilib/resourcebuilder.cpp create mode 100644 src/designer/src/lib/uilib/resourcebuilder_p.h create mode 100644 src/designer/src/lib/uilib/textbuilder.cpp create mode 100644 src/designer/src/lib/uilib/textbuilder_p.h create mode 100644 src/designer/src/lib/uilib/ui4.cpp create mode 100644 src/designer/src/lib/uilib/ui4_p.h create mode 100644 src/designer/src/lib/uilib/uilib.pri create mode 100644 src/designer/src/lib/uilib/uilib_global.h create mode 100644 src/designer/src/lib/uilib/widgets.table create mode 100644 src/designer/src/uitools/quiloader.cpp create mode 100644 src/designer/src/uitools/quiloader.h create mode 100644 src/designer/src/uitools/quiloader_p.h create mode 100644 src/designer/src/uitools/uitools.pro create mode 100644 tests/auto/uiloader/.gitignore create mode 100644 tests/auto/uiloader/README.TXT create mode 100644 tests/auto/uiloader/WTC0090dca226c8.ini create mode 100644 tests/auto/uiloader/baseline/Dialog_with_Buttons_Bottom.ui create mode 100644 tests/auto/uiloader/baseline/Dialog_with_Buttons_Right.ui create mode 100644 tests/auto/uiloader/baseline/Dialog_without_Buttons.ui create mode 100644 tests/auto/uiloader/baseline/Main_Window.ui create mode 100644 tests/auto/uiloader/baseline/Widget.ui create mode 100644 tests/auto/uiloader/baseline/addlinkdialog.ui create mode 100644 tests/auto/uiloader/baseline/addtorrentform.ui create mode 100644 tests/auto/uiloader/baseline/authenticationdialog.ui create mode 100644 tests/auto/uiloader/baseline/backside.ui create mode 100644 tests/auto/uiloader/baseline/batchtranslation.ui create mode 100644 tests/auto/uiloader/baseline/bookmarkdialog.ui create mode 100644 tests/auto/uiloader/baseline/bookwindow.ui create mode 100644 tests/auto/uiloader/baseline/browserwidget.ui create mode 100644 tests/auto/uiloader/baseline/calculator.ui create mode 100644 tests/auto/uiloader/baseline/calculatorform.ui create mode 100644 tests/auto/uiloader/baseline/certificateinfo.ui create mode 100644 tests/auto/uiloader/baseline/chatdialog.ui create mode 100644 tests/auto/uiloader/baseline/chatmainwindow.ui create mode 100644 tests/auto/uiloader/baseline/chatsetnickname.ui create mode 100644 tests/auto/uiloader/baseline/config.ui create mode 100644 tests/auto/uiloader/baseline/connectdialog.ui create mode 100644 tests/auto/uiloader/baseline/controller.ui create mode 100644 tests/auto/uiloader/baseline/cookies.ui create mode 100644 tests/auto/uiloader/baseline/cookiesexceptions.ui create mode 100644 tests/auto/uiloader/baseline/css_borderimage.ui create mode 100644 tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui create mode 100644 tests/auto/uiloader/baseline/css_borderradius_allwidgets.ui create mode 100644 tests/auto/uiloader/baseline/css_buttons_background.ui create mode 100644 tests/auto/uiloader/baseline/css_combobox_background.ui create mode 100644 tests/auto/uiloader/baseline/css_exemple_coffee.ui create mode 100644 tests/auto/uiloader/baseline/css_exemple_pagefold.ui create mode 100644 tests/auto/uiloader/baseline/css_exemple_usage.ui create mode 100644 tests/auto/uiloader/baseline/css_frames.ui create mode 100644 tests/auto/uiloader/baseline/css_groupboxes.ui create mode 100644 tests/auto/uiloader/baseline/css_itemview_task258382.ui create mode 100644 tests/auto/uiloader/baseline/css_qprogressbar.ui create mode 100644 tests/auto/uiloader/baseline/css_qtabwidget.ui create mode 100644 tests/auto/uiloader/baseline/css_qtbug6855.ui create mode 100644 tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui create mode 100644 tests/auto/uiloader/baseline/css_scroll.ui create mode 100644 tests/auto/uiloader/baseline/css_scrollarea_base.ui create mode 100644 tests/auto/uiloader/baseline/css_splitter.ui create mode 100644 tests/auto/uiloader/baseline/css_tab_border.ui create mode 100644 tests/auto/uiloader/baseline/css_tab_closebutton.ui create mode 100644 tests/auto/uiloader/baseline/css_tab_task213374.ui create mode 100644 tests/auto/uiloader/baseline/css_task255849_downarrow.ui create mode 100644 tests/auto/uiloader/baseline/css_task259226_spinboxes.ui create mode 100644 tests/auto/uiloader/baseline/default.ui create mode 100644 tests/auto/uiloader/baseline/dialog.ui create mode 100644 tests/auto/uiloader/baseline/downloaditem.ui create mode 100644 tests/auto/uiloader/baseline/downloads.ui create mode 100644 tests/auto/uiloader/baseline/embeddeddialog.ui create mode 100644 tests/auto/uiloader/baseline/filespage.ui create mode 100644 tests/auto/uiloader/baseline/filternamedialog.ui create mode 100644 tests/auto/uiloader/baseline/filterpage.ui create mode 100644 tests/auto/uiloader/baseline/finddialog.ui create mode 100644 tests/auto/uiloader/baseline/formwindowsettings.ui create mode 100644 tests/auto/uiloader/baseline/generalpage.ui create mode 100644 tests/auto/uiloader/baseline/gridpanel.ui create mode 100644 tests/auto/uiloader/baseline/helpdialog.ui create mode 100644 tests/auto/uiloader/baseline/history.ui create mode 100644 tests/auto/uiloader/baseline/identifierpage.ui create mode 100644 tests/auto/uiloader/baseline/imagedialog.ui create mode 100644 tests/auto/uiloader/baseline/images/arrow-down.png create mode 100644 tests/auto/uiloader/baseline/images/arrow-up.png create mode 100644 tests/auto/uiloader/baseline/images/borderimage.png create mode 100644 tests/auto/uiloader/baseline/images/checkbox_checked.png create mode 100644 tests/auto/uiloader/baseline/images/checkbox_checked_hover.png create mode 100644 tests/auto/uiloader/baseline/images/checkbox_checked_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/checkbox_unchecked.png create mode 100644 tests/auto/uiloader/baseline/images/checkbox_unchecked_hover.png create mode 100644 tests/auto/uiloader/baseline/images/checkbox_unchecked_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/down_arrow.png create mode 100644 tests/auto/uiloader/baseline/images/down_arrow_disabled.png create mode 100644 tests/auto/uiloader/baseline/images/frame.png create mode 100644 tests/auto/uiloader/baseline/images/pagefold.png create mode 100644 tests/auto/uiloader/baseline/images/pushbutton.png create mode 100644 tests/auto/uiloader/baseline/images/pushbutton_hover.png create mode 100644 tests/auto/uiloader/baseline/images/pushbutton_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/radiobutton_checked.png create mode 100644 tests/auto/uiloader/baseline/images/radiobutton_checked_hover.png create mode 100644 tests/auto/uiloader/baseline/images/radiobutton_checked_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/radiobutton_unchecked.png create mode 100644 tests/auto/uiloader/baseline/images/radiobutton_unchecked_hover.png create mode 100644 tests/auto/uiloader/baseline/images/radiobutton_unchecked_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/sizegrip.png create mode 100644 tests/auto/uiloader/baseline/images/spindown.png create mode 100644 tests/auto/uiloader/baseline/images/spindown_hover.png create mode 100644 tests/auto/uiloader/baseline/images/spindown_off.png create mode 100644 tests/auto/uiloader/baseline/images/spindown_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/spinup.png create mode 100644 tests/auto/uiloader/baseline/images/spinup_hover.png create mode 100644 tests/auto/uiloader/baseline/images/spinup_off.png create mode 100644 tests/auto/uiloader/baseline/images/spinup_pressed.png create mode 100644 tests/auto/uiloader/baseline/images/splitter_horizontal.png create mode 100644 tests/auto/uiloader/baseline/images/splitter_vertical.png create mode 100644 tests/auto/uiloader/baseline/images/up_arrow.png create mode 100644 tests/auto/uiloader/baseline/images/up_arrow_disabled.png create mode 100644 tests/auto/uiloader/baseline/inputpage.ui create mode 100644 tests/auto/uiloader/baseline/installdialog.ui create mode 100644 tests/auto/uiloader/baseline/languagesdialog.ui create mode 100644 tests/auto/uiloader/baseline/listwidgeteditor.ui create mode 100644 tests/auto/uiloader/baseline/mainwindow.ui create mode 100644 tests/auto/uiloader/baseline/mainwindowbase.ui create mode 100644 tests/auto/uiloader/baseline/mydialog.ui create mode 100644 tests/auto/uiloader/baseline/myform.ui create mode 100644 tests/auto/uiloader/baseline/newactiondialog.ui create mode 100644 tests/auto/uiloader/baseline/newdynamicpropertydialog.ui create mode 100644 tests/auto/uiloader/baseline/newform.ui create mode 100644 tests/auto/uiloader/baseline/orderdialog.ui create mode 100644 tests/auto/uiloader/baseline/outputpage.ui create mode 100644 tests/auto/uiloader/baseline/pagefold.ui create mode 100644 tests/auto/uiloader/baseline/paletteeditor.ui create mode 100644 tests/auto/uiloader/baseline/paletteeditoradvancedbase.ui create mode 100644 tests/auto/uiloader/baseline/passworddialog.ui create mode 100644 tests/auto/uiloader/baseline/pathpage.ui create mode 100644 tests/auto/uiloader/baseline/phrasebookbox.ui create mode 100644 tests/auto/uiloader/baseline/plugindialog.ui create mode 100644 tests/auto/uiloader/baseline/preferencesdialog.ui create mode 100644 tests/auto/uiloader/baseline/previewconfigurationwidget.ui create mode 100644 tests/auto/uiloader/baseline/previewdialogbase.ui create mode 100644 tests/auto/uiloader/baseline/previewwidget.ui create mode 100644 tests/auto/uiloader/baseline/previewwidgetbase.ui create mode 100644 tests/auto/uiloader/baseline/proxy.ui create mode 100644 tests/auto/uiloader/baseline/qfiledialog.ui create mode 100644 tests/auto/uiloader/baseline/qpagesetupwidget.ui create mode 100644 tests/auto/uiloader/baseline/qprintpropertieswidget.ui create mode 100644 tests/auto/uiloader/baseline/qprintsettingsoutput.ui create mode 100644 tests/auto/uiloader/baseline/qprintwidget.ui create mode 100644 tests/auto/uiloader/baseline/qsqlconnectiondialog.ui create mode 100644 tests/auto/uiloader/baseline/qtgradientdialog.ui create mode 100644 tests/auto/uiloader/baseline/qtgradienteditor.ui create mode 100644 tests/auto/uiloader/baseline/qtgradientview.ui create mode 100644 tests/auto/uiloader/baseline/qtgradientviewdialog.ui create mode 100644 tests/auto/uiloader/baseline/qtresourceeditordialog.ui create mode 100644 tests/auto/uiloader/baseline/qttoolbardialog.ui create mode 100644 tests/auto/uiloader/baseline/querywidget.ui create mode 100644 tests/auto/uiloader/baseline/remotecontrol.ui create mode 100644 tests/auto/uiloader/baseline/saveformastemplate.ui create mode 100644 tests/auto/uiloader/baseline/settings.ui create mode 100644 tests/auto/uiloader/baseline/signalslotdialog.ui create mode 100644 tests/auto/uiloader/baseline/sslclient.ui create mode 100644 tests/auto/uiloader/baseline/sslerrors.ui create mode 100644 tests/auto/uiloader/baseline/statistics.ui create mode 100644 tests/auto/uiloader/baseline/stringlisteditor.ui create mode 100644 tests/auto/uiloader/baseline/stylesheeteditor.ui create mode 100644 tests/auto/uiloader/baseline/tabbedbrowser.ui create mode 100644 tests/auto/uiloader/baseline/tablewidgeteditor.ui create mode 100644 tests/auto/uiloader/baseline/tetrixwindow.ui create mode 100644 tests/auto/uiloader/baseline/textfinder.ui create mode 100644 tests/auto/uiloader/baseline/topicchooser.ui create mode 100644 tests/auto/uiloader/baseline/translatedialog.ui create mode 100644 tests/auto/uiloader/baseline/translationsettings.ui create mode 100644 tests/auto/uiloader/baseline/treewidgeteditor.ui create mode 100644 tests/auto/uiloader/baseline/trpreviewtool.ui create mode 100644 tests/auto/uiloader/baseline/validators.ui create mode 100644 tests/auto/uiloader/baseline/wateringconfigdialog.ui create mode 100644 tests/auto/uiloader/desert.ini create mode 100644 tests/auto/uiloader/dole.ini create mode 100644 tests/auto/uiloader/gravlaks.ini create mode 100644 tests/auto/uiloader/jackychan.ini create mode 100644 tests/auto/uiloader/jeunehomme.ini create mode 100644 tests/auto/uiloader/kangaroo.ini create mode 100644 tests/auto/uiloader/kayak.ini create mode 100644 tests/auto/uiloader/scruffy.ini create mode 100644 tests/auto/uiloader/troll15.ini create mode 100644 tests/auto/uiloader/tundra.ini create mode 100644 tests/auto/uiloader/uiloader.pro create mode 100644 tests/auto/uiloader/uiloader/tst_uiloader.cpp create mode 100644 tests/auto/uiloader/uiloader/uiloader.cpp create mode 100644 tests/auto/uiloader/uiloader/uiloader.h create mode 100644 tests/auto/uiloader/uiloader/uiloader.pro create mode 100644 tests/auto/uiloader/wartburg.ini diff --git a/examples/examples.pro b/examples/examples.pro index e2f2c617f..3c12ee67c 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS += help designer +SUBDIRS += help designer uitools diff --git a/examples/uitools/multipleinheritance/calculatorform.cpp b/examples/uitools/multipleinheritance/calculatorform.cpp new file mode 100644 index 000000000..ae1312f55 --- /dev/null +++ b/examples/uitools/multipleinheritance/calculatorform.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "calculatorform.h" + + +//! [0] +CalculatorForm::CalculatorForm(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} +//! [0] + +//! [1] +void CalculatorForm::on_inputSpinBox1_valueChanged(int value) +{ + outputWidget->setText(QString::number(value + inputSpinBox2->value())); +} +//! [1] + +//! [2] +void CalculatorForm::on_inputSpinBox2_valueChanged(int value) +{ + outputWidget->setText(QString::number(value + inputSpinBox1->value())); +} +//! [2] diff --git a/examples/uitools/multipleinheritance/calculatorform.h b/examples/uitools/multipleinheritance/calculatorform.h new file mode 100644 index 000000000..9b8c8880b --- /dev/null +++ b/examples/uitools/multipleinheritance/calculatorform.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CALCULATORFORM_H +#define CALCULATORFORM_H + +//! [0] +#include "ui_calculatorform.h" +//! [0] + +//! [1] +class CalculatorForm : public QWidget, private Ui::CalculatorForm +{ + Q_OBJECT + +public: + CalculatorForm(QWidget *parent = 0); + +private slots: + void on_inputSpinBox1_valueChanged(int value); + void on_inputSpinBox2_valueChanged(int value); +}; +//! [1] + +#endif diff --git a/examples/uitools/multipleinheritance/calculatorform.ui b/examples/uitools/multipleinheritance/calculatorform.ui new file mode 100644 index 000000000..dda0e62dd --- /dev/null +++ b/examples/uitools/multipleinheritance/calculatorform.ui @@ -0,0 +1,303 @@ + + + + + CalculatorForm + + + CalculatorForm + + + + 0 + 0 + 276 + 98 + + + + + 5 + 5 + 0 + 0 + + + + Calculator Builder + + + + + + + 9 + + + 6 + + + + + + + + 1 + + + 6 + + + + + + + + 1 + + + 6 + + + + + label + + + + 1 + 1 + 45 + 19 + + + + Input 1 + + + + + + + inputSpinBox1 + + + + 1 + 26 + 45 + 25 + + + + true + + + + + + + + + label_3 + + + + 54 + 1 + 7 + 52 + + + + + + + + Qt::AlignCenter + + + + + + + + + + 1 + + + 6 + + + + + label_2 + + + + 1 + 1 + 45 + 19 + + + + Input 2 + + + + + + + inputSpinBox2 + + + + 1 + 26 + 45 + 25 + + + + true + + + + + + + + + label_3_2 + + + + 120 + 1 + 7 + 52 + + + + = + + + Qt::AlignCenter + + + + + + + + + + 1 + + + 6 + + + + + label_2_2_2 + + + + 1 + 1 + 37 + 17 + + + + Output + + + + + + + outputWidget + + + + 1 + 24 + 37 + 27 + + + + QFrame::Box + + + QFrame::Sunken + + + 0 + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + + + + + + + + + verticalSpacer + + + + 85 + 69 + 20 + 20 + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + horizontalSpacer + + + + 188 + 26 + 79 + 20 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + diff --git a/examples/uitools/multipleinheritance/main.cpp b/examples/uitools/multipleinheritance/main.cpp new file mode 100644 index 000000000..56ba8efe5 --- /dev/null +++ b/examples/uitools/multipleinheritance/main.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "calculatorform.h" + +//! [0] +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + CalculatorForm calculator; +#if defined(Q_OS_SYMBIAN) + calculator.showMaximized(); +#else + calculator.show(); +#endif + return app.exec(); +} +//! [0] diff --git a/examples/uitools/multipleinheritance/multipleinheritance.desktop b/examples/uitools/multipleinheritance/multipleinheritance.desktop new file mode 100644 index 000000000..7e652f972 --- /dev/null +++ b/examples/uitools/multipleinheritance/multipleinheritance.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Multiple Inheritance +Exec=/opt/usr/bin/multipleinheritance +Icon=multipleinheritance +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/uitools/multipleinheritance/multipleinheritance.pro b/examples/uitools/multipleinheritance/multipleinheritance.pro new file mode 100644 index 000000000..7e6496741 --- /dev/null +++ b/examples/uitools/multipleinheritance/multipleinheritance.pro @@ -0,0 +1,19 @@ +#! [0] +SOURCES = calculatorform.cpp main.cpp +HEADERS = calculatorform.h +FORMS = calculatorform.ui +#! [0] + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools/multipleinheritance +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools/multipleinheritance +INSTALLS += target sources + +symbian { + TARGET.UID3 = 0xA000D7C1 + CONFIG += qt_example +} +QT += widgets +maemo5: CONFIG += qt_example + diff --git a/examples/uitools/textfinder/main.cpp b/examples/uitools/textfinder/main.cpp new file mode 100644 index 000000000..2fe9b715d --- /dev/null +++ b/examples/uitools/textfinder/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "textfinder.h" + +//! [0] +int main(int argc, char *argv[]) +{ + Q_INIT_RESOURCE(textfinder); + QApplication app(argc, argv); + + TextFinder *textFinder = new TextFinder; + textFinder->show(); + + return app.exec(); +} +//! [0] diff --git a/examples/uitools/textfinder/textfinder.cpp b/examples/uitools/textfinder/textfinder.cpp new file mode 100644 index 000000000..041c36f21 --- /dev/null +++ b/examples/uitools/textfinder/textfinder.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "textfinder.h" + +//! [0] +TextFinder::TextFinder(QWidget *parent) + : QWidget(parent) +{ + QWidget *formWidget = loadUiFile(); + +//! [1] + ui_findButton = findChild("findButton"); + ui_textEdit = findChild("textEdit"); + ui_lineEdit = findChild("lineEdit"); +//! [0] //! [1] + +//! [2] + QMetaObject::connectSlotsByName(this); +//! [2] + +//! [3a] + loadTextFile(); +//! [3a] + +//! [3b] + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(formWidget); + setLayout(layout); +//! [3b] + +//! [3c] + setWindowTitle(tr("Text Finder")); + isFirstTime = true; +} +//! [3c] + +//! [4] +QWidget* TextFinder::loadUiFile() +{ + QUiLoader loader; + + QFile file(":/forms/textfinder.ui"); + file.open(QFile::ReadOnly); + + QWidget *formWidget = loader.load(&file, this); + file.close(); + + return formWidget; +} +//! [4] + +//! [5] +void TextFinder::loadTextFile() +{ + QFile inputFile(":/forms/input.txt"); + inputFile.open(QIODevice::ReadOnly); + QTextStream in(&inputFile); + QString line = in.readAll(); + inputFile.close(); + + ui_textEdit->append(line); + ui_textEdit->setUndoRedoEnabled(false); + ui_textEdit->setUndoRedoEnabled(true); +} +//! [5] + +//! [6] //! [7] +void TextFinder::on_findButton_clicked() +{ + QString searchString = ui_lineEdit->text(); + QTextDocument *document = ui_textEdit->document(); + + bool found = false; + + if (isFirstTime == false) + document->undo(); + + if (searchString.isEmpty()) { + QMessageBox::information(this, tr("Empty Search Field"), + "The search field is empty. Please enter a word and click Find."); + } else { + + QTextCursor highlightCursor(document); + QTextCursor cursor(document); + + cursor.beginEditBlock(); +//! [6] + + QTextCharFormat plainFormat(highlightCursor.charFormat()); + QTextCharFormat colorFormat = plainFormat; + colorFormat.setForeground(Qt::red); + + while (!highlightCursor.isNull() && !highlightCursor.atEnd()) { + highlightCursor = document->find(searchString, highlightCursor, QTextDocument::FindWholeWords); + + if (!highlightCursor.isNull()) { + found = true; + highlightCursor.movePosition(QTextCursor::WordRight, + QTextCursor::KeepAnchor); + highlightCursor.mergeCharFormat(colorFormat); + } + } + +//! [8] + cursor.endEditBlock(); +//! [7] //! [9] + isFirstTime = false; + + if (found == false) { + QMessageBox::information(this, tr("Word Not Found"), + "Sorry, the word cannot be found."); + } + } +} +//! [8] //! [9] diff --git a/examples/uitools/textfinder/textfinder.desktop b/examples/uitools/textfinder/textfinder.desktop new file mode 100644 index 000000000..e1911cc61 --- /dev/null +++ b/examples/uitools/textfinder/textfinder.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Text Finder +Exec=/opt/usr/bin/textfinder +Icon=textfinder +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/uitools/textfinder/textfinder.h b/examples/uitools/textfinder/textfinder.h new file mode 100644 index 000000000..c3cd030cb --- /dev/null +++ b/examples/uitools/textfinder/textfinder.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TEXTFINDER_H +#define TEXTFINDER_H + +#include + +QT_BEGIN_NAMESPACE +class QPushButton; +class QTextEdit; +class QLineEdit; +QT_END_NAMESPACE + +//! [0] +class TextFinder : public QWidget +{ + Q_OBJECT + +public: + TextFinder(QWidget *parent = 0); + +private slots: + void on_findButton_clicked(); + +private: + QWidget* loadUiFile(); + void loadTextFile(); + + QPushButton *ui_findButton; + QTextEdit *ui_textEdit; + QLineEdit *ui_lineEdit; + bool isFirstTime; +}; +//! [0] + +#endif diff --git a/examples/uitools/textfinder/textfinder.pro b/examples/uitools/textfinder/textfinder.pro new file mode 100644 index 000000000..337b7216e --- /dev/null +++ b/examples/uitools/textfinder/textfinder.pro @@ -0,0 +1,17 @@ +CONFIG += uitools +HEADERS = textfinder.h +RESOURCES = textfinder.qrc +SOURCES = textfinder.cpp main.cpp + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools/textfinder +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro forms +sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools/textfinder +INSTALLS += target sources + +symbian: CONFIG += qt_example +QT += widgets +maemo5: CONFIG += qt_example + +symbian: warning(This example does not work on Symbian platform) +simulator: warning(This example does not work on Simulator platform) diff --git a/examples/uitools/textfinder/textfinder.qrc b/examples/uitools/textfinder/textfinder.qrc new file mode 100644 index 000000000..a4cea8a77 --- /dev/null +++ b/examples/uitools/textfinder/textfinder.qrc @@ -0,0 +1,6 @@ + + + forms/textfinder.ui + forms/input.txt + + \ No newline at end of file diff --git a/examples/uitools/uitools.pro b/examples/uitools/uitools.pro new file mode 100644 index 000000000..f17de666f --- /dev/null +++ b/examples/uitools/uitools.pro @@ -0,0 +1,14 @@ +TEMPLATE = subdirs +SUBDIRS = multipleinheritance + +!wince*:!symbian:contains(QT_BUILD_PARTS, tools): SUBDIRS += textfinder + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS uitools.pro README +sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/uitools +INSTALLS += target sources + +symbian: CONFIG += qt_example +QT += widgets +maemo5: CONFIG += qt_example diff --git a/modules/qt_designer.pri b/modules/qt_designer.pri index 2a2ce8a86..faf22047b 100644 --- a/modules/qt_designer.pri +++ b/modules/qt_designer.pri @@ -11,5 +11,7 @@ QT.designer.sources = $$QT_MODULE_BASE/src/designer/src/lib QT.designer.libs = $$QT_MODULE_LIB_BASE QT.designer.plugins = $$QT_MODULE_PLUGIN_BASE QT.designer.imports = $$QT_MODULE_IMPORT_BASE -QT.designer.depends = xml +QT.designer.depends = core xml gui widgets QT.designer.DEFINES = QT_DESIGNER_LIB + +QT_CONFIG += designer diff --git a/modules/qt_uitools.pri b/modules/qt_uitools.pri new file mode 100644 index 000000000..a0d08ccc4 --- /dev/null +++ b/modules/qt_uitools.pri @@ -0,0 +1,17 @@ +QT.uitools.VERSION = 5.0.0 +QT.uitools.MAJOR_VERSION = 5 +QT.uitools.MINOR_VERSION = 0 +QT.uitools.PATCH_VERSION = 0 + +QT.uitools.name = QtUiTools +QT.uitools.bins = $$QT_MODULE_BIN_BASE +QT.uitools.includes = $$QT_MODULE_INCLUDE_BASE/QtUiTools +QT.uitools.private_includes = $$QT_MODULE_INCLUDE_BASE/QtUiTools/$$QT.uitools.VERSION +QT.uitools.sources = $$QT_MODULE_BASE/src/designer/src/uitools +QT.uitools.libs = $$QT_MODULE_LIB_BASE +QT.uitools.plugins = $$QT_MODULE_PLUGIN_BASE +QT.uitools.imports = $$QT_MODULE_IMPORT_BASE +QT.uitools.depends = xml +QT.uitools.DEFINES = QT_UITOOLS_LIB + +QT_CONFIG += uitools diff --git a/src/designer/src/lib/lib.pro b/src/designer/src/lib/lib.pro index a23e16417..7219ad57f 100644 --- a/src/designer/src/lib/lib.pro +++ b/src/designer/src/lib/lib.pro @@ -1,47 +1,30 @@ +MODULE = designer load(qt_module) TARGET = QtDesigner -QT += core-private gui-private widgets widgets-private xml uilib uilib-private +QPRO_PWD = $$PWD +QT += core-private gui-private widgets widgets-private xml -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols +CONFIG += module +MODULE_PRI = ../../../../modules/qt_designer.pri -#win32|mac: CONFIG += debug_and_release -#DESTDIR = $$QT_BUILD_TREE/lib -#!wince*:DLLDESTDIR = $$QT.designer.bins - -#INCLUDEPATH += $$QT.designer.includes \ -# $$QT.designer.private_includes \ -# $$QT.designer.private_includes/QtDesigner - -#isEmpty(QT_MAJOR_VERSION) { -# VERSION=4.3.0 -#} else { -# VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -#} - -unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml +unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml QtCore QtGui QtWidgets load(qt_module_config) HEADERS += qtdesignerversion.h -!contains(CONFIG, static) { - CONFIG += dll - - DEFINES += \ - QDESIGNER_SDK_LIBRARY \ - QDESIGNER_EXTENSION_LIBRARY \ - QDESIGNER_UILIB_LIBRARY \ - QDESIGNER_SHARED_LIBRARY -} else { - DEFINES += QT_DESIGNER_STATIC -} +#!contains(CONFIG, static) { +# CONFIG += dll -##headers.pri is loaded from the last include path -#LAST_MODULE_INCLUDE=$$INCLUDEPATH -#for(include_path, INCLUDEPATH):LAST_MODULE_INCLUDE=$${include_path} -#HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri -#include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) +# DEFINES += \ +# QDESIGNER_SDK_LIBRARY \ +# QDESIGNER_EXTENSION_LIBRARY \ +# QDESIGNER_UILIB_LIBRARY \ +# QDESIGNER_SHARED_LIBRARY +#} else { +# DEFINES += QT_DESIGNER_STATIC +#} #mac frameworks mac:CONFIG += explicitlib @@ -64,21 +47,8 @@ mac:!static:contains(QT_CONFIG, qt_framework) { include(extension/extension.pri) include(sdk/sdk.pri) include(shared/shared.pri) +include(uilib/uilib.pri) PRECOMPILED_HEADER=lib_pch.h include(../sharedcomponents.pri) include(../components/component.pri) - -#target.path=$$[QT_INSTALL_LIBS] -#INSTALLS += target -#win32 { -# dlltarget.path=$$[QT_INSTALL_BINS] -# INSTALLS += dlltarget -#} - - -#qt_install_headers { -# designer_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES -# designer_headers.path = $$[QT_INSTALL_HEADERS]/QtDesigner -# INSTALLS += designer_headers -#} diff --git a/src/designer/src/lib/shared/widgetdatabase.cpp b/src/designer/src/lib/shared/widgetdatabase.cpp index 673c7945e..849b475b0 100644 --- a/src/designer/src/lib/shared/widgetdatabase.cpp +++ b/src/designer/src/lib/shared/widgetdatabase.cpp @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp new file mode 100644 index 000000000..da64a5ee2 --- /dev/null +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -0,0 +1,3154 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +**sw +****************************************************************************/ + +#include "abstractformbuilder.h" +#include "formbuilderextra_p.h" +#include "resourcebuilder_p.h" +#include "textbuilder_p.h" +#include "ui4_p.h" +#include "properties_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifndef QFORMINTERNAL_NAMESPACE +# include // Compiling within Designer +#endif + +#include + +#include + +#include + +Q_DECLARE_METATYPE(QWidgetList) + +static const char *buttonGroupPropertyC = "buttonGroup"; + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +using namespace QFormInternal; +#endif + +class QFriendlyLayout: public QLayout +{ +public: + inline QFriendlyLayout() { Q_ASSERT(0); } + +#ifdef QFORMINTERNAL_NAMESPACE + friend class QFormInternal::QAbstractFormBuilder; +#else + friend class QAbstractFormBuilder; +#endif +}; + +/*! + \class QAbstractFormBuilder + + \brief The QAbstractFormBuilder class provides a default + implementation for classes that create user interfaces at + run-time. + + \inmodule QtDesigner + + QAbstractFormBuilder provides a standard interface and a default + implementation for constructing forms from user interface + files. It is not intended to be instantiated directly. Use the + QFormBuilder class to create user interfaces from UI files at + run-time. For example: + + \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp 0 + + To override certain aspects of the form builder's behavior, + subclass QAbstractFormBuilder and reimplement the relevant virtual + functions: + + \list + \o load() handles reading of UI format files from arbitrary + QIODevices, and construction of widgets from the XML data + that they contain. + \o save() handles saving of widget details in UI format to + arbitrary QIODevices. + \o workingDirectory() and setWorkingDirectory() control the + directory in which forms are held. The form builder looks for + other resources on paths relative to this directory. + \endlist + + The QFormBuilder class is typically used by custom components and + applications that embed \QD. Standalone applications that need to + dynamically generate user interfaces at run-time use the + QUiLoader, found in the QtUiTools module. + + \sa {QtUiTools Module} +*/ + +/*! + Constructs a new form builder.*/ +QAbstractFormBuilder::QAbstractFormBuilder() : d(new QFormBuilderExtra) +{ + setResourceBuilder(new QResourceBuilder()); + setTextBuilder(new QTextBuilder()); +} + +/*! + Destroys the form builder.*/ +QAbstractFormBuilder::~QAbstractFormBuilder() +{ +} + +// Return UI file version from attribute 'version="4.0"' +static QPair uiVersion(const QString &attr) +{ + const QStringList versions = attr.split(QLatin1Char('.'), QString::SkipEmptyParts); + if (versions.size() >= 2) { + bool okMajor, okMinor; + const int majorVersion = versions.at(0).toInt(&okMajor); + const int minorVersion = versions.at(1).toInt(&okMinor); + if (okMajor && okMinor) + return QPair(majorVersion, minorVersion); + } + return QPair(-1, -1); +} + +static inline QString msgXmlError(const QXmlStreamReader &reader) +{ + return QCoreApplication::translate("QAbstractFormBuilder", "An error has occurred while reading the UI file at line %1, column %2: %3") + .arg(reader.lineNumber()).arg(reader.columnNumber()).arg(reader.errorString()); +} + +// Read and check the version and the (optional) language attribute +// of an element and leave reader positioned at . +static bool inline readUiAttributes(QXmlStreamReader &reader, const QString &language, QString *errorMessage) +{ + const QString uiElement = QLatin1String("ui"); + // Read up to first element + while (!reader.atEnd()) { + switch (reader.readNext()) { + case QXmlStreamReader::Invalid: + *errorMessage = msgXmlError(reader); + return false; + case QXmlStreamReader::StartElement: + if (reader.name().compare(uiElement, Qt::CaseInsensitive) == 0) { + const QString versionAttribute = QLatin1String("version"); + const QString languageAttribute = QLatin1String("language"); + const QXmlStreamAttributes attributes = reader.attributes(); + if (attributes.hasAttribute(versionAttribute)) { + const QString versionString = attributes.value(versionAttribute).toString(); + if (uiVersion(versionString).first < 4) { + *errorMessage = QCoreApplication::translate("QAbstractFormBuilder", "This file was created using Designer from Qt-%1 and cannot be read.") + .arg(versionString); + return false; + } // version error + } // has version + if (attributes.hasAttribute(languageAttribute)) { + // Check on optional language (Jambi) + const QString formLanguage = attributes.value(languageAttribute).toString(); + if (!formLanguage.isEmpty() && formLanguage.compare(language, Qt::CaseInsensitive)) { + *errorMessage = QCoreApplication::translate("QAbstractFormBuilder", "This file cannot be read because it was created using %1.").arg(formLanguage); + return false; + } // language error + } // has language + return true; + } // matched + break; + default: + break; + } + } + // No found. + *errorMessage = QCoreApplication::translate("QAbstractFormBuilder", "Invalid UI file: The root element is missing."); + return false; +} + +/*! + \fn QWidget *QAbstractFormBuilder::load(QIODevice *device, QWidget *parent) + + Loads an XML representation of a widget from the given \a device, + and constructs a new widget with the specified \a parent. + + \sa save(), errorString() +*/ +QWidget *QAbstractFormBuilder::load(QIODevice *dev, QWidget *parentWidget) +{ + QXmlStreamReader reader(dev); + d->m_errorString.clear(); + if (!readUiAttributes(reader, d->m_language, &d->m_errorString)) { + uiLibWarning(d->m_errorString); + return false; + } + DomUI ui; + ui.read(reader); + if (reader.hasError()) { + d->m_errorString = msgXmlError(reader); + uiLibWarning(d->m_errorString); + return 0; + } + + QWidget *widget = create(&ui, parentWidget); + if (!widget && d->m_errorString.isEmpty()) + d->m_errorString = QCoreApplication::translate("QAbstractFormBuilder", "Invalid UI file"); + return widget; +} + +/*! + \internal +*/ +QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget) +{ + typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash; + + d->clear(); + if (const DomLayoutDefault *def = ui->elementLayoutDefault()) { + d->m_defaultMargin = def->hasAttributeMargin() ? def->attributeMargin() : INT_MIN; + d->m_defaultSpacing = def->hasAttributeSpacing() ? def->attributeSpacing() : INT_MIN; + } + + DomWidget *ui_widget = ui->elementWidget(); + if (!ui_widget) + return 0; + + initialize(ui); + + if (const DomButtonGroups *domButtonGroups = ui->elementButtonGroups()) + d->registerButtonGroups(domButtonGroups); + + if (QWidget *widget = create(ui_widget, parentWidget)) { + // Reparent button groups that were actually created to main container for them to be found in the signal/slot part + const ButtonGroupHash &buttonGroups = d->buttonGroups(); + if (!buttonGroups.empty()) { + const ButtonGroupHash::const_iterator cend = buttonGroups.constEnd(); + for (ButtonGroupHash::const_iterator it = buttonGroups.constBegin(); it != cend; ++it) + if (it.value().second) + it.value().second->setParent(widget); + } + createConnections(ui->elementConnections(), widget); + createResources(ui->elementResources()); // maybe this should go first, before create()... + applyTabStops(widget, ui->elementTabStops()); + d->applyInternalProperties(); + reset(); + d->clear(); + return widget; + } + d->clear(); + return 0; +} + +/*! + \internal + Retrieve relevant information from the custom widgets section. + Called by create(DomUI *, QWidget *); call manually if you + just use create(DomWidget *, QWidget *) on some child widget of DomUI. + */ + +void QAbstractFormBuilder::initialize(const DomUI *ui) +{ + typedef QList DomCustomWidgetList; + + DomCustomWidgets *domCustomWidgets = ui->elementCustomWidgets(); + createCustomWidgets(domCustomWidgets); + + if (domCustomWidgets) { + const DomCustomWidgetList customWidgets = domCustomWidgets->elementCustomWidget(); + if (!customWidgets.empty()) { + const DomCustomWidgetList::const_iterator cend = customWidgets.constEnd(); + for (DomCustomWidgetList::const_iterator it = customWidgets.constBegin(); it != cend; ++it) + d->storeCustomWidgetData((*it)->elementClass(), *it); + } + } +} + +/*! + \internal +*/ +QWidget *QAbstractFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget) +{ + QWidget *w = createWidget(ui_widget->attributeClass(), parentWidget, ui_widget->attributeName()); + if (!w) + return 0; + + applyProperties(w, ui_widget->elementProperty()); + + foreach (DomAction *ui_action, ui_widget->elementAction()) { + QAction *child_action = create(ui_action, w); + Q_UNUSED( child_action ); + } + + foreach (DomActionGroup *ui_action_group, ui_widget->elementActionGroup()) { + QActionGroup *child_action_group = create(ui_action_group, w); + Q_UNUSED( child_action_group ); + } + + QWidgetList children; + foreach (DomWidget *ui_child, ui_widget->elementWidget()) { + if (QWidget *child = create(ui_child, w)) { + children += child; + } else { + const QString className = ui_child->elementClass().empty() ? QString() : ui_child->elementClass().front(); + uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "The creation of a widget of the class '%1' failed.").arg(className)); + } + } + + foreach (DomLayout *ui_lay, ui_widget->elementLayout()) { + QLayout *child_lay = create(ui_lay, 0, w); + Q_UNUSED( child_lay ); + } + + const QList addActions = ui_widget->elementAddAction(); + if (!addActions.empty()) { + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + foreach (DomActionRef *ui_action_ref, addActions) { + const QString name = ui_action_ref->attributeName(); + if (name == strings.separator) { + QAction *sep = new QAction(w); + sep->setSeparator(true); + w->addAction(sep); + addMenuAction(sep); + } else if (QAction *a = d->m_actions.value(name)) { + w->addAction(a); + } else if (QActionGroup *g = d->m_actionGroups.value(name)) { + w->addActions(g->actions()); + } else if (QMenu *menu = w->findChild(name)) { + w->addAction(menu->menuAction()); + addMenuAction(menu->menuAction()); + } + } + } + + loadExtraInfo(ui_widget, w, parentWidget); +#ifndef QT_FORMBUILDER_NO_SCRIPT + QString scriptErrorMessage; + d->formScriptRunner().run(ui_widget, + d->customWidgetScript(ui_widget->attributeClass()), + w, children, &scriptErrorMessage); +#endif + addItem(ui_widget, w, parentWidget); + + if (qobject_cast(w) && parentWidget) + w->setAttribute(Qt::WA_Moved, false); // So that QDialog::setVisible(true) will center it + + const QStringList zOrderNames = ui_widget->elementZOrder(); + if (!zOrderNames.isEmpty()) { + QList zOrder = qvariant_cast(w->property("_q_zOrder")); + foreach (const QString &widgetName, zOrderNames) { + if (QWidget *child = w->findChild(widgetName)) { + if (child->parentWidget() == w) { + zOrder.removeAll(child); + zOrder.append(child); + child->raise(); + } + } + } + w->setProperty("_q_zOrder", QVariant::fromValue(zOrder)); + } + + return w; +} + +/*! + \internal +*/ +QAction *QAbstractFormBuilder::create(DomAction *ui_action, QObject *parent) +{ + QAction *a = createAction(parent, ui_action->attributeName()); + if (!a) + return 0; + + d->m_actions.insert(ui_action->attributeName(), a); + applyProperties(a, ui_action->elementProperty()); + return a; +} + +/*! + \internal +*/ +QActionGroup *QAbstractFormBuilder::create(DomActionGroup *ui_action_group, QObject *parent) +{ + QActionGroup *a = createActionGroup(parent, ui_action_group->attributeName()); + if (!a) + return 0; + d->m_actionGroups.insert(ui_action_group->attributeName(), a); + applyProperties(a, ui_action_group->elementProperty()); + + foreach (DomAction *ui_action, ui_action_group->elementAction()) { + QAction *child_action = create(ui_action, a); + Q_UNUSED( child_action ); + } + + foreach (DomActionGroup *g, ui_action_group->elementActionGroup()) { + QActionGroup *child_action_group = create(g, parent); + Q_UNUSED( child_action_group ); + } + + return a; +} + +// 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. +Qt::ToolBarArea QAbstractFormBuilder::toolbarAreaFromDOMAttributes(const DomPropertyHash &attributes) { + const DomProperty *attr = attributes.value(QFormBuilderStrings::instance().toolBarAreaAttribute); + if (!attr) + return Qt::TopToolBarArea; + switch(attr->kind()) { + case DomProperty::Number: + return static_cast(attr->elementNumber()); + case DomProperty::Enum: + return enumKeyOfObjectToValue("toolBarArea", attr->elementEnum().toLatin1()); + default: + break; + } + return Qt::TopToolBarArea; +} + +/*! + \internal +*/ +bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget) +{ + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute()); + + if (parentWidget == 0) + return true; + // Check special cases. First: Custom container + const QString className = QLatin1String(parentWidget->metaObject()->className()); + const QString addPageMethod = d->customWidgetAddPageMethod(className); + if (!addPageMethod.isEmpty()) { + // If this fails ( non-existent or non-slot), use ContainerExtension in Designer, else it can't be helped + return QMetaObject::invokeMethod(parentWidget, addPageMethod.toUtf8().constData(), Qt::DirectConnection, Q_ARG(QWidget*, widget)); + } + + if (QMainWindow *mw = qobject_cast(parentWidget)) { + +#ifndef QT_NO_MENUBAR + // the menubar + if (QMenuBar *menuBar = qobject_cast(widget)) { + mw->setMenuBar(menuBar); + return true; + } +#endif + +#ifndef QT_NO_TOOLBAR + // apply the toolbar's attributes + else if (QToolBar *toolBar = qobject_cast(widget)) { + mw->addToolBar(toolbarAreaFromDOMAttributes(attributes), toolBar); + // check break + if (const DomProperty *attr = attributes.value(strings.toolBarBreakAttribute)) + if (attr->elementBool() == strings.trueValue) + mw->insertToolBarBreak (toolBar); + + return true; + } +#endif + +#ifndef QT_NO_STATUSBAR + // statusBar + else if (QStatusBar *statusBar = qobject_cast(widget)) { + mw->setStatusBar(statusBar); + return true; + } +#endif + +#ifndef QT_NO_DOCKWIDGET + // apply the dockwidget's attributes + else if (QDockWidget *dockWidget = qobject_cast(widget)) { + if (const DomProperty *attr = attributes.value(strings.dockWidgetAreaAttribute)) { + Qt::DockWidgetArea area = static_cast(attr->elementNumber()); + if (!dockWidget->isAreaAllowed(area)) { + if (dockWidget->isAreaAllowed(Qt::LeftDockWidgetArea)) + area = Qt::LeftDockWidgetArea; + else if (dockWidget->isAreaAllowed(Qt::RightDockWidgetArea)) + area = Qt::RightDockWidgetArea; + else if (dockWidget->isAreaAllowed(Qt::TopDockWidgetArea)) + area = Qt::TopDockWidgetArea; + else if (dockWidget->isAreaAllowed(Qt::BottomDockWidgetArea)) + area = Qt::BottomDockWidgetArea; + } + mw->addDockWidget(area, dockWidget); + } else { + mw->addDockWidget(Qt::LeftDockWidgetArea, dockWidget); + } + return true; + } +#endif + + else if (! mw->centralWidget()) { + mw->setCentralWidget(widget); + return true; + } + } + +#ifndef QT_NO_TABWIDGET + else if (QTabWidget *tabWidget = qobject_cast(parentWidget)) { + widget->setParent(0); + + const int tabIndex = tabWidget->count(); + if (const DomProperty *titleP = attributes.value(strings.titleAttribute, 0)) + tabWidget->addTab(widget, toString(titleP->elementString())); + else + tabWidget->addTab(widget, strings.defaultTitle); + + if (DomProperty *picon = attributes.value(strings.iconAttribute)) { + QVariant v = resourceBuilder()->loadResource(workingDirectory(), picon); + QVariant nativeValue = resourceBuilder()->toNativeValue(v); + tabWidget->setTabIcon(tabIndex, qvariant_cast(nativeValue)); + } + +#ifndef QT_NO_TOOLTIP + if (const DomProperty *ptoolTip = attributes.value(strings.toolTipAttribute)) { + tabWidget->setTabToolTip(tabIndex, toString(ptoolTip->elementString())); + } +#endif + +#ifndef QT_NO_WHATSTHIS + if (const DomProperty *pwhatsThis = attributes.value(strings.whatsThisAttribute)) { + tabWidget->setTabWhatsThis(tabIndex, toString(pwhatsThis->elementString())); + } +#endif + + return true; + } +#endif + +#ifndef QT_NO_TOOLBOX + else if (QToolBox *toolBox = qobject_cast(parentWidget)) { + const int tabIndex = toolBox->count(); + if (const DomProperty *labelP = attributes.value(strings.labelAttribute, 0)) + toolBox->addItem(widget, toString(labelP->elementString())); + else + toolBox->addItem(widget, strings.defaultTitle); + + if (DomProperty *picon = attributes.value(strings.iconAttribute)) { + QVariant v = resourceBuilder()->loadResource(workingDirectory(), picon); + QVariant nativeValue = resourceBuilder()->toNativeValue(v); + toolBox->setItemIcon(tabIndex, qvariant_cast(nativeValue)); + } + +#ifndef QT_NO_TOOLTIP + if (const DomProperty *ptoolTip = attributes.value(strings.toolTipAttribute)) { + toolBox->setItemToolTip(tabIndex, toString(ptoolTip->elementString())); + } +#endif + + return true; + } +#endif + +#ifndef QT_NO_STACKEDWIDGET + else if (QStackedWidget *stackedWidget = qobject_cast(parentWidget)) { + stackedWidget->addWidget(widget); + return true; + } +#endif + +#ifndef QT_NO_SPLITTER + else if (QSplitter *splitter = qobject_cast(parentWidget)) { + splitter->addWidget(widget); + return true; + } +#endif + +#ifndef QT_NO_MDIAREA + else if (QMdiArea *mdiArea = qobject_cast(parentWidget)) { + mdiArea->addSubWindow(widget); + return true; + } +#endif + +#ifndef QT_NO_WORKSPACE + else if (QWorkspace *ws = qobject_cast(parentWidget)) { + ws->addWindow(widget); + return true; + } +#endif + +#ifndef QT_NO_DOCKWIDGET + else if (QDockWidget *dockWidget = qobject_cast(parentWidget)) { + dockWidget->setWidget(widget); + return true; + } +#endif + +#ifndef QT_NO_SCROLLAREA + else if (QScrollArea *scrollArea = qobject_cast(parentWidget)) { + scrollArea->setWidget(widget); + return true; + } +#endif + +#ifndef QT_NO_WIZARD + else if (QWizard *wizard = qobject_cast(parentWidget)) { + QWizardPage *page = qobject_cast(widget); + if (!page) { + uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Attempt to add child that is not of class QWizardPage to QWizard.")); + return false; + } + wizard->addPage(page); + return true; + } +#endif + return false; +} + +/*! + \internal +*/ +void QAbstractFormBuilder::layoutInfo(DomLayout *ui_layout, QObject *parent, int *margin, int *spacing) +{ + Q_UNUSED(parent) + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + const DomPropertyHash properties = propertyMap(ui_layout->elementProperty()); + + int mar = INT_MIN; + int spac = INT_MIN; + if (const DomProperty *p = properties.value(strings.marginProperty, 0)) + mar = p->elementNumber(); + + if (const DomProperty *p = properties.value(strings.spacingProperty, 0)) + spac = p->elementNumber(); + +#ifdef Q_OS_MAC + // here we recognize UI file < 4.3 (no we don't store margin property) + if (mar != INT_MIN) { + const int defaultMargin = parent->inherits("QLayoutWidget") ? 0 : 9; + if (mar == defaultMargin) + mar = INT_MIN; + if (spac == 6) + spac = INT_MIN; + + if (mar == INT_MIN || spac == INT_MIN) { + QList properties = ui_layout->elementProperty(); + QMutableListIterator it(properties); + while (it.hasNext()) { + DomProperty *prop = it.next(); + if ((mar == INT_MIN && prop->attributeName() == strings.marginProperty) || + (spac == INT_MIN && prop->attributeName() == strings.spacingProperty)) { + it.remove(); + delete prop; + } + } + ui_layout->setElementProperty(properties); + } + } +#endif + if (margin) + *margin = mar; + if (spacing) + *spacing = spac; +} + +/*! + \internal +*/ +QLayout *QAbstractFormBuilder::create(DomLayout *ui_layout, QLayout *parentLayout, QWidget *parentWidget) +{ + QObject *p = parentLayout; + + if (p == 0) + p = parentWidget; + + Q_ASSERT(p != 0); + + bool tracking = false; + + if (p == parentWidget && parentWidget->layout()) { + tracking = true; + p = parentWidget->layout(); + } + + QLayout *layout = createLayout(ui_layout->attributeClass(), p, ui_layout->hasAttributeName() ? ui_layout->attributeName() : QString()); + + if (layout == 0) + return 0; + + if (tracking && layout->parent() == 0) { + QBoxLayout *box = qobject_cast(parentWidget->layout()); + if (!box) { // only QBoxLayout is supported + const QString widgetClass = QString::fromUtf8(parentWidget->metaObject()->className()); + const QString layoutClass = QString::fromUtf8(parentWidget->layout()->metaObject()->className()); + const QString msg = QCoreApplication::translate("QAbstractFormBuilder", "Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3.\n" + "This indicates an inconsistency in the ui-file."). + arg(parentWidget->objectName(), widgetClass, layoutClass); + uiLibWarning(msg); + return 0; + } + box->addLayout(layout); + } + + int margin = INT_MIN, spacing = INT_MIN; + layoutInfo(ui_layout, p, &margin, &spacing); + + if (margin != INT_MIN) { + layout->setMargin(margin); + } else { + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + int left, top, right, bottom; + left = top = right = bottom = -1; + layout->getContentsMargins(&left, &top, &right, &bottom); + + const DomPropertyHash properties = propertyMap(ui_layout->elementProperty()); + + if (const DomProperty *p = properties.value(strings.leftMarginProperty, 0)) + left = p->elementNumber(); + + if (const DomProperty *p = properties.value(strings.topMarginProperty, 0)) + top = p->elementNumber(); + + if (const DomProperty *p = properties.value(strings.rightMarginProperty, 0)) + right = p->elementNumber(); + + if (const DomProperty *p = properties.value(strings.bottomMarginProperty, 0)) + bottom = p->elementNumber(); + + layout->setContentsMargins(left, top, right, bottom); + } + + if (spacing != INT_MIN) { + layout->setSpacing(spacing); + } else { + QGridLayout *grid = qobject_cast(layout); + if (grid) { + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + const DomPropertyHash properties = propertyMap(ui_layout->elementProperty()); + + if (const DomProperty *p = properties.value(strings.horizontalSpacingProperty, 0)) + grid->setHorizontalSpacing(p->elementNumber()); + if (const DomProperty *p = properties.value(strings.verticalSpacingProperty, 0)) + grid->setVerticalSpacing(p->elementNumber()); + } + } + + applyProperties(layout, ui_layout->elementProperty()); + + foreach (DomLayoutItem *ui_item, ui_layout->elementItem()) { + if (QLayoutItem *item = create(ui_item, layout, parentWidget)) { + addItem(ui_item, item, layout); + } + } + // Check the box stretch attributes + if (QBoxLayout *box = qobject_cast(layout)) { + const QString boxStretch = ui_layout->attributeStretch(); + if (!boxStretch.isEmpty()) + QFormBuilderExtra::setBoxLayoutStretch(boxStretch, box); + } + // Check the grid stretch/minimum size attributes + if (QGridLayout *grid = qobject_cast(layout)) { + // Stretch + const QString gridRowStretch = ui_layout->attributeRowStretch(); + if (!gridRowStretch.isEmpty()) + QFormBuilderExtra::setGridLayoutRowStretch(gridRowStretch, grid); + const QString gridColumnStretch = ui_layout->attributeColumnStretch(); + if (!gridColumnStretch.isEmpty()) + QFormBuilderExtra::setGridLayoutColumnStretch(gridColumnStretch, grid); + // Minimum size + const QString gridColumnMinimumWidth = ui_layout->attributeColumnMinimumWidth(); + if (!gridColumnMinimumWidth.isEmpty()) + QFormBuilderExtra::setGridLayoutColumnMinimumWidth(gridColumnMinimumWidth, grid); + const QString gridRowMinimumHeight = ui_layout->attributeRowMinimumHeight(); + if (!gridRowMinimumHeight.isEmpty()) + QFormBuilderExtra::setGridLayoutRowMinimumHeight(gridRowMinimumHeight, grid); + } + return layout; +} + +#ifndef QT_NO_FORMLAYOUT +static inline QFormLayout::ItemRole formLayoutRole(int column, int colspan) +{ + if (colspan > 1) + return QFormLayout::SpanningRole; + return column == 0 ? QFormLayout::LabelRole : QFormLayout::FieldRole; +} +#endif + +static inline QString alignmentValue(Qt::Alignment a) +{ + QString h,v; + switch (a & Qt::AlignHorizontal_Mask) { + case Qt::AlignLeft: + h = QLatin1String("Qt::AlignLeft"); + break; + case Qt::AlignRight: + h = QLatin1String("Qt::AlignRight"); + break; + case Qt::AlignHCenter: + h = QLatin1String("Qt::AlignHCenter"); + break; + case Qt::AlignJustify: + h = QLatin1String("Qt::AlignJustify"); + break; + } + switch (a & Qt::AlignVertical_Mask) { + case Qt::AlignTop: + v = QLatin1String("Qt::AlignTop"); + break; + case Qt::AlignBottom: + v = QLatin1String("Qt::AlignBottom"); + break; + case Qt::AlignVCenter: + v = QLatin1String("Qt::AlignVCenter"); + break; + } + if (h.isEmpty() && v.isEmpty()) + return QString(); + if (!v.isEmpty()) { + if (!h.isEmpty()) + h += QLatin1Char('|'); + h += v; + } + return h; +} + +static inline Qt::Alignment alignmentFromDom(const QString &in) +{ + Qt::Alignment rc = 0; + if (!in.isEmpty()) { + foreach (const QString &f, in.split(QLatin1Char('|'))) { + if (f == QLatin1String("Qt::AlignLeft")) { + rc |= Qt::AlignLeft; + } else if (f == QLatin1String("Qt::AlignRight")) { + rc |= Qt::AlignRight; + } else if (f == QLatin1String("Qt::AlignHCenter")) { + rc |= Qt::AlignHCenter; + } else if (f == QLatin1String("Qt::AlignJustify")) { + rc |= Qt::AlignJustify; + } else if (f == QLatin1String("Qt::AlignTop")) { + rc |= Qt::AlignTop; + } else if (f == QLatin1String("Qt::AlignBottom")) { + rc |= Qt::AlignBottom; + } else if (f == QLatin1String("Qt::AlignVCenter")) { + rc |= Qt::AlignVCenter; + } + } + } + return rc; +} + +/*! + \internal +*/ +bool QAbstractFormBuilder::addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout) +{ + // Calling addChildWidget(), etc. is required to maintain consistency of the layouts, + // see documentation of addItem(), which should ideally not be used. + if (item->widget()) { + static_cast(layout)->addChildWidget(item->widget()); + } else if (item->layout()) { + static_cast(layout)->addChildLayout(item->layout()); + } else if (item->spacerItem()) { + // nothing to do + } else { + return false; + } + + if (QGridLayout *grid = qobject_cast(layout)) { + const int rowSpan = ui_item->hasAttributeRowSpan() ? ui_item->attributeRowSpan() : 1; + const int colSpan = ui_item->hasAttributeColSpan() ? ui_item->attributeColSpan() : 1; + grid->addItem(item, ui_item->attributeRow(), ui_item->attributeColumn(), + rowSpan, colSpan, item->alignment()); + return true; + } +#ifndef QT_NO_FORMLAYOUT + if (QFormLayout *form = qobject_cast(layout)) { + const int row = ui_item->attributeRow(); + const int colSpan = ui_item->hasAttributeColSpan() ? ui_item->attributeColSpan() : 1; + form->setItem(row, formLayoutRole(ui_item->attributeColumn(), colSpan), item); + return true; + } + +#endif + layout->addItem(item); + return true; +} + +/*! + \internal +*/ +QLayoutItem *QAbstractFormBuilder::create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget) +{ + switch (ui_layoutItem->kind()) { + case DomLayoutItem::Widget: { + if (QWidget *w = create(ui_layoutItem->elementWidget(), parentWidget)) { +#ifdef QFORMINTERNAL_NAMESPACE // uilib + QWidgetItem *item = new QWidgetItemV2(w); +#else // Within Designer: Use factory method that returns special items that refuse to shrink to 0,0 + QWidgetItem *item = QLayoutPrivate::createWidgetItem(layout, w); +#endif + item->setAlignment(alignmentFromDom(ui_layoutItem->attributeAlignment())); + return item; + } + qWarning() << QCoreApplication::translate("QAbstractFormBuilder", "Empty widget item in %1 '%2'.").arg(QString::fromUtf8(layout->metaObject()->className()), layout->objectName()); + return 0; + } + case DomLayoutItem::Spacer: { + QSize size(0, 0); + QSizePolicy::Policy sizeType = QSizePolicy::Expanding; + bool isVspacer = false; + + const DomSpacer *ui_spacer = ui_layoutItem->elementSpacer(); + + const QMetaEnum sizePolicy_enum = metaEnum("sizeType"); + const QMetaEnum orientation_enum = metaEnum("orientation"); + + const QList spacerProperties = ui_spacer->elementProperty(); + if (!spacerProperties.empty()) { + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + foreach (DomProperty *p, spacerProperties) { + const QVariant v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p); // ### remove me + if (v.isNull()) + continue; + if (p->attributeName() == strings.sizeHintProperty && p->kind() == DomProperty::Size) { + size = v.toSize(); // ### remove me + } else if (p->attributeName() == strings.sizeTypeProperty && p->kind() == DomProperty::Enum) { + sizeType = static_cast(v.toInt()); + } else if (p->attributeName() == strings.orientationProperty && p->kind() == DomProperty::Enum) { + const Qt::Orientation o = static_cast(v.toInt()); + isVspacer = (o == Qt::Vertical); + } + } + } + + QSpacerItem *spacer = 0; + if (isVspacer) + spacer = new QSpacerItem(size.width(), size.height(), QSizePolicy::Minimum, sizeType); + else + spacer = new QSpacerItem(size.width(), size.height(), sizeType, QSizePolicy::Minimum); + return spacer; } + + case DomLayoutItem::Layout: + return create(ui_layoutItem->elementLayout(), layout, parentWidget); + + default: + break; + } + + return 0; +} + +/*! + \internal +*/ +void QAbstractFormBuilder::applyProperties(QObject *o, const QList &properties) +{ + typedef QList DomPropertyList; + + if (properties.empty()) + return; + + const DomPropertyList::const_iterator cend = properties.constEnd(); + for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) { + const QVariant v = toVariant(o->metaObject(), *it); + if (!v.isNull()) { + const QString attributeName = (*it)->attributeName(); + if (!d->applyPropertyInternally(o, attributeName, v)) + o->setProperty(attributeName.toUtf8(), v); + } + } +} + + +/*! + \internal + Check whether a property is applied internally by QAbstractFormBuilder. Call this + from overwritten applyProperties(). +*/ + +bool QAbstractFormBuilder::applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value) +{ + return d->applyPropertyInternally(o,propertyName, value); +} + +/*! + \internal +*/ + +QVariant QAbstractFormBuilder::toVariant(const QMetaObject *meta, DomProperty *p) +{ + return domPropertyToVariant(this, meta, p); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::setupColorGroup(QPalette &palette, QPalette::ColorGroup colorGroup, + DomColorGroup *group) +{ + // old format + const QList colors = group->elementColor(); + for (int role = 0; role < colors.size(); ++role) { + const DomColor *color = colors.at(role); + const QColor c(color->elementRed(), color->elementGreen(), color->elementBlue()); + palette.setColor(colorGroup, QPalette::ColorRole(role), c); + } + + // new format + const QMetaEnum colorRole_enum = metaEnum("colorRole"); + + const QList colorRoles = group->elementColorRole(); + for (int role = 0; role < colorRoles.size(); ++role) { + const DomColorRole *colorRole = colorRoles.at(role); + + if (colorRole->hasAttributeRole()) { + const int r = colorRole_enum.keyToValue(colorRole->attributeRole().toLatin1()); + if (r != -1) { + const QBrush br = setupBrush(colorRole->elementBrush()); + palette.setBrush(colorGroup, static_cast(r), br); + } + } + } +} + +/*! + \internal +*/ +DomColorGroup *QAbstractFormBuilder::saveColorGroup(const QPalette &palette) +{ + + const QMetaEnum colorRole_enum = metaEnum("colorRole"); + + DomColorGroup *group = new DomColorGroup(); + QList colorRoles; + + const uint mask = palette.resolve(); + for (int role = QPalette::WindowText; role < QPalette::NColorRoles; ++role) { + if (mask & (1 << role)) { + QBrush br = palette.brush(QPalette::ColorRole(role)); + + DomColorRole *colorRole = new DomColorRole(); + colorRole->setElementBrush(saveBrush(br)); + colorRole->setAttributeRole(QLatin1String(colorRole_enum.valueToKey(role))); + colorRoles.append(colorRole); + } + } + + group->setElementColorRole(colorRoles); + return group; +} + +/*! + \internal +*/ +QBrush QAbstractFormBuilder::setupBrush(DomBrush *brush) +{ + QBrush br; + if (!brush->hasAttributeBrushStyle()) + return br; + + const Qt::BrushStyle style = enumKeyOfObjectToValue("brushStyle", brush->attributeBrushStyle().toLatin1()); + + if (style == Qt::LinearGradientPattern || + style == Qt::RadialGradientPattern || + style == Qt::ConicalGradientPattern) { + const QMetaEnum gradientType_enum = metaEnum("gradientType"); + const QMetaEnum gradientSpread_enum = metaEnum("gradientSpread"); + const QMetaEnum gradientCoordinate_enum = metaEnum("gradientCoordinate"); + + const DomGradient *gradient = brush->elementGradient(); + const QGradient::Type type = enumKeyToValue(gradientType_enum, gradient->attributeType().toLatin1()); + + + QGradient *gr = 0; + + if (type == QGradient::LinearGradient) { + gr = new QLinearGradient(QPointF(gradient->attributeStartX(), gradient->attributeStartY()), + QPointF(gradient->attributeEndX(), gradient->attributeEndY())); + } else if (type == QGradient::RadialGradient) { + gr = new QRadialGradient(QPointF(gradient->attributeCentralX(), gradient->attributeCentralY()), + gradient->attributeRadius(), + QPointF(gradient->attributeFocalX(), gradient->attributeFocalY())); + } else if (type == QGradient::ConicalGradient) { + gr = new QConicalGradient(QPointF(gradient->attributeCentralX(), gradient->attributeCentralY()), + gradient->attributeAngle()); + } + if (!gr) + return br; + + const QGradient::Spread spread = enumKeyToValue(gradientSpread_enum, gradient->attributeSpread().toLatin1()); + gr->setSpread(spread); + + const QGradient::CoordinateMode coord = enumKeyToValue(gradientCoordinate_enum, gradient->attributeCoordinateMode().toLatin1()); + gr->setCoordinateMode(coord); + + const QList stops = gradient->elementGradientStop(); + QListIterator it(stops); + while (it.hasNext()) { + const DomGradientStop *stop = it.next(); + const DomColor *color = stop->elementColor(); + gr->setColorAt(stop->attributePosition(), QColor::fromRgb(color->elementRed(), + color->elementGreen(), color->elementBlue(), color->attributeAlpha())); + } + br = QBrush(*gr); + delete gr; + } else if (style == Qt::TexturePattern) { + const DomProperty *texture = brush->elementTexture(); + if (texture && texture->kind() == DomProperty::Pixmap) { + br.setTexture(domPropertyToPixmap(texture)); + } + } else { + const DomColor *color = brush->elementColor(); + br.setColor(QColor::fromRgb(color->elementRed(), + color->elementGreen(), color->elementBlue(), color->attributeAlpha())); + br.setStyle((Qt::BrushStyle)style); + } + return br; +} + +/*! + \internal +*/ +DomBrush *QAbstractFormBuilder::saveBrush(const QBrush &br) +{ + const QMetaEnum brushStyle_enum = metaEnum("brushStyle"); + + DomBrush *brush = new DomBrush(); + const Qt::BrushStyle style = br.style(); + brush->setAttributeBrushStyle(QLatin1String(brushStyle_enum.valueToKey(style))); + if (style == Qt::LinearGradientPattern || + style == Qt::RadialGradientPattern || + style == Qt::ConicalGradientPattern) { + const QMetaEnum gradientType_enum = metaEnum("gradientType"); + const QMetaEnum gradientSpread_enum = metaEnum("gradientSpread"); + const QMetaEnum gradientCoordinate_enum = metaEnum("gradientCoordinate"); + + DomGradient *gradient = new DomGradient(); + const QGradient *gr = br.gradient(); + const QGradient::Type type = gr->type(); + gradient->setAttributeType(QLatin1String(gradientType_enum.valueToKey(type))); + gradient->setAttributeSpread(QLatin1String(gradientSpread_enum.valueToKey(gr->spread()))); + gradient->setAttributeCoordinateMode(QLatin1String(gradientCoordinate_enum.valueToKey(gr->coordinateMode()))); + QList stops; + QGradientStops st = gr->stops(); + QVectorIterator > it(st); + while (it.hasNext()) { + const QPair pair = it.next(); + DomGradientStop *stop = new DomGradientStop(); + stop->setAttributePosition(pair.first); + DomColor *color = new DomColor(); + color->setElementRed(pair.second.red()); + color->setElementGreen(pair.second.green()); + color->setElementBlue(pair.second.blue()); + color->setAttributeAlpha(pair.second.alpha()); + stop->setElementColor(color); + stops.append(stop); + } + gradient->setElementGradientStop(stops); + if (type == QGradient::LinearGradient) { + QLinearGradient *lgr = (QLinearGradient *)(gr); + gradient->setAttributeStartX(lgr->start().x()); + gradient->setAttributeStartY(lgr->start().y()); + gradient->setAttributeEndX(lgr->finalStop().x()); + gradient->setAttributeEndY(lgr->finalStop().y()); + } else if (type == QGradient::RadialGradient) { + QRadialGradient *rgr = (QRadialGradient *)(gr); + gradient->setAttributeCentralX(rgr->center().x()); + gradient->setAttributeCentralY(rgr->center().y()); + gradient->setAttributeFocalX(rgr->focalPoint().x()); + gradient->setAttributeFocalY(rgr->focalPoint().y()); + gradient->setAttributeRadius(rgr->radius()); + } else if (type == QGradient::ConicalGradient) { + QConicalGradient *cgr = (QConicalGradient *)(gr); + gradient->setAttributeCentralX(cgr->center().x()); + gradient->setAttributeCentralY(cgr->center().y()); + gradient->setAttributeAngle(cgr->angle()); + } + + brush->setElementGradient(gradient); + } else if (style == Qt::TexturePattern) { + const QPixmap pixmap = br.texture(); + if (!pixmap.isNull()) { + DomProperty *p = new DomProperty; + setPixmapProperty(*p, pixmapPaths(pixmap)); + brush->setElementTexture(p); + } + } else { + QColor c = br.color(); + DomColor *color = new DomColor(); + color->setElementRed(c.red()); + color->setElementGreen(c.green()); + color->setElementBlue(c.blue()); + color->setAttributeAlpha(c.alpha()); + brush->setElementColor(color); + } + return brush; +} + +/*! + \internal +*/ +QWidget *QAbstractFormBuilder::createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name) +{ + Q_UNUSED(widgetName); + Q_UNUSED(parentWidget); + Q_UNUSED(name); + return 0; +} + +/*! + \internal +*/ +QLayout *QAbstractFormBuilder::createLayout(const QString &layoutName, QObject *parent, const QString &name) +{ + Q_UNUSED(layoutName); + Q_UNUSED(parent); + Q_UNUSED(name); + return 0; +} + +/*! + \internal +*/ +QAction *QAbstractFormBuilder::createAction(QObject *parent, const QString &name) +{ + QAction *action = new QAction(parent); + action->setObjectName(name); + return action; +} + +/*! + \internal +*/ +QActionGroup *QAbstractFormBuilder::createActionGroup(QObject *parent, const QString &name) +{ + QActionGroup *g = new QActionGroup(parent); + g->setObjectName(name); + return g; +} + +/*! + \fn void QAbstractFormBuilder::save(QIODevice *device, QWidget *widget) + + Saves an XML representation of the given \a widget to the + specified \a device in the standard UI file format. + + \sa load()*/ +void QAbstractFormBuilder::save(QIODevice *dev, QWidget *widget) +{ + DomWidget *ui_widget = createDom(widget, 0); + Q_ASSERT( ui_widget != 0 ); + + DomUI *ui = new DomUI(); + ui->setAttributeVersion(QLatin1String("4.0")); + ui->setElementWidget(ui_widget); + + saveDom(ui, widget); + + QXmlStreamWriter writer(dev); + writer.setAutoFormatting(true); + writer.setAutoFormattingIndent(1); + writer.writeStartDocument(); + ui->write(writer); + writer.writeEndDocument(); + + d->m_laidout.clear(); + + delete ui; +} + +/*! + \internal +*/ +void QAbstractFormBuilder::saveDom(DomUI *ui, QWidget *widget) +{ + ui->setElementClass(widget->objectName()); + + if (DomConnections *ui_connections = saveConnections()) { + ui->setElementConnections(ui_connections); + } + + if (DomCustomWidgets *ui_customWidgets = saveCustomWidgets()) { + ui->setElementCustomWidgets(ui_customWidgets); + } + + if (DomTabStops *ui_tabStops = saveTabStops()) { + ui->setElementTabStops(ui_tabStops); + } + + if (DomResources *ui_resources = saveResources()) { + ui->setElementResources(ui_resources); + } + if (DomButtonGroups *ui_buttonGroups = saveButtonGroups(widget)) + ui->setElementButtonGroups(ui_buttonGroups); +} + +/*! + \internal +*/ +DomConnections *QAbstractFormBuilder::saveConnections() +{ + return new DomConnections; +} + +/*! + \internal +*/ + +DomWidget *QAbstractFormBuilder::createDom(QWidget *widget, DomWidget *ui_parentWidget, bool recursive) +{ + DomWidget *ui_widget = new DomWidget(); + ui_widget->setAttributeClass(QLatin1String(widget->metaObject()->className())); + ui_widget->setElementProperty(computeProperties(widget)); + + if (recursive) { + if (QLayout *layout = widget->layout()) { + if (DomLayout *ui_layout = createDom(layout, 0, ui_parentWidget)) { + QList ui_layouts; + ui_layouts.append(ui_layout); + + ui_widget->setElementLayout(ui_layouts); + } + } + } + + // widgets, actions and action groups + QList ui_widgets; + QList ui_actions; + QList ui_action_groups; + + QList children; + + // splitters need to store their children in the order specified by child indexes, + // not the order of the child list. +#ifndef QT_NO_SPLITTER + if (const QSplitter *splitter = qobject_cast(widget)) { + const int count = splitter->count(); + for (int i = 0; i < count; ++i) + children.append(splitter->widget(i)); + } else +#endif + { + QList childObjects = widget->children(); + + const QList list = qvariant_cast(widget->property("_q_widgetOrder")); + foreach (QWidget *w, list) { + if (childObjects.contains(w)) { + children.append(w); + childObjects.removeAll(w); + } + } + children += childObjects; + + const QList zOrder = qvariant_cast(widget->property("_q_zOrder")); + if (list != zOrder) { + QStringList zOrderList; + QListIterator itZOrder(zOrder); + while (itZOrder.hasNext()) + zOrderList.append(itZOrder.next()->objectName()); + ui_widget->setElementZOrder(zOrderList); + } + } + + foreach (QObject *obj, children) { + if (QWidget *childWidget = qobject_cast(obj)) { + if (d->m_laidout.contains(childWidget) || recursive == false) + continue; + + if (QMenu *menu = qobject_cast(childWidget)) { + QList actions = menu->parentWidget()->actions(); + QListIterator it(actions); + bool found = false; + while (it.hasNext()) { + if (it.next()->menu() == menu) + found = true; + } + if (!found) + continue; + } + + if (DomWidget *ui_child = createDom(childWidget, ui_widget)) { + ui_widgets.append(ui_child); + } + } else if (QAction *childAction = qobject_cast(obj)) { + if (childAction->actionGroup() != 0) { + // it will be added later. + continue; + } + + if (DomAction *ui_action = createDom(childAction)) { + ui_actions.append(ui_action); + } + } else if (QActionGroup *childActionGroup = qobject_cast(obj)) { + if (DomActionGroup *ui_action_group = createDom(childActionGroup)) { + ui_action_groups.append(ui_action_group); + } + } + } + + // add-action + QList ui_action_refs; + foreach (QAction *action, widget->actions()) { + if (DomActionRef *ui_action_ref = createActionRefDom(action)) { + ui_action_refs.append(ui_action_ref); + } + } + + if (recursive) + ui_widget->setElementWidget(ui_widgets); + + ui_widget->setElementAction(ui_actions); + ui_widget->setElementActionGroup(ui_action_groups); + ui_widget->setElementAddAction(ui_action_refs); + + saveExtraInfo(widget, ui_widget, ui_parentWidget); + + return ui_widget; +} + +/*! + \internal +*/ +DomActionRef *QAbstractFormBuilder::createActionRefDom(QAction *action) +{ + QString name = action->objectName(); + + if (action->menu() != 0) + name = action->menu()->objectName(); + + DomActionRef *ui_action_ref = new DomActionRef(); + if (action->isSeparator()) + ui_action_ref->setAttributeName(QFormBuilderStrings::instance().separator); + else + ui_action_ref->setAttributeName(name); + + return ui_action_ref; +} + +// Struct to store layout item parameters for saving layout items +struct FormBuilderSaveLayoutEntry { + explicit FormBuilderSaveLayoutEntry(QLayoutItem *li = 0) : + item(li), row(-1), column(-1), rowSpan(0), columnSpan(0), alignment(0) {} + + QLayoutItem *item; + int row; + int column; + int rowSpan; + int columnSpan; + Qt::Alignment alignment; +}; + +// Create list from standard box layout +static QList saveLayoutEntries(const QLayout *layout) +{ + QList rc; + if (const int count = layout->count()) { + rc.reserve(count); + for (int idx = 0; idx < count; ++idx) { + QLayoutItem *item = layout->itemAt(idx); + FormBuilderSaveLayoutEntry entry(item); + entry.alignment = item->alignment(); + rc.append(entry); + } + } + return rc; +} + +// Create list from grid layout +static QList saveGridLayoutEntries(QGridLayout *gridLayout) +{ + QList rc; + if (const int count = gridLayout->count()) { + rc.reserve(count); + for (int idx = 0; idx < count; ++idx) { + QLayoutItem *item = gridLayout->itemAt(idx); + FormBuilderSaveLayoutEntry entry(item); + gridLayout->getItemPosition(idx, &entry.row, &entry.column, &entry.rowSpan,&entry.columnSpan); + entry.alignment = item->alignment(); + rc.append(entry); + } + } + return rc; +} + +#ifndef QT_NO_FORMLAYOUT +// Create list from form layout +static QList saveFormLayoutEntries(const QFormLayout *formLayout) +{ + QList rc; + if (const int count = formLayout->count()) { + rc.reserve(count); + for (int idx = 0; idx < count; ++idx) { + QLayoutItem *item = formLayout->itemAt(idx); + QFormLayout::ItemRole role = QFormLayout::LabelRole; + FormBuilderSaveLayoutEntry entry(item); + formLayout->getItemPosition(idx, &entry.row, &role); + switch (role ) { + case QFormLayout::LabelRole: + entry.column = 0; + break; + case QFormLayout::FieldRole: + entry.column = 1; + break; + case QFormLayout::SpanningRole: + entry.column = 0; + entry.columnSpan = 2; + break; + } + rc.push_back(entry); + } + } + return rc; +} +#endif + +/*! + \internal +*/ + +DomLayout *QAbstractFormBuilder::createDom(QLayout *layout, DomLayout *ui_layout, DomWidget *ui_parentWidget) +{ + Q_UNUSED(ui_layout) + DomLayout *lay = new DomLayout(); + lay->setAttributeClass(QLatin1String(layout->metaObject()->className())); + const QString objectName = layout->objectName(); + if (!objectName.isEmpty()) + lay->setAttributeName(objectName); + lay->setElementProperty(computeProperties(layout)); + + QList newList; + if (QGridLayout *gridLayout = qobject_cast(layout)) { + newList = saveGridLayoutEntries(gridLayout); +#ifndef QT_NO_FORMLAYOUT + } else if (const QFormLayout *formLayout = qobject_cast(layout)) { + newList = saveFormLayoutEntries(formLayout); +#endif + } else { + newList = saveLayoutEntries(layout); + } + + QList ui_items; + foreach (const FormBuilderSaveLayoutEntry &item, newList) { + if (DomLayoutItem *ui_item = createDom(item.item, lay, ui_parentWidget)) { + if (item.row >= 0) + ui_item->setAttributeRow(item.row); + if (item.column >= 0) + ui_item->setAttributeColumn(item.column); + if (item.rowSpan > 1) + ui_item->setAttributeRowSpan(item.rowSpan); + if (item.columnSpan > 1) + ui_item->setAttributeColSpan(item.columnSpan); + if (item.alignment) + ui_item->setAttributeAlignment(alignmentValue(item.alignment)); + ui_items.append(ui_item); + } + } + + lay->setElementItem(ui_items); + + return lay; +} + +/*! + \internal +*/ +DomLayoutItem *QAbstractFormBuilder::createDom(QLayoutItem *item, DomLayout *ui_layout, DomWidget *ui_parentWidget) +{ + DomLayoutItem *ui_item = new DomLayoutItem(); + + if (item->widget()) { + ui_item->setElementWidget(createDom(item->widget(), ui_parentWidget)); + d->m_laidout.insert(item->widget(), true); + } else if (item->layout()) { + ui_item->setElementLayout(createDom(item->layout(), ui_layout, ui_parentWidget)); + } else if (item->spacerItem()) { + ui_item->setElementSpacer(createDom(item->spacerItem(), ui_layout, ui_parentWidget)); + } + + return ui_item; +} + +/*! + \internal +*/ +DomSpacer *QAbstractFormBuilder::createDom(QSpacerItem *spacer, DomLayout *ui_layout, DomWidget *ui_parentWidget) +{ + Q_UNUSED(ui_layout); + Q_UNUSED(ui_parentWidget); + + DomSpacer *ui_spacer = new DomSpacer(); + QList properties; + + DomProperty *prop = 0; + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + // sizeHint property + prop = new DomProperty(); + prop->setAttributeName(strings.sizeHintProperty); + prop->setElementSize(new DomSize()); + prop->elementSize()->setElementWidth(spacer->sizeHint().width()); + prop->elementSize()->setElementHeight(spacer->sizeHint().height()); + properties.append(prop); + + // orientation property + prop = new DomProperty(); // ### we don't implemented the case where expandingDirections() is both Vertical and Horizontal + prop->setAttributeName(strings.orientationProperty); + prop->setElementEnum((spacer->expandingDirections() & Qt::Horizontal) ? strings.qtHorizontal : strings.qtVertical); + properties.append(prop); + + ui_spacer->setElementProperty(properties); + return ui_spacer; +} + +/*! + \internal +*/ +DomProperty *QAbstractFormBuilder::createProperty(QObject *obj, const QString &pname, const QVariant &v) +{ + if (!checkProperty(obj, pname)) { + return 0; + } + return variantToDomProperty(this, obj->metaObject(), pname, v); +} + +/*! + \internal +*/ +QList QAbstractFormBuilder::computeProperties(QObject *obj) +{ + QList lst; + + const QMetaObject *meta = obj->metaObject(); + + QHash properties; + const int propertyCount = meta->propertyCount(); + for(int i=0; i < propertyCount; ++i) + properties.insert(meta->property(i).name(), true); + + const QList propertyNames = properties.keys(); + + const int propertyNamesCount = propertyNames.size(); + for(int i=0; iproperty(meta->indexOfProperty(pname.toUtf8())); + + if (!prop.isWritable() || !checkProperty(obj, QLatin1String(prop.name()))) + continue; + + const QVariant v = prop.read(obj); + + DomProperty *dom_prop = 0; + if (v.type() == QVariant::Int) { + dom_prop = new DomProperty(); + + if (prop.isFlagType()) + uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Flags property are not supported yet.")); + + if (prop.isEnumType()) { + QString scope = QString::fromUtf8(prop.enumerator().scope()); + if (scope.size()) + scope += QString::fromUtf8("::"); + const QString e = QString::fromUtf8(prop.enumerator().valueToKey(v.toInt())); + if (e.size()) + dom_prop->setElementEnum(scope + e); + } else + dom_prop->setElementNumber(v.toInt()); + dom_prop->setAttributeName(pname); + } else { + dom_prop = createProperty(obj, pname, v); + } + + if (!dom_prop || dom_prop->kind() == DomProperty::Unknown) + delete dom_prop; + else + lst.append(dom_prop); + } + + return lst; +} + + +/*! + \internal + \typedef QAbstractFormBuilder::DomPropertyHash + \typedef QAbstractFormBuilder::IconPaths +*/ + + +/*! + \internal +*/ +QAbstractFormBuilder::DomPropertyHash QAbstractFormBuilder::propertyMap(const QList &properties) +{ + DomPropertyHash map; + + foreach (DomProperty *p, properties) + map.insert(p->attributeName(), p); + + return map; +} + +/*! + \internal +*/ +bool QAbstractFormBuilder::checkProperty(QObject *obj, const QString &prop) const +{ + Q_UNUSED(obj); + Q_UNUSED(prop); + + return true; +} + +/*! + \internal +*/ +QString QAbstractFormBuilder::toString(const DomString *str) +{ + return str ? str->text() : QString(); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::applyTabStops(QWidget *widget, DomTabStops *tabStops) +{ + if (!tabStops) + return; + + QWidget *lastWidget = 0; + + const QStringList l = tabStops->elementTabStop(); + for (int i=0; ifindChild(name); + if (!child) { + uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "While applying tab stops: The widget '%1' could not be found.").arg(name)); + continue; + } + + if (i == 0) { + lastWidget = widget->findChild(name); + continue; + } else if (!child || !lastWidget) { + continue; + } + + QWidget::setTabOrder(lastWidget, child); + + lastWidget = widget->findChild(name); + } +} + +/*! + \internal +*/ +DomCustomWidgets *QAbstractFormBuilder::saveCustomWidgets() +{ + return 0; +} + +/*! + \internal +*/ +DomTabStops *QAbstractFormBuilder::saveTabStops() +{ + return 0; +} + +/*! + \internal +*/ +DomResources *QAbstractFormBuilder::saveResources() +{ + return 0; +} + +/*! + \internal + \since 4.5 +*/ + +DomButtonGroups *QAbstractFormBuilder::saveButtonGroups(const QWidget *mainContainer) +{ + // Save fst order buttongroup children of maincontainer + typedef QList ButtonGroupList; + const QObjectList mchildren = mainContainer->children(); + if (mchildren.empty()) + return 0; + QList domGroups; + const QObjectList::const_iterator cend = mchildren.constEnd(); + for (QObjectList::const_iterator it = mchildren.constBegin(); it != cend; ++it) + if (QButtonGroup *bg = qobject_cast(*it)) + if (DomButtonGroup* dg = createDom(bg)) + domGroups.push_back(dg); + + if (domGroups.empty()) + return 0; + DomButtonGroups *rc = new DomButtonGroups; + rc->setElementButtonGroup(domGroups); + return rc; +} + +// VC6 would not find templated members, so we use statics and this utter hack. +class FriendlyFB : public QAbstractFormBuilder { +public: + using QAbstractFormBuilder::saveResource; + using QAbstractFormBuilder::saveText; + using QAbstractFormBuilder::resourceBuilder; + using QAbstractFormBuilder::textBuilder; + using QAbstractFormBuilder::toVariant; +}; + +template +static void storeItemFlags(const T *item, QList *properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + static const Qt::ItemFlags defaultFlags = T().flags(); + static const QMetaEnum itemFlags_enum = metaEnum("itemFlags"); + + if (item->flags() != defaultFlags) { + DomProperty *p = new DomProperty; + p->setAttributeName(strings.flagsAttribute); + p->setElementSet(QString::fromAscii(itemFlags_enum.valueToKeys(item->flags()))); + properties->append(p); + } +} + +#ifndef Q_CC_RVCT +// RVCT does not accept static inline functions if one argument is templated type +// For this reason all necessary function variants are explicityly written for it. +template +static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const T *item, + QList *properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + FriendlyFB * const formBuilder = static_cast(abstractFormBuilder); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = formBuilder->saveText(it.second, item->data(it.first.second)))) + properties->append(p); + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((v = item->data(it.first)).isValid() && + (p = variantToDomProperty(abstractFormBuilder, + static_cast(&QAbstractFormBuilderGadget::staticMetaObject), + it.second, v))) + properties->append(p); + + if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole)))) + properties->append(p); +} + +template +static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const T *item, + QList *properties) +{ + storeItemProps(abstractFormBuilder, item, properties); + storeItemFlags(item, properties); +} + +template +static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, T *item, + const QHash &properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + FriendlyFB * const formBuilder = static_cast(abstractFormBuilder); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = properties.value(it.second))) { + v = formBuilder->textBuilder()->loadText(p); + QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v); + item->setData(it.first.first, qvariant_cast(nativeValue)); + item->setData(it.first.second, v); + } + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((p = properties.value(it.second)) && + (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid()) + item->setData(it.first, v); + + if ((p = properties.value(strings.iconAttribute))) { + v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p); + QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v); + item->setIcon(qvariant_cast(nativeValue)); + item->setData(Qt::DecorationPropertyRole, v); + } +} + +template +static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, T *item, + const QHash &properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + static const QMetaEnum itemFlags_enum = metaEnum("itemFlags"); + + loadItemProps(abstractFormBuilder, item, properties); + + DomProperty *p; + if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set) + item->setFlags(enumKeysToValue(itemFlags_enum, p->elementSet().toAscii())); +} + +#else + +static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const QTableWidgetItem *item, + QList *properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + FriendlyFB * const formBuilder = static_cast(abstractFormBuilder); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = formBuilder->saveText(it.second, item->data(it.first.second)))) + properties->append(p); + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((v = item->data(it.first)).isValid() && + (p = variantToDomProperty(abstractFormBuilder, + static_cast(&QAbstractFormBuilderGadget::staticMetaObject), + it.second, v))) + properties->append(p); + + if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole)))) + properties->append(p); +} + +static void storeItemProps(QAbstractFormBuilder *abstractFormBuilder, const QListWidgetItem *item, + QList *properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + FriendlyFB * const formBuilder = static_cast(abstractFormBuilder); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = formBuilder->saveText(it.second, item->data(it.first.second)))) + properties->append(p); + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((v = item->data(it.first)).isValid() && + (p = variantToDomProperty(abstractFormBuilder, + static_cast(&QAbstractFormBuilderGadget::staticMetaObject), + it.second, v))) + properties->append(p); + + if ((p = formBuilder->saveResource(item->data(Qt::DecorationPropertyRole)))) + properties->append(p); +} + +static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const QTableWidgetItem *item, + QList *properties) +{ + storeItemProps(abstractFormBuilder, item, properties); + storeItemFlags(item, properties); +} + +static void storeItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, const QListWidgetItem *item, + QList *properties) +{ + storeItemProps(abstractFormBuilder, item, properties); + storeItemFlags(item, properties); +} + +static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, QTableWidgetItem *item, + const QHash &properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + FriendlyFB * const formBuilder = static_cast(abstractFormBuilder); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = properties.value(it.second))) { + v = formBuilder->textBuilder()->loadText(p); + QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v); + item->setData(it.first.first, qvariant_cast(nativeValue)); + item->setData(it.first.second, v); + } + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((p = properties.value(it.second)) && + (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid()) + item->setData(it.first, v); + + if ((p = properties.value(strings.iconAttribute))) { + v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p); + QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v); + item->setIcon(qvariant_cast(nativeValue)); + item->setData(Qt::DecorationPropertyRole, v); + } +} + +static void loadItemProps(QAbstractFormBuilder *abstractFormBuilder, QListWidgetItem *item, + const QHash &properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + FriendlyFB * const formBuilder = static_cast(abstractFormBuilder); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = properties.value(it.second))) { + v = formBuilder->textBuilder()->loadText(p); + QVariant nativeValue = formBuilder->textBuilder()->toNativeValue(v); + item->setData(it.first.first, qvariant_cast(nativeValue)); + item->setData(it.first.second, v); + } + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((p = properties.value(it.second)) && + (v = formBuilder->toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid()) + item->setData(it.first, v); + + if ((p = properties.value(strings.iconAttribute))) { + v = formBuilder->resourceBuilder()->loadResource(formBuilder->workingDirectory(), p); + QVariant nativeValue = formBuilder->resourceBuilder()->toNativeValue(v); + item->setIcon(qvariant_cast(nativeValue)); + item->setData(Qt::DecorationPropertyRole, v); + } +} + +static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, QTableWidgetItem *item, + const QHash &properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + static const QMetaEnum itemFlags_enum = metaEnum("itemFlags"); + + loadItemProps(abstractFormBuilder, item, properties); + + DomProperty *p; + if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set) + item->setFlags(enumKeysToValue(itemFlags_enum, p->elementSet().toAscii())); +} + +static void loadItemPropsNFlags(QAbstractFormBuilder *abstractFormBuilder, QListWidgetItem *item, + const QHash &properties) +{ + static const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + static const QMetaEnum itemFlags_enum = metaEnum("itemFlags"); + + loadItemProps(abstractFormBuilder, item, properties); + + DomProperty *p; + if ((p = properties.value(strings.flagsAttribute)) && p->kind() == DomProperty::Set) + item->setFlags(enumKeysToValue(itemFlags_enum, p->elementSet().toAscii())); +} + +#endif + +/*! + \internal +*/ +void QAbstractFormBuilder::saveTreeWidgetExtraInfo(QTreeWidget *treeWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget) +{ + Q_UNUSED(ui_parentWidget); + + QList columns; + DomProperty *p; + QVariant v; + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + // save the header + for (int c = 0; ccolumnCount(); ++c) { + DomColumn *column = new DomColumn; + + QList properties; + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) { + p = saveText(it.second, treeWidget->headerItem()->data(c, it.first.second)); + // Prevent uic 4.4.X from crashing if it cannot find a column text + if (!p && it.first.first == Qt::EditRole && it.second == QLatin1String("text")) { + DomString *defaultHeader = new DomString; + defaultHeader->setText(QString::number(c + 1)); + defaultHeader->setAttributeNotr(QLatin1String("true")); + p = new DomProperty; + p->setAttributeName(it.second); + p->setElementString(defaultHeader); + } + if (p) + properties.append(p); + } + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((v = treeWidget->headerItem()->data(c, it.first)).isValid() && + (p = variantToDomProperty(this, &QAbstractFormBuilderGadget::staticMetaObject, it.second, v))) + properties.append(p); + + if ((p = saveResource(treeWidget->headerItem()->data(c, Qt::DecorationPropertyRole)))) + properties.append(p); + + column->setElementProperty(properties); + columns.append(column); + } + + ui_widget->setElementColumn(columns); + + QList items = ui_widget->elementItem(); + + QQueue > pendingQueue; + for (int i = 0; i < treeWidget->topLevelItemCount(); i++) + pendingQueue.enqueue(qMakePair(treeWidget->topLevelItem(i), (DomItem *)0)); + + while (!pendingQueue.isEmpty()) { + const QPair pair = pendingQueue.dequeue(); + QTreeWidgetItem *item = pair.first; + DomItem *parentDomItem = pair.second; + + DomItem *currentDomItem = new DomItem; + + QList properties; + for (int c = 0; c < treeWidget->columnCount(); c++) { + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = saveText(it.second, item->data(c, it.first.second)))) + properties.append(p); + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((v = item->data(c, it.first)).isValid() && + (p = variantToDomProperty(this, &QAbstractFormBuilderGadget::staticMetaObject, it.second, v))) + properties.append(p); + + if ((p = saveResource(item->data(c, Qt::DecorationPropertyRole)))) + properties.append(p); + } + storeItemFlags(item, &properties); + currentDomItem->setElementProperty(properties); + + if (parentDomItem) { + QList childrenItems = parentDomItem->elementItem(); + childrenItems.append(currentDomItem); + parentDomItem->setElementItem(childrenItems); + } else + items.append(currentDomItem); + + for (int i = 0; i < item->childCount(); i++) + pendingQueue.enqueue(qMakePair(item->child(i), currentDomItem)); + } + + ui_widget->setElementItem(items); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::saveTableWidgetExtraInfo(QTableWidget *tableWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget) +{ + Q_UNUSED(ui_parentWidget); + + // save the horizontal header + QList columns; + for (int c = 0; c < tableWidget->columnCount(); c++) { + QList properties; + QTableWidgetItem *item = tableWidget->horizontalHeaderItem(c); + if (item) + storeItemProps(this, item, &properties); + + DomColumn *column = new DomColumn; + column->setElementProperty(properties); + columns.append(column); + } + ui_widget->setElementColumn(columns); + + // save the vertical header + QList rows; + for (int r = 0; r < tableWidget->rowCount(); r++) { + QList properties; + QTableWidgetItem *item = tableWidget->verticalHeaderItem(r); + if (item) + storeItemProps(this, item, &properties); + + DomRow *row = new DomRow; + row->setElementProperty(properties); + rows.append(row); + } + ui_widget->setElementRow(rows); + + QList items = ui_widget->elementItem(); + for (int r = 0; r < tableWidget->rowCount(); r++) + for (int c = 0; c < tableWidget->columnCount(); c++) { + QTableWidgetItem *item = tableWidget->item(r, c); + if (item) { + QList properties; + storeItemPropsNFlags(this, item, &properties); + + DomItem *domItem = new DomItem; + domItem->setAttributeRow(r); + domItem->setAttributeColumn(c); + domItem->setElementProperty(properties); + items.append(domItem); + } + } + + ui_widget->setElementItem(items); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::saveListWidgetExtraInfo(QListWidget *listWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget) +{ + Q_UNUSED(ui_parentWidget); + + QList ui_items = ui_widget->elementItem(); + for (int i=0; icount(); ++i) { + QList properties; + storeItemPropsNFlags(this, listWidget->item(i), &properties); + + DomItem *ui_item = new DomItem(); + ui_item->setElementProperty(properties); + ui_items.append(ui_item); + } + + ui_widget->setElementItem(ui_items); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::saveComboBoxExtraInfo(QComboBox *comboBox, DomWidget *ui_widget, DomWidget *ui_parentWidget) +{ + Q_UNUSED(ui_parentWidget); + QList ui_items = ui_widget->elementItem(); + + const int count = comboBox->count(); + for (int i=0; i < count; ++i) { + // We might encounter items for which both builders return 0 in Designer + // (indicating a custom combo adding items in the constructor). Ignore those. + DomProperty *textProperty = saveText(QFormBuilderStrings::instance().textAttribute, + comboBox->itemData(i, Qt::DisplayPropertyRole)); + DomProperty *iconProperty = saveResource(comboBox->itemData(i, Qt::DecorationPropertyRole)); + if (textProperty || iconProperty) { + QList properties; + if (textProperty) + properties.push_back(textProperty); + if (iconProperty) + properties.push_back(iconProperty); + + DomItem *ui_item = new DomItem(); + ui_item->setElementProperty(properties); + ui_items.push_back(ui_item); + } + } + + ui_widget->setElementItem(ui_items); +} + +/*! + \internal + \since 4.5 +*/ + +void QAbstractFormBuilder::saveButtonExtraInfo(const QAbstractButton *widget, DomWidget *ui_widget, DomWidget *) +{ + typedef QList DomPropertyList; + if (const QButtonGroup *buttonGroup = widget->group()) { + DomPropertyList attributes = ui_widget->elementAttribute(); + DomString *domString = new DomString(); + domString->setText(buttonGroup->objectName()); + domString->setAttributeNotr(QLatin1String("true")); + DomProperty *domProperty = new DomProperty(); + domProperty->setAttributeName(QLatin1String(buttonGroupPropertyC)); + domProperty->setElementString(domString); + attributes += domProperty; + ui_widget->setElementAttribute(attributes); + } +} + +/*! + \internal + \since 4.5 +*/ +void QAbstractFormBuilder::saveItemViewExtraInfo(const QAbstractItemView *itemView, + DomWidget *ui_widget, DomWidget *) +{ + // + // Special handling for qtableview/qtreeview fake header attributes + // + static QStringList realPropertyNames = + (QStringList() << QLatin1String("visible") + << QLatin1String("cascadingSectionResizes") + << QLatin1String("defaultSectionSize") + << QLatin1String("highlightSections") + << QLatin1String("minimumSectionSize") + << QLatin1String("showSortIndicator") + << QLatin1String("stretchLastSection")); + + if (const QTreeView *treeView = qobject_cast(itemView)) { + QList viewProperties = ui_widget->elementAttribute(); + QList headerProperties = computeProperties(treeView->header()); + foreach (const QString &realPropertyName, realPropertyNames) { + const QString upperPropertyName = realPropertyName.at(0).toUpper() + + realPropertyName.mid(1); + const QString fakePropertyName = QLatin1String("header") + upperPropertyName; + foreach (DomProperty *property, headerProperties) { + if (property->attributeName() == realPropertyName) { + property->setAttributeName(fakePropertyName); + viewProperties << property; + } + } + } + ui_widget->setElementAttribute(viewProperties); + } else if (const QTableView *tableView = qobject_cast(itemView)) { + static QStringList headerPrefixes = + (QStringList() << QLatin1String("horizontalHeader") + << QLatin1String("verticalHeader")); + + QList viewProperties = ui_widget->elementAttribute(); + foreach (const QString &headerPrefix, headerPrefixes) { + QList headerProperties; + if (headerPrefix == QLatin1String("horizontalHeader")) + headerProperties = computeProperties(tableView->horizontalHeader()); + else + headerProperties = computeProperties(tableView->verticalHeader()); + foreach (const QString &realPropertyName, realPropertyNames) { + const QString upperPropertyName = realPropertyName.at(0).toUpper() + + realPropertyName.mid(1); + const QString fakePropertyName = headerPrefix + upperPropertyName; + foreach (DomProperty *property, headerProperties) { + if (property->attributeName() == realPropertyName) { + property->setAttributeName(fakePropertyName); + viewProperties << property; + } + } + } + } + ui_widget->setElementAttribute(viewProperties); + } +} + +/*! + \internal + \since 4.4 +*/ + +void QAbstractFormBuilder::setResourceBuilder(QResourceBuilder *builder) +{ + d->setResourceBuilder(builder); +} + +/*! + \internal + \since 4.4 +*/ + +QResourceBuilder *QAbstractFormBuilder::resourceBuilder() const +{ + return d->resourceBuilder(); +} + +/*! + \internal + \since 4.5 +*/ + +void QAbstractFormBuilder::setTextBuilder(QTextBuilder *builder) +{ + d->setTextBuilder(builder); +} + +/*! + \internal + \since 4.5 +*/ + +QTextBuilder *QAbstractFormBuilder::textBuilder() const +{ + return d->textBuilder(); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::saveExtraInfo(QWidget *widget, DomWidget *ui_widget, + DomWidget *ui_parentWidget) +{ + if (QListWidget *listWidget = qobject_cast(widget)) { + saveListWidgetExtraInfo(listWidget, ui_widget, ui_parentWidget); + } else if (QTreeWidget *treeWidget = qobject_cast(widget)) { + saveTreeWidgetExtraInfo(treeWidget, ui_widget, ui_parentWidget); + } else if (QTableWidget *tableWidget = qobject_cast(widget)) { + saveTableWidgetExtraInfo(tableWidget, ui_widget, ui_parentWidget); + } else if (QComboBox *comboBox = qobject_cast(widget)) { + if (!qobject_cast(widget)) + saveComboBoxExtraInfo(comboBox, ui_widget, ui_parentWidget); + } else if(QAbstractButton *ab = qobject_cast(widget)) { + saveButtonExtraInfo(ab, ui_widget, ui_parentWidget); + } + if (QAbstractItemView *itemView = qobject_cast(widget)) { + saveItemViewExtraInfo(itemView, ui_widget, ui_parentWidget); + } +} + +/*! + \internal +*/ +void QAbstractFormBuilder::loadListWidgetExtraInfo(DomWidget *ui_widget, QListWidget *listWidget, QWidget *parentWidget) +{ + Q_UNUSED(parentWidget); + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + const QMetaEnum itemFlags_enum = metaEnum("itemFlags"); + + foreach (DomItem *ui_item, ui_widget->elementItem()) { + const DomPropertyHash properties = propertyMap(ui_item->elementProperty()); + QListWidgetItem *item = new QListWidgetItem(listWidget); +#ifndef Q_CC_RVCT + loadItemPropsNFlags(this, item, properties); +#else + loadItemPropsNFlags(this, item, properties); +#endif + } + + DomProperty *currentRow = propertyMap(ui_widget->elementProperty()).value(strings.currentRowProperty); + if (currentRow) + listWidget->setCurrentRow(currentRow->elementNumber()); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::loadTreeWidgetExtraInfo(DomWidget *ui_widget, QTreeWidget *treeWidget, QWidget *parentWidget) +{ + Q_UNUSED(parentWidget); + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + const QMetaEnum itemFlags_enum = metaEnum("itemFlags"); + const QList columns = ui_widget->elementColumn(); + if (columns.count() > 0) + treeWidget->setColumnCount(columns.count()); + + for (int i = 0; ielementProperty()); + + DomProperty *p; + QVariant v; + + foreach (const QFormBuilderStrings::RoleNName &it, strings.itemRoles) + if ((p = properties.value(it.second)) && + (v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p)).isValid()) + treeWidget->headerItem()->setData(i, it.first, v); + + foreach (const QFormBuilderStrings::TextRoleNName &it, strings.itemTextRoles) + if ((p = properties.value(it.second))) { + v = textBuilder()->loadText(p); + QVariant nativeValue = textBuilder()->toNativeValue(v); + treeWidget->headerItem()->setData(i, it.first.first, qvariant_cast(nativeValue)); + treeWidget->headerItem()->setData(i, it.first.second, v); + } + + if ((p = properties.value(strings.iconAttribute))) { + v = resourceBuilder()->loadResource(workingDirectory(), p); + QVariant nativeValue = resourceBuilder()->toNativeValue(v); + treeWidget->headerItem()->setIcon(i, qvariant_cast(nativeValue)); + treeWidget->headerItem()->setData(i, Qt::DecorationPropertyRole, v); + } + } + + QQueue > pendingQueue; + foreach (DomItem *ui_item, ui_widget->elementItem()) + pendingQueue.enqueue(qMakePair(ui_item, (QTreeWidgetItem *)0)); + + while (!pendingQueue.isEmpty()) { + const QPair pair = pendingQueue.dequeue(); + const DomItem *domItem = pair.first; + QTreeWidgetItem *parentItem = pair.second; + + QTreeWidgetItem *currentItem = 0; + + if (parentItem) + currentItem = new QTreeWidgetItem(parentItem); + else + currentItem = new QTreeWidgetItem(treeWidget); + + const QList properties = domItem->elementProperty(); + int col = -1; + foreach (DomProperty *property, properties) { + if (property->attributeName() == strings.flagsAttribute && !property->elementSet().isEmpty()) { + currentItem->setFlags(enumKeysToValue(itemFlags_enum, property->elementSet().toAscii())); + } else if (property->attributeName() == strings.textAttribute && property->elementString()) { + col++; + QVariant textV = textBuilder()->loadText(property); + QVariant nativeValue = textBuilder()->toNativeValue(textV); + currentItem->setText(col, qvariant_cast(nativeValue)); + currentItem->setData(col, Qt::DisplayPropertyRole, textV); + } else if (col >= 0) { + if (property->attributeName() == strings.iconAttribute) { + QVariant v = resourceBuilder()->loadResource(workingDirectory(), property); + if (v.isValid()) { + QVariant nativeValue = resourceBuilder()->toNativeValue(v); + currentItem->setIcon(col, qvariant_cast(nativeValue)); + currentItem->setData(col, Qt::DecorationPropertyRole, v); + } + } else { + QVariant v; + int role = strings.treeItemRoleHash.value(property->attributeName(), (Qt::ItemDataRole)-1); + if (role >= 0) { + if ((v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, property)).isValid()) + currentItem->setData(col, role, v); + } else { + QPair rolePair = + strings.treeItemTextRoleHash.value(property->attributeName(), + qMakePair((Qt::ItemDataRole)-1, (Qt::ItemDataRole)-1)); + if (rolePair.first >= 0) { + QVariant textV = textBuilder()->loadText(property); + QVariant nativeValue = textBuilder()->toNativeValue(textV); + currentItem->setData(col, rolePair.first, qvariant_cast(nativeValue)); + currentItem->setData(col, rolePair.second, textV); + } + } + } + } + } + + foreach (DomItem *childItem, domItem->elementItem()) + pendingQueue.enqueue(qMakePair(childItem, currentItem)); + + } +} + +/*! + \internal +*/ +void QAbstractFormBuilder::loadTableWidgetExtraInfo(DomWidget *ui_widget, QTableWidget *tableWidget, QWidget *parentWidget) +{ + Q_UNUSED(parentWidget); + + const QList columns = ui_widget->elementColumn(); + if (columns.count() > 0) + tableWidget->setColumnCount(columns.count()); + for (int i = 0; i< columns.count(); i++) { + DomColumn *c = columns.at(i); + const DomPropertyHash properties = propertyMap(c->elementProperty()); + + if (!properties.isEmpty()) { + QTableWidgetItem *item = new QTableWidgetItem; + loadItemProps(this, item, properties); + tableWidget->setHorizontalHeaderItem(i, item); + } + } + + const QList rows = ui_widget->elementRow(); + if (rows.count() > 0) + tableWidget->setRowCount(rows.count()); + for (int i = 0; i< rows.count(); i++) { + const DomRow *r = rows.at(i); + const DomPropertyHash properties = propertyMap(r->elementProperty()); + + if (!properties.isEmpty()) { + QTableWidgetItem *item = new QTableWidgetItem; + loadItemProps(this, item, properties); + tableWidget->setVerticalHeaderItem(i, item); + } + } + + foreach (DomItem *ui_item, ui_widget->elementItem()) { + if (ui_item->hasAttributeRow() && ui_item->hasAttributeColumn()) { + const DomPropertyHash properties = propertyMap(ui_item->elementProperty()); + QTableWidgetItem *item = new QTableWidgetItem; + loadItemPropsNFlags(this, item, properties); + tableWidget->setItem(ui_item->attributeRow(), ui_item->attributeColumn(), item); + } + } +} + +/*! + \internal +*/ +void QAbstractFormBuilder::loadComboBoxExtraInfo(DomWidget *ui_widget, QComboBox *comboBox, QWidget *parentWidget) +{ + Q_UNUSED(parentWidget); + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + foreach (DomItem *ui_item, ui_widget->elementItem()) { + const DomPropertyHash properties = propertyMap(ui_item->elementProperty()); + QString text; + QIcon icon; + QVariant textData; + QVariant iconData; + + DomProperty *p = 0; + + p = properties.value(strings.textAttribute); + if (p && p->elementString()) { + textData = textBuilder()->loadText(p); + text = qvariant_cast(textBuilder()->toNativeValue(textData)); + } + + p = properties.value(strings.iconAttribute); + if (p) { + iconData = resourceBuilder()->loadResource(workingDirectory(), p); + icon = qvariant_cast(resourceBuilder()->toNativeValue(iconData)); + } + + comboBox->addItem(icon, text); + comboBox->setItemData((comboBox->count()-1), iconData, Qt::DecorationPropertyRole); + comboBox->setItemData((comboBox->count()-1), textData, Qt::DisplayPropertyRole); + } + + DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); + if (currentIndex) + comboBox->setCurrentIndex(currentIndex->elementNumber()); +} + +// Get the button group name out of a widget's attribute list +static QString buttonGroupName(const DomWidget *ui_widget) +{ + typedef QList DomPropertyList; + const DomPropertyList attributes = ui_widget->elementAttribute(); + if (attributes.empty()) + return QString(); + const QString buttonGroupProperty = QLatin1String(buttonGroupPropertyC); + const DomPropertyList::const_iterator cend = attributes.constEnd(); + for (DomPropertyList::const_iterator it = attributes.constBegin(); it != cend; ++it) + if ( (*it)->attributeName() == buttonGroupProperty) + return (*it)->elementString()->text(); + return QString(); +} + +/*! + \internal + \since 4.5 +*/ + +void QAbstractFormBuilder::loadButtonExtraInfo(const DomWidget *ui_widget, QAbstractButton *button, QWidget *) +{ + typedef QFormBuilderExtra::ButtonGroupEntry ButtonGroupEntry; + typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash; + + const QString groupName = buttonGroupName(ui_widget); + if (groupName.isEmpty()) + return; + // Find entry + ButtonGroupHash &buttonGroups = d->buttonGroups(); + ButtonGroupHash::iterator it = buttonGroups.find(groupName); + if (it == buttonGroups.end()) { +#ifdef QFORMINTERNAL_NAMESPACE // Suppress the warning when copying in Designer + uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "Invalid QButtonGroup reference '%1' referenced by '%2'.").arg(groupName, button->objectName())); +#endif + return; + } + // Create button group on demand? + QButtonGroup *&group = it.value().second; + if (group == 0) { + group = new QButtonGroup; + group->setObjectName(groupName); + applyProperties(group, it.value().first->elementProperty()); + } + group->addButton(button); +} + +/*! + \internal + \since 4.5 +*/ +void QAbstractFormBuilder::loadItemViewExtraInfo(DomWidget *ui_widget, QAbstractItemView *itemView, + QWidget *) +{ + // + // Special handling for qtableview/qtreeview fake header attributes + // + static QStringList realPropertyNames = + (QStringList() << QLatin1String("visible") + << QLatin1String("cascadingSectionResizes") + << QLatin1String("defaultSectionSize") + << QLatin1String("highlightSections") + << QLatin1String("minimumSectionSize") + << QLatin1String("showSortIndicator") + << QLatin1String("stretchLastSection")); + + if (QTreeView *treeView = qobject_cast(itemView)) { + QList allAttributes = ui_widget->elementAttribute(); + QList headerProperties; + foreach (const QString &realPropertyName, realPropertyNames) { + const QString upperPropertyName = realPropertyName.at(0).toUpper() + + realPropertyName.mid(1); + const QString fakePropertyName = QLatin1String("header") + upperPropertyName; + foreach (DomProperty *attr, allAttributes) { + if (attr->attributeName() == fakePropertyName) { + attr->setAttributeName(realPropertyName); + headerProperties << attr; + } + } + } + applyProperties(treeView->header(), headerProperties); + } else if (QTableView *tableView = qobject_cast(itemView)) { + static QStringList headerPrefixes = + (QStringList() << QLatin1String("horizontalHeader") + << QLatin1String("verticalHeader")); + + QList allAttributes = ui_widget->elementAttribute(); + foreach (const QString &headerPrefix, headerPrefixes) { + QList headerProperties; + foreach (const QString &realPropertyName, realPropertyNames) { + const QString upperPropertyName = realPropertyName.at(0).toUpper() + + realPropertyName.mid(1); + const QString fakePropertyName = headerPrefix + upperPropertyName; + foreach (DomProperty *attr, allAttributes) { + if (attr->attributeName() == fakePropertyName) { + attr->setAttributeName(realPropertyName); + headerProperties << attr; + } + } + } + if (headerPrefix == QLatin1String("horizontalHeader")) + applyProperties(tableView->horizontalHeader(), headerProperties); + else + applyProperties(tableView->verticalHeader(), headerProperties); + } + } +} + +/*! + \internal +*/ +void QAbstractFormBuilder::loadExtraInfo(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget) +{ + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + if (0) { +#ifndef QT_NO_LISTWIDGET + } else if (QListWidget *listWidget = qobject_cast(widget)) { + loadListWidgetExtraInfo(ui_widget, listWidget, parentWidget); +#endif +#ifndef QT_NO_TREEWIDGET + } else if (QTreeWidget *treeWidget = qobject_cast(widget)) { + loadTreeWidgetExtraInfo(ui_widget, treeWidget, parentWidget); +#endif +#ifndef QT_NO_TABLEWIDGET + } else if (QTableWidget *tableWidget = qobject_cast(widget)) { + loadTableWidgetExtraInfo(ui_widget, tableWidget, parentWidget); +#endif +#ifndef QT_NO_COMBOBOX + } else if (QComboBox *comboBox = qobject_cast(widget)) { + if (!qobject_cast(widget)) + loadComboBoxExtraInfo(ui_widget, comboBox, parentWidget); +#endif +#ifndef QT_NO_TABWIDGET + } else if (QTabWidget *tabWidget = qobject_cast(widget)) { + const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); + if (currentIndex) + tabWidget->setCurrentIndex(currentIndex->elementNumber()); +#endif +#ifndef QT_NO_STACKEDWIDGET + } else if (QStackedWidget *stackedWidget = qobject_cast(widget)) { + const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); + if (currentIndex) + stackedWidget->setCurrentIndex(currentIndex->elementNumber()); +#endif +#ifndef QT_NO_TOOLBOX + } else if (QToolBox *toolBox = qobject_cast(widget)) { + const DomProperty *currentIndex = propertyMap(ui_widget->elementProperty()).value(strings.currentIndexProperty); + if (currentIndex) + toolBox->setCurrentIndex(currentIndex->elementNumber()); + const DomProperty *tabSpacing = propertyMap(ui_widget->elementProperty()).value(strings.tabSpacingProperty); + if (tabSpacing) + toolBox->layout()->setSpacing(tabSpacing->elementNumber()); +#endif + } else if (QAbstractButton *ab = qobject_cast(widget)) { + loadButtonExtraInfo(ui_widget, ab, parentWidget); + } + if (QAbstractItemView *itemView = qobject_cast(widget)) { + loadItemViewExtraInfo(ui_widget, itemView, parentWidget); + } +} + +/*! + Returns the current working directory of the form builder. + + \sa setWorkingDirectory() */ +QDir QAbstractFormBuilder::workingDirectory() const +{ + return d->m_workingDirectory; +} + +/*! + Sets the current working directory of the form builder to the + specified \a directory. + + \sa workingDirectory()*/ +void QAbstractFormBuilder::setWorkingDirectory(const QDir &directory) +{ + d->m_workingDirectory = directory; +} + +/*! + \internal +*/ +DomAction *QAbstractFormBuilder::createDom(QAction *action) +{ + if (action->parentWidget() == action->menu() || action->isSeparator()) + return 0; + + DomAction *ui_action = new DomAction; + ui_action->setAttributeName(action->objectName()); + + const QList properties = computeProperties(action); + ui_action->setElementProperty(properties); + + return ui_action; +} + +/*! + \internal + \since 4.5 +*/ + +DomButtonGroup *QAbstractFormBuilder::createDom(QButtonGroup *buttonGroup) +{ + if (buttonGroup->buttons().count() == 0) // Empty group left over on form? + return 0; + DomButtonGroup *domButtonGroup = new DomButtonGroup; + domButtonGroup->setAttributeName(buttonGroup->objectName()); + + QList properties = computeProperties(buttonGroup); + domButtonGroup->setElementProperty(properties); + return domButtonGroup; +} + +/*! + \internal +*/ +DomActionGroup *QAbstractFormBuilder::createDom(QActionGroup *actionGroup) +{ + DomActionGroup *ui_action_group = new DomActionGroup; + ui_action_group->setAttributeName(actionGroup->objectName()); + + QList properties = computeProperties(actionGroup); + ui_action_group->setElementProperty(properties); + + QList ui_actions; + + foreach (QAction *action, actionGroup->actions()) { + if (DomAction *ui_action = createDom(action)) { + ui_actions.append(ui_action); + } + } + + ui_action_group->setElementAction(ui_actions); + + return ui_action_group; +} + +/*! + \internal +*/ +void QAbstractFormBuilder::addMenuAction(QAction *action) +{ + Q_UNUSED(action); +} + +/*! + \internal +*/ +void QAbstractFormBuilder::reset() +{ + d->m_laidout.clear(); + d->m_actions.clear(); + d->m_actionGroups.clear(); + d->m_defaultMargin = INT_MIN; + d->m_defaultSpacing = INT_MIN; +} + +/*! + \internal + Access meta enumeration for Qt::ToolBarArea +*/ + +QMetaEnum QAbstractFormBuilder::toolBarAreaMetaEnum() +{ + return metaEnum("toolBarArea"); +} + +/*! + \internal + Return paths of an icon. +*/ + +QAbstractFormBuilder::IconPaths QAbstractFormBuilder::iconPaths(const QIcon &icon) const +{ + Q_UNUSED(icon); + qWarning() << "QAbstractFormBuilder::iconPaths() is obsoleted"; + return IconPaths(); +} + +/*! + \internal + Return paths of a pixmap. +*/ + +QAbstractFormBuilder::IconPaths QAbstractFormBuilder::pixmapPaths(const QPixmap &pixmap) const +{ + Q_UNUSED(pixmap); + qWarning() << "QAbstractFormBuilder::pixmapPaths() is obsoleted"; + return IconPaths(); +} + +/*! + \internal + Set up a DOM property with icon. +*/ + +void QAbstractFormBuilder::setIconProperty(DomProperty &p, const IconPaths &ip) const +{ + DomResourceIcon *dpi = new DomResourceIcon; + + /* TODO + if (!ip.second.isEmpty()) + pix->setAttributeResource(ip.second); +*/ + dpi->setText(ip.first); + + p.setAttributeName(QFormBuilderStrings::instance().iconAttribute); + p.setElementIconSet(dpi); +} + +/*! + \internal + Set up a DOM property with pixmap. +*/ + +void QAbstractFormBuilder::setPixmapProperty(DomProperty &p, const IconPaths &ip) const +{ + DomResourcePixmap *pix = new DomResourcePixmap; + if (!ip.second.isEmpty()) + pix->setAttributeResource(ip.second); + + pix->setText(ip.first); + + p.setAttributeName(QFormBuilderStrings::instance().pixmapAttribute); + p.setElementPixmap(pix); +} + +/*! + \internal + Convenience. Return DOM property for icon; 0 if icon.isNull(). +*/ + +DomProperty* QAbstractFormBuilder::iconToDomProperty(const QIcon &icon) const +{ + Q_UNUSED(icon); + qWarning() << "QAbstractFormBuilder::iconToDomProperty() is obsoleted"; + return 0; +} + +/*! + \internal + \since 4.4 +*/ + +DomProperty *QAbstractFormBuilder::saveResource(const QVariant &v) const +{ + if (v.isNull()) + return 0; + + DomProperty *p = resourceBuilder()->saveResource(workingDirectory(), v); + if (p) + p->setAttributeName(QFormBuilderStrings::instance().iconAttribute); + return p; +} + +/*! + \internal + \since 4.5 +*/ + +DomProperty *QAbstractFormBuilder::saveText(const QString &attributeName, const QVariant &v) const +{ + if (v.isNull()) + return 0; + + DomProperty *p = textBuilder()->saveText(v); + if (p) + p->setAttributeName(attributeName); + return p; +} + +/*! + \internal + Return the appropriate DOM pixmap for an image dom property. + From 4.4 - unused +*/ + +const DomResourcePixmap *QAbstractFormBuilder::domPixmap(const DomProperty* p) { + switch (p->kind()) { + case DomProperty::IconSet: + qDebug() << "** WARNING QAbstractFormBuilder::domPixmap() called for icon set!"; + break; + case DomProperty::Pixmap: + return p->elementPixmap(); + default: + break; + } + return 0; +} + +/*! + \internal + Create icon from DOM. + From 4.4 - unused +*/ + +QIcon QAbstractFormBuilder::domPropertyToIcon(const DomResourcePixmap *icon) +{ + Q_UNUSED(icon); + qWarning() << "QAbstractFormBuilder::domPropertyToIcon() is obsoleted"; + return QIcon(); +} + +/*! + \internal + Create icon from DOM. Assert if !domPixmap + From 4.4 - unused +*/ + +QIcon QAbstractFormBuilder::domPropertyToIcon(const DomProperty* p) +{ + Q_UNUSED(p); + qWarning() << "QAbstractFormBuilder::domPropertyToIcon() is obsoleted"; + return QIcon(); +} + + +/*! + \internal + Create pixmap from DOM. + From 4.4 - unused +*/ + +QPixmap QAbstractFormBuilder::domPropertyToPixmap(const DomResourcePixmap* pixmap) +{ + Q_UNUSED(pixmap); + qWarning() << "QAbstractFormBuilder::domPropertyToPixmap() is obsoleted"; + return QPixmap(); +} + + +/*! + \internal + Create pixmap from DOM. Assert if !domPixmap + From 4.4 - unused +*/ + +QPixmap QAbstractFormBuilder::domPropertyToPixmap(const DomProperty* p) +{ + Q_UNUSED(p); + qWarning() << "QAbstractFormBuilder::domPropertyToPixmap() is obsoleted"; + return QPixmap(); +} + +/*! + \fn void QAbstractFormBuilder::createConnections ( DomConnections *, QWidget * ) + \internal +*/ + +/*! + \fn void QAbstractFormBuilder::createCustomWidgets ( DomCustomWidgets * ) + \internal +*/ + +/*! + \fn void QAbstractFormBuilder::createResources ( DomResources * ) + \internal +*/ + +/*! + \fn QFormScriptRunner *QAbstractFormBuilder::formScriptRunner() const + \internal + \since 4.3 +*/ +#ifndef QT_FORMBUILDER_NO_SCRIPT +QFormScriptRunner *QAbstractFormBuilder::formScriptRunner() const +{ + return &(d->formScriptRunner()); +} +#endif + +/*! + Sets whether the execution of scripts is enabled to \a enabled. + \since 4.3 + \internal +*/ + +void QAbstractFormBuilder::setScriptingEnabled(bool enabled) +{ +#ifdef QT_FORMBUILDER_NO_SCRIPT + if (enabled) + uiLibWarning(QCoreApplication::translate("QAbstractFormBuilder", "This version of the uitools library is linked without script support.")); +#else + QFormScriptRunner::Options options = formScriptRunner()->options(); + if (enabled) + options &= ~QFormScriptRunner::DisableScripts; + else + options |= QFormScriptRunner::DisableScripts; + formScriptRunner()->setOptions(options); +#endif +} + +/*! + Returns whether the execution of scripts is enabled. + \sa setScriptingEnabled() + \since 4.3 + \internal +*/ + +bool QAbstractFormBuilder::isScriptingEnabled() const +{ +#ifdef QT_FORMBUILDER_NO_SCRIPT + return false; +#else + return !(formScriptRunner()->options() & QFormScriptRunner::DisableScripts); +#endif +} + +/*! + Returns a human-readable description of the last error occurred in load(). + + \since 5.0 + \sa load() +*/ + +QString QAbstractFormBuilder::errorString() const +{ + return d->m_errorString; +} + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/abstractformbuilder.h b/src/designer/src/lib/uilib/abstractformbuilder.h new file mode 100644 index 000000000..d0882500b --- /dev/null +++ b/src/designer/src/lib/uilib/abstractformbuilder.h @@ -0,0 +1,283 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ABSTRACTFORMBUILDER_H +#define ABSTRACTFORMBUILDER_H + +#include "uilib_global.h" + +#include +#include +#include +#include + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE +#if 0 +// pragma for syncqt, don't remove. + +#pragma qt_class(QAbstractFormBuilder) +#endif + +class QAction; +class QButtonGroup; +class QActionGroup; +class QComboBox; +class QIODevice; +class QIcon; +class QLayout; +class QLayoutItem; +class QListWidget; +class QObject; +class QSpacerItem; +class QTreeWidget; +class QTableWidget; +class QVariant; +class QWidget; +class QAbstractButton; +class QAbstractItemView; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class DomAction; +class DomActionGroup; +class DomButtonGroup; +class DomButtonGroups; +class DomActionRef; +class DomBrush; +class DomColorGroup; +class DomConnections; +class DomCustomWidgets; +class DomLayout; +class DomLayoutItem; +class DomProperty; +class DomResources; +class DomSpacer; +class DomString; +class DomTabStops; +class DomUI; +class DomWidget; +class DomResourcePixmap; + +class QResourceBuilder; +class QTextBuilder; +class QFormBuilderExtra; + +#ifndef QT_FORMBUILDER_NO_SCRIPT +class QFormScriptRunner; +#endif + +class QDESIGNER_UILIB_EXPORT QAbstractFormBuilder +{ +public: + QAbstractFormBuilder(); + virtual ~QAbstractFormBuilder(); + + QDir workingDirectory() const; + void setWorkingDirectory(const QDir &directory); + + virtual QWidget *load(QIODevice *dev, QWidget *parentWidget=0); + virtual void save(QIODevice *dev, QWidget *widget); + + void setScriptingEnabled(bool enabled); + bool isScriptingEnabled() const; + + QString errorString() const; + +protected: +// +// load +// + virtual void loadExtraInfo(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget); + + virtual QWidget *create(DomUI *ui, QWidget *parentWidget); + virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget); + virtual QLayout *create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget); + virtual QLayoutItem *create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget); + + virtual QAction *create(DomAction *ui_action, QObject *parent); + virtual QActionGroup *create(DomActionGroup *ui_action_group, QObject *parent); + virtual void addMenuAction(QAction *action); + + virtual void applyProperties(QObject *o, const QList &properties); + bool applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value); + + virtual void applyTabStops(QWidget *widget, DomTabStops *tabStops); + + virtual QWidget *createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name); + virtual QLayout *createLayout(const QString &layoutName, QObject *parent, const QString &name); + virtual QAction *createAction(QObject *parent, const QString &name); + virtual QActionGroup *createActionGroup(QObject *parent, const QString &name); + + virtual void createCustomWidgets(DomCustomWidgets *) {} + virtual void createConnections(DomConnections *, QWidget *) {} + virtual void createResources(DomResources*) {} + + virtual bool addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout); + virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget); + +// +// save +// + virtual void saveExtraInfo(QWidget *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget); + + virtual void saveDom(DomUI *ui, QWidget *widget); + + virtual DomActionRef *createActionRefDom(QAction *action); + + virtual DomWidget *createDom(QWidget *widget, DomWidget *ui_parentWidget, bool recursive = true); + virtual DomLayout *createDom(QLayout *layout, DomLayout *ui_layout, DomWidget *ui_parentWidget); + virtual DomLayoutItem *createDom(QLayoutItem *item, DomLayout *ui_parentLayout, DomWidget *ui_parentWidget); + virtual DomSpacer *createDom(QSpacerItem *spacer, DomLayout *ui_parentLayout, DomWidget *ui_parentWidget); + + virtual DomAction *createDom(QAction *action); + virtual DomActionGroup *createDom(QActionGroup *actionGroup); + DomButtonGroup *createDom(QButtonGroup *buttonGroup); + + virtual DomConnections *saveConnections(); + virtual DomCustomWidgets *saveCustomWidgets(); + virtual DomTabStops *saveTabStops(); + virtual DomResources *saveResources(); + DomButtonGroups *saveButtonGroups(const QWidget *mainContainer); + virtual QList computeProperties(QObject *obj); + virtual bool checkProperty(QObject *obj, const QString &prop) const; + virtual DomProperty *createProperty(QObject *object, const QString &propertyName, const QVariant &value); + + virtual void layoutInfo(DomLayout *layout, QObject *parent, int *margin, int *spacing); + + void loadListWidgetExtraInfo(DomWidget *ui_widget, QListWidget *listWidget, QWidget *parentWidget); + void loadTreeWidgetExtraInfo(DomWidget *ui_widget, QTreeWidget *treeWidget, QWidget *parentWidget); + void loadTableWidgetExtraInfo(DomWidget *ui_widget, QTableWidget *tableWidget, QWidget *parentWidget); + void loadComboBoxExtraInfo(DomWidget *ui_widget, QComboBox *comboBox, QWidget *parentWidget); + void loadButtonExtraInfo(const DomWidget *ui_widget, QAbstractButton *button, QWidget *parentWidget); + void loadItemViewExtraInfo(DomWidget *ui_widget, QAbstractItemView *itemView, QWidget *parentWidget); + + void saveListWidgetExtraInfo(QListWidget *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget); + void saveTreeWidgetExtraInfo(QTreeWidget *treeWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget); + void saveTableWidgetExtraInfo(QTableWidget *tablWidget, DomWidget *ui_widget, DomWidget *ui_parentWidget); + void saveComboBoxExtraInfo(QComboBox *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget); + void saveButtonExtraInfo(const QAbstractButton *widget, DomWidget *ui_widget, DomWidget *ui_parentWidget); + void saveItemViewExtraInfo(const QAbstractItemView *itemView, DomWidget *ui_widget, DomWidget *ui_parentWidget); + + void setResourceBuilder(QResourceBuilder *builder); + QResourceBuilder *resourceBuilder() const; + DomProperty *saveResource(const QVariant &v) const; + + void setTextBuilder(QTextBuilder *builder); + QTextBuilder *textBuilder() const; + DomProperty *saveText(const QString &attributeName, const QVariant &v) const; +// +// utils +// + + QVariant toVariant(const QMetaObject *meta, DomProperty *property); + static QString toString(const DomString *str); + + typedef QHash DomPropertyHash; + static DomPropertyHash propertyMap(const QList &properties); + + void setupColorGroup(QPalette &palette, QPalette::ColorGroup colorGroup, DomColorGroup *group); + DomColorGroup *saveColorGroup(const QPalette &palette); + QBrush setupBrush(DomBrush *brush); + DomBrush *saveBrush(const QBrush &brush); + + void reset(); + void initialize(const DomUI *ui); + +#ifndef QT_FORMBUILDER_NO_SCRIPT + QFormScriptRunner *formScriptRunner() const; +#endif +// +// utils +// + + static QMetaEnum toolBarAreaMetaEnum(); + +// +// Icon/pixmap stuff +// + // A Pair of icon path/qrc path. + typedef QPair IconPaths; + + IconPaths iconPaths(const QIcon &) const; + IconPaths pixmapPaths(const QPixmap &) const; + void setIconProperty(DomProperty &, const IconPaths &) const; + void setPixmapProperty(DomProperty &, const IconPaths &) const; + DomProperty* iconToDomProperty(const QIcon &) const; + + static const DomResourcePixmap *domPixmap(const DomProperty* p); + QIcon domPropertyToIcon(const DomResourcePixmap *); + QIcon domPropertyToIcon(const DomProperty* p); + QPixmap domPropertyToPixmap(const DomResourcePixmap* p); + QPixmap domPropertyToPixmap(const DomProperty* p); + +private: +// +// utils +// + static Qt::ToolBarArea toolbarAreaFromDOMAttributes(const DomPropertyHash &attributeMap); + + QAbstractFormBuilder(const QAbstractFormBuilder &other); + void operator = (const QAbstractFormBuilder &other); + + friend QDESIGNER_UILIB_EXPORT DomProperty *variantToDomProperty(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const QString &propertyName, const QVariant &value); + friend QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(QAbstractFormBuilder *abstractFormBuilder,const QMetaObject *meta, const DomProperty *property); + +protected: + QScopedPointer d; +}; + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // ABSTRACTFORMBUILDER_H diff --git a/src/designer/src/lib/uilib/container.h b/src/designer/src/lib/uilib/container.h new file mode 100644 index 000000000..cf670edaf --- /dev/null +++ b/src/designer/src/lib/uilib/container.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CONTAINER_H +#define CONTAINER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QWidget; + +class QDesignerContainerExtension +{ +public: + virtual ~QDesignerContainerExtension() {} + + virtual int count() const = 0; + virtual QWidget *widget(int index) const = 0; + + virtual int currentIndex() const = 0; + virtual void setCurrentIndex(int index) = 0; + + virtual void addWidget(QWidget *widget) = 0; + virtual void insertWidget(int index, QWidget *widget) = 0; + virtual void remove(int index) = 0; + + virtual bool canAddWidget() const + // ### Qt6 remove body, provided in Qt5 for source compatibility to Qt4. + { return true; } + virtual bool canRemove(int index) const + // ### Qt6 remove body, provided in Qt5 for source compatibility to Qt4. + { Q_UNUSED(index); return true; } +}; +Q_DECLARE_EXTENSION_INTERFACE(QDesignerContainerExtension, "com.trolltech.Qt.Designer.Container") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // CONTAINER_H diff --git a/src/designer/src/lib/uilib/container.qdoc b/src/designer/src/lib/uilib/container.qdoc new file mode 100644 index 000000000..8f7a07d30 --- /dev/null +++ b/src/designer/src/lib/uilib/container.qdoc @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \class QDesignerContainerExtension + \brief The QDesignerContainerExtension class allows you to add pages to + a custom multi-page container in Qt Designer's workspace. + \inmodule QtDesigner + + QDesignerContainerExtension provide an interface for creating + custom container extensions. A container extension consists of a + collection of functions that \QD needs to manage a multi-page + container plugin, and a list of the container's pages. + + \image containerextension-example.png + + \warning This is \e not an extension for container plugins in + general, only custom \e multi-page containers. + + To create a container extension, your extension class must inherit + from both QObject and QDesignerContainerExtension. For example: + + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 6 + + Since we are implementing an interface, we must ensure that it's + made known to the meta object system using the Q_INTERFACES() + macro. This enables \QD to use the qobject_cast() function to + query for supported interfaces using nothing but a QObject + pointer. + + You must reimplement several functions to enable \QD to manage a + custom multi-page container widget: \QD uses count() to keep track + of the number pages in your container, widget() to return the page + at a given index in the list of the container's pages, and + currentIndex() to return the list index of the selected page. \QD + uses the addWidget() function to add a given page to the + container, expecting it to be appended to the list of pages, while + it expects the insertWidget() function to add a given page to the + container by inserting it at a given index. + + In \QD the extensions are not created until they are + required. For that reason you must also create a + QExtensionFactory, i.e a class that is able to make an instance of + your extension, and register it using \QD's \l + {QExtensionManager}{extension manager}. + + When a container extension is required, \QD's \l + {QExtensionManager}{extension manager} will run through all its + registered factories calling QExtensionFactory::createExtension() + for each until the first one that is able to create a container + extension, is found. This factory will then create the extension + for the plugin. + + There are four available types of extensions in \QD: + QDesignerContainerExtension , QDesignerMemberSheetExtension, + QDesignerPropertySheetExtension and QDesignerTaskMenuExtension. + \QD's behavior is the same whether the requested extension is + associated with a multi page container, a member sheet, a property + sheet or a task menu. + + The QExtensionFactory class provides a standard extension factory, + and can also be used as an interface for custom extension + factories. You can either create a new QExtensionFactory and + reimplement the QExtensionFactory::createExtension() function. For + example: + + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 7 + + Or you can use an existing factory, expanding the + QExtensionFactory::createExtension() function to make the factory + able to create a container extension as well. For example: + + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 8 + + For a complete example using the QDesignerContainerExtension + class, see the \l {designer/containerextension}{Container + Extension example}. The example shows how to create a custom + multi-page plugin for \QD. + + \sa QExtensionFactory, QExtensionManager, {Creating Custom Widget + Extensions} +*/ + +/*! + \fn QDesignerContainerExtension::~QDesignerContainerExtension() + + Destroys the extension. +*/ + +/*! + \fn int QDesignerContainerExtension::count() const + + Returns the number of pages in the container. +*/ + +/*! + \fn QWidget *QDesignerContainerExtension::widget(int index) const + + Returns the page at the given \a index in the extension's list of + pages. + + \sa addWidget(), insertWidget() +*/ + +/*! + \fn int QDesignerContainerExtension::currentIndex() const + + Returns the index of the currently selected page in the + container. + + \sa setCurrentIndex() +*/ + +/*! + \fn void QDesignerContainerExtension::setCurrentIndex(int index) + + Sets the currently selected page in the container to be the + page at the given \a index in the extension's list of pages. + + \sa currentIndex() +*/ + +/*! + \fn void QDesignerContainerExtension::addWidget(QWidget *page) + + Adds the given \a page to the container by appending it to the + extension's list of pages. + + \sa insertWidget(), remove(), widget() +*/ + +/*! + \fn void QDesignerContainerExtension::insertWidget(int index, QWidget *page) + + Adds the given \a page to the container by inserting it at the + given \a index in the extension's list of pages. + + \sa addWidget(), remove(), widget() +*/ + +/*! + \fn void QDesignerContainerExtension::remove(int index) + + Removes the page at the given \a index from the extension's list + of pages. + + \sa addWidget(), insertWidget() +*/ + +/*! + \fn bool QDesignerContainerExtension::canAddWidget() const + + Returns whether a widget can be added. This determines whether + the context menu options to add or insert pages are enabled. + + This should return false for containers that have a single, fixed + page, for example QScrollArea or QDockWidget. + + \since 5.0 + \sa addWidget(), canRemove() +*/ + +/*! + \fn bool QDesignerContainerExtension::canRemove(int index) const + + Returns whether the widget at the given \a index can be removed. + This determines whether the context menu option to remove the current + page is enabled. + + This should return false for containers that have a single, fixed + page, for example QScrollArea or QDockWidget. + + \since 5.0 + \sa remove(), canAddWidget() +*/ diff --git a/src/designer/src/lib/uilib/customwidget.h b/src/designer/src/lib/uilib/customwidget.h new file mode 100644 index 000000000..43cc05504 --- /dev/null +++ b/src/designer/src/lib/uilib/customwidget.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CUSTOMWIDGET_H +#define CUSTOMWIDGET_H + +#include "extension.h" +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QWidget; +class QDesignerFormEditorInterface; + +class QDesignerCustomWidgetInterface +{ +public: + virtual ~QDesignerCustomWidgetInterface() {} + + virtual QString name() const = 0; + virtual QString group() const = 0; + virtual QString toolTip() const = 0; + virtual QString whatsThis() const = 0; + virtual QString includeFile() const = 0; + virtual QIcon icon() const = 0; + + virtual bool isContainer() const = 0; + + virtual QWidget *createWidget(QWidget *parent) = 0; + + virtual bool isInitialized() const { return false; } + virtual void initialize(QDesignerFormEditorInterface *core) { Q_UNUSED(core); } + + virtual QString domXml() const + { + return QString::fromUtf8("") + .arg(name()).arg(name().toLower()); + } + + virtual QString codeTemplate() const { return QString(); } +}; +Q_DECLARE_INTERFACE(QDesignerCustomWidgetInterface, "com.trolltech.Qt.Designer.CustomWidget") + + +class QDesignerCustomWidgetCollectionInterface +{ +public: + virtual ~QDesignerCustomWidgetCollectionInterface() {} + + virtual QList customWidgets() const = 0; +}; +Q_DECLARE_INTERFACE(QDesignerCustomWidgetCollectionInterface, + "com.trolltech.Qt.Designer.CustomWidgetCollection") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // CUSTOMWIDGET_H diff --git a/src/designer/src/lib/uilib/customwidget.qdoc b/src/designer/src/lib/uilib/customwidget.qdoc new file mode 100644 index 000000000..9c3bfdd9d --- /dev/null +++ b/src/designer/src/lib/uilib/customwidget.qdoc @@ -0,0 +1,295 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms +** and conditions contained in a signed written agreement between you +** and Nokia. +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \class QDesignerCustomWidgetInterface + + \brief The QDesignerCustomWidgetInterface class enables Qt Designer + to access and construct custom widgets. + + \inmodule QtDesigner + + QDesignerCustomWidgetInterface provides a custom widget with an + interface. The class contains a set of functions that must be subclassed + to return basic information about the widget, such as its class name and + the name of its header file. Other functions must be implemented to + initialize the plugin when it is loaded, and to construct instances of + the custom widget for \QD to use. + + When implementing a custom widget you must subclass + QDesignerCustomWidgetInterface to expose your widget to \QD. For + example, this is the declaration for the plugin used in the + \l{Custom Widget Plugin Example}{Custom Widget Plugin example} that + enables an analog clock custom widget to be used by \QD: + + \snippet examples/designer/customwidgetplugin/customwidgetplugin.h 0 + + Note that the only part of the class definition that is specific + to this particular custom widget is the class name. In addition, + since we are implementing an interface, we must ensure that it's + made known to the meta object system using the Q_INTERFACES() + macro. This enables \QD to use the qobject_cast() function to + query for supported interfaces using nothing but a QObject + pointer. + + After \QD loads a custom widget plugin, it calls the interface's + initialize() function to enable it to set up any resources that it + may need. This function is called with a QDesignerFormEditorInterface + parameter that provides the plugin with a gateway to all of \QD's API. + + \QD constructs instances of the custom widget by calling the plugin's + createWidget() function with a suitable parent widget. Plugins must + construct and return an instance of a custom widget with the specified + parent widget. + + In the implementation of the class you must remember to export + your custom widget plugin to \QD using the Q_EXPORT_PLUGIN2() + macro. For example, if a library called \c libcustomwidgetplugin.so + (on Unix) or \c libcustomwidget.dll (on Windows) contains a widget + class called \c MyCustomWidget, we can export it by adding the + following line to the file containing the plugin implementation: + + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 14 + + This macro ensures that \QD can access and construct the custom widget. + Without this macro, there is no way for \QD to use it. + + When implementing a custom widget plugin, you build it as a + separate library. If you want to include several custom widget + plugins in the same library, you must in addition subclass + QDesignerCustomWidgetCollectionInterface. + + \warning If your custom widget plugin contains QVariant + properties, be aware that only the following \l + {QVariant::Type}{types} are supported: + + \list + \o QVariant::ByteArray + \o QVariant::Bool + \o QVariant::Color + \o QVariant::Cursor + \o QVariant::Date + \o QVariant::DateTime + \o QVariant::Double + \o QVariant::Int + \o QVariant::Point + \o QVariant::Rect + \o QVariant::Size + \o QVariant::SizePolicy + \o QVariant::String + \o QVariant::Time + \o QVariant::UInt + \endlist + + For a complete example using the QDesignerCustomWidgetInterface + class, see the \l {designer/customwidgetplugin}{Custom Widget + Example}. The example shows how to create a custom widget plugin + for \QD. + + \sa QDesignerCustomWidgetCollectionInterface {Creating Custom + Widgets for Qt Designer} +*/ + +/*! + \fn QDesignerCustomWidgetInterface::~QDesignerCustomWidgetInterface() + + Destroys the custom widget interface. +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::name() const + + Returns the class name of the custom widget supplied by the interface. + + The name returned \e must be identical to the class name used for the + custom widget. +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::group() const + + Returns the name of the group to which the custom widget belongs. +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::toolTip() const + + Returns a short description of the widget that can be used by \QD + in a tool tip. +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::whatsThis() const + + Returns a description of the widget that can be used by \QD in + "What's This?" help for the widget. +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::includeFile() const + + Returns the path to the include file that \l uic uses when + creating code for the custom widget. +*/ + +/*! + \fn QIcon QDesignerCustomWidgetInterface::icon() const + + Returns the icon used to represent the custom widget in \QD's + widget box. +*/ + +/*! + \fn bool QDesignerCustomWidgetInterface::isContainer() const + + Returns true if the custom widget is intended to be used as a + container; otherwise returns false. + + Most custom widgets are not used to hold other widgets, so their + implementations of this function will return false, but custom + containers will return true to ensure that they behave correctly + in \QD. +*/ + +/*! + \fn QWidget *QDesignerCustomWidgetInterface::createWidget(QWidget *parent) + + Returns a new instance of the custom widget, with the given \a + parent. +*/ + +/*! + \fn bool QDesignerCustomWidgetInterface::isInitialized() const + + Returns true if the widget has been initialized; otherwise returns + false. + + \sa initialize() +*/ + +/*! + \fn void QDesignerCustomWidgetInterface::initialize(QDesignerFormEditorInterface *formEditor) + + Initializes the widget for use with the specified \a formEditor + interface. + + \sa isInitialized() +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::domXml() const + + Returns the XML that is used to describe the custom widget's + properties to \QD. +*/ + +/*! + \fn QString QDesignerCustomWidgetInterface::codeTemplate() const + + This function is reserved for future use by \QD. + + \omit + Returns the code template that \QD includes in forms that contain + the custom widget when they are saved. + \endomit +*/ + +/*! + \macro QDESIGNER_WIDGET_EXPORT + \relates QDesignerCustomWidgetInterface + \since 4.1 + + This macro is used when defining custom widgets to ensure that they are + correctly exported from plugins for use with \QD. + + On some platforms, the symbols required by \QD to create new widgets + are removed from plugins by the build system, making them unusable. + Using this macro ensures that the symbols are retained on those platforms, + and has no side effects on other platforms. + + For example, the \l{designer/worldtimeclockplugin}{World Time Clock Plugin} + example exports a custom widget class with the following declaration: + + \snippet examples/designer/worldtimeclockplugin/worldtimeclock.h 0 + \dots + \snippet examples/designer/worldtimeclockplugin/worldtimeclock.h 2 + + \sa {Creating Custom Widgets for Qt Designer} +*/ + + + + + +/*! + \class QDesignerCustomWidgetCollectionInterface + + \brief The QDesignerCustomWidgetCollectionInterface class allows + you to include several custom widgets in one single library. + + \inmodule QtDesigner + + When implementing a custom widget plugin, you build it as a + separate library. If you want to include several custom widget + plugins in the same library, you must in addition subclass + QDesignerCustomWidgetCollectionInterface. + + QDesignerCustomWidgetCollectionInterface contains one single + function returning a list of the collection's + QDesignerCustomWidgetInterface objects. For example, if you have + several custom widgets \c CustomWidgetOne, \c CustomWidgetTwo and + \c CustomWidgetThree, the class definition may look like this: + + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 12 + + In the class constructor you add the interfaces to your custom + widgets to the list which you return in the customWidgets() + function: + + \snippet doc/src/snippets/code/doc_src_qtdesigner.cpp 13 + + Note that instead of exporting each custom widget plugin using the + Q_EXPORT_PLUGIN2() macro, you export the entire collection. The + Q_EXPORT_PLUGIN2() macro ensures that \QD can access and construct + the custom widgets. Without this macro, there is no way for \QD to + use them. + + \sa QDesignerCustomWidgetInterface, {Creating Custom Widgets for + Qt Designer} +*/ + +/*! + \fn QDesignerCustomWidgetCollectionInterface::~QDesignerCustomWidgetCollectionInterface() { + + Destroys the custom widget collection interface. +*/ + +/*! + \fn QList QDesignerCustomWidgetCollectionInterface::customWidgets() const + + Returns a list of interfaces to the collection's custom widgets. +*/ diff --git a/src/designer/src/lib/uilib/extension.h b/src/designer/src/lib/uilib/extension.h new file mode 100644 index 000000000..9d6754e9e --- /dev/null +++ b/src/designer/src/lib/uilib/extension.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef EXTENSION_H +#define EXTENSION_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_TYPEID(IFace) QLatin1String(IFace##_iid) + +class QAbstractExtensionFactory +{ +public: + virtual ~QAbstractExtensionFactory() {} + + virtual QObject *extension(QObject *object, const QString &iid) const = 0; +}; +Q_DECLARE_INTERFACE(QAbstractExtensionFactory, "com.trolltech.Qt.QAbstractExtensionFactory") + +class QAbstractExtensionManager +{ +public: + virtual ~QAbstractExtensionManager() {} + + virtual void registerExtensions(QAbstractExtensionFactory *factory, const QString &iid) = 0; + virtual void unregisterExtensions(QAbstractExtensionFactory *factory, const QString &iid) = 0; + + virtual QObject *extension(QObject *object, const QString &iid) const = 0; +}; +Q_DECLARE_INTERFACE(QAbstractExtensionManager, "com.trolltech.Qt.QAbstractExtensionManager") + +#if defined(Q_CC_MSVC) && (_MSC_VER < 1300) + +template +inline T qt_extension_helper(QAbstractExtensionManager *, QObject *, T) +{ return 0; } + +template +inline T qt_extension(QAbstractExtensionManager* manager, QObject *object) +{ return qt_extension_helper(manager, object, T(0)); } + +#define Q_DECLARE_EXTENSION_INTERFACE(IFace, IId) \ +const char * const IFace##_iid = IId; \ +Q_DECLARE_INTERFACE(IFace, IId) \ +template <> inline IFace *qt_extension_helper(QAbstractExtensionManager *manager, QObject *object, IFace *) \ +{ QObject *extension = manager->extension(object, Q_TYPEID(IFace)); return (IFace *)(extension ? extension->qt_metacast(IFace##_iid) : 0); } + +#else + +template +inline T qt_extension(QAbstractExtensionManager* manager, QObject *object) +{ return 0; } + +#define Q_DECLARE_EXTENSION_INTERFACE(IFace, IId) \ +const char * const IFace##_iid = IId; \ +Q_DECLARE_INTERFACE(IFace, IId) \ +template <> inline IFace *qt_extension(QAbstractExtensionManager *manager, QObject *object) \ +{ QObject *extension = manager->extension(object, Q_TYPEID(IFace)); return extension ? static_cast(extension->qt_metacast(IFace##_iid)) : static_cast(0); } + +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // EXTENSION_H diff --git a/src/designer/src/lib/uilib/formbuilder.cpp b/src/designer/src/lib/uilib/formbuilder.cpp new file mode 100644 index 000000000..5e22ddb99 --- /dev/null +++ b/src/designer/src/lib/uilib/formbuilder.cpp @@ -0,0 +1,550 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "customwidget.h" +#include "formbuilder.h" +#include "formbuilderextra_p.h" +#include "ui4_p.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal { +#endif + +/*! + \class QFormBuilder + + \brief The QFormBuilder class is used to dynamically construct + user interfaces from UI files at run-time. + + \inmodule QtDesigner + + The QFormBuilder class provides a mechanism for dynamically + creating user interfaces at run-time, based on UI files + created with \QD. For example: + + \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp 0 + + By including the user interface in the example's resources (\c + myForm.qrc), we ensure that it will be present when the example is + run: + + \snippet doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp 1 + + QFormBuilder extends the QAbstractFormBuilder base class with a + number of functions that are used to support custom widget + plugins: + + \list + \o pluginPaths() returns the list of paths that the form builder + searches when loading custom widget plugins. + \o addPluginPath() allows additional paths to be registered with + the form builder. + \o setPluginPath() is used to replace the existing list of paths + with a list obtained from some other source. + \o clearPluginPaths() removes all paths registered with the form + builder. + \o customWidgets() returns a list of interfaces to plugins that + can be used to create new instances of registered custom widgets. + \endlist + + The QFormBuilder class is typically used by custom components and + applications that embed \QD. Standalone applications that need to + dynamically generate user interfaces at run-time use the + QUiLoader class, found in the QtUiTools module. + + \sa QAbstractFormBuilder, {QtUiTools Module} +*/ + +/*! + \fn QFormBuilder::QFormBuilder() + + Constructs a new form builder. +*/ + +QFormBuilder::QFormBuilder() +{ +} + +/*! + Destroys the form builder. +*/ +QFormBuilder::~QFormBuilder() +{ +} + +/*! + \internal +*/ +QWidget *QFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidget) +{ + if (!d->parentWidgetIsSet()) + d->setParentWidget(parentWidget); + // Is this a QLayoutWidget with a margin of 0: Not a known page-based + // container and no method for adding pages registered. + d->setProcessingLayoutWidget(false); + if (ui_widget->attributeClass() == QFormBuilderStrings::instance().qWidgetClass && !ui_widget->hasAttributeNative() + && parentWidget +#ifndef QT_NO_MAINWINDOW + && !qobject_cast(parentWidget) +#endif +#ifndef QT_NO_TOOLBOX + && !qobject_cast(parentWidget) +#endif +#ifndef QT_NO_STACKEDWIDGET + && !qobject_cast(parentWidget) +#endif +#ifndef QT_NO_STACKEDWIDGET + && !qobject_cast(parentWidget) +#endif +#ifndef QT_NO_SCROLLAREA + && !qobject_cast(parentWidget) +#endif +#ifndef QT_NO_MDIAREA + && !qobject_cast(parentWidget) +#endif +#ifndef QT_NO_DOCKWIDGET + && !qobject_cast(parentWidget) +#endif + ) { + const QString parentClassName = QLatin1String(parentWidget->metaObject()->className()); + if (!d->isCustomWidgetContainer(parentClassName)) + d->setProcessingLayoutWidget(true); + } + return QAbstractFormBuilder::create(ui_widget, parentWidget); +} + + +/*! + \internal +*/ +QWidget *QFormBuilder::createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name) +{ + if (widgetName.isEmpty()) { + //: Empty class name passed to widget factory method + qWarning() << QCoreApplication::translate("QFormBuilder", "An empty class name was passed on to %1 (object name: '%2').").arg(QString::fromUtf8(Q_FUNC_INFO), name); + return 0; + } + + QWidget *w = 0; + +#ifndef QT_NO_TABWIDGET + if (qobject_cast(parentWidget)) + parentWidget = 0; +#endif +#ifndef QT_NO_STACKEDWIDGET + if (qobject_cast(parentWidget)) + parentWidget = 0; +#endif +#ifndef QT_NO_TOOLBOX + if (qobject_cast(parentWidget)) + parentWidget = 0; +#endif + + // ### special-casing for Line (QFrame) -- fix for 4.2 + do { + if (widgetName == QFormBuilderStrings::instance().lineClass) { + w = new QFrame(parentWidget); + static_cast(w)->setFrameStyle(QFrame::HLine | QFrame::Sunken); + break; + } + const QByteArray widgetNameBA = widgetName.toUtf8(); + const char *widgetNameC = widgetNameBA.constData(); + if (w) { // symmetry for macro + } + +#define DECLARE_LAYOUT(L, C) +#define DECLARE_COMPAT_WIDGET(W, C) +#define DECLARE_WIDGET(W, C) else if (!qstrcmp(widgetNameC, #W)) { Q_ASSERT(w == 0); w = new W(parentWidget); } +#define DECLARE_WIDGET_1(W, C) else if (!qstrcmp(widgetNameC, #W)) { Q_ASSERT(w == 0); w = new W(0, parentWidget); } + +#include "widgets.table" + +#undef DECLARE_COMPAT_WIDGET +#undef DECLARE_LAYOUT +#undef DECLARE_WIDGET +#undef DECLARE_WIDGET_1 + + if (w) + break; + + // try with a registered custom widget + QDesignerCustomWidgetInterface *factory = d->m_customWidgets.value(widgetName); + if (factory != 0) + w = factory->createWidget(parentWidget); + } while(false); + + if (w == 0) { // Attempt to instantiate base class of promoted/custom widgets + const QString baseClassName = d->customWidgetBaseClass(widgetName); + if (!baseClassName.isEmpty()) { + qWarning() << QCoreApplication::translate("QFormBuilder", "QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'.").arg(widgetName, baseClassName); + return createWidget(baseClassName, parentWidget, name); + } + } + + if (w == 0) { // nothing to do + qWarning() << QCoreApplication::translate("QFormBuilder", "QFormBuilder was unable to create a widget of the class '%1'.").arg(widgetName); + return 0; + } + + w->setObjectName(name); + + if (qobject_cast(w)) + w->setParent(parentWidget); + + return w; +} + +/*! + \internal +*/ +QLayout *QFormBuilder::createLayout(const QString &layoutName, QObject *parent, const QString &name) +{ + QLayout *l = 0; + + QWidget *parentWidget = qobject_cast(parent); + QLayout *parentLayout = qobject_cast(parent); + + Q_ASSERT(parentWidget || parentLayout); + +#define DECLARE_WIDGET(W, C) +#define DECLARE_COMPAT_WIDGET(W, C) + +#define DECLARE_LAYOUT(L, C) \ + if (layoutName == QLatin1String(#L)) { \ + Q_ASSERT(l == 0); \ + l = parentLayout \ + ? new L() \ + : new L(parentWidget); \ + } + +#include "widgets.table" + +#undef DECLARE_LAYOUT +#undef DECLARE_COMPAT_WIDGET +#undef DECLARE_WIDGET + + if (l) { + l->setObjectName(name); + } else { + qWarning() << QCoreApplication::translate("QFormBuilder", "The layout type `%1' is not supported.").arg(layoutName); + } + + return l; +} + +/*! + \internal +*/ +bool QFormBuilder::addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout) +{ + return QAbstractFormBuilder::addItem(ui_item, item, layout); +} + +/*! + \internal +*/ +bool QFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget) +{ + return QAbstractFormBuilder::addItem(ui_widget, widget, parentWidget); +} + +/*! + \internal +*/ +QWidget *QFormBuilder::widgetByName(QWidget *topLevel, const QString &name) +{ + Q_ASSERT(topLevel); + if (topLevel->objectName() == name) + return topLevel; + + return topLevel->findChild(name); +} + +static QObject *objectByName(QWidget *topLevel, const QString &name) +{ + Q_ASSERT(topLevel); + if (topLevel->objectName() == name) + return topLevel; + + return topLevel->findChild(name); +} + +/*! + \internal +*/ +void QFormBuilder::createConnections(DomConnections *ui_connections, QWidget *widget) +{ + typedef QList DomConnectionList; + Q_ASSERT(widget != 0); + + if (ui_connections == 0) + return; + + const DomConnectionList connections = ui_connections->elementConnection(); + if (!connections.empty()) { + const DomConnectionList::const_iterator cend = connections.constEnd(); + for (DomConnectionList::const_iterator it = connections.constBegin(); it != cend; ++it) { + + QObject *sender = objectByName(widget, (*it)->elementSender()); + QObject *receiver = objectByName(widget, (*it)->elementReceiver()); + if (!sender || !receiver) + continue; + + QByteArray sig = (*it)->elementSignal().toUtf8(); + sig.prepend("2"); + QByteArray sl = (*it)->elementSlot().toUtf8(); + sl.prepend("1"); + QObject::connect(sender, sig, receiver, sl); + } + } +} + +/*! + \internal +*/ +QWidget *QFormBuilder::create(DomUI *ui, QWidget *parentWidget) +{ + return QAbstractFormBuilder::create(ui, parentWidget); +} + +/*! + \internal +*/ +QLayout *QFormBuilder::create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget) +{ + // Is this a temporary layout widget used to represent QLayout hierarchies in Designer? + // Set its margins to 0. + bool layoutWidget = d->processingLayoutWidget(); + QLayout *l = QAbstractFormBuilder::create(ui_layout, layout, parentWidget); + if (layoutWidget) { + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + int left, top, right, bottom; + left = top = right = bottom = 0; + const DomPropertyHash properties = propertyMap(ui_layout->elementProperty()); + + if (DomProperty *prop = properties.value(strings.leftMarginProperty)) + left = prop->elementNumber(); + + if (DomProperty *prop = properties.value(strings.topMarginProperty)) + top = prop->elementNumber(); + + if (DomProperty *prop = properties.value(strings.rightMarginProperty)) + right = prop->elementNumber(); + + if (DomProperty *prop = properties.value(strings.bottomMarginProperty)) + bottom = prop->elementNumber(); + + l->setContentsMargins(left, top, right, bottom); + d->setProcessingLayoutWidget(false); + } + return l; +} + +/*! + \internal +*/ +QLayoutItem *QFormBuilder::create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget) +{ + return QAbstractFormBuilder::create(ui_layoutItem, layout, parentWidget); +} + +/*! + \internal +*/ +QAction *QFormBuilder::create(DomAction *ui_action, QObject *parent) +{ + return QAbstractFormBuilder::create(ui_action, parent); +} + +/*! + \internal +*/ +QActionGroup *QFormBuilder::create(DomActionGroup *ui_action_group, QObject *parent) +{ + return QAbstractFormBuilder::create(ui_action_group, parent); +} + +/*! + Returns the list of paths the form builder searches for plugins. + + \sa addPluginPath() +*/ +QStringList QFormBuilder::pluginPaths() const +{ + return d->m_pluginPaths; +} + +/*! + Clears the list of paths that the form builder uses to search for + custom widget plugins. + + \sa pluginPaths() +*/ +void QFormBuilder::clearPluginPaths() +{ + d->m_pluginPaths.clear(); + updateCustomWidgets(); +} + +/*! + Adds a new plugin path specified by \a pluginPath to the list of + paths that will be searched by the form builder when loading a + custom widget plugin. + + \sa setPluginPath(), clearPluginPaths() +*/ +void QFormBuilder::addPluginPath(const QString &pluginPath) +{ + d->m_pluginPaths.append(pluginPath); + updateCustomWidgets(); +} + +/*! + Sets the list of plugin paths to the list specified by \a pluginPaths. + + \sa addPluginPath() +*/ +void QFormBuilder::setPluginPath(const QStringList &pluginPaths) +{ + d->m_pluginPaths = pluginPaths; + updateCustomWidgets(); +} + +static void insertPlugins(QObject *o, QMap *customWidgets) +{ + // step 1) try with a normal plugin + if (QDesignerCustomWidgetInterface *iface = qobject_cast(o)) { + customWidgets->insert(iface->name(), iface); + return; + } + // step 2) try with a collection of plugins + if (QDesignerCustomWidgetCollectionInterface *c = qobject_cast(o)) { + foreach (QDesignerCustomWidgetInterface *iface, c->customWidgets()) + customWidgets->insert(iface->name(), iface); + } +} + +/*! + \internal +*/ +void QFormBuilder::updateCustomWidgets() +{ + d->m_customWidgets.clear(); + + foreach (const QString &path, d->m_pluginPaths) { + const QDir dir(path); + const QStringList candidates = dir.entryList(QDir::Files); + + foreach (const QString &plugin, candidates) { + if (!QLibrary::isLibrary(plugin)) + continue; + + QString loaderPath = path; + loaderPath += QLatin1Char('/'); + loaderPath += plugin; + + QPluginLoader loader(loaderPath); + if (loader.load()) + insertPlugins(loader.instance(), &d->m_customWidgets); + } + } + // Check statically linked plugins + const QObjectList staticPlugins = QPluginLoader::staticInstances(); + if (!staticPlugins.empty()) + foreach (QObject *o, staticPlugins) + insertPlugins(o, &d->m_customWidgets); +} + +/*! + \fn QList QFormBuilder::customWidgets() const + + Returns a list of the available plugins. +*/ +QList QFormBuilder::customWidgets() const +{ + return d->m_customWidgets.values(); +} + +/*! + \internal +*/ + +void QFormBuilder::applyProperties(QObject *o, const QList &properties) +{ + typedef QList DomPropertyList; + + if (properties.empty()) + return; + + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + + const DomPropertyList::const_iterator cend = properties.constEnd(); + for (DomPropertyList::const_iterator it = properties.constBegin(); it != cend; ++it) { + const QVariant v = toVariant(o->metaObject(), *it); + if (v.isNull()) + continue; + + const QString attributeName = (*it)->attributeName(); + const bool isWidget = o->isWidgetType(); + if (isWidget && o->parent() == d->parentWidget() && attributeName == strings.geometryProperty) { + // apply only the size part of a geometry for the root widget + static_cast(o)->resize(qvariant_cast(v).size()); + } else if (d->applyPropertyInternally(o, attributeName, v)) { + } else if (isWidget && !qstrcmp("QFrame", o->metaObject()->className ()) && attributeName == strings.orientationProperty) { + // ### special-casing for Line (QFrame) -- try to fix me + o->setProperty("frameShape", v); // v is of QFrame::Shape enum + } else { + o->setProperty(attributeName.toUtf8(), v); + } + } +} + +#ifdef QFORMINTERNAL_NAMESPACE +} // namespace QFormInternal +#endif + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/formbuilder.h b/src/designer/src/lib/uilib/formbuilder.h new file mode 100644 index 000000000..b94db06eb --- /dev/null +++ b/src/designer/src/lib/uilib/formbuilder.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FORMBUILDER_H +#define FORMBUILDER_H + +#include "uilib_global.h" +#include "abstractformbuilder.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE +#if 0 +// pragma for syncqt, don't remove. + +#pragma qt_class(QFormBuilder) +#endif + +class QDesignerCustomWidgetInterface; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class QDESIGNER_UILIB_EXPORT QFormBuilder: public QAbstractFormBuilder +{ +public: + QFormBuilder(); + virtual ~QFormBuilder(); + + QStringList pluginPaths() const; + + void clearPluginPaths(); + void addPluginPath(const QString &pluginPath); + void setPluginPath(const QStringList &pluginPaths); + + QList customWidgets() const; + +protected: + virtual QWidget *create(DomUI *ui, QWidget *parentWidget); + virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget); + virtual QLayout *create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget); + virtual QLayoutItem *create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget); + virtual QAction *create(DomAction *ui_action, QObject *parent); + virtual QActionGroup *create(DomActionGroup *ui_action_group, QObject *parent); + + virtual QWidget *createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name); + virtual QLayout *createLayout(const QString &layoutName, QObject *parent, const QString &name); + + virtual void createConnections(DomConnections *connections, QWidget *widget); + + virtual bool addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout); + virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget); + + virtual void updateCustomWidgets(); + virtual void applyProperties(QObject *o, const QList &properties); + + static QWidget *widgetByName(QWidget *topLevel, const QString &name); + +private: +}; + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // FORMBUILDER_H diff --git a/src/designer/src/lib/uilib/formbuilderextra.cpp b/src/designer/src/lib/uilib/formbuilderextra.cpp new file mode 100644 index 000000000..3d34a20bf --- /dev/null +++ b/src/designer/src/lib/uilib/formbuilderextra.cpp @@ -0,0 +1,533 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "formbuilderextra_p.h" +#include "abstractformbuilder.h" +#include "resourcebuilder_p.h" +#include "textbuilder_p.h" +#include "ui4_p.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal { +#endif + +void uiLibWarning(const QString &message) { + qWarning("Designer: %s", qPrintable(message)); +} + + +QFormBuilderExtra::CustomWidgetData::CustomWidgetData() : + isContainer(false) +{ +} + +QFormBuilderExtra::CustomWidgetData::CustomWidgetData(const DomCustomWidget *dcw) : + addPageMethod(dcw->elementAddPageMethod()), + baseClass(dcw->elementExtends()), + isContainer(dcw->hasElementContainer() && dcw->elementContainer() != 0) +{ +#ifndef QT_FORMBUILDER_NO_SCRIPT + if (const DomScript *domScript = dcw->elementScript()) + script = domScript->text(); +#endif +} + +QFormBuilderExtra::QFormBuilderExtra() : + m_defaultMargin(INT_MIN), + m_defaultSpacing(INT_MIN), + m_language(QLatin1String("c++")), + m_layoutWidget(false), + m_resourceBuilder(0), + m_textBuilder(0) +{ +} + +QFormBuilderExtra::~QFormBuilderExtra() +{ + clearResourceBuilder(); + clearTextBuilder(); +} + +void QFormBuilderExtra::clear() +{ + m_buddies.clear(); + m_parentWidget = 0; + m_parentWidgetIsSet = false; +#ifndef QT_FORMBUILDER_NO_SCRIPT + m_FormScriptRunner.clearErrors(); +#endif + m_customWidgetDataHash.clear(); + m_buttonGroups.clear(); +} + + +bool QFormBuilderExtra::applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value) +{ + // Store buddies and apply them later on as the widgets might not exist yet. + QLabel *label = qobject_cast(o); + if (!label || propertyName != QFormBuilderStrings::instance().buddyProperty) + return false; + + m_buddies.insert(label, value.toString()); + return true; +} + +void QFormBuilderExtra::applyInternalProperties() const +{ + if (m_buddies.empty()) + return; + + const BuddyHash::const_iterator cend = m_buddies.constEnd(); + for (BuddyHash::const_iterator it = m_buddies.constBegin(); it != cend; ++it ) + applyBuddy(it.value(), BuddyApplyAll, it.key()); +} + +bool QFormBuilderExtra::applyBuddy(const QString &buddyName, BuddyMode applyMode, QLabel *label) +{ + if (buddyName.isEmpty()) { + label->setBuddy(0); + return false; + } + + const QWidgetList widgets = label->topLevelWidget()->findChildren(buddyName); + if (widgets.empty()) { + label->setBuddy(0); + return false; + } + + const QWidgetList::const_iterator cend = widgets.constEnd(); + for ( QWidgetList::const_iterator it = widgets.constBegin(); it != cend; ++it) { + if (applyMode == BuddyApplyAll || !(*it)->isHidden()) { + label->setBuddy(*it); + return true; + } + } + + label->setBuddy(0); + return false; +} + +const QPointer &QFormBuilderExtra::parentWidget() const +{ + return m_parentWidget; +} + +bool QFormBuilderExtra::parentWidgetIsSet() const +{ + return m_parentWidgetIsSet; +} + +void QFormBuilderExtra::setParentWidget(const QPointer &w) +{ + // Parent widget requires special handling of the geometry property. + m_parentWidget = w; + m_parentWidgetIsSet = true; +} + +#ifndef QT_FORMBUILDER_NO_SCRIPT +QFormScriptRunner &QFormBuilderExtra::formScriptRunner() +{ + return m_FormScriptRunner; +} + +QString QFormBuilderExtra::customWidgetScript(const QString &className) const +{ + const QHash::const_iterator it = m_customWidgetDataHash.constFind(className); + if (it != m_customWidgetDataHash.constEnd()) + return it.value().script; + return QString(); +} + +#endif + +void QFormBuilderExtra::storeCustomWidgetData(const QString &className, const DomCustomWidget *d) +{ + if (d) + m_customWidgetDataHash.insert(className, CustomWidgetData(d)); +} + +QString QFormBuilderExtra::customWidgetBaseClass(const QString &className) const +{ + const QHash::const_iterator it = m_customWidgetDataHash.constFind(className); + if (it != m_customWidgetDataHash.constEnd()) + return it.value().baseClass; + return QString(); +} + +QString QFormBuilderExtra::customWidgetAddPageMethod(const QString &className) const +{ + const QHash::const_iterator it = m_customWidgetDataHash.constFind(className); + if (it != m_customWidgetDataHash.constEnd()) + return it.value().addPageMethod; + return QString(); +} + +bool QFormBuilderExtra::isCustomWidgetContainer(const QString &className) const +{ + const QHash::const_iterator it = m_customWidgetDataHash.constFind(className); + if (it != m_customWidgetDataHash.constEnd()) + return it.value().isContainer; + return false; +} + +void QFormBuilderExtra::setProcessingLayoutWidget(bool processing) +{ + m_layoutWidget = processing; +} + + bool QFormBuilderExtra::processingLayoutWidget() const +{ + return m_layoutWidget; +} +void QFormBuilderExtra::setResourceBuilder(QResourceBuilder *builder) +{ + if (m_resourceBuilder == builder) + return; + clearResourceBuilder(); + m_resourceBuilder = builder; +} + +QResourceBuilder *QFormBuilderExtra::resourceBuilder() const +{ + return m_resourceBuilder; +} + +void QFormBuilderExtra::clearResourceBuilder() +{ + if (m_resourceBuilder) { + delete m_resourceBuilder; + m_resourceBuilder = 0; + } +} + +void QFormBuilderExtra::setTextBuilder(QTextBuilder *builder) +{ + if (m_textBuilder == builder) + return; + clearTextBuilder(); + m_textBuilder = builder; +} + +QTextBuilder *QFormBuilderExtra::textBuilder() const +{ + return m_textBuilder; +} + +void QFormBuilderExtra::clearTextBuilder() +{ + if (m_textBuilder) { + delete m_textBuilder; + m_textBuilder = 0; + } +} + +void QFormBuilderExtra::registerButtonGroups(const DomButtonGroups *domGroups) +{ + typedef QList DomButtonGroupList; + const DomButtonGroupList domGroupList = domGroups->elementButtonGroup(); + const DomButtonGroupList::const_iterator cend = domGroupList.constEnd(); + for (DomButtonGroupList::const_iterator it = domGroupList.constBegin(); it != cend; ++it) { + DomButtonGroup *domGroup = *it; + m_buttonGroups.insert(domGroup->attributeName(), ButtonGroupEntry(domGroup, 0)); + } +} + +// Utilities for parsing per-cell integer properties that have setters and +// getters of the form 'setX(int idx, int value)' and 'x(int index)' +// (converting them to comma-separated string lists and back). +// Used for layout stretch and grid per-row/column properties. + +// Format a list of cell-properties of one dimension as a ','-separated list +template +inline QString perCellPropertyToString(const Layout *l, int count, int (Layout::*getter)(int) const) +{ + if (count == 0) + return QString(); + QString rc; + { + QTextStream str(&rc); + for (int i = 0; i < count; i++) { + if (i) + str << QLatin1Char(','); + str << (l->*getter)(i); + } + } + return rc; +} + +// Clear the property, set all cells to 0 + +template +inline void clearPerCellValue(Layout *l, int count, void (Layout::*setter)(int,int), int value = 0) +{ + for (int i = 0; i < count; i++) + (l->*setter)(i, value); +} + +// Parse and set the property from a comma-separated list + +template +inline bool parsePerCellProperty(Layout *l, int count, void (Layout::*setter)(int,int), const QString &s, int defaultValue = 0) +{ + if (s.isEmpty()) { + clearPerCellValue(l, count, setter, defaultValue); + return true; + } + const QStringList list = s.split(QLatin1Char(',')); + if (list.empty()) { + clearPerCellValue(l, count, setter, defaultValue); + return true; + } + // Apply all values contained in list + const int ac = qMin(count, list.size()); + bool ok; + int i = 0; + for ( ; i < ac; i++) { + const int value = list.at(i).toInt(&ok); + if (!ok || value < 0) + return false; + (l->*setter)(i, value); + } + // Clear rest + for ( ; i < count; i++) + (l->*setter)(i, defaultValue); + return true; +} + +// Read and write stretch +static QString msgInvalidStretch(const QString &objectName, const QString &stretch) +{ + //: Parsing layout stretch values + return QCoreApplication::translate("FormBuilder", "Invalid stretch value for '%1': '%2'").arg(objectName, stretch); +} + +QString QFormBuilderExtra::boxLayoutStretch(const QBoxLayout *box) +{ + return perCellPropertyToString(box, box->count(), &QBoxLayout::stretch); +} + +bool QFormBuilderExtra::setBoxLayoutStretch(const QString &s, QBoxLayout *box) +{ + const bool rc = parsePerCellProperty(box, box->count(), &QBoxLayout::setStretch, s); + if (!rc) + uiLibWarning(msgInvalidStretch(box->objectName(), s)); + return rc; +} + +void QFormBuilderExtra::clearBoxLayoutStretch(QBoxLayout *box) +{ + clearPerCellValue(box, box->count(), &QBoxLayout::setStretch); +} + +QString QFormBuilderExtra::gridLayoutRowStretch(const QGridLayout *grid) +{ + return perCellPropertyToString(grid, grid->rowCount(), &QGridLayout::rowStretch); +} + +bool QFormBuilderExtra::setGridLayoutRowStretch(const QString &s, QGridLayout *grid) +{ + const bool rc = parsePerCellProperty(grid, grid->rowCount(), &QGridLayout::setRowStretch, s); + if (!rc) + uiLibWarning(msgInvalidStretch(grid->objectName(), s)); + return rc; +} + +void QFormBuilderExtra::clearGridLayoutRowStretch(QGridLayout *grid) +{ + clearPerCellValue(grid, grid->rowCount(), &QGridLayout::setRowStretch); +} + +QString QFormBuilderExtra::gridLayoutColumnStretch(const QGridLayout *grid) +{ + return perCellPropertyToString(grid, grid->columnCount(), &QGridLayout::columnStretch); +} + +bool QFormBuilderExtra::setGridLayoutColumnStretch(const QString &s, QGridLayout *grid) +{ + const bool rc = parsePerCellProperty(grid, grid->columnCount(), &QGridLayout::setColumnStretch, s); + if (!rc) + uiLibWarning(msgInvalidStretch(grid->objectName(), s)); + return rc; +} + +void QFormBuilderExtra::clearGridLayoutColumnStretch(QGridLayout *grid) +{ + clearPerCellValue(grid, grid->columnCount(), &QGridLayout::setColumnStretch); +} + +// Read and write grid layout row/column size limits + +static QString msgInvalidMinimumSize(const QString &objectName, const QString &ms) +{ + //: Parsing grid layout minimum size values + return QCoreApplication::translate("FormBuilder", "Invalid minimum size for '%1': '%2'").arg(objectName, ms); +} + +QString QFormBuilderExtra::gridLayoutRowMinimumHeight(const QGridLayout *grid) +{ + return perCellPropertyToString(grid, grid->rowCount(), &QGridLayout::rowMinimumHeight); +} + +bool QFormBuilderExtra::setGridLayoutRowMinimumHeight(const QString &s, QGridLayout *grid) +{ + const bool rc = parsePerCellProperty(grid, grid->rowCount(), &QGridLayout::setRowMinimumHeight, s); + if (!rc) + uiLibWarning(msgInvalidMinimumSize(grid->objectName(), s)); + return rc; +} + +void QFormBuilderExtra::clearGridLayoutRowMinimumHeight(QGridLayout *grid) +{ + clearPerCellValue(grid, grid->rowCount(), &QGridLayout::setRowMinimumHeight); +} + +QString QFormBuilderExtra::gridLayoutColumnMinimumWidth(const QGridLayout *grid) +{ + return perCellPropertyToString(grid, grid->columnCount(), &QGridLayout::columnMinimumWidth); +} + +bool QFormBuilderExtra::setGridLayoutColumnMinimumWidth(const QString &s, QGridLayout *grid) +{ + const bool rc = parsePerCellProperty(grid, grid->columnCount(), &QGridLayout::setColumnMinimumWidth, s); + if (!rc) + uiLibWarning(msgInvalidMinimumSize(grid->objectName(), s)); + return rc; +} + +void QFormBuilderExtra::clearGridLayoutColumnMinimumWidth(QGridLayout *grid) +{ + clearPerCellValue(grid, grid->columnCount(), &QGridLayout::setColumnMinimumWidth); +} + +// ------------ QFormBuilderStrings + +QFormBuilderStrings::QFormBuilderStrings() : + buddyProperty(QLatin1String("buddy")), + cursorProperty(QLatin1String("cursor")), + objectNameProperty(QLatin1String("objectName")), + trueValue(QLatin1String("true")), + falseValue(QLatin1String("false")), + horizontalPostFix(QLatin1String("Horizontal")), + separator(QLatin1String("separator")), + defaultTitle(QLatin1String("Page")), + titleAttribute(QLatin1String("title")), + labelAttribute(QLatin1String("label")), + toolTipAttribute(QLatin1String("toolTip")), + whatsThisAttribute(QLatin1String("whatsThis")), + flagsAttribute(QLatin1String("flags")), + iconAttribute(QLatin1String("icon")), + pixmapAttribute(QLatin1String("pixmap")), + textAttribute(QLatin1String("text")), + currentIndexProperty(QLatin1String("currentIndex")), + toolBarAreaAttribute(QLatin1String("toolBarArea")), + toolBarBreakAttribute(QLatin1String("toolBarBreak")), + dockWidgetAreaAttribute(QLatin1String("dockWidgetArea")), + marginProperty(QLatin1String("margin")), + spacingProperty(QLatin1String("spacing")), + leftMarginProperty(QLatin1String("leftMargin")), + topMarginProperty(QLatin1String("topMargin")), + rightMarginProperty(QLatin1String("rightMargin")), + bottomMarginProperty(QLatin1String("bottomMargin")), + horizontalSpacingProperty(QLatin1String("horizontalSpacing")), + verticalSpacingProperty(QLatin1String("verticalSpacing")), + sizeHintProperty(QLatin1String("sizeHint")), + sizeTypeProperty(QLatin1String("sizeType")), + orientationProperty(QLatin1String("orientation")), + styleSheetProperty(QLatin1String("styleSheet")), + qtHorizontal(QLatin1String("Qt::Horizontal")), + qtVertical(QLatin1String("Qt::Vertical")), + currentRowProperty(QLatin1String("currentRow")), + tabSpacingProperty(QLatin1String("tabSpacing")), + qWidgetClass(QLatin1String("QWidget")), + lineClass(QLatin1String("Line")), + geometryProperty(QLatin1String("geometry")), + scriptWidgetVariable(QLatin1String("widget")), + scriptChildWidgetsVariable(QLatin1String("childWidgets")) +{ + itemRoles.append(qMakePair(Qt::FontRole, QString::fromLatin1("font"))); + itemRoles.append(qMakePair(Qt::TextAlignmentRole, QString::fromLatin1("textAlignment"))); + itemRoles.append(qMakePair(Qt::BackgroundRole, QString::fromLatin1("background"))); + itemRoles.append(qMakePair(Qt::ForegroundRole, QString::fromLatin1("foreground"))); + itemRoles.append(qMakePair(Qt::CheckStateRole, QString::fromLatin1("checkState"))); + + foreach (const RoleNName &it, itemRoles) + treeItemRoleHash.insert(it.second, it.first); + + itemTextRoles.append(qMakePair(qMakePair(Qt::EditRole, Qt::DisplayPropertyRole), + textAttribute)); // This must be first for the loop below + itemTextRoles.append(qMakePair(qMakePair(Qt::ToolTipRole, Qt::ToolTipPropertyRole), + toolTipAttribute)); + itemTextRoles.append(qMakePair(qMakePair(Qt::StatusTipRole, Qt::StatusTipPropertyRole), + QString::fromLatin1("statusTip"))); + itemTextRoles.append(qMakePair(qMakePair(Qt::WhatsThisRole, Qt::WhatsThisPropertyRole), + whatsThisAttribute)); + + // Note: this skips the first item! + QList::const_iterator it = itemTextRoles.constBegin(), end = itemTextRoles.constEnd(); + while (++it != end) + treeItemTextRoleHash.insert(it->second, it->first); +} + +const QFormBuilderStrings &QFormBuilderStrings::instance() +{ + static const QFormBuilderStrings rc; + return rc; +} + +#ifdef QFORMINTERNAL_NAMESPACE +} // namespace QFormInternal +#endif + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/formbuilderextra_p.h b/src/designer/src/lib/uilib/formbuilderextra_p.h new file mode 100644 index 000000000..20516a548 --- /dev/null +++ b/src/designer/src/lib/uilib/formbuilderextra_p.h @@ -0,0 +1,276 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef ABSTRACTFORMBUILDERPRIVATE_H +#define ABSTRACTFORMBUILDERPRIVATE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "uilib_global.h" + +#ifndef QT_FORMBUILDER_NO_SCRIPT +# include "formscriptrunner_p.h" +#endif + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QDesignerCustomWidgetInterface; +class QObject; +class QVariant; +class QWidget; +class QObject; +class QLabel; +class QButtonGroup; +class QBoxLayout; +class QGridLayout; +class QAction; +class QActionGroup; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class DomButtonGroups; +class DomButtonGroup; +class DomCustomWidget; + +class QAbstractFormBuilder; +class QResourceBuilder; +class QTextBuilder; + +class QDESIGNER_UILIB_EXPORT QFormBuilderExtra +{ +public: + QFormBuilderExtra(); + ~QFormBuilderExtra(); + + struct CustomWidgetData { + CustomWidgetData(); + explicit CustomWidgetData(const DomCustomWidget *dc); + + QString addPageMethod; + QString script; + QString baseClass; + bool isContainer; + }; + + void clear(); + + bool applyPropertyInternally(QObject *o, const QString &propertyName, const QVariant &value); + + enum BuddyMode { BuddyApplyAll, BuddyApplyVisibleOnly }; + + void applyInternalProperties() const; + static bool applyBuddy(const QString &buddyName, BuddyMode applyMode, QLabel *label); + + const QPointer &parentWidget() const; + bool parentWidgetIsSet() const; + void setParentWidget(const QPointer &w); + +#ifndef QT_FORMBUILDER_NO_SCRIPT + QFormScriptRunner &formScriptRunner(); + QString customWidgetScript(const QString &className) const; +#endif + + void setProcessingLayoutWidget(bool processing); + bool processingLayoutWidget() const; + + void setResourceBuilder(QResourceBuilder *builder); + QResourceBuilder *resourceBuilder() const; + + void setTextBuilder(QTextBuilder *builder); + QTextBuilder *textBuilder() const; + + void storeCustomWidgetData(const QString &className, const DomCustomWidget *d); + QString customWidgetAddPageMethod(const QString &className) const; + QString customWidgetBaseClass(const QString &className) const; + bool isCustomWidgetContainer(const QString &className) const; + + // --- Hash used in creating button groups on demand. Store a map of name and pair of dom group and real group + void registerButtonGroups(const DomButtonGroups *groups); + + typedef QPair ButtonGroupEntry; + typedef QHash ButtonGroupHash; + const ButtonGroupHash &buttonGroups() const { return m_buttonGroups; } + ButtonGroupHash &buttonGroups() { return m_buttonGroups; } + + // return stretch as a comma-separated list + static QString boxLayoutStretch(const QBoxLayout*); + // apply stretch + static bool setBoxLayoutStretch(const QString &, QBoxLayout*); + static void clearBoxLayoutStretch(QBoxLayout*); + + static QString gridLayoutRowStretch(const QGridLayout *); + static bool setGridLayoutRowStretch(const QString &, QGridLayout *); + static void clearGridLayoutRowStretch(QGridLayout *); + + static QString gridLayoutColumnStretch(const QGridLayout *); + static bool setGridLayoutColumnStretch(const QString &, QGridLayout *); + static void clearGridLayoutColumnStretch(QGridLayout *); + + // return the row/column sizes as comma-separated lists + static QString gridLayoutRowMinimumHeight(const QGridLayout *); + static bool setGridLayoutRowMinimumHeight(const QString &, QGridLayout *); + static void clearGridLayoutRowMinimumHeight(QGridLayout *); + + static QString gridLayoutColumnMinimumWidth(const QGridLayout *); + static bool setGridLayoutColumnMinimumWidth(const QString &, QGridLayout *); + static void clearGridLayoutColumnMinimumWidth(QGridLayout *); + + QStringList m_pluginPaths; + QMap m_customWidgets; + + QHash m_laidout; + QHash m_actions; + QHash m_actionGroups; + int m_defaultMargin; + int m_defaultSpacing; + QDir m_workingDirectory; + QString m_errorString; + QString m_language; + +private: + void clearResourceBuilder(); + void clearTextBuilder(); + + typedef QHash BuddyHash; + BuddyHash m_buddies; + +#ifndef QT_FORMBUILDER_NO_SCRIPT + QFormScriptRunner m_FormScriptRunner; +#endif + + QHash m_customWidgetDataHash; + + ButtonGroupHash m_buttonGroups; + + bool m_layoutWidget; + QResourceBuilder *m_resourceBuilder; + QTextBuilder *m_textBuilder; + + QPointer m_parentWidget; + bool m_parentWidgetIsSet; +}; + +void uiLibWarning(const QString &message); + +// Struct with static accessor that provides most strings used in the form builder. +struct QDESIGNER_UILIB_EXPORT QFormBuilderStrings { + QFormBuilderStrings(); + + static const QFormBuilderStrings &instance(); + + const QString buddyProperty; + const QString cursorProperty; + const QString objectNameProperty; + const QString trueValue; + const QString falseValue; + const QString horizontalPostFix; + const QString separator; + const QString defaultTitle; + const QString titleAttribute; + const QString labelAttribute; + const QString toolTipAttribute; + const QString whatsThisAttribute; + const QString flagsAttribute; + const QString iconAttribute; + const QString pixmapAttribute; + const QString textAttribute; + const QString currentIndexProperty; + const QString toolBarAreaAttribute; + const QString toolBarBreakAttribute; + const QString dockWidgetAreaAttribute; + const QString marginProperty; + const QString spacingProperty; + const QString leftMarginProperty; + const QString topMarginProperty; + const QString rightMarginProperty; + const QString bottomMarginProperty; + const QString horizontalSpacingProperty; + const QString verticalSpacingProperty; + const QString sizeHintProperty; + const QString sizeTypeProperty; + const QString orientationProperty; + const QString styleSheetProperty; + const QString qtHorizontal; + const QString qtVertical; + const QString currentRowProperty; + const QString tabSpacingProperty; + const QString qWidgetClass; + const QString lineClass; + const QString geometryProperty; + const QString scriptWidgetVariable; + const QString scriptChildWidgetsVariable; + + typedef QPair RoleNName; + QList itemRoles; + QHash treeItemRoleHash; + + // first.first is primary role, first.second is shadow role. + // Shadow is used for either the translation source or the designer + // representation of the string value. + typedef QPair, QString> TextRoleNName; + QList itemTextRoles; + QHash > treeItemTextRoleHash; +}; +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +#endif // ABSTRACTFORMBUILDERPRIVATE_H diff --git a/src/designer/src/lib/uilib/formscriptrunner.cpp b/src/designer/src/lib/uilib/formscriptrunner.cpp new file mode 100644 index 000000000..8efb12f9e --- /dev/null +++ b/src/designer/src/lib/uilib/formscriptrunner.cpp @@ -0,0 +1,208 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "formscriptrunner_p.h" +#include "formbuilderextra_p.h" +#include "ui4_p.h" + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace { + enum { debugFormScriptRunner = 0 }; +} + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal { +#endif + +class QFormScriptRunner::QFormScriptRunnerPrivate { +public: + QFormScriptRunnerPrivate() : m_options(DisableScripts) {} + void clearErrors() { m_errors.clear(); } + + bool run(const QString &script, QWidget *widget, const WidgetList &children, QString *errorMessage); + + static void initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine); + static QString engineError(QScriptEngine &scriptEngine); + + Options options() const { return m_options; } + void setOptions(Options options) { m_options = options; } + + Errors errors() const { return m_errors; } +private: + QScriptEngine m_scriptEngine; + Options m_options; + Errors m_errors; +}; + +bool QFormScriptRunner::QFormScriptRunnerPrivate::run(const QString &script, QWidget *widget, const WidgetList &children, QString *errorMessage) { + bool rc = false; + initializeEngine(widget, children, m_scriptEngine); + + do { + m_scriptEngine.evaluate(script); + if (m_scriptEngine.hasUncaughtException ()) { + *errorMessage = QCoreApplication::tr("Exception at line %1: %2").arg(m_scriptEngine.uncaughtExceptionLineNumber()).arg(engineError(m_scriptEngine)); + break; + } + rc = true; + } while (false); + m_scriptEngine.popContext(); + + if (!rc) { + Error error; + error.objectName = widget->objectName(); + error.script = script; + error.errorMessage = *errorMessage; + m_errors.push_back(error); + } + return rc; +} + +void QFormScriptRunner::QFormScriptRunnerPrivate::initializeEngine(QWidget *w, const WidgetList &children, QScriptEngine &scriptEngine) { + // Populate the script variables. This pushes a context which must be popped. + QScriptContext *ctx = scriptEngine.pushContext(); + QScriptValue widgetObject = scriptEngine.newQObject(w); + QScriptValue childrenArray = scriptEngine.newArray (children.size()); + + for(int i = 0; i < children.size(); i++) { + childrenArray.setProperty(i, scriptEngine.newQObject(children[i])); + } + + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + ctx ->activationObject().setProperty(strings.scriptWidgetVariable, widgetObject); + ctx ->activationObject().setProperty(strings.scriptChildWidgetsVariable, childrenArray); +} + +QString QFormScriptRunner::QFormScriptRunnerPrivate::engineError(QScriptEngine &scriptEngine) { + QScriptValue error = scriptEngine.evaluate(QLatin1String("Error")); + if (error.isValid()) + return error.toString(); + return QCoreApplication::tr("Unknown error"); +} +// -- QFormScriptRunner + +QFormScriptRunner::QFormScriptRunner() : m_impl(new QFormScriptRunnerPrivate) +{ +} + +QFormScriptRunner::~QFormScriptRunner() +{ + delete m_impl; +} + +bool QFormScriptRunner::run(const DomWidget *domWidget, + const QString &customWidgetScript, + QWidget *widget, const WidgetList &children, + QString *errorMessage) +{ + typedef QList DomScripts; + + const Options scriptOptions = m_impl->options(); + if (scriptOptions & DisableScripts) + return true; + // get list + const DomScripts domScripts = domWidget->elementScript(); + // Concatenate snippets, starting with custom widget script + QString script = customWidgetScript; + if (script.isEmpty() && domScripts.empty()) + return true; + + foreach (const DomScript *scriptSnippet, domScripts) { + // Ensure new line + if (!script.isEmpty() && !script.endsWith(QLatin1Char('\n'))) + script += QLatin1Char('\n'); + script += scriptSnippet->text(); + } + + if (script.isEmpty()) + return true; + + const bool rc = m_impl->run(script, widget, children, errorMessage); + + if (debugFormScriptRunner) { + qDebug() << "For " << widget << " with " << children.size() << " children, ran: " << script; + if (!rc) + qDebug() << *errorMessage; + } + + if (!rc) { + if (!(scriptOptions & DisableWarnings)) { + const QString message = QCoreApplication::tr("An error occurred while running the script for %1: %2\nScript: %3"). + arg(widget->objectName()).arg(*errorMessage).arg(script); + qWarning() << message; + } + } + return rc; +} + +QFormScriptRunner::Options QFormScriptRunner::options() const +{ + return m_impl->options(); +} + +void QFormScriptRunner::setOptions(Options options) +{ + m_impl->setOptions(options); +} + + +QFormScriptRunner::Errors QFormScriptRunner::errors() const +{ + return m_impl->errors(); +} + +void QFormScriptRunner::clearErrors() +{ + m_impl->clearErrors(); +} + + +#ifdef QFORMINTERNAL_NAMESPACE +} // namespace QFormInternal +#endif + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/formscriptrunner_p.h b/src/designer/src/lib/uilib/formscriptrunner_p.h new file mode 100644 index 000000000..f0a6a368c --- /dev/null +++ b/src/designer/src/lib/uilib/formscriptrunner_p.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FORMSCRIPTRUNNER_H +#define FORMSCRIPTRUNNER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "uilib_global.h" +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QWidget; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class DomWidget; + +class QDESIGNER_UILIB_EXPORT QFormScriptRunner +{ +public: + QFormScriptRunner(); + ~QFormScriptRunner(); + + typedef QList WidgetList; + + bool run(const DomWidget *domWidget, + const QString &customWidgetScript, + QWidget *widget, const WidgetList &children, + QString *errorMessage); + + struct Error { + QString objectName; + QString script; + QString errorMessage; + }; + typedef QList Errors; + Errors errors() const; + void clearErrors(); + + enum Option { + NoOptions = 0x0, + DisableWarnings = 0x1, + DisableScripts = 02 + }; + Q_DECLARE_FLAGS(Options, Option) + + Options options() const; + void setOptions(Options options); + +private: + class QFormScriptRunnerPrivate; + QFormScriptRunnerPrivate *m_impl; + + QFormScriptRunner(const QFormScriptRunner &); + void operator = (const QFormScriptRunner &); +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QFormScriptRunner::Options) + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +#endif // FORMSCRIPTRUNNER_H diff --git a/src/designer/src/lib/uilib/properties.cpp b/src/designer/src/lib/uilib/properties.cpp new file mode 100644 index 000000000..88cd455d6 --- /dev/null +++ b/src/designer/src/lib/uilib/properties.cpp @@ -0,0 +1,681 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "properties_p.h" +#include "ui4_p.h" +#include "abstractformbuilder.h" +#include "formbuilderextra_p.h" +#include "resourcebuilder_p.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +static inline void fixEnum(QString &s) +{ + int qualifierIndex = s.lastIndexOf(QLatin1Char(':')); + if (qualifierIndex == -1) + qualifierIndex = s.lastIndexOf(QLatin1Char('.')); + if (qualifierIndex != -1) + s.remove(0, qualifierIndex + 1); +} +// Convert complex DOM types with the help of QAbstractFormBuilder +QVariant domPropertyToVariant(QAbstractFormBuilder *afb,const QMetaObject *meta,const DomProperty *p) +{ + // Complex types that need functions from QAbstractFormBuilder + switch(p->kind()) { + case DomProperty::String: { + const int index = meta->indexOfProperty(p->attributeName().toUtf8()); + if (index != -1 && meta->property(index).type() == QVariant::KeySequence) + return QVariant::fromValue(QKeySequence(p->elementString()->text())); + } + break; + + case DomProperty::Palette: { + const DomPalette *dom = p->elementPalette(); + QPalette palette; + + if (dom->elementActive()) + afb->setupColorGroup(palette, QPalette::Active, dom->elementActive()); + + if (dom->elementInactive()) + afb->setupColorGroup(palette, QPalette::Inactive, dom->elementInactive()); + + if (dom->elementDisabled()) + afb->setupColorGroup(palette, QPalette::Disabled, dom->elementDisabled()); + + palette.setCurrentColorGroup(QPalette::Active); + return QVariant::fromValue(palette); + } + + case DomProperty::Set: { + const QByteArray pname = p->attributeName().toUtf8(); + const int index = meta->indexOfProperty(pname); + if (index == -1) { + uiLibWarning(QCoreApplication::translate("QFormBuilder", "The set-type property %1 could not be read.").arg(p->attributeName())); + return QVariant(); + } + + const QMetaEnum e = meta->property(index).enumerator(); + Q_ASSERT(e.isFlag() == true); + return QVariant(e.keysToValue(p->elementSet().toUtf8())); + } + + case DomProperty::Enum: { + const QByteArray pname = p->attributeName().toUtf8(); + const int index = meta->indexOfProperty(pname); + QString enumValue = p->elementEnum(); + // Triggers in case of objects in Designer like Spacer/Line for which properties + // are serialized using language introspection. On preview, however, these objects are + // emulated by hacks in the formbuilder (size policy/orientation) + fixEnum(enumValue); + if (index == -1) { + // ### special-casing for Line (QFrame) -- fix for 4.2. Jambi hack for enumerations + if (!qstrcmp(meta->className(), "QFrame") + && (pname == QByteArray("orientation"))) { + return QVariant(enumValue == QFormBuilderStrings::instance().horizontalPostFix ? QFrame::HLine : QFrame::VLine); + } else { + uiLibWarning(QCoreApplication::translate("QFormBuilder", "The enumeration-type property %1 could not be read.").arg(p->attributeName())); + return QVariant(); + } + } + + const QMetaEnum e = meta->property(index).enumerator(); + return QVariant(e.keyToValue(enumValue.toUtf8())); + } + case DomProperty::Brush: + return QVariant::fromValue(afb->setupBrush(p->elementBrush())); + default: + if (afb->resourceBuilder()->isResourceProperty(p)) { + return afb->resourceBuilder()->loadResource(afb->workingDirectory(), p); + } + + break; + } + + // simple type + return domPropertyToVariant(p); +} + +// Convert simple DOM types +QVariant domPropertyToVariant(const DomProperty *p) +{ + // requires non-const virtual nameToIcon, etc. + switch(p->kind()) { + case DomProperty::Bool: + return QVariant(p->elementBool() == QFormBuilderStrings::instance().trueValue); + + case DomProperty::Cstring: + return QVariant(p->elementCstring().toUtf8()); + + case DomProperty::Point: { + const DomPoint *point = p->elementPoint(); + return QVariant(QPoint(point->elementX(), point->elementY())); + } + + case DomProperty::PointF: { + const DomPointF *pointf = p->elementPointF(); + return QVariant(QPointF(pointf->elementX(), pointf->elementY())); + } + + case DomProperty::Size: { + const DomSize *size = p->elementSize(); + return QVariant(QSize(size->elementWidth(), size->elementHeight())); + } + + case DomProperty::SizeF: { + const DomSizeF *sizef = p->elementSizeF(); + return QVariant(QSizeF(sizef->elementWidth(), sizef->elementHeight())); + } + + case DomProperty::Rect: { + const DomRect *rc = p->elementRect(); + const QRect g(rc->elementX(), rc->elementY(), rc->elementWidth(), rc->elementHeight()); + return QVariant(g); + } + + case DomProperty::RectF: { + const DomRectF *rcf = p->elementRectF(); + const QRectF g(rcf->elementX(), rcf->elementY(), rcf->elementWidth(), rcf->elementHeight()); + return QVariant(g); + } + + case DomProperty::String: + return QVariant(p->elementString()->text()); + + case DomProperty::Number: + return QVariant(p->elementNumber()); + + case DomProperty::UInt: + return QVariant(p->elementUInt()); + + case DomProperty::LongLong: + return QVariant(p->elementLongLong()); + + case DomProperty::ULongLong: + return QVariant(p->elementULongLong()); + + case DomProperty::Double: + return QVariant(p->elementDouble()); + + case DomProperty::Char: { + const DomChar *character = p->elementChar(); + const QChar c(character->elementUnicode()); + return QVariant::fromValue(c); + } + + case DomProperty::Color: { + const DomColor *color = p->elementColor(); + QColor c(color->elementRed(), color->elementGreen(), color->elementBlue()); + if (color->hasAttributeAlpha()) + c.setAlpha(color->attributeAlpha()); + return QVariant::fromValue(c); + } + + case DomProperty::Font: { + const DomFont *font = p->elementFont(); + + QFont f; + if (font->hasElementFamily() && !font->elementFamily().isEmpty()) + f.setFamily(font->elementFamily()); + if (font->hasElementPointSize() && font->elementPointSize() > 0) + f.setPointSize(font->elementPointSize()); + if (font->hasElementWeight() && font->elementWeight() > 0) + f.setWeight(font->elementWeight()); + if (font->hasElementItalic()) + f.setItalic(font->elementItalic()); + if (font->hasElementBold()) + f.setBold(font->elementBold()); + if (font->hasElementUnderline()) + f.setUnderline(font->elementUnderline()); + if (font->hasElementStrikeOut()) + f.setStrikeOut(font->elementStrikeOut()); + if (font->hasElementKerning()) + f.setKerning(font->elementKerning()); + if (font->hasElementAntialiasing()) + f.setStyleStrategy(font->elementAntialiasing() ? QFont::PreferDefault : QFont::NoAntialias); + if (font->hasElementStyleStrategy()) { + f.setStyleStrategy(enumKeyOfObjectToValue("styleStrategy", font->elementStyleStrategy().toLatin1())); + } + return QVariant::fromValue(f); + } + + case DomProperty::Date: { + const DomDate *date = p->elementDate(); + return QVariant(QDate(date->elementYear(), date->elementMonth(), date->elementDay())); + } + + case DomProperty::Time: { + const DomTime *t = p->elementTime(); + return QVariant(QTime(t->elementHour(), t->elementMinute(), t->elementSecond())); + } + + case DomProperty::DateTime: { + const DomDateTime *dateTime = p->elementDateTime(); + const QDate d(dateTime->elementYear(), dateTime->elementMonth(), dateTime->elementDay()); + const QTime tm(dateTime->elementHour(), dateTime->elementMinute(), dateTime->elementSecond()); + return QVariant(QDateTime(d, tm)); + } + + case DomProperty::Url: { + const DomUrl *url = p->elementUrl(); + return QVariant(QUrl(url->elementString()->text())); + } + +#ifndef QT_NO_CURSOR + case DomProperty::Cursor: + return QVariant::fromValue(QCursor(static_cast(p->elementCursor()))); + + case DomProperty::CursorShape: + return QVariant::fromValue(QCursor(enumKeyOfObjectToValue("cursorShape", p->elementCursorShape().toLatin1()))); +#endif + + case DomProperty::Locale: { + const DomLocale *locale = p->elementLocale(); + return QVariant::fromValue(QLocale(enumKeyOfObjectToValue("language", locale->attributeLanguage().toLatin1()), + enumKeyOfObjectToValue("country", locale->attributeCountry().toLatin1()))); + } + case DomProperty::SizePolicy: { + const DomSizePolicy *sizep = p->elementSizePolicy(); + + QSizePolicy sizePolicy; + sizePolicy.setHorizontalStretch(sizep->elementHorStretch()); + sizePolicy.setVerticalStretch(sizep->elementVerStretch()); + + const QMetaEnum sizeType_enum = metaEnum("sizeType"); + + if (sizep->hasElementHSizeType()) { + sizePolicy.setHorizontalPolicy((QSizePolicy::Policy) sizep->elementHSizeType()); + } else if (sizep->hasAttributeHSizeType()) { + const QSizePolicy::Policy sp = enumKeyToValue(sizeType_enum, sizep->attributeHSizeType().toLatin1()); + sizePolicy.setHorizontalPolicy(sp); + } + + if (sizep->hasElementVSizeType()) { + sizePolicy.setVerticalPolicy((QSizePolicy::Policy) sizep->elementVSizeType()); + } else if (sizep->hasAttributeVSizeType()) { + const QSizePolicy::Policy sp = enumKeyToValue(sizeType_enum, sizep->attributeVSizeType().toLatin1()); + sizePolicy.setVerticalPolicy(sp); + } + + return QVariant::fromValue(sizePolicy); + } + + case DomProperty::StringList: + return QVariant(p->elementStringList()->elementString()); + + default: + uiLibWarning(QCoreApplication::translate("QFormBuilder", "Reading properties of the type %1 is not supported yet.").arg(p->kind())); + break; + } + + return QVariant(); +} + +// Apply a simple variant type to a DOM property +static bool applySimpleProperty(const QVariant &v, bool translateString, DomProperty *dom_prop) +{ + switch (v.type()) { + case QVariant::String: { + DomString *str = new DomString(); + str->setText(v.toString()); + if (!translateString) + str->setAttributeNotr(QLatin1String("true")); + dom_prop->setElementString(str); + } + return true; + + case QVariant::ByteArray: + dom_prop->setElementCstring(QString::fromUtf8(v.toByteArray())); + return true; + + case QVariant::Int: + dom_prop->setElementNumber(v.toInt()); + return true; + + case QVariant::UInt: + dom_prop->setElementUInt(v.toUInt()); + return true; + + case QVariant::LongLong: + dom_prop->setElementLongLong(v.toLongLong()); + return true; + + case QVariant::ULongLong: + dom_prop->setElementULongLong(v.toULongLong()); + return true; + + case QVariant::Double: + dom_prop->setElementDouble(v.toDouble()); + return true; + + case QVariant::Bool: + dom_prop->setElementBool(v.toBool() ? QFormBuilderStrings::instance().trueValue : QFormBuilderStrings::instance().falseValue); + return true; + + case QVariant::Char: { + DomChar *ch = new DomChar(); + const QChar character = v.toChar(); + ch->setElementUnicode(character.unicode()); + dom_prop->setElementChar(ch); + } + return true; + + case QVariant::Point: { + DomPoint *pt = new DomPoint(); + const QPoint point = v.toPoint(); + pt->setElementX(point.x()); + pt->setElementY(point.y()); + dom_prop->setElementPoint(pt); + } + return true; + + case QVariant::PointF: { + DomPointF *ptf = new DomPointF(); + const QPointF pointf = v.toPointF(); + ptf->setElementX(pointf.x()); + ptf->setElementY(pointf.y()); + dom_prop->setElementPointF(ptf); + } + return true; + + case QVariant::Color: { + DomColor *clr = new DomColor(); + const QColor color = qvariant_cast(v); + clr->setElementRed(color.red()); + clr->setElementGreen(color.green()); + clr->setElementBlue(color.blue()); + const int alphaChannel = color.alpha(); + if (alphaChannel != 255) + clr->setAttributeAlpha(alphaChannel); + dom_prop->setElementColor(clr); + } + return true; + + case QVariant::Size: { + DomSize *sz = new DomSize(); + const QSize size = v.toSize(); + sz->setElementWidth(size.width()); + sz->setElementHeight(size.height()); + dom_prop->setElementSize(sz); + } + return true; + + case QVariant::SizeF: { + DomSizeF *szf = new DomSizeF(); + const QSizeF sizef = v.toSizeF(); + szf->setElementWidth(sizef.width()); + szf->setElementHeight(sizef.height()); + dom_prop->setElementSizeF(szf); + } + return true; + + case QVariant::Rect: { + DomRect *rc = new DomRect(); + const QRect rect = v.toRect(); + rc->setElementX(rect.x()); + rc->setElementY(rect.y()); + rc->setElementWidth(rect.width()); + rc->setElementHeight(rect.height()); + dom_prop->setElementRect(rc); + } + return true; + + case QVariant::RectF: { + DomRectF *rcf = new DomRectF(); + const QRectF rectf = v.toRectF(); + rcf->setElementX(rectf.x()); + rcf->setElementY(rectf.y()); + rcf->setElementWidth(rectf.width()); + rcf->setElementHeight(rectf.height()); + dom_prop->setElementRectF(rcf); + } + return true; + + case QVariant::Font: { + DomFont *fnt = new DomFont(); + const QFont font = qvariant_cast(v); + const uint mask = font.resolve(); + if (mask & QFont::WeightResolved) { + fnt->setElementBold(font.bold()); + fnt->setElementWeight(font.weight()); + } + if (mask & QFont::FamilyResolved) + fnt->setElementFamily(font.family()); + if (mask & QFont::StyleResolved) + fnt->setElementItalic(font.italic()); + if (mask & QFont::SizeResolved) + fnt->setElementPointSize(font.pointSize()); + if (mask & QFont::StrikeOutResolved) + fnt->setElementStrikeOut(font.strikeOut()); + if (mask & QFont::UnderlineResolved) + fnt->setElementUnderline(font.underline()); + if (mask & QFont::KerningResolved) + fnt->setElementKerning(font.kerning()); + if (mask & QFont::StyleStrategyResolved) { + const QMetaEnum styleStrategy_enum = metaEnum("styleStrategy"); + fnt->setElementStyleStrategy(QLatin1String(styleStrategy_enum.valueToKey(font.styleStrategy()))); + } + dom_prop->setElementFont(fnt); + } + return true; + +#ifndef QT_NO_CURSOR + case QVariant::Cursor: { + const QMetaEnum cursorShape_enum = metaEnum("cursorShape"); + dom_prop->setElementCursorShape(QLatin1String(cursorShape_enum.valueToKey(qvariant_cast(v).shape()))); + } + return true; +#endif + + case QVariant::KeySequence: { + DomString *s = new DomString(); + s->setText(qvariant_cast(v).toString(QKeySequence::PortableText)); + dom_prop->setElementString(s); + } + return true; + + case QVariant::Locale: { + DomLocale *dom = new DomLocale(); + const QLocale locale = qvariant_cast(v); + + const QMetaEnum language_enum = metaEnum("language"); + const QMetaEnum country_enum = metaEnum("country"); + + dom->setAttributeLanguage(QLatin1String(language_enum.valueToKey(locale.language()))); + dom->setAttributeCountry(QLatin1String(country_enum.valueToKey(locale.country()))); + + dom_prop->setElementLocale(dom); + } + return true; + + case QVariant::SizePolicy: { + DomSizePolicy *dom = new DomSizePolicy(); + const QSizePolicy sizePolicy = qvariant_cast(v); + + dom->setElementHorStretch(sizePolicy.horizontalStretch()); + dom->setElementVerStretch(sizePolicy.verticalStretch()); + + const QMetaEnum sizeType_enum = metaEnum("sizeType"); + + dom->setAttributeHSizeType(QLatin1String(sizeType_enum.valueToKey(sizePolicy.horizontalPolicy()))); + dom->setAttributeVSizeType(QLatin1String(sizeType_enum.valueToKey(sizePolicy.verticalPolicy()))); + + dom_prop->setElementSizePolicy(dom); + } + return true; + + case QVariant::Date: { + DomDate *dom = new DomDate(); + const QDate date = qvariant_cast(v); + + dom->setElementYear(date.year()); + dom->setElementMonth(date.month()); + dom->setElementDay(date.day()); + + dom_prop->setElementDate(dom); + } + return true; + + case QVariant::Time: { + DomTime *dom = new DomTime(); + const QTime time = qvariant_cast(v); + + dom->setElementHour(time.hour()); + dom->setElementMinute(time.minute()); + dom->setElementSecond(time.second()); + + dom_prop->setElementTime(dom); + } + return true; + + case QVariant::DateTime: { + DomDateTime *dom = new DomDateTime(); + const QDateTime dateTime = qvariant_cast(v); + + dom->setElementHour(dateTime.time().hour()); + dom->setElementMinute(dateTime.time().minute()); + dom->setElementSecond(dateTime.time().second()); + dom->setElementYear(dateTime.date().year()); + dom->setElementMonth(dateTime.date().month()); + dom->setElementDay(dateTime.date().day()); + + dom_prop->setElementDateTime(dom); + } + return true; + + case QVariant::Url: { + DomUrl *dom = new DomUrl(); + const QUrl url = v.toUrl(); + + DomString *str = new DomString(); + str->setText(url.toString()); + dom->setElementString(str); + + dom_prop->setElementUrl(dom); + } + return true; + + case QVariant::StringList: { + DomStringList *sl = new DomStringList; + sl->setElementString(qvariant_cast(v)); + dom_prop->setElementStringList(sl); + } + return true; + + default: + break; + } + + return false; +} +static QString msgCannotWriteProperty(const QString &pname, const QVariant &v) +{ + return QCoreApplication::translate("QFormBuilder", "The property %1 could not be written. The type %2 is not supported yet."). + arg(pname).arg(QLatin1String(v.typeName())); + +} + +static bool isOfType(const QMetaObject *what, const QMetaObject *type) +{ + do { + if (what == type) + return true; + } while ((what = what->superClass())); + return false; +} + +static bool isTranslatable(const QString &pname, const QVariant &v, const QMetaObject *meta) +{ + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + if (pname == strings.objectNameProperty) + return false; + if (pname == strings.styleSheetProperty && v.type() == QVariant::String && isOfType(meta, &QWidget::staticMetaObject)) + return false; + return true; +} + +// Convert complex variant types to DOM properties with the help of QAbstractFormBuilder +// Does not perform a check using QAbstractFormBuilder::checkProperty(). +DomProperty *variantToDomProperty(QAbstractFormBuilder *afb, const QMetaObject *meta, + const QString &pname, const QVariant &v) +{ + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + + DomProperty *dom_prop = new DomProperty(); + dom_prop->setAttributeName(pname); + + const int pindex = meta->indexOfProperty(pname.toLatin1()); + if (pindex != -1) { + QMetaProperty meta_property = meta->property(pindex); + if ((v.type() == QVariant::Int || v.type() == QVariant::UInt) && meta_property.isEnumType()) { + const QMetaEnum e = meta_property.enumerator(); + if (e.isFlag()) + dom_prop->setElementSet(QString::fromAscii(e.valueToKeys(v.toInt()))); + else + dom_prop->setElementEnum(QString::fromAscii(e.valueToKey(v.toInt()))); + return dom_prop; + } + if (!meta_property.hasStdCppSet() || (isOfType(meta, &QAbstractScrollArea::staticMetaObject) && pname == strings.cursorProperty)) + dom_prop->setAttributeStdset(0); + } + + // Try simple properties + if (applySimpleProperty(v, isTranslatable(pname, v, meta), dom_prop)) + return dom_prop; + + // Complex properties + switch (v.type()) { + case QVariant::Palette: { + DomPalette *dom = new DomPalette(); + QPalette palette = qvariant_cast(v); + + palette.setCurrentColorGroup(QPalette::Active); + dom->setElementActive(afb->saveColorGroup(palette)); + + palette.setCurrentColorGroup(QPalette::Inactive); + dom->setElementInactive(afb->saveColorGroup(palette)); + + palette.setCurrentColorGroup(QPalette::Disabled); + dom->setElementDisabled(afb->saveColorGroup(palette)); + + dom_prop->setElementPalette(dom); + } break; + case QVariant::Brush: + dom_prop->setElementBrush(afb->saveBrush(qvariant_cast(v))); + break; + default: { + const bool hadAttributeStdset = dom_prop->hasAttributeStdset(); + const bool attributeStdset = dom_prop->attributeStdset(); + delete dom_prop; + if (afb->resourceBuilder()->isResourceType(v)) { + dom_prop = afb->resourceBuilder()->saveResource(afb->workingDirectory(), v); + if (dom_prop) { + dom_prop->setAttributeName(pname); + if (hadAttributeStdset) + dom_prop->setAttributeStdset(attributeStdset); + } + break; + } + uiLibWarning(msgCannotWriteProperty(pname, v)); + } return 0; + } + return dom_prop; +} + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/properties_p.h b/src/designer/src/lib/uilib/properties_p.h new file mode 100644 index 000000000..98b84fce9 --- /dev/null +++ b/src/designer/src/lib/uilib/properties_p.h @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// +// 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. +// + +#ifndef UILIBPROPERTIES_H +#define UILIBPROPERTIES_H + +#include "uilib_global.h" + +#include +#include +#include +#include + +#include + +#include "formbuilderextra_p.h" + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class QAbstractFormBuilder; +class DomProperty; + +QDESIGNER_UILIB_EXPORT DomProperty *variantToDomProperty(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const QString &propertyName, const QVariant &value); + + +QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(const DomProperty *property); +QDESIGNER_UILIB_EXPORT QVariant domPropertyToVariant(QAbstractFormBuilder *abstractFormBuilder, const QMetaObject *meta, const DomProperty *property); + +// This class exists to provide meta information +// for enumerations only. +class QAbstractFormBuilderGadget: public QWidget +{ + Q_OBJECT + Q_PROPERTY(Qt::ItemFlags itemFlags READ fakeItemFlags) + Q_PROPERTY(Qt::CheckState checkState READ fakeCheckState) + Q_PROPERTY(Qt::Alignment textAlignment READ fakeAlignment) + Q_PROPERTY(Qt::Orientation orientation READ fakeOrientation) + Q_PROPERTY(QSizePolicy::Policy sizeType READ fakeSizeType) + Q_PROPERTY(QPalette::ColorRole colorRole READ fakeColorRole) + Q_PROPERTY(QPalette::ColorGroup colorGroup READ fakeColorGroup) + Q_PROPERTY(QFont::StyleStrategy styleStrategy READ fakeStyleStrategy) + Q_PROPERTY(Qt::CursorShape cursorShape READ fakeCursorShape) + Q_PROPERTY(Qt::BrushStyle brushStyle READ fakeBrushStyle) + Q_PROPERTY(Qt::ToolBarArea toolBarArea READ fakeToolBarArea) + Q_PROPERTY(QGradient::Type gradientType READ fakeGradientType) + Q_PROPERTY(QGradient::Spread gradientSpread READ fakeGradientSpread) + Q_PROPERTY(QGradient::CoordinateMode gradientCoordinate READ fakeGradientCoordinate) + Q_PROPERTY(QLocale::Language language READ fakeLanguage) + Q_PROPERTY(QLocale::Country country READ fakeCountry) +public: + QAbstractFormBuilderGadget() { Q_ASSERT(0); } + + Qt::Orientation fakeOrientation() const { Q_ASSERT(0); return Qt::Horizontal; } + QSizePolicy::Policy fakeSizeType() const { Q_ASSERT(0); return QSizePolicy::Expanding; } + QPalette::ColorGroup fakeColorGroup() const { Q_ASSERT(0); return static_cast(0); } + QPalette::ColorRole fakeColorRole() const { Q_ASSERT(0); return static_cast(0); } + QFont::StyleStrategy fakeStyleStrategy() const { Q_ASSERT(0); return QFont::PreferDefault; } + Qt::CursorShape fakeCursorShape() const { Q_ASSERT(0); return Qt::ArrowCursor; } + Qt::BrushStyle fakeBrushStyle() const { Q_ASSERT(0); return Qt::NoBrush; } + Qt::ToolBarArea fakeToolBarArea() const { Q_ASSERT(0); return Qt::NoToolBarArea; } + QGradient::Type fakeGradientType() const { Q_ASSERT(0); return QGradient::NoGradient; } + QGradient::Spread fakeGradientSpread() const { Q_ASSERT(0); return QGradient::PadSpread; } + QGradient::CoordinateMode fakeGradientCoordinate() const { Q_ASSERT(0); return QGradient::LogicalMode; } + QLocale::Language fakeLanguage() const { Q_ASSERT(0); return QLocale::C; } + QLocale::Country fakeCountry() const { Q_ASSERT(0); return QLocale::AnyCountry; } + Qt::ItemFlags fakeItemFlags() const { Q_ASSERT(0); return Qt::NoItemFlags; } + Qt::CheckState fakeCheckState() const { Q_ASSERT(0); return Qt::Unchecked; } + Qt::Alignment fakeAlignment() const { Q_ASSERT(0); return Qt::AlignLeft; } +}; + +// Convert key to value for a given QMetaEnum +template +inline EnumType enumKeyToValue(const QMetaEnum &metaEnum,const char *key, const EnumType* = 0) +{ + int val = metaEnum.keyToValue(key); + if (val == -1) { + + uiLibWarning(QCoreApplication::translate("QFormBuilder", "The enumeration-value '%1' is invalid. The default value '%2' will be used instead.") + .arg(QString::fromUtf8(key)).arg(QString::fromUtf8(metaEnum.key(0)))); + val = metaEnum.value(0); + } + return static_cast(val); +} + +// Convert keys to value for a given QMetaEnum +template +inline EnumType enumKeysToValue(const QMetaEnum &metaEnum,const char *keys, const EnumType* = 0) +{ + int val = metaEnum.keysToValue(keys); + if (val == -1) { + + uiLibWarning(QCoreApplication::translate("QFormBuilder", "The flag-value '%1' is invalid. Zero will be used instead.") + .arg(QString::fromUtf8(keys))); + val = 0; + } + return static_cast(QFlag(val)); +} + +// Access meta enumeration object of a qobject +template +inline QMetaEnum metaEnum(const char *name, const QObjectType* = 0) +{ + const int e_index = QObjectType::staticMetaObject.indexOfProperty(name); + Q_ASSERT(e_index != -1); + return QObjectType::staticMetaObject.property(e_index).enumerator(); +} + +// Convert key to value for enumeration by name +template +inline EnumType enumKeyOfObjectToValue(const char *enumName, const char *key, const QObjectType* = 0, const EnumType* = 0) +{ + const QMetaEnum me = metaEnum(enumName); + return enumKeyToValue(me, key); +} + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +#endif // UILIBPROPERTIES_H diff --git a/src/designer/src/lib/uilib/qdesignerexportwidget.h b/src/designer/src/lib/uilib/qdesignerexportwidget.h new file mode 100644 index 000000000..54053ff27 --- /dev/null +++ b/src/designer/src/lib/uilib/qdesignerexportwidget.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDESIGNEREXPORTWIDGET_H +#define QDESIGNEREXPORTWIDGET_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#if 0 +// pragma for syncqt, don't remove. +#pragma qt_class(QDesignerExportWidget) +#endif + +#if defined(QDESIGNER_EXPORT_WIDGETS) +# define QDESIGNER_WIDGET_EXPORT Q_DECL_EXPORT +#else +# define QDESIGNER_WIDGET_EXPORT Q_DECL_IMPORT +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif //QDESIGNEREXPORTWIDGET_H diff --git a/src/designer/src/lib/uilib/resourcebuilder.cpp b/src/designer/src/lib/uilib/resourcebuilder.cpp new file mode 100644 index 000000000..72921c636 --- /dev/null +++ b/src/designer/src/lib/uilib/resourcebuilder.cpp @@ -0,0 +1,180 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "resourcebuilder_p.h" +#include "ui4_p.h" +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal { +#endif + +enum { themeDebug = 0 }; + +QResourceBuilder::QResourceBuilder() +{ + +} + +QResourceBuilder::~QResourceBuilder() +{ + +} + +int QResourceBuilder::iconStateFlags(const DomResourceIcon *dpi) +{ + int rc = 0; + if (dpi->hasElementNormalOff()) + rc |= NormalOff; + if (dpi->hasElementNormalOn()) + rc |= NormalOn; + if (dpi->hasElementDisabledOff()) + rc |= DisabledOff; + if (dpi->hasElementDisabledOn()) + rc |= DisabledOn; + if (dpi->hasElementActiveOff()) + rc |= ActiveOff; + if (dpi->hasElementActiveOn()) + rc |= ActiveOn; + if (dpi->hasElementSelectedOff()) + rc |= SelectedOff; + if (dpi->hasElementSelectedOn()) + rc |= SelectedOn; + return rc; +} + +QVariant QResourceBuilder::loadResource(const QDir &workingDirectory, const DomProperty *property) const +{ + switch (property->kind()) { + case DomProperty::Pixmap: { + const DomResourcePixmap *dpx = property->elementPixmap(); + QPixmap pixmap(QFileInfo(workingDirectory, dpx->text()).absoluteFilePath()); + return QVariant::fromValue(pixmap); + } + case DomProperty::IconSet: { + const DomResourceIcon *dpi = property->elementIconSet(); + if (!dpi->attributeTheme().isEmpty()) { + const QString theme = dpi->attributeTheme(); + const bool known = QIcon::hasThemeIcon(theme); + if (themeDebug) + qDebug("Theme %s known %d", qPrintable(theme), known); + if (known) + return qVariantFromValue(QIcon::fromTheme(dpi->attributeTheme())); + } // non-empty theme + if (const int flags = iconStateFlags(dpi)) { // new, post 4.4 format + QIcon icon; + if (flags & NormalOff) + icon.addFile(QFileInfo(workingDirectory, dpi->elementNormalOff()->text()).absoluteFilePath(), QSize(), QIcon::Normal, QIcon::Off); + if (flags & NormalOn) + icon.addFile(QFileInfo(workingDirectory, dpi->elementNormalOn()->text()).absoluteFilePath(), QSize(), QIcon::Normal, QIcon::On); + if (flags & DisabledOff) + icon.addFile(QFileInfo(workingDirectory, dpi->elementDisabledOff()->text()).absoluteFilePath(), QSize(), QIcon::Disabled, QIcon::Off); + if (flags & DisabledOn) + icon.addFile(QFileInfo(workingDirectory, dpi->elementDisabledOn()->text()).absoluteFilePath(), QSize(), QIcon::Disabled, QIcon::On); + if (flags & ActiveOff) + icon.addFile(QFileInfo(workingDirectory, dpi->elementActiveOff()->text()).absoluteFilePath(), QSize(), QIcon::Active, QIcon::Off); + if (flags & ActiveOn) + icon.addFile(QFileInfo(workingDirectory, dpi->elementActiveOn()->text()).absoluteFilePath(), QSize(), QIcon::Active, QIcon::On); + if (flags & SelectedOff) + icon.addFile(QFileInfo(workingDirectory, dpi->elementSelectedOff()->text()).absoluteFilePath(), QSize(), QIcon::Selected, QIcon::Off); + if (flags & SelectedOn) + icon.addFile(QFileInfo(workingDirectory, dpi->elementSelectedOn()->text()).absoluteFilePath(), QSize(), QIcon::Selected, QIcon::On); + return QVariant::fromValue(icon); + } else { // 4.3 legacy + const QIcon icon(QFileInfo(workingDirectory, dpi->text()).absoluteFilePath()); + return QVariant::fromValue(icon); + } + } + break; + default: + break; + } + return QVariant(); +} + +QVariant QResourceBuilder::toNativeValue(const QVariant &value) const +{ + return value; +} + +DomProperty *QResourceBuilder::saveResource(const QDir &workingDirectory, const QVariant &value) const +{ + Q_UNUSED(workingDirectory) + Q_UNUSED(value) + return 0; +} + +bool QResourceBuilder::isResourceProperty(const DomProperty *p) const +{ + switch (p->kind()) { + case DomProperty::Pixmap: + case DomProperty::IconSet: + return true; + default: + break; + } + return false; +} + +bool QResourceBuilder::isResourceType(const QVariant &value) const +{ + switch (value.type()) { + case QVariant::Pixmap: + case QVariant::Icon: + return true; + default: + break; + } + return false; +} + +#ifdef QFORMINTERNAL_NAMESPACE +} // namespace QFormInternal +#endif + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/resourcebuilder_p.h b/src/designer/src/lib/uilib/resourcebuilder_p.h new file mode 100644 index 000000000..ca699a05f --- /dev/null +++ b/src/designer/src/lib/uilib/resourcebuilder_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef RESOURCEBUILDER_H +#define RESOURCEBUILDER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "uilib_global.h" +#include +#include + +QT_BEGIN_NAMESPACE + +class QDir; +class QVariant; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class DomProperty; +class DomResourceIcon; + +class QDESIGNER_UILIB_EXPORT QResourceBuilder +{ +public: + enum IconStateFlags { + NormalOff = 0x1, NormalOn = 0x2, DisabledOff = 0x4, DisabledOn = 0x8, + ActiveOff = 0x10, ActiveOn = 0x20, SelectedOff = 0x40, SelectedOn = 0x80 + }; + + QResourceBuilder(); + virtual ~QResourceBuilder(); + + virtual QVariant loadResource(const QDir &workingDirectory, const DomProperty *property) const; + + virtual QVariant toNativeValue(const QVariant &value) const; + + virtual DomProperty *saveResource(const QDir &workingDirectory, const QVariant &value) const; + + virtual bool isResourceProperty(const DomProperty *p) const; + + virtual bool isResourceType(const QVariant &value) const; + + static int iconStateFlags(const DomResourceIcon *resIcon); +}; + + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +#endif // RESOURCEBUILDER_H diff --git a/src/designer/src/lib/uilib/textbuilder.cpp b/src/designer/src/lib/uilib/textbuilder.cpp new file mode 100644 index 000000000..d9d2ac3b1 --- /dev/null +++ b/src/designer/src/lib/uilib/textbuilder.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "textbuilder_p.h" +#include "ui4_p.h" +#include + +QT_BEGIN_NAMESPACE + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal { +#endif + +QTextBuilder::QTextBuilder() +{ + +} + +QTextBuilder::~QTextBuilder() +{ + +} + +QVariant QTextBuilder::loadText(const DomProperty *property) const +{ + if (property->kind() == DomProperty::String) + return property->elementString()->text(); + return QVariant(); +} + +QVariant QTextBuilder::toNativeValue(const QVariant &value) const +{ + return value; +} + +DomProperty *QTextBuilder::saveText(const QVariant &value) const +{ + Q_UNUSED(value) + return 0; +} + +#ifdef QFORMINTERNAL_NAMESPACE +} // namespace QFormInternal +#endif + +QT_END_NAMESPACE diff --git a/src/designer/src/lib/uilib/textbuilder_p.h b/src/designer/src/lib/uilib/textbuilder_p.h new file mode 100644 index 000000000..bef4a64f0 --- /dev/null +++ b/src/designer/src/lib/uilib/textbuilder_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TEXTBUILDER_H +#define TEXTBUILDER_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "uilib_global.h" +#include +#include + +QT_BEGIN_NAMESPACE + +class QDir; +class QVariant; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class DomProperty; +class DomString; + +class QDESIGNER_UILIB_EXPORT QTextBuilder +{ +public: + QTextBuilder(); + virtual ~QTextBuilder(); + + virtual QVariant loadText(const DomProperty *property) const; + + virtual QVariant toNativeValue(const QVariant &value) const; + + virtual DomProperty *saveText(const QVariant &value) const; +}; + + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +#endif // TEXTBUILDER_H diff --git a/src/designer/src/lib/uilib/ui4.cpp b/src/designer/src/lib/uilib/ui4.cpp new file mode 100644 index 000000000..5c232c862 --- /dev/null +++ b/src/designer/src/lib/uilib/ui4.cpp @@ -0,0 +1,8907 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "ui4_p.h" + + +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; + delete m_buttonGroups; + + if (clear_all) { + m_text.clear(); + m_has_attr_version = false; + m_has_attr_language = false; + m_has_attr_displayname = false; + m_has_attr_stdsetdef = false; + m_attr_stdsetdef = 0; + 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; + m_buttonGroups = 0; +} + +DomUI::DomUI() +{ + m_children = 0; + m_has_attr_version = false; + m_has_attr_language = false; + m_has_attr_displayname = false; + m_has_attr_stdsetdef = false; + m_attr_stdsetdef = 0; + 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; + m_buttonGroups = 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; + delete m_buttonGroups; +} + +void DomUI::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("version")) { + setAttributeVersion(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("language")) { + setAttributeLanguage(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("displayname")) { + setAttributeDisplayname(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("stdsetdef")) { + setAttributeStdsetdef(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("stdSetDef")) { + setAttributeStdSetDef(attribute.value().toString().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("author")) { + setElementAuthor(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("comment")) { + setElementComment(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("exportmacro")) { + setElementExportMacro(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("class")) { + setElementClass(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("widget")) { + DomWidget *v = new DomWidget(); + v->read(reader); + setElementWidget(v); + continue; + } + if (tag == QStringLiteral("layoutdefault")) { + DomLayoutDefault *v = new DomLayoutDefault(); + v->read(reader); + setElementLayoutDefault(v); + continue; + } + if (tag == QStringLiteral("layoutfunction")) { + DomLayoutFunction *v = new DomLayoutFunction(); + v->read(reader); + setElementLayoutFunction(v); + continue; + } + if (tag == QStringLiteral("pixmapfunction")) { + setElementPixmapFunction(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("customwidgets")) { + DomCustomWidgets *v = new DomCustomWidgets(); + v->read(reader); + setElementCustomWidgets(v); + continue; + } + if (tag == QStringLiteral("tabstops")) { + DomTabStops *v = new DomTabStops(); + v->read(reader); + setElementTabStops(v); + continue; + } + if (tag == QStringLiteral("images")) { + DomImages *v = new DomImages(); + v->read(reader); + setElementImages(v); + continue; + } + if (tag == QStringLiteral("includes")) { + DomIncludes *v = new DomIncludes(); + v->read(reader); + setElementIncludes(v); + continue; + } + if (tag == QStringLiteral("resources")) { + DomResources *v = new DomResources(); + v->read(reader); + setElementResources(v); + continue; + } + if (tag == QStringLiteral("connections")) { + DomConnections *v = new DomConnections(); + v->read(reader); + setElementConnections(v); + continue; + } + if (tag == QStringLiteral("designerdata")) { + DomDesignerData *v = new DomDesignerData(); + v->read(reader); + setElementDesignerdata(v); + continue; + } + if (tag == QStringLiteral("slots")) { + DomSlots *v = new DomSlots(); + v->read(reader); + setElementSlots(v); + continue; + } + if (tag == QStringLiteral("buttongroups")) { + DomButtonGroups *v = new DomButtonGroups(); + v->read(reader); + setElementButtonGroups(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomUI::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("ui") : tagName.toLower()); + + if (hasAttributeVersion()) + writer.writeAttribute(QStringLiteral("version"), attributeVersion()); + + if (hasAttributeLanguage()) + writer.writeAttribute(QStringLiteral("language"), attributeLanguage()); + + if (hasAttributeDisplayname()) + writer.writeAttribute(QStringLiteral("displayname"), attributeDisplayname()); + + if (hasAttributeStdsetdef()) + writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdsetdef())); + + if (hasAttributeStdSetDef()) + writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdSetDef())); + + if (m_children & Author) { + writer.writeTextElement(QStringLiteral("author"), m_author); + } + + if (m_children & Comment) { + writer.writeTextElement(QStringLiteral("comment"), m_comment); + } + + if (m_children & ExportMacro) { + writer.writeTextElement(QStringLiteral("exportmacro"), m_exportMacro); + } + + if (m_children & Class) { + writer.writeTextElement(QStringLiteral("class"), m_class); + } + + if (m_children & Widget) { + m_widget->write(writer, QStringLiteral("widget")); + } + + if (m_children & LayoutDefault) { + m_layoutDefault->write(writer, QStringLiteral("layoutdefault")); + } + + if (m_children & LayoutFunction) { + m_layoutFunction->write(writer, QStringLiteral("layoutfunction")); + } + + if (m_children & PixmapFunction) { + writer.writeTextElement(QStringLiteral("pixmapfunction"), m_pixmapFunction); + } + + if (m_children & CustomWidgets) { + m_customWidgets->write(writer, QStringLiteral("customwidgets")); + } + + if (m_children & TabStops) { + m_tabStops->write(writer, QStringLiteral("tabstops")); + } + + if (m_children & Images) { + m_images->write(writer, QStringLiteral("images")); + } + + if (m_children & Includes) { + m_includes->write(writer, QStringLiteral("includes")); + } + + if (m_children & Resources) { + m_resources->write(writer, QStringLiteral("resources")); + } + + if (m_children & Connections) { + m_connections->write(writer, QStringLiteral("connections")); + } + + if (m_children & Designerdata) { + m_designerdata->write(writer, QStringLiteral("designerdata")); + } + + if (m_children & Slots) { + m_slots->write(writer, QStringLiteral("slots")); + } + + if (m_children & ButtonGroups) { + m_buttonGroups->write(writer, QStringLiteral("buttongroups")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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; +} + +DomWidget* DomUI::takeElementWidget() +{ + DomWidget* a = m_widget; + m_widget = 0; + m_children ^= Widget; + return a; +} + +void DomUI::setElementWidget(DomWidget* a) +{ + delete m_widget; + m_children |= Widget; + m_widget = a; +} + +DomLayoutDefault* DomUI::takeElementLayoutDefault() +{ + DomLayoutDefault* a = m_layoutDefault; + m_layoutDefault = 0; + m_children ^= LayoutDefault; + return a; +} + +void DomUI::setElementLayoutDefault(DomLayoutDefault* a) +{ + delete m_layoutDefault; + m_children |= LayoutDefault; + m_layoutDefault = a; +} + +DomLayoutFunction* DomUI::takeElementLayoutFunction() +{ + DomLayoutFunction* a = m_layoutFunction; + m_layoutFunction = 0; + m_children ^= LayoutFunction; + return 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; +} + +DomCustomWidgets* DomUI::takeElementCustomWidgets() +{ + DomCustomWidgets* a = m_customWidgets; + m_customWidgets = 0; + m_children ^= CustomWidgets; + return a; +} + +void DomUI::setElementCustomWidgets(DomCustomWidgets* a) +{ + delete m_customWidgets; + m_children |= CustomWidgets; + m_customWidgets = a; +} + +DomTabStops* DomUI::takeElementTabStops() +{ + DomTabStops* a = m_tabStops; + m_tabStops = 0; + m_children ^= TabStops; + return a; +} + +void DomUI::setElementTabStops(DomTabStops* a) +{ + delete m_tabStops; + m_children |= TabStops; + m_tabStops = a; +} + +DomImages* DomUI::takeElementImages() +{ + DomImages* a = m_images; + m_images = 0; + m_children ^= Images; + return a; +} + +void DomUI::setElementImages(DomImages* a) +{ + delete m_images; + m_children |= Images; + m_images = a; +} + +DomIncludes* DomUI::takeElementIncludes() +{ + DomIncludes* a = m_includes; + m_includes = 0; + m_children ^= Includes; + return a; +} + +void DomUI::setElementIncludes(DomIncludes* a) +{ + delete m_includes; + m_children |= Includes; + m_includes = a; +} + +DomResources* DomUI::takeElementResources() +{ + DomResources* a = m_resources; + m_resources = 0; + m_children ^= Resources; + return a; +} + +void DomUI::setElementResources(DomResources* a) +{ + delete m_resources; + m_children |= Resources; + m_resources = a; +} + +DomConnections* DomUI::takeElementConnections() +{ + DomConnections* a = m_connections; + m_connections = 0; + m_children ^= Connections; + return a; +} + +void DomUI::setElementConnections(DomConnections* a) +{ + delete m_connections; + m_children |= Connections; + m_connections = a; +} + +DomDesignerData* DomUI::takeElementDesignerdata() +{ + DomDesignerData* a = m_designerdata; + m_designerdata = 0; + m_children ^= Designerdata; + return a; +} + +void DomUI::setElementDesignerdata(DomDesignerData* a) +{ + delete m_designerdata; + m_children |= Designerdata; + m_designerdata = a; +} + +DomSlots* DomUI::takeElementSlots() +{ + DomSlots* a = m_slots; + m_slots = 0; + m_children ^= Slots; + return a; +} + +void DomUI::setElementSlots(DomSlots* a) +{ + delete m_slots; + m_children |= Slots; + m_slots = a; +} + +DomButtonGroups* DomUI::takeElementButtonGroups() +{ + DomButtonGroups* a = m_buttonGroups; + m_buttonGroups = 0; + m_children ^= ButtonGroups; + return a; +} + +void DomUI::setElementButtonGroups(DomButtonGroups* a) +{ + delete m_buttonGroups; + m_children |= ButtonGroups; + m_buttonGroups = 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 DomUI::clearElementButtonGroups() +{ + delete m_buttonGroups; + m_buttonGroups = 0; + m_children &= ~ButtonGroups; +} + +void DomIncludes::clear(bool clear_all) +{ + qDeleteAll(m_include); + m_include.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomIncludes::DomIncludes() +{ + m_children = 0; +} + +DomIncludes::~DomIncludes() +{ + qDeleteAll(m_include); + m_include.clear(); +} + +void DomIncludes::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("include")) { + DomInclude *v = new DomInclude(); + v->read(reader); + m_include.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomIncludes::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("includes") : tagName.toLower()); + + for (int i = 0; i < m_include.size(); ++i) { + DomInclude* v = m_include[i]; + v->write(writer, QStringLiteral("include")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomIncludes::setElementInclude(const QList& a) +{ + m_children |= Include; + m_include = a; +} + +void DomInclude::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_location = false; + m_has_attr_impldecl = false; + } + + m_children = 0; +} + +DomInclude::DomInclude() +{ + m_children = 0; + m_has_attr_location = false; + m_has_attr_impldecl = false; + m_text.clear(); +} + +DomInclude::~DomInclude() +{ +} + +void DomInclude::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("location")) { + setAttributeLocation(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("impldecl")) { + setAttributeImpldecl(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomInclude::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("include") : tagName.toLower()); + + if (hasAttributeLocation()) + writer.writeAttribute(QStringLiteral("location"), attributeLocation()); + + if (hasAttributeImpldecl()) + writer.writeAttribute(QStringLiteral("impldecl"), attributeImpldecl()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomResources::clear(bool clear_all) +{ + qDeleteAll(m_include); + m_include.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + } + + m_children = 0; +} + +DomResources::DomResources() +{ + m_children = 0; + m_has_attr_name = false; +} + +DomResources::~DomResources() +{ + qDeleteAll(m_include); + m_include.clear(); +} + +void DomResources::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("include")) { + DomResource *v = new DomResource(); + v->read(reader); + m_include.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomResources::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resources") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + for (int i = 0; i < m_include.size(); ++i) { + DomResource* v = m_include[i]; + v->write(writer, QStringLiteral("include")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomResources::setElementInclude(const QList& a) +{ + m_children |= Include; + m_include = a; +} + +void DomResource::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_location = false; + } + + m_children = 0; +} + +DomResource::DomResource() +{ + m_children = 0; + m_has_attr_location = false; +} + +DomResource::~DomResource() +{ +} + +void DomResource::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("location")) { + setAttributeLocation(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomResource::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resource") : tagName.toLower()); + + if (hasAttributeLocation()) + writer.writeAttribute(QStringLiteral("location"), attributeLocation()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomActionGroup::clear(bool clear_all) +{ + qDeleteAll(m_action); + m_action.clear(); + qDeleteAll(m_actionGroup); + m_actionGroup.clear(); + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + } + + m_children = 0; +} + +DomActionGroup::DomActionGroup() +{ + m_children = 0; + m_has_attr_name = false; +} + +DomActionGroup::~DomActionGroup() +{ + qDeleteAll(m_action); + m_action.clear(); + qDeleteAll(m_actionGroup); + m_actionGroup.clear(); + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); +} + +void DomActionGroup::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("action")) { + DomAction *v = new DomAction(); + v->read(reader); + m_action.append(v); + continue; + } + if (tag == QStringLiteral("actiongroup")) { + DomActionGroup *v = new DomActionGroup(); + v->read(reader); + m_actionGroup.append(v); + continue; + } + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + if (tag == QStringLiteral("attribute")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_attribute.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomActionGroup::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("actiongroup") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + for (int i = 0; i < m_action.size(); ++i) { + DomAction* v = m_action[i]; + v->write(writer, QStringLiteral("action")); + } + for (int i = 0; i < m_actionGroup.size(); ++i) { + DomActionGroup* v = m_actionGroup[i]; + v->write(writer, QStringLiteral("actiongroup")); + } + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + for (int i = 0; i < m_attribute.size(); ++i) { + DomProperty* v = m_attribute[i]; + v->write(writer, QStringLiteral("attribute")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomActionGroup::setElementAction(const QList& a) +{ + m_children |= Action; + m_action = a; +} + +void DomActionGroup::setElementActionGroup(const QList& a) +{ + m_children |= ActionGroup; + m_actionGroup = a; +} + +void DomActionGroup::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomActionGroup::setElementAttribute(const QList& a) +{ + m_children |= Attribute; + m_attribute = a; +} + +void DomAction::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + m_has_attr_menu = false; + } + + m_children = 0; +} + +DomAction::DomAction() +{ + m_children = 0; + m_has_attr_name = false; + m_has_attr_menu = false; +} + +DomAction::~DomAction() +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); +} + +void DomAction::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("menu")) { + setAttributeMenu(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + if (tag == QStringLiteral("attribute")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_attribute.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomAction::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("action") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (hasAttributeMenu()) + writer.writeAttribute(QStringLiteral("menu"), attributeMenu()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + for (int i = 0; i < m_attribute.size(); ++i) { + DomProperty* v = m_attribute[i]; + v->write(writer, QStringLiteral("attribute")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomAction::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomAction::setElementAttribute(const QList& a) +{ + m_children |= Attribute; + m_attribute = a; +} + +void DomActionRef::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + } + + m_children = 0; +} + +DomActionRef::DomActionRef() +{ + m_children = 0; + m_has_attr_name = false; +} + +DomActionRef::~DomActionRef() +{ +} + +void DomActionRef::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomActionRef::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("actionref") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomButtonGroup::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + } + + m_children = 0; +} + +DomButtonGroup::DomButtonGroup() +{ + m_children = 0; + m_has_attr_name = false; +} + +DomButtonGroup::~DomButtonGroup() +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); +} + +void DomButtonGroup::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + if (tag == QStringLiteral("attribute")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_attribute.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomButtonGroup::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("buttongroup") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + for (int i = 0; i < m_attribute.size(); ++i) { + DomProperty* v = m_attribute[i]; + v->write(writer, QStringLiteral("attribute")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomButtonGroup::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomButtonGroup::setElementAttribute(const QList& a) +{ + m_children |= Attribute; + m_attribute = a; +} + +void DomButtonGroups::clear(bool clear_all) +{ + qDeleteAll(m_buttonGroup); + m_buttonGroup.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomButtonGroups::DomButtonGroups() +{ + m_children = 0; +} + +DomButtonGroups::~DomButtonGroups() +{ + qDeleteAll(m_buttonGroup); + m_buttonGroup.clear(); +} + +void DomButtonGroups::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("buttongroup")) { + DomButtonGroup *v = new DomButtonGroup(); + v->read(reader); + m_buttonGroup.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomButtonGroups::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("buttongroups") : tagName.toLower()); + + for (int i = 0; i < m_buttonGroup.size(); ++i) { + DomButtonGroup* v = m_buttonGroup[i]; + v->write(writer, QStringLiteral("buttongroup")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomButtonGroups::setElementButtonGroup(const QList& a) +{ + m_children |= ButtonGroup; + m_buttonGroup = a; +} + +void DomImages::clear(bool clear_all) +{ + qDeleteAll(m_image); + m_image.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomImages::DomImages() +{ + m_children = 0; +} + +DomImages::~DomImages() +{ + qDeleteAll(m_image); + m_image.clear(); +} + +void DomImages::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("image")) { + DomImage *v = new DomImage(); + v->read(reader); + m_image.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomImages::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("images") : tagName.toLower()); + + for (int i = 0; i < m_image.size(); ++i) { + DomImage* v = m_image[i]; + v->write(writer, QStringLiteral("image")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomImages::setElementImage(const QList& a) +{ + m_children |= Image; + m_image = a; +} + +void DomImage::clear(bool clear_all) +{ + delete m_data; + + if (clear_all) { + m_text.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("data")) { + DomImageData *v = new DomImageData(); + v->read(reader); + setElementData(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomImage::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("image") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (m_children & Data) { + m_data->write(writer, QStringLiteral("data")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomImageData* DomImage::takeElementData() +{ + DomImageData* a = m_data; + m_data = 0; + m_children ^= Data; + return a; +} + +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.clear(); + m_has_attr_format = false; + m_has_attr_length = false; + m_attr_length = 0; + } + + m_children = 0; +} + +DomImageData::DomImageData() +{ + m_children = 0; + m_has_attr_format = false; + m_has_attr_length = false; + m_attr_length = 0; + m_text.clear(); +} + +DomImageData::~DomImageData() +{ +} + +void DomImageData::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("format")) { + setAttributeFormat(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("length")) { + setAttributeLength(attribute.value().toString().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomImageData::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("imagedata") : tagName.toLower()); + + if (hasAttributeFormat()) + writer.writeAttribute(QStringLiteral("format"), attributeFormat()); + + if (hasAttributeLength()) + writer.writeAttribute(QStringLiteral("length"), QString::number(attributeLength())); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomCustomWidgets::clear(bool clear_all) +{ + qDeleteAll(m_customWidget); + m_customWidget.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomCustomWidgets::DomCustomWidgets() +{ + m_children = 0; +} + +DomCustomWidgets::~DomCustomWidgets() +{ + qDeleteAll(m_customWidget); + m_customWidget.clear(); +} + +void DomCustomWidgets::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("customwidget")) { + DomCustomWidget *v = new DomCustomWidget(); + v->read(reader); + m_customWidget.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomCustomWidgets::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("customwidgets") : tagName.toLower()); + + for (int i = 0; i < m_customWidget.size(); ++i) { + DomCustomWidget* v = m_customWidget[i]; + v->write(writer, QStringLiteral("customwidget")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomCustomWidgets::setElementCustomWidget(const QList& a) +{ + m_children |= CustomWidget; + m_customWidget = a; +} + +void DomHeader::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_location = false; + } + + m_children = 0; +} + +DomHeader::DomHeader() +{ + m_children = 0; + m_has_attr_location = false; + m_text.clear(); +} + +DomHeader::~DomHeader() +{ +} + +void DomHeader::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("location")) { + setAttributeLocation(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomHeader::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("header") : tagName.toLower()); + + if (hasAttributeLocation()) + writer.writeAttribute(QStringLiteral("location"), attributeLocation()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomCustomWidget::clear(bool clear_all) +{ + delete m_header; + delete m_sizeHint; + delete m_sizePolicy; + delete m_script; + delete m_properties; + delete m_slots; + delete m_propertyspecifications; + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; + m_header = 0; + m_sizeHint = 0; + m_container = 0; + m_sizePolicy = 0; + m_script = 0; + m_properties = 0; + m_slots = 0; + m_propertyspecifications = 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; + m_propertyspecifications = 0; +} + +DomCustomWidget::~DomCustomWidget() +{ + delete m_header; + delete m_sizeHint; + delete m_sizePolicy; + delete m_script; + delete m_properties; + delete m_slots; + delete m_propertyspecifications; +} + +void DomCustomWidget::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("class")) { + setElementClass(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("extends")) { + setElementExtends(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("header")) { + DomHeader *v = new DomHeader(); + v->read(reader); + setElementHeader(v); + continue; + } + if (tag == QStringLiteral("sizehint")) { + DomSize *v = new DomSize(); + v->read(reader); + setElementSizeHint(v); + continue; + } + if (tag == QStringLiteral("addpagemethod")) { + setElementAddPageMethod(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("container")) { + setElementContainer(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("sizepolicy")) { + DomSizePolicyData *v = new DomSizePolicyData(); + v->read(reader); + setElementSizePolicy(v); + continue; + } + if (tag == QStringLiteral("pixmap")) { + setElementPixmap(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("script")) { + DomScript *v = new DomScript(); + v->read(reader); + setElementScript(v); + continue; + } + if (tag == QStringLiteral("properties")) { + DomProperties *v = new DomProperties(); + v->read(reader); + setElementProperties(v); + continue; + } + if (tag == QStringLiteral("slots")) { + DomSlots *v = new DomSlots(); + v->read(reader); + setElementSlots(v); + continue; + } + if (tag == QStringLiteral("propertyspecifications")) { + DomPropertySpecifications *v = new DomPropertySpecifications(); + v->read(reader); + setElementPropertyspecifications(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomCustomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("customwidget") : tagName.toLower()); + + if (m_children & Class) { + writer.writeTextElement(QStringLiteral("class"), m_class); + } + + if (m_children & Extends) { + writer.writeTextElement(QStringLiteral("extends"), m_extends); + } + + if (m_children & Header) { + m_header->write(writer, QStringLiteral("header")); + } + + if (m_children & SizeHint) { + m_sizeHint->write(writer, QStringLiteral("sizehint")); + } + + if (m_children & AddPageMethod) { + writer.writeTextElement(QStringLiteral("addpagemethod"), m_addPageMethod); + } + + if (m_children & Container) { + writer.writeTextElement(QStringLiteral("container"), QString::number(m_container)); + } + + if (m_children & SizePolicy) { + m_sizePolicy->write(writer, QStringLiteral("sizepolicy")); + } + + if (m_children & Pixmap) { + writer.writeTextElement(QStringLiteral("pixmap"), m_pixmap); + } + + if (m_children & Script) { + m_script->write(writer, QStringLiteral("script")); + } + + if (m_children & Properties) { + m_properties->write(writer, QStringLiteral("properties")); + } + + if (m_children & Slots) { + m_slots->write(writer, QStringLiteral("slots")); + } + + if (m_children & Propertyspecifications) { + m_propertyspecifications->write(writer, QStringLiteral("propertyspecifications")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomCustomWidget::setElementClass(const QString& a) +{ + m_children |= Class; + m_class = a; +} + +void DomCustomWidget::setElementExtends(const QString& a) +{ + m_children |= Extends; + m_extends = a; +} + +DomHeader* DomCustomWidget::takeElementHeader() +{ + DomHeader* a = m_header; + m_header = 0; + m_children ^= Header; + return a; +} + +void DomCustomWidget::setElementHeader(DomHeader* a) +{ + delete m_header; + m_children |= Header; + m_header = a; +} + +DomSize* DomCustomWidget::takeElementSizeHint() +{ + DomSize* a = m_sizeHint; + m_sizeHint = 0; + m_children ^= SizeHint; + return 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; +} + +DomSizePolicyData* DomCustomWidget::takeElementSizePolicy() +{ + DomSizePolicyData* a = m_sizePolicy; + m_sizePolicy = 0; + m_children ^= SizePolicy; + return 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; +} + +DomScript* DomCustomWidget::takeElementScript() +{ + DomScript* a = m_script; + m_script = 0; + m_children ^= Script; + return a; +} + +void DomCustomWidget::setElementScript(DomScript* a) +{ + delete m_script; + m_children |= Script; + m_script = a; +} + +DomProperties* DomCustomWidget::takeElementProperties() +{ + DomProperties* a = m_properties; + m_properties = 0; + m_children ^= Properties; + return a; +} + +void DomCustomWidget::setElementProperties(DomProperties* a) +{ + delete m_properties; + m_children |= Properties; + m_properties = a; +} + +DomSlots* DomCustomWidget::takeElementSlots() +{ + DomSlots* a = m_slots; + m_slots = 0; + m_children ^= Slots; + return a; +} + +void DomCustomWidget::setElementSlots(DomSlots* a) +{ + delete m_slots; + m_children |= Slots; + m_slots = a; +} + +DomPropertySpecifications* DomCustomWidget::takeElementPropertyspecifications() +{ + DomPropertySpecifications* a = m_propertyspecifications; + m_propertyspecifications = 0; + m_children ^= Propertyspecifications; + return a; +} + +void DomCustomWidget::setElementPropertyspecifications(DomPropertySpecifications* a) +{ + delete m_propertyspecifications; + m_children |= Propertyspecifications; + m_propertyspecifications = 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 DomCustomWidget::clearElementPropertyspecifications() +{ + delete m_propertyspecifications; + m_propertyspecifications = 0; + m_children &= ~Propertyspecifications; +} + +void DomProperties::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomProperties::DomProperties() +{ + m_children = 0; +} + +DomProperties::~DomProperties() +{ + qDeleteAll(m_property); + m_property.clear(); +} + +void DomProperties::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomPropertyData *v = new DomPropertyData(); + v->read(reader); + m_property.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomProperties::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("properties") : tagName.toLower()); + + for (int i = 0; i < m_property.size(); ++i) { + DomPropertyData* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomProperties::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomPropertyData::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_type = false; + } + + m_children = 0; +} + +DomPropertyData::DomPropertyData() +{ + m_children = 0; + m_has_attr_type = false; +} + +DomPropertyData::~DomPropertyData() +{ +} + +void DomPropertyData::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("type")) { + setAttributeType(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomPropertyData::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertydata") : tagName.toLower()); + + if (hasAttributeType()) + writer.writeAttribute(QStringLiteral("type"), attributeType()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomSizePolicyData::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("hordata")) { + setElementHorData(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("verdata")) { + setElementVerData(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomSizePolicyData::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicydata") : tagName.toLower()); + + if (m_children & HorData) { + writer.writeTextElement(QStringLiteral("hordata"), QString::number(m_horData)); + } + + if (m_children & VerData) { + writer.writeTextElement(QStringLiteral("verdata"), QString::number(m_verData)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + m_has_attr_spacing = false; + m_attr_spacing = 0; + m_has_attr_margin = false; + m_attr_margin = 0; + } + + m_children = 0; +} + +DomLayoutDefault::DomLayoutDefault() +{ + m_children = 0; + m_has_attr_spacing = false; + m_attr_spacing = 0; + m_has_attr_margin = false; + m_attr_margin = 0; +} + +DomLayoutDefault::~DomLayoutDefault() +{ +} + +void DomLayoutDefault::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("spacing")) { + setAttributeSpacing(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("margin")) { + setAttributeMargin(attribute.value().toString().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomLayoutDefault::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutdefault") : tagName.toLower()); + + if (hasAttributeSpacing()) + writer.writeAttribute(QStringLiteral("spacing"), QString::number(attributeSpacing())); + + if (hasAttributeMargin()) + writer.writeAttribute(QStringLiteral("margin"), QString::number(attributeMargin())); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomLayoutFunction::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_spacing = false; + m_has_attr_margin = false; + } + + m_children = 0; +} + +DomLayoutFunction::DomLayoutFunction() +{ + m_children = 0; + m_has_attr_spacing = false; + m_has_attr_margin = false; +} + +DomLayoutFunction::~DomLayoutFunction() +{ +} + +void DomLayoutFunction::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("spacing")) { + setAttributeSpacing(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("margin")) { + setAttributeMargin(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomLayoutFunction::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutfunction") : tagName.toLower()); + + if (hasAttributeSpacing()) + writer.writeAttribute(QStringLiteral("spacing"), attributeSpacing()); + + if (hasAttributeMargin()) + writer.writeAttribute(QStringLiteral("margin"), attributeMargin()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomTabStops::clear(bool clear_all) +{ + m_tabStop.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomTabStops::DomTabStops() +{ + m_children = 0; +} + +DomTabStops::~DomTabStops() +{ + m_tabStop.clear(); +} + +void DomTabStops::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("tabstop")) { + m_tabStop.append(reader.readElementText()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomTabStops::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("tabstops") : tagName.toLower()); + + for (int i = 0; i < m_tabStop.size(); ++i) { + QString v = m_tabStop[i]; + writer.writeTextElement(QStringLiteral("tabstop"), v); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomTabStops::setElementTabStop(const QStringList& a) +{ + m_children |= TabStop; + m_tabStop = a; +} + +void DomLayout::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + qDeleteAll(m_item); + m_item.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_class = false; + m_has_attr_name = false; + m_has_attr_stretch = false; + m_has_attr_rowStretch = false; + m_has_attr_columnStretch = false; + m_has_attr_rowMinimumHeight = false; + m_has_attr_columnMinimumWidth = false; + } + + m_children = 0; +} + +DomLayout::DomLayout() +{ + m_children = 0; + m_has_attr_class = false; + m_has_attr_name = false; + m_has_attr_stretch = false; + m_has_attr_rowStretch = false; + m_has_attr_columnStretch = false; + m_has_attr_rowMinimumHeight = false; + m_has_attr_columnMinimumWidth = false; +} + +DomLayout::~DomLayout() +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + qDeleteAll(m_item); + m_item.clear(); +} + +void DomLayout::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("class")) { + setAttributeClass(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("stretch")) { + setAttributeStretch(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("rowstretch")) { + setAttributeRowStretch(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("columnstretch")) { + setAttributeColumnStretch(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("rowminimumheight")) { + setAttributeRowMinimumHeight(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("columnminimumwidth")) { + setAttributeColumnMinimumWidth(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + if (tag == QStringLiteral("attribute")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_attribute.append(v); + continue; + } + if (tag == QStringLiteral("item")) { + DomLayoutItem *v = new DomLayoutItem(); + v->read(reader); + m_item.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomLayout::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layout") : tagName.toLower()); + + if (hasAttributeClass()) + writer.writeAttribute(QStringLiteral("class"), attributeClass()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (hasAttributeStretch()) + writer.writeAttribute(QStringLiteral("stretch"), attributeStretch()); + + if (hasAttributeRowStretch()) + writer.writeAttribute(QStringLiteral("rowstretch"), attributeRowStretch()); + + if (hasAttributeColumnStretch()) + writer.writeAttribute(QStringLiteral("columnstretch"), attributeColumnStretch()); + + if (hasAttributeRowMinimumHeight()) + writer.writeAttribute(QStringLiteral("rowminimumheight"), attributeRowMinimumHeight()); + + if (hasAttributeColumnMinimumWidth()) + writer.writeAttribute(QStringLiteral("columnminimumwidth"), attributeColumnMinimumWidth()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + for (int i = 0; i < m_attribute.size(); ++i) { + DomProperty* v = m_attribute[i]; + v->write(writer, QStringLiteral("attribute")); + } + for (int i = 0; i < m_item.size(); ++i) { + DomLayoutItem* v = m_item[i]; + v->write(writer, QStringLiteral("item")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomLayout::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomLayout::setElementAttribute(const QList& a) +{ + m_children |= Attribute; + m_attribute = a; +} + +void DomLayout::setElementItem(const QList& a) +{ + m_children |= Item; + m_item = a; +} + +void DomLayoutItem::clear(bool clear_all) +{ + delete m_widget; + delete m_layout; + delete m_spacer; + + if (clear_all) { + m_text.clear(); + 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_has_attr_alignment = false; + } + + 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_has_attr_alignment = false; + m_widget = 0; + m_layout = 0; + m_spacer = 0; +} + +DomLayoutItem::~DomLayoutItem() +{ + delete m_widget; + delete m_layout; + delete m_spacer; +} + +void DomLayoutItem::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("row")) { + setAttributeRow(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("column")) { + setAttributeColumn(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("rowspan")) { + setAttributeRowSpan(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("colspan")) { + setAttributeColSpan(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("alignment")) { + setAttributeAlignment(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("widget")) { + DomWidget *v = new DomWidget(); + v->read(reader); + setElementWidget(v); + continue; + } + if (tag == QStringLiteral("layout")) { + DomLayout *v = new DomLayout(); + v->read(reader); + setElementLayout(v); + continue; + } + if (tag == QStringLiteral("spacer")) { + DomSpacer *v = new DomSpacer(); + v->read(reader); + setElementSpacer(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomLayoutItem::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("layoutitem") : tagName.toLower()); + + if (hasAttributeRow()) + writer.writeAttribute(QStringLiteral("row"), QString::number(attributeRow())); + + if (hasAttributeColumn()) + writer.writeAttribute(QStringLiteral("column"), QString::number(attributeColumn())); + + if (hasAttributeRowSpan()) + writer.writeAttribute(QStringLiteral("rowspan"), QString::number(attributeRowSpan())); + + if (hasAttributeColSpan()) + writer.writeAttribute(QStringLiteral("colspan"), QString::number(attributeColSpan())); + + if (hasAttributeAlignment()) + writer.writeAttribute(QStringLiteral("alignment"), attributeAlignment()); + + switch (kind()) { + case Widget: { + DomWidget* v = elementWidget(); + if (v != 0) { + v->write(writer, QStringLiteral("widget")); + } + break; + } + case Layout: { + DomLayout* v = elementLayout(); + if (v != 0) { + v->write(writer, QStringLiteral("layout")); + } + break; + } + case Spacer: { + DomSpacer* v = elementSpacer(); + if (v != 0) { + v->write(writer, QStringLiteral("spacer")); + } + break; + } + default: + break; + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomWidget* DomLayoutItem::takeElementWidget() +{ + DomWidget* a = m_widget; + m_widget = 0; + return a; +} + +void DomLayoutItem::setElementWidget(DomWidget* a) +{ + clear(false); + m_kind = Widget; + m_widget = a; +} + +DomLayout* DomLayoutItem::takeElementLayout() +{ + DomLayout* a = m_layout; + m_layout = 0; + return a; +} + +void DomLayoutItem::setElementLayout(DomLayout* a) +{ + clear(false); + m_kind = Layout; + m_layout = a; +} + +DomSpacer* DomLayoutItem::takeElementSpacer() +{ + DomSpacer* a = m_spacer; + m_spacer = 0; + return a; +} + +void DomLayoutItem::setElementSpacer(DomSpacer* a) +{ + clear(false); + m_kind = Spacer; + m_spacer = a; +} + +void DomRow::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomRow::DomRow() +{ + m_children = 0; +} + +DomRow::~DomRow() +{ + qDeleteAll(m_property); + m_property.clear(); +} + +void DomRow::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomRow::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("row") : tagName.toLower()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomRow::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomColumn::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomColumn::DomColumn() +{ + m_children = 0; +} + +DomColumn::~DomColumn() +{ + qDeleteAll(m_property); + m_property.clear(); +} + +void DomColumn::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomColumn::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("column") : tagName.toLower()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomColumn::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomItem::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_item); + m_item.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_row = false; + m_attr_row = 0; + m_has_attr_column = false; + m_attr_column = 0; + } + + m_children = 0; +} + +DomItem::DomItem() +{ + m_children = 0; + m_has_attr_row = false; + m_attr_row = 0; + m_has_attr_column = false; + m_attr_column = 0; +} + +DomItem::~DomItem() +{ + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_item); + m_item.clear(); +} + +void DomItem::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("row")) { + setAttributeRow(attribute.value().toString().toInt()); + continue; + } + if (name == QStringLiteral("column")) { + setAttributeColumn(attribute.value().toString().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + if (tag == QStringLiteral("item")) { + DomItem *v = new DomItem(); + v->read(reader); + m_item.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomItem::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("item") : tagName.toLower()); + + if (hasAttributeRow()) + writer.writeAttribute(QStringLiteral("row"), QString::number(attributeRow())); + + if (hasAttributeColumn()) + writer.writeAttribute(QStringLiteral("column"), QString::number(attributeColumn())); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + for (int i = 0; i < m_item.size(); ++i) { + DomItem* v = m_item[i]; + v->write(writer, QStringLiteral("item")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomItem::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomItem::setElementItem(const QList& a) +{ + m_children |= Item; + m_item = a; +} + +void DomWidget::clear(bool clear_all) +{ + m_class.clear(); + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_script); + m_script.clear(); + qDeleteAll(m_widgetData); + m_widgetData.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + qDeleteAll(m_row); + m_row.clear(); + qDeleteAll(m_column); + m_column.clear(); + qDeleteAll(m_item); + m_item.clear(); + qDeleteAll(m_layout); + m_layout.clear(); + qDeleteAll(m_widget); + m_widget.clear(); + qDeleteAll(m_action); + m_action.clear(); + qDeleteAll(m_actionGroup); + m_actionGroup.clear(); + qDeleteAll(m_addAction); + m_addAction.clear(); + m_zOrder.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_class = false; + m_has_attr_name = false; + m_has_attr_native = false; + m_attr_native = false; + } + + m_children = 0; +} + +DomWidget::DomWidget() +{ + m_children = 0; + m_has_attr_class = false; + m_has_attr_name = false; + m_has_attr_native = false; + m_attr_native = false; +} + +DomWidget::~DomWidget() +{ + m_class.clear(); + qDeleteAll(m_property); + m_property.clear(); + qDeleteAll(m_script); + m_script.clear(); + qDeleteAll(m_widgetData); + m_widgetData.clear(); + qDeleteAll(m_attribute); + m_attribute.clear(); + qDeleteAll(m_row); + m_row.clear(); + qDeleteAll(m_column); + m_column.clear(); + qDeleteAll(m_item); + m_item.clear(); + qDeleteAll(m_layout); + m_layout.clear(); + qDeleteAll(m_widget); + m_widget.clear(); + qDeleteAll(m_action); + m_action.clear(); + qDeleteAll(m_actionGroup); + m_actionGroup.clear(); + qDeleteAll(m_addAction); + m_addAction.clear(); + m_zOrder.clear(); +} + +void DomWidget::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("class")) { + setAttributeClass(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("native")) { + setAttributeNative((attribute.value().toString() == QLatin1String("true") ? true : false)); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("class")) { + m_class.append(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + if (tag == QStringLiteral("script")) { + DomScript *v = new DomScript(); + v->read(reader); + m_script.append(v); + continue; + } + if (tag == QStringLiteral("widgetdata")) { + DomWidgetData *v = new DomWidgetData(); + v->read(reader); + m_widgetData.append(v); + continue; + } + if (tag == QStringLiteral("attribute")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_attribute.append(v); + continue; + } + if (tag == QStringLiteral("row")) { + DomRow *v = new DomRow(); + v->read(reader); + m_row.append(v); + continue; + } + if (tag == QStringLiteral("column")) { + DomColumn *v = new DomColumn(); + v->read(reader); + m_column.append(v); + continue; + } + if (tag == QStringLiteral("item")) { + DomItem *v = new DomItem(); + v->read(reader); + m_item.append(v); + continue; + } + if (tag == QStringLiteral("layout")) { + DomLayout *v = new DomLayout(); + v->read(reader); + m_layout.append(v); + continue; + } + if (tag == QStringLiteral("widget")) { + DomWidget *v = new DomWidget(); + v->read(reader); + m_widget.append(v); + continue; + } + if (tag == QStringLiteral("action")) { + DomAction *v = new DomAction(); + v->read(reader); + m_action.append(v); + continue; + } + if (tag == QStringLiteral("actiongroup")) { + DomActionGroup *v = new DomActionGroup(); + v->read(reader); + m_actionGroup.append(v); + continue; + } + if (tag == QStringLiteral("addaction")) { + DomActionRef *v = new DomActionRef(); + v->read(reader); + m_addAction.append(v); + continue; + } + if (tag == QStringLiteral("zorder")) { + m_zOrder.append(reader.readElementText()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomWidget::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("widget") : tagName.toLower()); + + if (hasAttributeClass()) + writer.writeAttribute(QStringLiteral("class"), attributeClass()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (hasAttributeNative()) + writer.writeAttribute(QStringLiteral("native"), (attributeNative() ? QLatin1String("true") : QLatin1String("false"))); + + for (int i = 0; i < m_class.size(); ++i) { + QString v = m_class[i]; + writer.writeTextElement(QStringLiteral("class"), v); + } + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + for (int i = 0; i < m_script.size(); ++i) { + DomScript* v = m_script[i]; + v->write(writer, QStringLiteral("script")); + } + for (int i = 0; i < m_widgetData.size(); ++i) { + DomWidgetData* v = m_widgetData[i]; + v->write(writer, QStringLiteral("widgetdata")); + } + for (int i = 0; i < m_attribute.size(); ++i) { + DomProperty* v = m_attribute[i]; + v->write(writer, QStringLiteral("attribute")); + } + for (int i = 0; i < m_row.size(); ++i) { + DomRow* v = m_row[i]; + v->write(writer, QStringLiteral("row")); + } + for (int i = 0; i < m_column.size(); ++i) { + DomColumn* v = m_column[i]; + v->write(writer, QStringLiteral("column")); + } + for (int i = 0; i < m_item.size(); ++i) { + DomItem* v = m_item[i]; + v->write(writer, QStringLiteral("item")); + } + for (int i = 0; i < m_layout.size(); ++i) { + DomLayout* v = m_layout[i]; + v->write(writer, QStringLiteral("layout")); + } + for (int i = 0; i < m_widget.size(); ++i) { + DomWidget* v = m_widget[i]; + v->write(writer, QStringLiteral("widget")); + } + for (int i = 0; i < m_action.size(); ++i) { + DomAction* v = m_action[i]; + v->write(writer, QStringLiteral("action")); + } + for (int i = 0; i < m_actionGroup.size(); ++i) { + DomActionGroup* v = m_actionGroup[i]; + v->write(writer, QStringLiteral("actiongroup")); + } + for (int i = 0; i < m_addAction.size(); ++i) { + DomActionRef* v = m_addAction[i]; + v->write(writer, QStringLiteral("addaction")); + } + for (int i = 0; i < m_zOrder.size(); ++i) { + QString v = m_zOrder[i]; + writer.writeTextElement(QStringLiteral("zorder"), v); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomWidget::setElementClass(const QStringList& a) +{ + m_children |= Class; + m_class = a; +} + +void DomWidget::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomWidget::setElementScript(const QList& a) +{ + m_children |= Script; + m_script = a; +} + +void DomWidget::setElementWidgetData(const QList& a) +{ + m_children |= WidgetData; + m_widgetData = a; +} + +void DomWidget::setElementAttribute(const QList& a) +{ + m_children |= Attribute; + m_attribute = a; +} + +void DomWidget::setElementRow(const QList& a) +{ + m_children |= Row; + m_row = a; +} + +void DomWidget::setElementColumn(const QList& a) +{ + m_children |= Column; + m_column = a; +} + +void DomWidget::setElementItem(const QList& a) +{ + m_children |= Item; + m_item = a; +} + +void DomWidget::setElementLayout(const QList& a) +{ + m_children |= Layout; + m_layout = a; +} + +void DomWidget::setElementWidget(const QList& a) +{ + m_children |= Widget; + m_widget = a; +} + +void DomWidget::setElementAction(const QList& a) +{ + m_children |= Action; + m_action = a; +} + +void DomWidget::setElementActionGroup(const QList& a) +{ + m_children |= ActionGroup; + m_actionGroup = a; +} + +void DomWidget::setElementAddAction(const QList& a) +{ + m_children |= AddAction; + m_addAction = a; +} + +void DomWidget::setElementZOrder(const QStringList& a) +{ + m_children |= ZOrder; + m_zOrder = a; +} + +void DomSpacer::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + } + + m_children = 0; +} + +DomSpacer::DomSpacer() +{ + m_children = 0; + m_has_attr_name = false; +} + +DomSpacer::~DomSpacer() +{ + qDeleteAll(m_property); + m_property.clear(); +} + +void DomSpacer::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomSpacer::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("spacer") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomSpacer::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomColor::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("alpha")) { + setAttributeAlpha(attribute.value().toString().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("red")) { + setElementRed(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("green")) { + setElementGreen(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("blue")) { + setElementBlue(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomColor::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("color") : tagName.toLower()); + + if (hasAttributeAlpha()) + writer.writeAttribute(QStringLiteral("alpha"), QString::number(attributeAlpha())); + + if (m_children & Red) { + writer.writeTextElement(QStringLiteral("red"), QString::number(m_red)); + } + + if (m_children & Green) { + writer.writeTextElement(QStringLiteral("green"), QString::number(m_green)); + } + + if (m_children & Blue) { + writer.writeTextElement(QStringLiteral("blue"), QString::number(m_blue)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("position")) { + setAttributePosition(attribute.value().toString().toDouble()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("color")) { + DomColor *v = new DomColor(); + v->read(reader); + setElementColor(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomGradientStop::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("gradientstop") : tagName.toLower()); + + if (hasAttributePosition()) + writer.writeAttribute(QStringLiteral("position"), QString::number(attributePosition(), 'f', 15)); + + if (m_children & Color) { + m_color->write(writer, QStringLiteral("color")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomColor* DomGradientStop::takeElementColor() +{ + DomColor* a = m_color; + m_color = 0; + m_children ^= Color; + return a; +} + +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) +{ + qDeleteAll(m_gradientStop); + m_gradientStop.clear(); + + if (clear_all) { + m_text.clear(); + 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; + } + + m_children = 0; +} + +DomGradient::DomGradient() +{ + m_children = 0; + 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() +{ + qDeleteAll(m_gradientStop); + m_gradientStop.clear(); +} + +void DomGradient::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("startx")) { + setAttributeStartX(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("starty")) { + setAttributeStartY(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("endx")) { + setAttributeEndX(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("endy")) { + setAttributeEndY(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("centralx")) { + setAttributeCentralX(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("centraly")) { + setAttributeCentralY(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("focalx")) { + setAttributeFocalX(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("focaly")) { + setAttributeFocalY(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("radius")) { + setAttributeRadius(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("angle")) { + setAttributeAngle(attribute.value().toString().toDouble()); + continue; + } + if (name == QStringLiteral("type")) { + setAttributeType(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("spread")) { + setAttributeSpread(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("coordinatemode")) { + setAttributeCoordinateMode(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("gradientstop")) { + DomGradientStop *v = new DomGradientStop(); + v->read(reader); + m_gradientStop.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomGradient::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("gradient") : tagName.toLower()); + + if (hasAttributeStartX()) + writer.writeAttribute(QStringLiteral("startx"), QString::number(attributeStartX(), 'f', 15)); + + if (hasAttributeStartY()) + writer.writeAttribute(QStringLiteral("starty"), QString::number(attributeStartY(), 'f', 15)); + + if (hasAttributeEndX()) + writer.writeAttribute(QStringLiteral("endx"), QString::number(attributeEndX(), 'f', 15)); + + if (hasAttributeEndY()) + writer.writeAttribute(QStringLiteral("endy"), QString::number(attributeEndY(), 'f', 15)); + + if (hasAttributeCentralX()) + writer.writeAttribute(QStringLiteral("centralx"), QString::number(attributeCentralX(), 'f', 15)); + + if (hasAttributeCentralY()) + writer.writeAttribute(QStringLiteral("centraly"), QString::number(attributeCentralY(), 'f', 15)); + + if (hasAttributeFocalX()) + writer.writeAttribute(QStringLiteral("focalx"), QString::number(attributeFocalX(), 'f', 15)); + + if (hasAttributeFocalY()) + writer.writeAttribute(QStringLiteral("focaly"), QString::number(attributeFocalY(), 'f', 15)); + + if (hasAttributeRadius()) + writer.writeAttribute(QStringLiteral("radius"), QString::number(attributeRadius(), 'f', 15)); + + if (hasAttributeAngle()) + writer.writeAttribute(QStringLiteral("angle"), QString::number(attributeAngle(), 'f', 15)); + + if (hasAttributeType()) + writer.writeAttribute(QStringLiteral("type"), attributeType()); + + if (hasAttributeSpread()) + writer.writeAttribute(QStringLiteral("spread"), attributeSpread()); + + if (hasAttributeCoordinateMode()) + writer.writeAttribute(QStringLiteral("coordinatemode"), attributeCoordinateMode()); + + for (int i = 0; i < m_gradientStop.size(); ++i) { + DomGradientStop* v = m_gradientStop[i]; + v->write(writer, QStringLiteral("gradientstop")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomGradient::setElementGradientStop(const QList& a) +{ + m_children |= GradientStop; + m_gradientStop = a; +} + +void DomBrush::clear(bool clear_all) +{ + delete m_color; + delete m_texture; + delete m_gradient; + + if (clear_all) { + m_text.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("brushstyle")) { + setAttributeBrushStyle(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("color")) { + DomColor *v = new DomColor(); + v->read(reader); + setElementColor(v); + continue; + } + if (tag == QStringLiteral("texture")) { + DomProperty *v = new DomProperty(); + v->read(reader); + setElementTexture(v); + continue; + } + if (tag == QStringLiteral("gradient")) { + DomGradient *v = new DomGradient(); + v->read(reader); + setElementGradient(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomBrush::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("brush") : tagName.toLower()); + + if (hasAttributeBrushStyle()) + writer.writeAttribute(QStringLiteral("brushstyle"), attributeBrushStyle()); + + switch (kind()) { + case Color: { + DomColor* v = elementColor(); + if (v != 0) { + v->write(writer, QStringLiteral("color")); + } + break; + } + case Texture: { + DomProperty* v = elementTexture(); + if (v != 0) { + v->write(writer, QStringLiteral("texture")); + } + break; + } + case Gradient: { + DomGradient* v = elementGradient(); + if (v != 0) { + v->write(writer, QStringLiteral("gradient")); + } + break; + } + default: + break; + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomColor* DomBrush::takeElementColor() +{ + DomColor* a = m_color; + m_color = 0; + return a; +} + +void DomBrush::setElementColor(DomColor* a) +{ + clear(false); + m_kind = Color; + m_color = a; +} + +DomProperty* DomBrush::takeElementTexture() +{ + DomProperty* a = m_texture; + m_texture = 0; + return a; +} + +void DomBrush::setElementTexture(DomProperty* a) +{ + clear(false); + m_kind = Texture; + m_texture = a; +} + +DomGradient* DomBrush::takeElementGradient() +{ + DomGradient* a = m_gradient; + m_gradient = 0; + return 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.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("role")) { + setAttributeRole(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("brush")) { + DomBrush *v = new DomBrush(); + v->read(reader); + setElementBrush(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomColorRole::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("colorrole") : tagName.toLower()); + + if (hasAttributeRole()) + writer.writeAttribute(QStringLiteral("role"), attributeRole()); + + if (m_children & Brush) { + m_brush->write(writer, QStringLiteral("brush")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomBrush* DomColorRole::takeElementBrush() +{ + DomBrush* a = m_brush; + m_brush = 0; + m_children ^= Brush; + return a; +} + +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) +{ + qDeleteAll(m_colorRole); + m_colorRole.clear(); + qDeleteAll(m_color); + m_color.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomColorGroup::DomColorGroup() +{ + m_children = 0; +} + +DomColorGroup::~DomColorGroup() +{ + qDeleteAll(m_colorRole); + m_colorRole.clear(); + qDeleteAll(m_color); + m_color.clear(); +} + +void DomColorGroup::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("colorrole")) { + DomColorRole *v = new DomColorRole(); + v->read(reader); + m_colorRole.append(v); + continue; + } + if (tag == QStringLiteral("color")) { + DomColor *v = new DomColor(); + v->read(reader); + m_color.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomColorGroup::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("colorgroup") : tagName.toLower()); + + for (int i = 0; i < m_colorRole.size(); ++i) { + DomColorRole* v = m_colorRole[i]; + v->write(writer, QStringLiteral("colorrole")); + } + for (int i = 0; i < m_color.size(); ++i) { + DomColor* v = m_color[i]; + v->write(writer, QStringLiteral("color")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomColorGroup::setElementColorRole(const QList& a) +{ + m_children |= ColorRole; + m_colorRole = a; +} + +void DomColorGroup::setElementColor(const QList& a) +{ + m_children |= Color; + m_color = a; +} + +void DomPalette::clear(bool clear_all) +{ + delete m_active; + delete m_inactive; + delete m_disabled; + + if (clear_all) { + m_text.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("active")) { + DomColorGroup *v = new DomColorGroup(); + v->read(reader); + setElementActive(v); + continue; + } + if (tag == QStringLiteral("inactive")) { + DomColorGroup *v = new DomColorGroup(); + v->read(reader); + setElementInactive(v); + continue; + } + if (tag == QStringLiteral("disabled")) { + DomColorGroup *v = new DomColorGroup(); + v->read(reader); + setElementDisabled(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomPalette::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("palette") : tagName.toLower()); + + if (m_children & Active) { + m_active->write(writer, QStringLiteral("active")); + } + + if (m_children & Inactive) { + m_inactive->write(writer, QStringLiteral("inactive")); + } + + if (m_children & Disabled) { + m_disabled->write(writer, QStringLiteral("disabled")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomColorGroup* DomPalette::takeElementActive() +{ + DomColorGroup* a = m_active; + m_active = 0; + m_children ^= Active; + return a; +} + +void DomPalette::setElementActive(DomColorGroup* a) +{ + delete m_active; + m_children |= Active; + m_active = a; +} + +DomColorGroup* DomPalette::takeElementInactive() +{ + DomColorGroup* a = m_inactive; + m_inactive = 0; + m_children ^= Inactive; + return a; +} + +void DomPalette::setElementInactive(DomColorGroup* a) +{ + delete m_inactive; + m_children |= Inactive; + m_inactive = a; +} + +DomColorGroup* DomPalette::takeElementDisabled() +{ + DomColorGroup* a = m_disabled; + m_disabled = 0; + m_children ^= Disabled; + return 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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("family")) { + setElementFamily(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("pointsize")) { + setElementPointSize(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("weight")) { + setElementWeight(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("italic")) { + setElementItalic((reader.readElementText() == QLatin1String("true") ? true : false)); + continue; + } + if (tag == QStringLiteral("bold")) { + setElementBold((reader.readElementText() == QLatin1String("true") ? true : false)); + continue; + } + if (tag == QStringLiteral("underline")) { + setElementUnderline((reader.readElementText() == QLatin1String("true") ? true : false)); + continue; + } + if (tag == QStringLiteral("strikeout")) { + setElementStrikeOut((reader.readElementText() == QLatin1String("true") ? true : false)); + continue; + } + if (tag == QStringLiteral("antialiasing")) { + setElementAntialiasing((reader.readElementText() == QLatin1String("true") ? true : false)); + continue; + } + if (tag == QStringLiteral("stylestrategy")) { + setElementStyleStrategy(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("kerning")) { + setElementKerning((reader.readElementText() == QLatin1String("true") ? true : false)); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomFont::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("font") : tagName.toLower()); + + if (m_children & Family) { + writer.writeTextElement(QStringLiteral("family"), m_family); + } + + if (m_children & PointSize) { + writer.writeTextElement(QStringLiteral("pointsize"), QString::number(m_pointSize)); + } + + if (m_children & Weight) { + writer.writeTextElement(QStringLiteral("weight"), QString::number(m_weight)); + } + + if (m_children & Italic) { + writer.writeTextElement(QStringLiteral("italic"), (m_italic ? QLatin1String("true") : QLatin1String("false"))); + } + + if (m_children & Bold) { + writer.writeTextElement(QStringLiteral("bold"), (m_bold ? QLatin1String("true") : QLatin1String("false"))); + } + + if (m_children & Underline) { + writer.writeTextElement(QStringLiteral("underline"), (m_underline ? QLatin1String("true") : QLatin1String("false"))); + } + + if (m_children & StrikeOut) { + writer.writeTextElement(QStringLiteral("strikeout"), (m_strikeOut ? QLatin1String("true") : QLatin1String("false"))); + } + + if (m_children & Antialiasing) { + writer.writeTextElement(QStringLiteral("antialiasing"), (m_antialiasing ? QLatin1String("true") : QLatin1String("false"))); + } + + if (m_children & StyleStrategy) { + writer.writeTextElement(QStringLiteral("stylestrategy"), m_styleStrategy); + } + + if (m_children & Kerning) { + writer.writeTextElement(QStringLiteral("kerning"), (m_kerning ? QLatin1String("true") : QLatin1String("false"))); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QString(QLatin1Char('x'))) { + setElementX(reader.readElementText().toInt()); + continue; + } + if (tag == QString(QLatin1Char('y'))) { + setElementY(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomPoint::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("point") : tagName.toLower()); + + if (m_children & X) { + writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x)); + } + + if (m_children & Y) { + writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QString(QLatin1Char('x'))) { + setElementX(reader.readElementText().toInt()); + continue; + } + if (tag == QString(QLatin1Char('y'))) { + setElementY(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("width")) { + setElementWidth(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("height")) { + setElementHeight(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomRect::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("rect") : tagName.toLower()); + + if (m_children & X) { + writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x)); + } + + if (m_children & Y) { + writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y)); + } + + if (m_children & Width) { + writer.writeTextElement(QStringLiteral("width"), QString::number(m_width)); + } + + if (m_children & Height) { + writer.writeTextElement(QStringLiteral("height"), QString::number(m_height)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + m_has_attr_language = false; + m_has_attr_country = false; + } + + m_children = 0; +} + +DomLocale::DomLocale() +{ + m_children = 0; + m_has_attr_language = false; + m_has_attr_country = false; +} + +DomLocale::~DomLocale() +{ +} + +void DomLocale::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("language")) { + setAttributeLanguage(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("country")) { + setAttributeCountry(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomLocale::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("locale") : tagName.toLower()); + + if (hasAttributeLanguage()) + writer.writeAttribute(QStringLiteral("language"), attributeLanguage()); + + if (hasAttributeCountry()) + writer.writeAttribute(QStringLiteral("country"), attributeCountry()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomSizePolicy::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("hsizetype")) { + setAttributeHSizeType(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("vsizetype")) { + setAttributeVSizeType(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("hsizetype")) { + setElementHSizeType(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("vsizetype")) { + setElementVSizeType(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("horstretch")) { + setElementHorStretch(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("verstretch")) { + setElementVerStretch(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomSizePolicy::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizepolicy") : tagName.toLower()); + + if (hasAttributeHSizeType()) + writer.writeAttribute(QStringLiteral("hsizetype"), attributeHSizeType()); + + if (hasAttributeVSizeType()) + writer.writeAttribute(QStringLiteral("vsizetype"), attributeVSizeType()); + + if (m_children & HSizeType) { + writer.writeTextElement(QStringLiteral("hsizetype"), QString::number(m_hSizeType)); + } + + if (m_children & VSizeType) { + writer.writeTextElement(QStringLiteral("vsizetype"), QString::number(m_vSizeType)); + } + + if (m_children & HorStretch) { + writer.writeTextElement(QStringLiteral("horstretch"), QString::number(m_horStretch)); + } + + if (m_children & VerStretch) { + writer.writeTextElement(QStringLiteral("verstretch"), QString::number(m_verStretch)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("width")) { + setElementWidth(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("height")) { + setElementHeight(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomSize::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("size") : tagName.toLower()); + + if (m_children & Width) { + writer.writeTextElement(QStringLiteral("width"), QString::number(m_width)); + } + + if (m_children & Height) { + writer.writeTextElement(QStringLiteral("height"), QString::number(m_height)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("year")) { + setElementYear(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("month")) { + setElementMonth(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("day")) { + setElementDay(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomDate::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("date") : tagName.toLower()); + + if (m_children & Year) { + writer.writeTextElement(QStringLiteral("year"), QString::number(m_year)); + } + + if (m_children & Month) { + writer.writeTextElement(QStringLiteral("month"), QString::number(m_month)); + } + + if (m_children & Day) { + writer.writeTextElement(QStringLiteral("day"), QString::number(m_day)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("hour")) { + setElementHour(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("minute")) { + setElementMinute(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("second")) { + setElementSecond(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomTime::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("time") : tagName.toLower()); + + if (m_children & Hour) { + writer.writeTextElement(QStringLiteral("hour"), QString::number(m_hour)); + } + + if (m_children & Minute) { + writer.writeTextElement(QStringLiteral("minute"), QString::number(m_minute)); + } + + if (m_children & Second) { + writer.writeTextElement(QStringLiteral("second"), QString::number(m_second)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("hour")) { + setElementHour(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("minute")) { + setElementMinute(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("second")) { + setElementSecond(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("year")) { + setElementYear(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("month")) { + setElementMonth(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("day")) { + setElementDay(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomDateTime::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("datetime") : tagName.toLower()); + + if (m_children & Hour) { + writer.writeTextElement(QStringLiteral("hour"), QString::number(m_hour)); + } + + if (m_children & Minute) { + writer.writeTextElement(QStringLiteral("minute"), QString::number(m_minute)); + } + + if (m_children & Second) { + writer.writeTextElement(QStringLiteral("second"), QString::number(m_second)); + } + + if (m_children & Year) { + writer.writeTextElement(QStringLiteral("year"), QString::number(m_year)); + } + + if (m_children & Month) { + writer.writeTextElement(QStringLiteral("month"), QString::number(m_month)); + } + + if (m_children & Day) { + writer.writeTextElement(QStringLiteral("day"), QString::number(m_day)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + m_children = 0; +} + +DomStringList::DomStringList() +{ + m_children = 0; +} + +DomStringList::~DomStringList() +{ + m_string.clear(); +} + +void DomStringList::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("string")) { + m_string.append(reader.readElementText()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomStringList::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("stringlist") : tagName.toLower()); + + for (int i = 0; i < m_string.size(); ++i) { + QString v = m_string[i]; + writer.writeTextElement(QStringLiteral("string"), v); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomStringList::setElementString(const QStringList& a) +{ + m_children |= String; + m_string = a; +} + +void DomResourcePixmap::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_resource = false; + m_has_attr_alias = false; + } + + m_children = 0; +} + +DomResourcePixmap::DomResourcePixmap() +{ + m_children = 0; + m_has_attr_resource = false; + m_has_attr_alias = false; + m_text.clear(); +} + +DomResourcePixmap::~DomResourcePixmap() +{ +} + +void DomResourcePixmap::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("resource")) { + setAttributeResource(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("alias")) { + setAttributeAlias(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomResourcePixmap::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourcepixmap") : tagName.toLower()); + + if (hasAttributeResource()) + writer.writeAttribute(QStringLiteral("resource"), attributeResource()); + + if (hasAttributeAlias()) + writer.writeAttribute(QStringLiteral("alias"), attributeAlias()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + m_has_attr_theme = false; + 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_theme = false; + m_has_attr_resource = false; + m_text.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("theme")) { + setAttributeTheme(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("resource")) { + setAttributeResource(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("normaloff")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementNormalOff(v); + continue; + } + if (tag == QStringLiteral("normalon")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementNormalOn(v); + continue; + } + if (tag == QStringLiteral("disabledoff")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementDisabledOff(v); + continue; + } + if (tag == QStringLiteral("disabledon")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementDisabledOn(v); + continue; + } + if (tag == QStringLiteral("activeoff")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementActiveOff(v); + continue; + } + if (tag == QStringLiteral("activeon")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementActiveOn(v); + continue; + } + if (tag == QStringLiteral("selectedoff")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementSelectedOff(v); + continue; + } + if (tag == QStringLiteral("selectedon")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementSelectedOn(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomResourceIcon::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourceicon") : tagName.toLower()); + + if (hasAttributeTheme()) + writer.writeAttribute(QStringLiteral("theme"), attributeTheme()); + + if (hasAttributeResource()) + writer.writeAttribute(QStringLiteral("resource"), attributeResource()); + + if (m_children & NormalOff) { + m_normalOff->write(writer, QStringLiteral("normaloff")); + } + + if (m_children & NormalOn) { + m_normalOn->write(writer, QStringLiteral("normalon")); + } + + if (m_children & DisabledOff) { + m_disabledOff->write(writer, QStringLiteral("disabledoff")); + } + + if (m_children & DisabledOn) { + m_disabledOn->write(writer, QStringLiteral("disabledon")); + } + + if (m_children & ActiveOff) { + m_activeOff->write(writer, QStringLiteral("activeoff")); + } + + if (m_children & ActiveOn) { + m_activeOn->write(writer, QStringLiteral("activeon")); + } + + if (m_children & SelectedOff) { + m_selectedOff->write(writer, QStringLiteral("selectedoff")); + } + + if (m_children & SelectedOn) { + m_selectedOn->write(writer, QStringLiteral("selectedon")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomResourcePixmap* DomResourceIcon::takeElementNormalOff() +{ + DomResourcePixmap* a = m_normalOff; + m_normalOff = 0; + m_children ^= NormalOff; + return a; +} + +void DomResourceIcon::setElementNormalOff(DomResourcePixmap* a) +{ + delete m_normalOff; + m_children |= NormalOff; + m_normalOff = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementNormalOn() +{ + DomResourcePixmap* a = m_normalOn; + m_normalOn = 0; + m_children ^= NormalOn; + return a; +} + +void DomResourceIcon::setElementNormalOn(DomResourcePixmap* a) +{ + delete m_normalOn; + m_children |= NormalOn; + m_normalOn = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementDisabledOff() +{ + DomResourcePixmap* a = m_disabledOff; + m_disabledOff = 0; + m_children ^= DisabledOff; + return a; +} + +void DomResourceIcon::setElementDisabledOff(DomResourcePixmap* a) +{ + delete m_disabledOff; + m_children |= DisabledOff; + m_disabledOff = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementDisabledOn() +{ + DomResourcePixmap* a = m_disabledOn; + m_disabledOn = 0; + m_children ^= DisabledOn; + return a; +} + +void DomResourceIcon::setElementDisabledOn(DomResourcePixmap* a) +{ + delete m_disabledOn; + m_children |= DisabledOn; + m_disabledOn = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementActiveOff() +{ + DomResourcePixmap* a = m_activeOff; + m_activeOff = 0; + m_children ^= ActiveOff; + return a; +} + +void DomResourceIcon::setElementActiveOff(DomResourcePixmap* a) +{ + delete m_activeOff; + m_children |= ActiveOff; + m_activeOff = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementActiveOn() +{ + DomResourcePixmap* a = m_activeOn; + m_activeOn = 0; + m_children ^= ActiveOn; + return a; +} + +void DomResourceIcon::setElementActiveOn(DomResourcePixmap* a) +{ + delete m_activeOn; + m_children |= ActiveOn; + m_activeOn = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementSelectedOff() +{ + DomResourcePixmap* a = m_selectedOff; + m_selectedOff = 0; + m_children ^= SelectedOff; + return a; +} + +void DomResourceIcon::setElementSelectedOff(DomResourcePixmap* a) +{ + delete m_selectedOff; + m_children |= SelectedOff; + m_selectedOff = a; +} + +DomResourcePixmap* DomResourceIcon::takeElementSelectedOn() +{ + DomResourcePixmap* a = m_selectedOn; + m_selectedOn = 0; + m_children ^= SelectedOn; + return 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.clear(); + m_has_attr_notr = false; + m_has_attr_comment = false; + m_has_attr_extraComment = false; + } + + m_children = 0; +} + +DomString::DomString() +{ + m_children = 0; + m_has_attr_notr = false; + m_has_attr_comment = false; + m_has_attr_extraComment = false; + m_text.clear(); +} + +DomString::~DomString() +{ +} + +void DomString::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("notr")) { + setAttributeNotr(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("comment")) { + setAttributeComment(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("extracomment")) { + setAttributeExtraComment(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomString::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("string") : tagName.toLower()); + + if (hasAttributeNotr()) + writer.writeAttribute(QStringLiteral("notr"), attributeNotr()); + + if (hasAttributeComment()) + writer.writeAttribute(QStringLiteral("comment"), attributeComment()); + + if (hasAttributeExtraComment()) + writer.writeAttribute(QStringLiteral("extracomment"), attributeExtraComment()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomPointF::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QString(QLatin1Char('x'))) { + setElementX(reader.readElementText().toDouble()); + continue; + } + if (tag == QString(QLatin1Char('y'))) { + setElementY(reader.readElementText().toDouble()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomPointF::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("pointf") : tagName.toLower()); + + if (m_children & X) { + writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x, 'f', 15)); + } + + if (m_children & Y) { + writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y, 'f', 15)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QString(QLatin1Char('x'))) { + setElementX(reader.readElementText().toDouble()); + continue; + } + if (tag == QString(QLatin1Char('y'))) { + setElementY(reader.readElementText().toDouble()); + continue; + } + if (tag == QStringLiteral("width")) { + setElementWidth(reader.readElementText().toDouble()); + continue; + } + if (tag == QStringLiteral("height")) { + setElementHeight(reader.readElementText().toDouble()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomRectF::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("rectf") : tagName.toLower()); + + if (m_children & X) { + writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x, 'f', 15)); + } + + if (m_children & Y) { + writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y, 'f', 15)); + } + + if (m_children & Width) { + writer.writeTextElement(QStringLiteral("width"), QString::number(m_width, 'f', 15)); + } + + if (m_children & Height) { + writer.writeTextElement(QStringLiteral("height"), QString::number(m_height, 'f', 15)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + 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(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("width")) { + setElementWidth(reader.readElementText().toDouble()); + continue; + } + if (tag == QStringLiteral("height")) { + setElementHeight(reader.readElementText().toDouble()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomSizeF::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("sizef") : tagName.toLower()); + + if (m_children & Width) { + writer.writeTextElement(QStringLiteral("width"), QString::number(m_width, 'f', 15)); + } + + if (m_children & Height) { + writer.writeTextElement(QStringLiteral("height"), QString::number(m_height, 'f', 15)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + m_children = 0; + m_unicode = 0; +} + +DomChar::DomChar() +{ + m_children = 0; + m_unicode = 0; +} + +DomChar::~DomChar() +{ +} + +void DomChar::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("unicode")) { + setElementUnicode(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomChar::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("char") : tagName.toLower()); + + if (m_children & Unicode) { + writer.writeTextElement(QStringLiteral("unicode"), QString::number(m_unicode)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + } + + m_children = 0; + m_string = 0; +} + +DomUrl::DomUrl() +{ + m_children = 0; + m_string = 0; +} + +DomUrl::~DomUrl() +{ + delete m_string; +} + +void DomUrl::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("string")) { + DomString *v = new DomString(); + v->read(reader); + setElementString(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomUrl::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("url") : tagName.toLower()); + + if (m_children & String) { + m_string->write(writer, QStringLiteral("string")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +DomString* DomUrl::takeElementString() +{ + DomString* a = m_string; + m_string = 0; + m_children ^= String; + return a; +} + +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.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("stdset")) { + setAttributeStdset(attribute.value().toString().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("bool")) { + setElementBool(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("color")) { + DomColor *v = new DomColor(); + v->read(reader); + setElementColor(v); + continue; + } + if (tag == QStringLiteral("cstring")) { + setElementCstring(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("cursor")) { + setElementCursor(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("cursorshape")) { + setElementCursorShape(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("enum")) { + setElementEnum(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("font")) { + DomFont *v = new DomFont(); + v->read(reader); + setElementFont(v); + continue; + } + if (tag == QStringLiteral("iconset")) { + DomResourceIcon *v = new DomResourceIcon(); + v->read(reader); + setElementIconSet(v); + continue; + } + if (tag == QStringLiteral("pixmap")) { + DomResourcePixmap *v = new DomResourcePixmap(); + v->read(reader); + setElementPixmap(v); + continue; + } + if (tag == QStringLiteral("palette")) { + DomPalette *v = new DomPalette(); + v->read(reader); + setElementPalette(v); + continue; + } + if (tag == QStringLiteral("point")) { + DomPoint *v = new DomPoint(); + v->read(reader); + setElementPoint(v); + continue; + } + if (tag == QStringLiteral("rect")) { + DomRect *v = new DomRect(); + v->read(reader); + setElementRect(v); + continue; + } + if (tag == QStringLiteral("set")) { + setElementSet(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("locale")) { + DomLocale *v = new DomLocale(); + v->read(reader); + setElementLocale(v); + continue; + } + if (tag == QStringLiteral("sizepolicy")) { + DomSizePolicy *v = new DomSizePolicy(); + v->read(reader); + setElementSizePolicy(v); + continue; + } + if (tag == QStringLiteral("size")) { + DomSize *v = new DomSize(); + v->read(reader); + setElementSize(v); + continue; + } + if (tag == QStringLiteral("string")) { + DomString *v = new DomString(); + v->read(reader); + setElementString(v); + continue; + } + if (tag == QStringLiteral("stringlist")) { + DomStringList *v = new DomStringList(); + v->read(reader); + setElementStringList(v); + continue; + } + if (tag == QStringLiteral("number")) { + setElementNumber(reader.readElementText().toInt()); + continue; + } + if (tag == QStringLiteral("float")) { + setElementFloat(reader.readElementText().toFloat()); + continue; + } + if (tag == QStringLiteral("double")) { + setElementDouble(reader.readElementText().toDouble()); + continue; + } + if (tag == QStringLiteral("date")) { + DomDate *v = new DomDate(); + v->read(reader); + setElementDate(v); + continue; + } + if (tag == QStringLiteral("time")) { + DomTime *v = new DomTime(); + v->read(reader); + setElementTime(v); + continue; + } + if (tag == QStringLiteral("datetime")) { + DomDateTime *v = new DomDateTime(); + v->read(reader); + setElementDateTime(v); + continue; + } + if (tag == QStringLiteral("pointf")) { + DomPointF *v = new DomPointF(); + v->read(reader); + setElementPointF(v); + continue; + } + if (tag == QStringLiteral("rectf")) { + DomRectF *v = new DomRectF(); + v->read(reader); + setElementRectF(v); + continue; + } + if (tag == QStringLiteral("sizef")) { + DomSizeF *v = new DomSizeF(); + v->read(reader); + setElementSizeF(v); + continue; + } + if (tag == QStringLiteral("longlong")) { + setElementLongLong(reader.readElementText().toLongLong()); + continue; + } + if (tag == QStringLiteral("char")) { + DomChar *v = new DomChar(); + v->read(reader); + setElementChar(v); + continue; + } + if (tag == QStringLiteral("url")) { + DomUrl *v = new DomUrl(); + v->read(reader); + setElementUrl(v); + continue; + } + if (tag == QStringLiteral("uint")) { + setElementUInt(reader.readElementText().toUInt()); + continue; + } + if (tag == QStringLiteral("ulonglong")) { + setElementULongLong(reader.readElementText().toULongLong()); + continue; + } + if (tag == QStringLiteral("brush")) { + DomBrush *v = new DomBrush(); + v->read(reader); + setElementBrush(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomProperty::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("property") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (hasAttributeStdset()) + writer.writeAttribute(QStringLiteral("stdset"), QString::number(attributeStdset())); + + switch (kind()) { + case Bool: { + writer.writeTextElement(QStringLiteral("bool"), elementBool()); + break; + } + case Color: { + DomColor* v = elementColor(); + if (v != 0) { + v->write(writer, QStringLiteral("color")); + } + break; + } + case Cstring: { + writer.writeTextElement(QStringLiteral("cstring"), elementCstring()); + break; + } + case Cursor: { + writer.writeTextElement(QStringLiteral("cursor"), QString::number(elementCursor())); + break; + } + case CursorShape: { + writer.writeTextElement(QStringLiteral("cursorShape"), elementCursorShape()); + break; + } + case Enum: { + writer.writeTextElement(QStringLiteral("enum"), elementEnum()); + break; + } + case Font: { + DomFont* v = elementFont(); + if (v != 0) { + v->write(writer, QStringLiteral("font")); + } + break; + } + case IconSet: { + DomResourceIcon* v = elementIconSet(); + if (v != 0) { + v->write(writer, QStringLiteral("iconset")); + } + break; + } + case Pixmap: { + DomResourcePixmap* v = elementPixmap(); + if (v != 0) { + v->write(writer, QStringLiteral("pixmap")); + } + break; + } + case Palette: { + DomPalette* v = elementPalette(); + if (v != 0) { + v->write(writer, QStringLiteral("palette")); + } + break; + } + case Point: { + DomPoint* v = elementPoint(); + if (v != 0) { + v->write(writer, QStringLiteral("point")); + } + break; + } + case Rect: { + DomRect* v = elementRect(); + if (v != 0) { + v->write(writer, QStringLiteral("rect")); + } + break; + } + case Set: { + writer.writeTextElement(QStringLiteral("set"), elementSet()); + break; + } + case Locale: { + DomLocale* v = elementLocale(); + if (v != 0) { + v->write(writer, QStringLiteral("locale")); + } + break; + } + case SizePolicy: { + DomSizePolicy* v = elementSizePolicy(); + if (v != 0) { + v->write(writer, QStringLiteral("sizepolicy")); + } + break; + } + case Size: { + DomSize* v = elementSize(); + if (v != 0) { + v->write(writer, QStringLiteral("size")); + } + break; + } + case String: { + DomString* v = elementString(); + if (v != 0) { + v->write(writer, QStringLiteral("string")); + } + break; + } + case StringList: { + DomStringList* v = elementStringList(); + if (v != 0) { + v->write(writer, QStringLiteral("stringlist")); + } + break; + } + case Number: { + writer.writeTextElement(QStringLiteral("number"), QString::number(elementNumber())); + break; + } + case Float: { + writer.writeTextElement(QStringLiteral("float"), QString::number(elementFloat(), 'f', 8)); + break; + } + case Double: { + writer.writeTextElement(QStringLiteral("double"), QString::number(elementDouble(), 'f', 15)); + break; + } + case Date: { + DomDate* v = elementDate(); + if (v != 0) { + v->write(writer, QStringLiteral("date")); + } + break; + } + case Time: { + DomTime* v = elementTime(); + if (v != 0) { + v->write(writer, QStringLiteral("time")); + } + break; + } + case DateTime: { + DomDateTime* v = elementDateTime(); + if (v != 0) { + v->write(writer, QStringLiteral("datetime")); + } + break; + } + case PointF: { + DomPointF* v = elementPointF(); + if (v != 0) { + v->write(writer, QStringLiteral("pointf")); + } + break; + } + case RectF: { + DomRectF* v = elementRectF(); + if (v != 0) { + v->write(writer, QStringLiteral("rectf")); + } + break; + } + case SizeF: { + DomSizeF* v = elementSizeF(); + if (v != 0) { + v->write(writer, QStringLiteral("sizef")); + } + break; + } + case LongLong: { + writer.writeTextElement(QStringLiteral("longLong"), QString::number(elementLongLong())); + break; + } + case Char: { + DomChar* v = elementChar(); + if (v != 0) { + v->write(writer, QStringLiteral("char")); + } + break; + } + case Url: { + DomUrl* v = elementUrl(); + if (v != 0) { + v->write(writer, QStringLiteral("url")); + } + break; + } + case UInt: { + writer.writeTextElement(QStringLiteral("UInt"), QString::number(elementUInt())); + break; + } + case ULongLong: { + writer.writeTextElement(QStringLiteral("uLongLong"), QString::number(elementULongLong())); + break; + } + case Brush: { + DomBrush* v = elementBrush(); + if (v != 0) { + v->write(writer, QStringLiteral("brush")); + } + break; + } + default: + break; + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomProperty::setElementBool(const QString& a) +{ + clear(false); + m_kind = Bool; + m_bool = a; +} + +DomColor* DomProperty::takeElementColor() +{ + DomColor* a = m_color; + m_color = 0; + return 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; +} + +DomFont* DomProperty::takeElementFont() +{ + DomFont* a = m_font; + m_font = 0; + return a; +} + +void DomProperty::setElementFont(DomFont* a) +{ + clear(false); + m_kind = Font; + m_font = a; +} + +DomResourceIcon* DomProperty::takeElementIconSet() +{ + DomResourceIcon* a = m_iconSet; + m_iconSet = 0; + return a; +} + +void DomProperty::setElementIconSet(DomResourceIcon* a) +{ + clear(false); + m_kind = IconSet; + m_iconSet = a; +} + +DomResourcePixmap* DomProperty::takeElementPixmap() +{ + DomResourcePixmap* a = m_pixmap; + m_pixmap = 0; + return a; +} + +void DomProperty::setElementPixmap(DomResourcePixmap* a) +{ + clear(false); + m_kind = Pixmap; + m_pixmap = a; +} + +DomPalette* DomProperty::takeElementPalette() +{ + DomPalette* a = m_palette; + m_palette = 0; + return a; +} + +void DomProperty::setElementPalette(DomPalette* a) +{ + clear(false); + m_kind = Palette; + m_palette = a; +} + +DomPoint* DomProperty::takeElementPoint() +{ + DomPoint* a = m_point; + m_point = 0; + return a; +} + +void DomProperty::setElementPoint(DomPoint* a) +{ + clear(false); + m_kind = Point; + m_point = a; +} + +DomRect* DomProperty::takeElementRect() +{ + DomRect* a = m_rect; + m_rect = 0; + return 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; +} + +DomLocale* DomProperty::takeElementLocale() +{ + DomLocale* a = m_locale; + m_locale = 0; + return a; +} + +void DomProperty::setElementLocale(DomLocale* a) +{ + clear(false); + m_kind = Locale; + m_locale = a; +} + +DomSizePolicy* DomProperty::takeElementSizePolicy() +{ + DomSizePolicy* a = m_sizePolicy; + m_sizePolicy = 0; + return a; +} + +void DomProperty::setElementSizePolicy(DomSizePolicy* a) +{ + clear(false); + m_kind = SizePolicy; + m_sizePolicy = a; +} + +DomSize* DomProperty::takeElementSize() +{ + DomSize* a = m_size; + m_size = 0; + return a; +} + +void DomProperty::setElementSize(DomSize* a) +{ + clear(false); + m_kind = Size; + m_size = a; +} + +DomString* DomProperty::takeElementString() +{ + DomString* a = m_string; + m_string = 0; + return a; +} + +void DomProperty::setElementString(DomString* a) +{ + clear(false); + m_kind = String; + m_string = a; +} + +DomStringList* DomProperty::takeElementStringList() +{ + DomStringList* a = m_stringList; + m_stringList = 0; + return 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; +} + +DomDate* DomProperty::takeElementDate() +{ + DomDate* a = m_date; + m_date = 0; + return a; +} + +void DomProperty::setElementDate(DomDate* a) +{ + clear(false); + m_kind = Date; + m_date = a; +} + +DomTime* DomProperty::takeElementTime() +{ + DomTime* a = m_time; + m_time = 0; + return a; +} + +void DomProperty::setElementTime(DomTime* a) +{ + clear(false); + m_kind = Time; + m_time = a; +} + +DomDateTime* DomProperty::takeElementDateTime() +{ + DomDateTime* a = m_dateTime; + m_dateTime = 0; + return a; +} + +void DomProperty::setElementDateTime(DomDateTime* a) +{ + clear(false); + m_kind = DateTime; + m_dateTime = a; +} + +DomPointF* DomProperty::takeElementPointF() +{ + DomPointF* a = m_pointF; + m_pointF = 0; + return a; +} + +void DomProperty::setElementPointF(DomPointF* a) +{ + clear(false); + m_kind = PointF; + m_pointF = a; +} + +DomRectF* DomProperty::takeElementRectF() +{ + DomRectF* a = m_rectF; + m_rectF = 0; + return a; +} + +void DomProperty::setElementRectF(DomRectF* a) +{ + clear(false); + m_kind = RectF; + m_rectF = a; +} + +DomSizeF* DomProperty::takeElementSizeF() +{ + DomSizeF* a = m_sizeF; + m_sizeF = 0; + return 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; +} + +DomChar* DomProperty::takeElementChar() +{ + DomChar* a = m_char; + m_char = 0; + return a; +} + +void DomProperty::setElementChar(DomChar* a) +{ + clear(false); + m_kind = Char; + m_char = a; +} + +DomUrl* DomProperty::takeElementUrl() +{ + DomUrl* a = m_url; + m_url = 0; + return 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; +} + +DomBrush* DomProperty::takeElementBrush() +{ + DomBrush* a = m_brush; + m_brush = 0; + return a; +} + +void DomProperty::setElementBrush(DomBrush* a) +{ + clear(false); + m_kind = Brush; + m_brush = a; +} + +void DomConnections::clear(bool clear_all) +{ + qDeleteAll(m_connection); + m_connection.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomConnections::DomConnections() +{ + m_children = 0; +} + +DomConnections::~DomConnections() +{ + qDeleteAll(m_connection); + m_connection.clear(); +} + +void DomConnections::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("connection")) { + DomConnection *v = new DomConnection(); + v->read(reader); + m_connection.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomConnections::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connections") : tagName.toLower()); + + for (int i = 0; i < m_connection.size(); ++i) { + DomConnection* v = m_connection[i]; + v->write(writer, QStringLiteral("connection")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomConnections::setElementConnection(const QList& a) +{ + m_children |= Connection; + m_connection = a; +} + +void DomConnection::clear(bool clear_all) +{ + delete m_hints; + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; + m_hints = 0; +} + +DomConnection::DomConnection() +{ + m_children = 0; + m_hints = 0; +} + +DomConnection::~DomConnection() +{ + delete m_hints; +} + +void DomConnection::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("sender")) { + setElementSender(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("signal")) { + setElementSignal(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("receiver")) { + setElementReceiver(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("slot")) { + setElementSlot(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("hints")) { + DomConnectionHints *v = new DomConnectionHints(); + v->read(reader); + setElementHints(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomConnection::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connection") : tagName.toLower()); + + if (m_children & Sender) { + writer.writeTextElement(QStringLiteral("sender"), m_sender); + } + + if (m_children & Signal) { + writer.writeTextElement(QStringLiteral("signal"), m_signal); + } + + if (m_children & Receiver) { + writer.writeTextElement(QStringLiteral("receiver"), m_receiver); + } + + if (m_children & Slot) { + writer.writeTextElement(QStringLiteral("slot"), m_slot); + } + + if (m_children & Hints) { + m_hints->write(writer, QStringLiteral("hints")); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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; +} + +DomConnectionHints* DomConnection::takeElementHints() +{ + DomConnectionHints* a = m_hints; + m_hints = 0; + m_children ^= Hints; + return 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) +{ + qDeleteAll(m_hint); + m_hint.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomConnectionHints::DomConnectionHints() +{ + m_children = 0; +} + +DomConnectionHints::~DomConnectionHints() +{ + qDeleteAll(m_hint); + m_hint.clear(); +} + +void DomConnectionHints::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("hint")) { + DomConnectionHint *v = new DomConnectionHint(); + v->read(reader); + m_hint.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomConnectionHints::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connectionhints") : tagName.toLower()); + + for (int i = 0; i < m_hint.size(); ++i) { + DomConnectionHint* v = m_hint[i]; + v->write(writer, QStringLiteral("hint")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomConnectionHints::setElementHint(const QList& a) +{ + m_children |= Hint; + m_hint = a; +} + +void DomConnectionHint::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + 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(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("type")) { + setAttributeType(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QString(QLatin1Char('x'))) { + setElementX(reader.readElementText().toInt()); + continue; + } + if (tag == QString(QLatin1Char('y'))) { + setElementY(reader.readElementText().toInt()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomConnectionHint::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("connectionhint") : tagName.toLower()); + + if (hasAttributeType()) + writer.writeAttribute(QStringLiteral("type"), attributeType()); + + if (m_children & X) { + writer.writeTextElement(QString(QLatin1Char('x')), QString::number(m_x)); + } + + if (m_children & Y) { + writer.writeTextElement(QString(QLatin1Char('y')), QString::number(m_y)); + } + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +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.clear(); + m_has_attr_source = false; + m_has_attr_language = false; + } + + m_children = 0; +} + +DomScript::DomScript() +{ + m_children = 0; + m_has_attr_source = false; + m_has_attr_language = false; +} + +DomScript::~DomScript() +{ +} + +void DomScript::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("source")) { + setAttributeSource(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("language")) { + setAttributeLanguage(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomScript::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("script") : tagName.toLower()); + + if (hasAttributeSource()) + writer.writeAttribute(QStringLiteral("source"), attributeSource()); + + if (hasAttributeLanguage()) + writer.writeAttribute(QStringLiteral("language"), attributeLanguage()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomWidgetData::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomWidgetData::DomWidgetData() +{ + m_children = 0; +} + +DomWidgetData::~DomWidgetData() +{ + qDeleteAll(m_property); + m_property.clear(); +} + +void DomWidgetData::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomWidgetData::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("widgetdata") : tagName.toLower()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomWidgetData::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomDesignerData::clear(bool clear_all) +{ + qDeleteAll(m_property); + m_property.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomDesignerData::DomDesignerData() +{ + m_children = 0; +} + +DomDesignerData::~DomDesignerData() +{ + qDeleteAll(m_property); + m_property.clear(); +} + +void DomDesignerData::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("property")) { + DomProperty *v = new DomProperty(); + v->read(reader); + m_property.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomDesignerData::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("designerdata") : tagName.toLower()); + + for (int i = 0; i < m_property.size(); ++i) { + DomProperty* v = m_property[i]; + v->write(writer, QStringLiteral("property")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomDesignerData::setElementProperty(const QList& a) +{ + m_children |= Property; + m_property = a; +} + +void DomSlots::clear(bool clear_all) +{ + m_signal.clear(); + m_slot.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomSlots::DomSlots() +{ + m_children = 0; +} + +DomSlots::~DomSlots() +{ + m_signal.clear(); + m_slot.clear(); +} + +void DomSlots::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("signal")) { + m_signal.append(reader.readElementText()); + continue; + } + if (tag == QStringLiteral("slot")) { + m_slot.append(reader.readElementText()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomSlots::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("slots") : tagName.toLower()); + + for (int i = 0; i < m_signal.size(); ++i) { + QString v = m_signal[i]; + writer.writeTextElement(QStringLiteral("signal"), v); + } + for (int i = 0; i < m_slot.size(); ++i) { + QString v = m_slot[i]; + writer.writeTextElement(QStringLiteral("slot"), v); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomSlots::setElementSignal(const QStringList& a) +{ + m_children |= Signal; + m_signal = a; +} + +void DomSlots::setElementSlot(const QStringList& a) +{ + m_children |= Slot; + m_slot = a; +} + +void DomPropertySpecifications::clear(bool clear_all) +{ + qDeleteAll(m_stringpropertyspecification); + m_stringpropertyspecification.clear(); + + if (clear_all) { + m_text.clear(); + } + + m_children = 0; +} + +DomPropertySpecifications::DomPropertySpecifications() +{ + m_children = 0; +} + +DomPropertySpecifications::~DomPropertySpecifications() +{ + qDeleteAll(m_stringpropertyspecification); + m_stringpropertyspecification.clear(); +} + +void DomPropertySpecifications::read(QXmlStreamReader &reader) +{ + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + if (tag == QStringLiteral("stringpropertyspecification")) { + DomStringPropertySpecification *v = new DomStringPropertySpecification(); + v->read(reader); + m_stringpropertyspecification.append(v); + continue; + } + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomPropertySpecifications::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("propertyspecifications") : tagName.toLower()); + + for (int i = 0; i < m_stringpropertyspecification.size(); ++i) { + DomStringPropertySpecification* v = m_stringpropertyspecification[i]; + v->write(writer, QStringLiteral("stringpropertyspecification")); + } + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +void DomPropertySpecifications::setElementStringpropertyspecification(const QList& a) +{ + m_children |= Stringpropertyspecification; + m_stringpropertyspecification = a; +} + +void DomStringPropertySpecification::clear(bool clear_all) +{ + + if (clear_all) { + m_text.clear(); + m_has_attr_name = false; + m_has_attr_type = false; + m_has_attr_notr = false; + } + + m_children = 0; +} + +DomStringPropertySpecification::DomStringPropertySpecification() +{ + m_children = 0; + m_has_attr_name = false; + m_has_attr_type = false; + m_has_attr_notr = false; +} + +DomStringPropertySpecification::~DomStringPropertySpecification() +{ +} + +void DomStringPropertySpecification::read(QXmlStreamReader &reader) +{ + + foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { + QStringRef name = attribute.name(); + if (name == QStringLiteral("name")) { + setAttributeName(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("type")) { + setAttributeType(attribute.value().toString()); + continue; + } + if (name == QStringLiteral("notr")) { + setAttributeNotr(attribute.value().toString()); + continue; + } + reader.raiseError(QStringLiteral("Unexpected attribute ") + name.toString()); + } + + for (bool finished = false; !finished && !reader.hasError();) { + switch (reader.readNext()) { + case QXmlStreamReader::StartElement : { + const QString tag = reader.name().toString().toLower(); + reader.raiseError(QStringLiteral("Unexpected element ") + tag); + } + break; + case QXmlStreamReader::EndElement : + finished = true; + break; + case QXmlStreamReader::Characters : + if (!reader.isWhitespace()) + m_text.append(reader.text().toString()); + break; + default : + break; + } + } +} + +void DomStringPropertySpecification::write(QXmlStreamWriter &writer, const QString &tagName) const +{ + writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("stringpropertyspecification") : tagName.toLower()); + + if (hasAttributeName()) + writer.writeAttribute(QStringLiteral("name"), attributeName()); + + if (hasAttributeType()) + writer.writeAttribute(QStringLiteral("type"), attributeType()); + + if (hasAttributeNotr()) + writer.writeAttribute(QStringLiteral("notr"), attributeNotr()); + + if (!m_text.isEmpty()) + writer.writeCharacters(m_text); + + writer.writeEndElement(); +} + +QT_END_NAMESPACE + diff --git a/src/designer/src/lib/uilib/ui4_p.h b/src/designer/src/lib/uilib/ui4_p.h new file mode 100644 index 000000000..6a56c9ead --- /dev/null +++ b/src/designer/src/lib/uilib/ui4_p.h @@ -0,0 +1,3603 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// +// 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 +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#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 DomButtonGroup; +class DomButtonGroups; +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; +class DomPropertySpecifications; +class DomStringPropertySpecification; + +/******************************************************************************* +** Declarations +*/ + +class QDESIGNER_UILIB_EXPORT DomUI { +public: + DomUI(); + ~DomUI(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 hasAttributeDisplayname() const { return m_has_attr_displayname; } + inline QString attributeDisplayname() const { return m_attr_displayname; } + inline void setAttributeDisplayname(const QString& a) { m_attr_displayname = a; m_has_attr_displayname = true; } + inline void clearAttributeDisplayname() { m_has_attr_displayname = 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; } + + 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; } + DomWidget* takeElementWidget(); + void setElementWidget(DomWidget* a); + inline bool hasElementWidget() const { return m_children & Widget; } + void clearElementWidget(); + + inline DomLayoutDefault* elementLayoutDefault() const { return m_layoutDefault; } + DomLayoutDefault* takeElementLayoutDefault(); + void setElementLayoutDefault(DomLayoutDefault* a); + inline bool hasElementLayoutDefault() const { return m_children & LayoutDefault; } + void clearElementLayoutDefault(); + + inline DomLayoutFunction* elementLayoutFunction() const { return m_layoutFunction; } + DomLayoutFunction* takeElementLayoutFunction(); + 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; } + DomCustomWidgets* takeElementCustomWidgets(); + void setElementCustomWidgets(DomCustomWidgets* a); + inline bool hasElementCustomWidgets() const { return m_children & CustomWidgets; } + void clearElementCustomWidgets(); + + inline DomTabStops* elementTabStops() const { return m_tabStops; } + DomTabStops* takeElementTabStops(); + void setElementTabStops(DomTabStops* a); + inline bool hasElementTabStops() const { return m_children & TabStops; } + void clearElementTabStops(); + + inline DomImages* elementImages() const { return m_images; } + DomImages* takeElementImages(); + void setElementImages(DomImages* a); + inline bool hasElementImages() const { return m_children & Images; } + void clearElementImages(); + + inline DomIncludes* elementIncludes() const { return m_includes; } + DomIncludes* takeElementIncludes(); + void setElementIncludes(DomIncludes* a); + inline bool hasElementIncludes() const { return m_children & Includes; } + void clearElementIncludes(); + + inline DomResources* elementResources() const { return m_resources; } + DomResources* takeElementResources(); + void setElementResources(DomResources* a); + inline bool hasElementResources() const { return m_children & Resources; } + void clearElementResources(); + + inline DomConnections* elementConnections() const { return m_connections; } + DomConnections* takeElementConnections(); + void setElementConnections(DomConnections* a); + inline bool hasElementConnections() const { return m_children & Connections; } + void clearElementConnections(); + + inline DomDesignerData* elementDesignerdata() const { return m_designerdata; } + DomDesignerData* takeElementDesignerdata(); + void setElementDesignerdata(DomDesignerData* a); + inline bool hasElementDesignerdata() const { return m_children & Designerdata; } + void clearElementDesignerdata(); + + inline DomSlots* elementSlots() const { return m_slots; } + DomSlots* takeElementSlots(); + void setElementSlots(DomSlots* a); + inline bool hasElementSlots() const { return m_children & Slots; } + void clearElementSlots(); + + inline DomButtonGroups* elementButtonGroups() const { return m_buttonGroups; } + DomButtonGroups* takeElementButtonGroups(); + void setElementButtonGroups(DomButtonGroups* a); + inline bool hasElementButtonGroups() const { return m_children & ButtonGroups; } + void clearElementButtonGroups(); + +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; + + QString m_attr_displayname; + bool m_has_attr_displayname; + + int m_attr_stdsetdef; + bool m_has_attr_stdsetdef; + + 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; + DomButtonGroups* m_buttonGroups; + 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, + ButtonGroups = 65536 + }; + + DomUI(const DomUI &other); + void operator = (const DomUI&other); +}; + +class QDESIGNER_UILIB_EXPORT DomIncludes { +public: + DomIncludes(); + ~DomIncludes(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementInclude() const { return m_include; } + void setElementInclude(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_include; + enum Child { + Include = 1 + }; + + DomIncludes(const DomIncludes &other); + void operator = (const DomIncludes&other); +}; + +class QDESIGNER_UILIB_EXPORT DomInclude { +public: + DomInclude(); + ~DomInclude(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomInclude(const DomInclude &other); + void operator = (const DomInclude&other); +}; + +class QDESIGNER_UILIB_EXPORT DomResources { +public: + DomResources(); + ~DomResources(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementInclude() const { return m_include; } + void setElementInclude(const QList& 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 + uint m_children; + QList m_include; + enum Child { + Include = 1 + }; + + DomResources(const DomResources &other); + void operator = (const DomResources&other); +}; + +class QDESIGNER_UILIB_EXPORT DomResource { +public: + DomResource(); + ~DomResource(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomResource(const DomResource &other); + void operator = (const DomResource&other); +}; + +class QDESIGNER_UILIB_EXPORT DomActionGroup { +public: + DomActionGroup(); + ~DomActionGroup(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementAction() const { return m_action; } + void setElementAction(const QList& a); + + inline QList elementActionGroup() const { return m_actionGroup; } + void setElementActionGroup(const QList& a); + + inline QList elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + + inline QList elementAttribute() const { return m_attribute; } + void setElementAttribute(const QList& 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 + uint m_children; + QList m_action; + QList m_actionGroup; + QList m_property; + QList m_attribute; + enum Child { + Action = 1, + ActionGroup = 2, + Property = 4, + Attribute = 8 + }; + + DomActionGroup(const DomActionGroup &other); + void operator = (const DomActionGroup&other); +}; + +class QDESIGNER_UILIB_EXPORT DomAction { +public: + DomAction(); + ~DomAction(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + + inline QList elementAttribute() const { return m_attribute; } + void setElementAttribute(const QList& 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 + uint m_children; + QList m_property; + QList m_attribute; + enum Child { + Property = 1, + Attribute = 2 + }; + + DomAction(const DomAction &other); + void operator = (const DomAction&other); +}; + +class QDESIGNER_UILIB_EXPORT DomActionRef { +public: + DomActionRef(); + ~DomActionRef(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomActionRef(const DomActionRef &other); + void operator = (const DomActionRef&other); +}; + +class QDESIGNER_UILIB_EXPORT DomButtonGroup { +public: + DomButtonGroup(); + ~DomButtonGroup(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + + inline QList elementAttribute() const { return m_attribute; } + void setElementAttribute(const QList& 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 + uint m_children; + QList m_property; + QList m_attribute; + enum Child { + Property = 1, + Attribute = 2 + }; + + DomButtonGroup(const DomButtonGroup &other); + void operator = (const DomButtonGroup&other); +}; + +class QDESIGNER_UILIB_EXPORT DomButtonGroups { +public: + DomButtonGroups(); + ~DomButtonGroups(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementButtonGroup() const { return m_buttonGroup; } + void setElementButtonGroup(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_buttonGroup; + enum Child { + ButtonGroup = 1 + }; + + DomButtonGroups(const DomButtonGroups &other); + void operator = (const DomButtonGroups&other); +}; + +class QDESIGNER_UILIB_EXPORT DomImages { +public: + DomImages(); + ~DomImages(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementImage() const { return m_image; } + void setElementImage(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_image; + enum Child { + Image = 1 + }; + + DomImages(const DomImages &other); + void operator = (const DomImages&other); +}; + +class QDESIGNER_UILIB_EXPORT DomImage { +public: + DomImage(); + ~DomImage(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomImageData* takeElementData(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomImageData(const DomImageData &other); + void operator = (const DomImageData&other); +}; + +class QDESIGNER_UILIB_EXPORT DomCustomWidgets { +public: + DomCustomWidgets(); + ~DomCustomWidgets(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementCustomWidget() const { return m_customWidget; } + void setElementCustomWidget(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_customWidget; + enum Child { + CustomWidget = 1 + }; + + DomCustomWidgets(const DomCustomWidgets &other); + void operator = (const DomCustomWidgets&other); +}; + +class QDESIGNER_UILIB_EXPORT DomHeader { +public: + DomHeader(); + ~DomHeader(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomHeader(const DomHeader &other); + void operator = (const DomHeader&other); +}; + +class QDESIGNER_UILIB_EXPORT DomCustomWidget { +public: + DomCustomWidget(); + ~DomCustomWidget(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomHeader* takeElementHeader(); + void setElementHeader(DomHeader* a); + inline bool hasElementHeader() const { return m_children & Header; } + void clearElementHeader(); + + inline DomSize* elementSizeHint() const { return m_sizeHint; } + DomSize* takeElementSizeHint(); + 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; } + DomSizePolicyData* takeElementSizePolicy(); + 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; } + DomScript* takeElementScript(); + void setElementScript(DomScript* a); + inline bool hasElementScript() const { return m_children & Script; } + void clearElementScript(); + + inline DomProperties* elementProperties() const { return m_properties; } + DomProperties* takeElementProperties(); + void setElementProperties(DomProperties* a); + inline bool hasElementProperties() const { return m_children & Properties; } + void clearElementProperties(); + + inline DomSlots* elementSlots() const { return m_slots; } + DomSlots* takeElementSlots(); + void setElementSlots(DomSlots* a); + inline bool hasElementSlots() const { return m_children & Slots; } + void clearElementSlots(); + + inline DomPropertySpecifications* elementPropertyspecifications() const { return m_propertyspecifications; } + DomPropertySpecifications* takeElementPropertyspecifications(); + void setElementPropertyspecifications(DomPropertySpecifications* a); + inline bool hasElementPropertyspecifications() const { return m_children & Propertyspecifications; } + void clearElementPropertyspecifications(); + +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; + DomPropertySpecifications* m_propertyspecifications; + enum Child { + Class = 1, + Extends = 2, + Header = 4, + SizeHint = 8, + AddPageMethod = 16, + Container = 32, + SizePolicy = 64, + Pixmap = 128, + Script = 256, + Properties = 512, + Slots = 1024, + Propertyspecifications = 2048 + }; + + DomCustomWidget(const DomCustomWidget &other); + void operator = (const DomCustomWidget&other); +}; + +class QDESIGNER_UILIB_EXPORT DomProperties { +public: + DomProperties(); + ~DomProperties(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_property; + enum Child { + Property = 1 + }; + + DomProperties(const DomProperties &other); + void operator = (const DomProperties&other); +}; + +class QDESIGNER_UILIB_EXPORT DomPropertyData { +public: + DomPropertyData(); + ~DomPropertyData(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomPropertyData(const DomPropertyData &other); + void operator = (const DomPropertyData&other); +}; + +class QDESIGNER_UILIB_EXPORT DomSizePolicyData { +public: + DomSizePolicyData(); + ~DomSizePolicyData(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomLayoutDefault(const DomLayoutDefault &other); + void operator = (const DomLayoutDefault&other); +}; + +class QDESIGNER_UILIB_EXPORT DomLayoutFunction { +public: + DomLayoutFunction(); + ~DomLayoutFunction(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomLayoutFunction(const DomLayoutFunction &other); + void operator = (const DomLayoutFunction&other); +}; + +class QDESIGNER_UILIB_EXPORT DomTabStops { +public: + DomTabStops(); + ~DomTabStops(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + QStringList m_tabStop; + enum Child { + TabStop = 1 + }; + + DomTabStops(const DomTabStops &other); + void operator = (const DomTabStops&other); +}; + +class QDESIGNER_UILIB_EXPORT DomLayout { +public: + DomLayout(); + ~DomLayout(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 hasAttributeStretch() const { return m_has_attr_stretch; } + inline QString attributeStretch() const { return m_attr_stretch; } + inline void setAttributeStretch(const QString& a) { m_attr_stretch = a; m_has_attr_stretch = true; } + inline void clearAttributeStretch() { m_has_attr_stretch = false; } + + inline bool hasAttributeRowStretch() const { return m_has_attr_rowStretch; } + inline QString attributeRowStretch() const { return m_attr_rowStretch; } + inline void setAttributeRowStretch(const QString& a) { m_attr_rowStretch = a; m_has_attr_rowStretch = true; } + inline void clearAttributeRowStretch() { m_has_attr_rowStretch = false; } + + inline bool hasAttributeColumnStretch() const { return m_has_attr_columnStretch; } + inline QString attributeColumnStretch() const { return m_attr_columnStretch; } + inline void setAttributeColumnStretch(const QString& a) { m_attr_columnStretch = a; m_has_attr_columnStretch = true; } + inline void clearAttributeColumnStretch() { m_has_attr_columnStretch = false; } + + inline bool hasAttributeRowMinimumHeight() const { return m_has_attr_rowMinimumHeight; } + inline QString attributeRowMinimumHeight() const { return m_attr_rowMinimumHeight; } + inline void setAttributeRowMinimumHeight(const QString& a) { m_attr_rowMinimumHeight = a; m_has_attr_rowMinimumHeight = true; } + inline void clearAttributeRowMinimumHeight() { m_has_attr_rowMinimumHeight = false; } + + inline bool hasAttributeColumnMinimumWidth() const { return m_has_attr_columnMinimumWidth; } + inline QString attributeColumnMinimumWidth() const { return m_attr_columnMinimumWidth; } + inline void setAttributeColumnMinimumWidth(const QString& a) { m_attr_columnMinimumWidth = a; m_has_attr_columnMinimumWidth = true; } + inline void clearAttributeColumnMinimumWidth() { m_has_attr_columnMinimumWidth = false; } + + // child element accessors + inline QList elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + + inline QList elementAttribute() const { return m_attribute; } + void setElementAttribute(const QList& a); + + inline QList elementItem() const { return m_item; } + void setElementItem(const QList& 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; + + QString m_attr_stretch; + bool m_has_attr_stretch; + + QString m_attr_rowStretch; + bool m_has_attr_rowStretch; + + QString m_attr_columnStretch; + bool m_has_attr_columnStretch; + + QString m_attr_rowMinimumHeight; + bool m_has_attr_rowMinimumHeight; + + QString m_attr_columnMinimumWidth; + bool m_has_attr_columnMinimumWidth; + + // child element data + uint m_children; + QList m_property; + QList m_attribute; + QList m_item; + enum Child { + Property = 1, + Attribute = 2, + Item = 4 + }; + + DomLayout(const DomLayout &other); + void operator = (const DomLayout&other); +}; + +class QDESIGNER_UILIB_EXPORT DomLayoutItem { +public: + DomLayoutItem(); + ~DomLayoutItem(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + + inline bool hasAttributeAlignment() const { return m_has_attr_alignment; } + inline QString attributeAlignment() const { return m_attr_alignment; } + inline void setAttributeAlignment(const QString& a) { m_attr_alignment = a; m_has_attr_alignment = true; } + inline void clearAttributeAlignment() { m_has_attr_alignment = 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; } + DomWidget* takeElementWidget(); + void setElementWidget(DomWidget* a); + + inline DomLayout* elementLayout() const { return m_layout; } + DomLayout* takeElementLayout(); + void setElementLayout(DomLayout* a); + + inline DomSpacer* elementSpacer() const { return m_spacer; } + DomSpacer* takeElementSpacer(); + 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; + + QString m_attr_alignment; + bool m_has_attr_alignment; + + // 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_property; + enum Child { + Property = 1 + }; + + DomRow(const DomRow &other); + void operator = (const DomRow&other); +}; + +class QDESIGNER_UILIB_EXPORT DomColumn { +public: + DomColumn(); + ~DomColumn(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_property; + enum Child { + Property = 1 + }; + + DomColumn(const DomColumn &other); + void operator = (const DomColumn&other); +}; + +class QDESIGNER_UILIB_EXPORT DomItem { +public: + DomItem(); + ~DomItem(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + + inline QList elementItem() const { return m_item; } + void setElementItem(const QList& 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 + uint m_children; + QList m_property; + QList m_item; + enum Child { + Property = 1, + Item = 2 + }; + + DomItem(const DomItem &other); + void operator = (const DomItem&other); +}; + +class QDESIGNER_UILIB_EXPORT DomWidget { +public: + DomWidget(); + ~DomWidget(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + + inline QList elementScript() const { return m_script; } + void setElementScript(const QList& a); + + inline QList elementWidgetData() const { return m_widgetData; } + void setElementWidgetData(const QList& a); + + inline QList elementAttribute() const { return m_attribute; } + void setElementAttribute(const QList& a); + + inline QList elementRow() const { return m_row; } + void setElementRow(const QList& a); + + inline QList elementColumn() const { return m_column; } + void setElementColumn(const QList& a); + + inline QList elementItem() const { return m_item; } + void setElementItem(const QList& a); + + inline QList elementLayout() const { return m_layout; } + void setElementLayout(const QList& a); + + inline QList elementWidget() const { return m_widget; } + void setElementWidget(const QList& a); + + inline QList elementAction() const { return m_action; } + void setElementAction(const QList& a); + + inline QList elementActionGroup() const { return m_actionGroup; } + void setElementActionGroup(const QList& a); + + inline QList elementAddAction() const { return m_addAction; } + void setElementAddAction(const QList& 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 + uint m_children; + QStringList m_class; + QList m_property; + QList m_script; + QList m_widgetData; + QList m_attribute; + QList m_row; + QList m_column; + QList m_item; + QList m_layout; + QList m_widget; + QList m_action; + QList m_actionGroup; + QList m_addAction; + QStringList m_zOrder; + enum Child { + Class = 1, + Property = 2, + Script = 4, + WidgetData = 8, + Attribute = 16, + Row = 32, + Column = 64, + Item = 128, + Layout = 256, + Widget = 512, + Action = 1024, + ActionGroup = 2048, + AddAction = 4096, + ZOrder = 8192 + }; + + DomWidget(const DomWidget &other); + void operator = (const DomWidget&other); +}; + +class QDESIGNER_UILIB_EXPORT DomSpacer { +public: + DomSpacer(); + ~DomSpacer(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& 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 + uint m_children; + QList m_property; + enum Child { + Property = 1 + }; + + DomSpacer(const DomSpacer &other); + void operator = (const DomSpacer&other); +}; + +class QDESIGNER_UILIB_EXPORT DomColor { +public: + DomColor(); + ~DomColor(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomColor* takeElementColor(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementGradientStop() const { return m_gradientStop; } + void setElementGradientStop(const QList& 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 + uint m_children; + QList m_gradientStop; + enum Child { + GradientStop = 1 + }; + + DomGradient(const DomGradient &other); + void operator = (const DomGradient&other); +}; + +class QDESIGNER_UILIB_EXPORT DomBrush { +public: + DomBrush(); + ~DomBrush(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomColor* takeElementColor(); + void setElementColor(DomColor* a); + + inline DomProperty* elementTexture() const { return m_texture; } + DomProperty* takeElementTexture(); + void setElementTexture(DomProperty* a); + + inline DomGradient* elementGradient() const { return m_gradient; } + DomGradient* takeElementGradient(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomBrush* takeElementBrush(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementColorRole() const { return m_colorRole; } + void setElementColorRole(const QList& a); + + inline QList elementColor() const { return m_color; } + void setElementColor(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_colorRole; + QList m_color; + enum Child { + ColorRole = 1, + Color = 2 + }; + + DomColorGroup(const DomColorGroup &other); + void operator = (const DomColorGroup&other); +}; + +class QDESIGNER_UILIB_EXPORT DomPalette { +public: + DomPalette(); + ~DomPalette(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomColorGroup* takeElementActive(); + void setElementActive(DomColorGroup* a); + inline bool hasElementActive() const { return m_children & Active; } + void clearElementActive(); + + inline DomColorGroup* elementInactive() const { return m_inactive; } + DomColorGroup* takeElementInactive(); + void setElementInactive(DomColorGroup* a); + inline bool hasElementInactive() const { return m_children & Inactive; } + void clearElementInactive(); + + inline DomColorGroup* elementDisabled() const { return m_disabled; } + DomColorGroup* takeElementDisabled(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomLocale(const DomLocale &other); + void operator = (const DomLocale&other); +}; + +class QDESIGNER_UILIB_EXPORT DomSizePolicy { +public: + DomSizePolicy(); + ~DomSizePolicy(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + QStringList m_string; + enum Child { + String = 1 + }; + + DomStringList(const DomStringList &other); + void operator = (const DomStringList&other); +}; + +class QDESIGNER_UILIB_EXPORT DomResourcePixmap { +public: + DomResourcePixmap(); + ~DomResourcePixmap(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomResourcePixmap(const DomResourcePixmap &other); + void operator = (const DomResourcePixmap&other); +}; + +class QDESIGNER_UILIB_EXPORT DomResourceIcon { +public: + DomResourceIcon(); + ~DomResourceIcon(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 hasAttributeTheme() const { return m_has_attr_theme; } + inline QString attributeTheme() const { return m_attr_theme; } + inline void setAttributeTheme(const QString& a) { m_attr_theme = a; m_has_attr_theme = true; } + inline void clearAttributeTheme() { m_has_attr_theme = false; } + + 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; } + DomResourcePixmap* takeElementNormalOff(); + void setElementNormalOff(DomResourcePixmap* a); + inline bool hasElementNormalOff() const { return m_children & NormalOff; } + void clearElementNormalOff(); + + inline DomResourcePixmap* elementNormalOn() const { return m_normalOn; } + DomResourcePixmap* takeElementNormalOn(); + void setElementNormalOn(DomResourcePixmap* a); + inline bool hasElementNormalOn() const { return m_children & NormalOn; } + void clearElementNormalOn(); + + inline DomResourcePixmap* elementDisabledOff() const { return m_disabledOff; } + DomResourcePixmap* takeElementDisabledOff(); + void setElementDisabledOff(DomResourcePixmap* a); + inline bool hasElementDisabledOff() const { return m_children & DisabledOff; } + void clearElementDisabledOff(); + + inline DomResourcePixmap* elementDisabledOn() const { return m_disabledOn; } + DomResourcePixmap* takeElementDisabledOn(); + void setElementDisabledOn(DomResourcePixmap* a); + inline bool hasElementDisabledOn() const { return m_children & DisabledOn; } + void clearElementDisabledOn(); + + inline DomResourcePixmap* elementActiveOff() const { return m_activeOff; } + DomResourcePixmap* takeElementActiveOff(); + void setElementActiveOff(DomResourcePixmap* a); + inline bool hasElementActiveOff() const { return m_children & ActiveOff; } + void clearElementActiveOff(); + + inline DomResourcePixmap* elementActiveOn() const { return m_activeOn; } + DomResourcePixmap* takeElementActiveOn(); + void setElementActiveOn(DomResourcePixmap* a); + inline bool hasElementActiveOn() const { return m_children & ActiveOn; } + void clearElementActiveOn(); + + inline DomResourcePixmap* elementSelectedOff() const { return m_selectedOff; } + DomResourcePixmap* takeElementSelectedOff(); + void setElementSelectedOff(DomResourcePixmap* a); + inline bool hasElementSelectedOff() const { return m_children & SelectedOff; } + void clearElementSelectedOff(); + + inline DomResourcePixmap* elementSelectedOn() const { return m_selectedOn; } + DomResourcePixmap* takeElementSelectedOn(); + 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_theme; + bool m_has_attr_theme; + + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + + inline bool hasAttributeExtraComment() const { return m_has_attr_extraComment; } + inline QString attributeExtraComment() const { return m_attr_extraComment; } + inline void setAttributeExtraComment(const QString& a) { m_attr_extraComment = a; m_has_attr_extraComment = true; } + inline void clearAttributeExtraComment() { m_has_attr_extraComment = 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; + + QString m_attr_extraComment; + bool m_has_attr_extraComment; + + // child element data + uint m_children; + + DomString(const DomString &other); + void operator = (const DomString&other); +}; + +class QDESIGNER_UILIB_EXPORT DomPointF { +public: + DomPointF(); + ~DomPointF(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomString* takeElementString(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomColor* takeElementColor(); + 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; } + DomFont* takeElementFont(); + void setElementFont(DomFont* a); + + inline DomResourceIcon* elementIconSet() const { return m_iconSet; } + DomResourceIcon* takeElementIconSet(); + void setElementIconSet(DomResourceIcon* a); + + inline DomResourcePixmap* elementPixmap() const { return m_pixmap; } + DomResourcePixmap* takeElementPixmap(); + void setElementPixmap(DomResourcePixmap* a); + + inline DomPalette* elementPalette() const { return m_palette; } + DomPalette* takeElementPalette(); + void setElementPalette(DomPalette* a); + + inline DomPoint* elementPoint() const { return m_point; } + DomPoint* takeElementPoint(); + void setElementPoint(DomPoint* a); + + inline DomRect* elementRect() const { return m_rect; } + DomRect* takeElementRect(); + void setElementRect(DomRect* a); + + inline QString elementSet() const { return m_set; } + void setElementSet(const QString& a); + + inline DomLocale* elementLocale() const { return m_locale; } + DomLocale* takeElementLocale(); + void setElementLocale(DomLocale* a); + + inline DomSizePolicy* elementSizePolicy() const { return m_sizePolicy; } + DomSizePolicy* takeElementSizePolicy(); + void setElementSizePolicy(DomSizePolicy* a); + + inline DomSize* elementSize() const { return m_size; } + DomSize* takeElementSize(); + void setElementSize(DomSize* a); + + inline DomString* elementString() const { return m_string; } + DomString* takeElementString(); + void setElementString(DomString* a); + + inline DomStringList* elementStringList() const { return m_stringList; } + DomStringList* takeElementStringList(); + 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; } + DomDate* takeElementDate(); + void setElementDate(DomDate* a); + + inline DomTime* elementTime() const { return m_time; } + DomTime* takeElementTime(); + void setElementTime(DomTime* a); + + inline DomDateTime* elementDateTime() const { return m_dateTime; } + DomDateTime* takeElementDateTime(); + void setElementDateTime(DomDateTime* a); + + inline DomPointF* elementPointF() const { return m_pointF; } + DomPointF* takeElementPointF(); + void setElementPointF(DomPointF* a); + + inline DomRectF* elementRectF() const { return m_rectF; } + DomRectF* takeElementRectF(); + void setElementRectF(DomRectF* a); + + inline DomSizeF* elementSizeF() const { return m_sizeF; } + DomSizeF* takeElementSizeF(); + void setElementSizeF(DomSizeF* a); + + inline qlonglong elementLongLong() const { return m_longLong; } + void setElementLongLong(qlonglong a); + + inline DomChar* elementChar() const { return m_char; } + DomChar* takeElementChar(); + void setElementChar(DomChar* a); + + inline DomUrl* elementUrl() const { return m_url; } + DomUrl* takeElementUrl(); + 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; } + DomBrush* takeElementBrush(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementConnection() const { return m_connection; } + void setElementConnection(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_connection; + enum Child { + Connection = 1 + }; + + DomConnections(const DomConnections &other); + void operator = (const DomConnections&other); +}; + +class QDESIGNER_UILIB_EXPORT DomConnection { +public: + DomConnection(); + ~DomConnection(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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; } + DomConnectionHints* takeElementHints(); + 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementHint() const { return m_hint; } + void setElementHint(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_hint; + enum Child { + Hint = 1 + }; + + DomConnectionHints(const DomConnectionHints &other); + void operator = (const DomConnectionHints&other); +}; + +class QDESIGNER_UILIB_EXPORT DomConnectionHint { +public: + DomConnectionHint(); + ~DomConnectionHint(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 + uint m_children; + + DomScript(const DomScript &other); + void operator = (const DomScript&other); +}; + +class QDESIGNER_UILIB_EXPORT DomWidgetData { +public: + DomWidgetData(); + ~DomWidgetData(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_property; + enum Child { + Property = 1 + }; + + DomWidgetData(const DomWidgetData &other); + void operator = (const DomWidgetData&other); +}; + +class QDESIGNER_UILIB_EXPORT DomDesignerData { +public: + DomDesignerData(); + ~DomDesignerData(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementProperty() const { return m_property; } + void setElementProperty(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_property; + enum Child { + Property = 1 + }; + + DomDesignerData(const DomDesignerData &other); + void operator = (const DomDesignerData&other); +}; + +class QDESIGNER_UILIB_EXPORT DomSlots { +public: + DomSlots(); + ~DomSlots(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementSignal() const { return m_signal; } + void setElementSignal(const QStringList& a); + + inline QStringList elementSlot() const { return m_slot; } + void setElementSlot(const QStringList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QStringList m_signal; + QStringList m_slot; + enum Child { + Signal = 1, + Slot = 2 + }; + + DomSlots(const DomSlots &other); + void operator = (const DomSlots&other); +}; + +class QDESIGNER_UILIB_EXPORT DomPropertySpecifications { +public: + DomPropertySpecifications(); + ~DomPropertySpecifications(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 elementStringpropertyspecification() const { return m_stringpropertyspecification; } + void setElementStringpropertyspecification(const QList& a); + +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + // child element data + uint m_children; + QList m_stringpropertyspecification; + enum Child { + Stringpropertyspecification = 1 + }; + + DomPropertySpecifications(const DomPropertySpecifications &other); + void operator = (const DomPropertySpecifications&other); +}; + +class QDESIGNER_UILIB_EXPORT DomStringPropertySpecification { +public: + DomStringPropertySpecification(); + ~DomStringPropertySpecification(); + + void read(QXmlStreamReader &reader); + void write(QXmlStreamWriter &writer, 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 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 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; } + + // child element accessors +private: + QString m_text; + void clear(bool clear_all = true); + + // attribute data + QString m_attr_name; + bool m_has_attr_name; + + QString m_attr_type; + bool m_has_attr_type; + + QString m_attr_notr; + bool m_has_attr_notr; + + // child element data + uint m_children; + + DomStringPropertySpecification(const DomStringPropertySpecification &other); + void operator = (const DomStringPropertySpecification&other); +}; + + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +#endif // UI4_H diff --git a/src/designer/src/lib/uilib/uilib.pri b/src/designer/src/lib/uilib/uilib.pri new file mode 100644 index 000000000..75904c2f6 --- /dev/null +++ b/src/designer/src/lib/uilib/uilib.pri @@ -0,0 +1,34 @@ + +INCLUDEPATH += $$PWD + +DEFINES += QT_DESIGNER +!contains(QT_CONFIG, script): DEFINES += QT_FORMBUILDER_NO_SCRIPT + +QT += gui widgets + +# Input +HEADERS += \ + $$PWD/ui4_p.h \ + $$PWD/abstractformbuilder.h \ + $$PWD/formbuilder.h \ + $$PWD/container.h \ + $$PWD/customwidget.h \ + $$PWD/properties_p.h \ + $$PWD/formbuilderextra_p.h \ + $$PWD/resourcebuilder_p.h \ + $$PWD/textbuilder_p.h + +SOURCES += \ + $$PWD/abstractformbuilder.cpp \ + $$PWD/formbuilder.cpp \ + $$PWD/ui4.cpp \ + $$PWD/properties.cpp \ + $$PWD/formbuilderextra.cpp \ + $$PWD/resourcebuilder.cpp \ + $$PWD/textbuilder.cpp + +!contains(DEFINES, QT_FORMBUILDER_NO_SCRIPT) { + QT += script + HEADERS += $$PWD/formscriptrunner_p.h + SOURCES += $$PWD/formscriptrunner.cpp +} diff --git a/src/designer/src/lib/uilib/uilib_global.h b/src/designer/src/lib/uilib/uilib_global.h new file mode 100644 index 000000000..b27a9bd3f --- /dev/null +++ b/src/designer/src/lib/uilib/uilib_global.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UILIB_GLOBAL_H +#define UILIB_GLOBAL_H + +#include + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +#define QDESIGNER_UILIB_EXTERN Q_DECL_EXPORT +#define QDESIGNER_UILIB_IMPORT Q_DECL_IMPORT + +#ifdef QT_DESIGNER_STATIC +# 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 + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // UILIB_GLOBAL_H diff --git a/src/designer/src/lib/uilib/widgets.table b/src/designer/src/lib/uilib/widgets.table new file mode 100644 index 000000000..9b8727849 --- /dev/null +++ b/src/designer/src/lib/uilib/widgets.table @@ -0,0 +1,148 @@ + +#ifndef DECLARE_WIDGET_1 +# define DECLARE_WIDGET_1(a,b) DECLARE_WIDGET(a,b) +#endif + +// widgets +#ifndef QT_NO_CHECKBOX +DECLARE_WIDGET(QCheckBox, "text") +#endif +#ifndef QT_NO_COMBOBOX +DECLARE_WIDGET(QComboBox, "") +#endif +#ifndef QT_NO_DATETIMEEDIT +DECLARE_WIDGET(QDateTimeEdit, "") +#endif +#ifndef QT_NO_DATEEDIT +DECLARE_WIDGET(QDateEdit, "") +#endif +#ifndef QT_NO_TIMEEDIT +DECLARE_WIDGET(QTimeEdit, "") +#endif +#ifndef QT_NO_DIAL +DECLARE_WIDGET(QDial, "") +#endif +DECLARE_WIDGET(QDialog, "") +#ifndef QT_NO_DOCKWIDGET +DECLARE_WIDGET(QDockWidget, "") +#endif +DECLARE_WIDGET(QFrame, "") +#ifndef QT_NO_GROUPBOX +DECLARE_WIDGET(QGroupBox, "") +#endif +#ifndef QT_NO_SCROLLAREA +DECLARE_WIDGET(QScrollArea, "") +#endif +#ifndef QT_NO_LCDNUMBER +DECLARE_WIDGET(QLCDNumber, "") +#endif +DECLARE_WIDGET(QLabel, "") +#ifndef QT_NO_LINEEDIT +DECLARE_WIDGET(QLineEdit, "") +#endif +#ifndef QT_NO_LISTVIEW +DECLARE_WIDGET(QListView, "") +#endif +#ifndef QT_NO_LISTWIDGET +DECLARE_WIDGET(QListWidget, "") +#endif +#ifndef QT_NO_MAINWINDOW +DECLARE_WIDGET(QMainWindow, "") +#endif +#ifndef QT_NO_MDIAREA +DECLARE_WIDGET(QMdiArea, "") +#endif +#ifndef QT_NO_MENU +DECLARE_WIDGET(QMenu, "") +#endif +#ifndef QT_NO_MENUBAR +DECLARE_WIDGET(QMenuBar, "") +#endif +#ifndef QT_NO_PROGRESSBAR +DECLARE_WIDGET(QProgressBar, "") +#endif +DECLARE_WIDGET(QPushButton, "text") +DECLARE_WIDGET(QRadioButton, "text") +DECLARE_WIDGET(QCommandLinkButton, "text") +#ifndef QT_NO_SCROLLBAR +DECLARE_WIDGET(QScrollBar, "") +#endif +#ifndef QT_NO_SLIDER +DECLARE_WIDGET(QSlider, "") +#endif +#ifndef QT_NO_SPINBOX +DECLARE_WIDGET(QSpinBox, "") +DECLARE_WIDGET(QDoubleSpinBox, "") +#endif +#ifndef QT_NO_TABWIDGET +DECLARE_WIDGET(QTabWidget, "") +#endif +#ifndef QT_NO_TABLEVIEW +DECLARE_WIDGET(QTableView, "") +#endif +#ifndef QT_NO_TABLEWIDGET +DECLARE_WIDGET(QTableWidget, "") +#endif +#ifndef QT_NO_TEXTBROWSER +DECLARE_WIDGET(QTextBrowser, "") +#endif +#ifndef QT_NO_TEXTEDIT +DECLARE_WIDGET(QTextEdit, "") +DECLARE_WIDGET(QPlainTextEdit, "") +#endif +#ifndef QT_NO_TOOLBAR +DECLARE_WIDGET(QToolBar, "") +#endif +#ifndef QT_NO_TOOLBOX +DECLARE_WIDGET(QToolBox, "") +#endif +#ifndef QT_NO_TOOLBUTTON +DECLARE_WIDGET(QToolButton, "text") +#endif +#ifndef QT_NO_TREEVIEW +DECLARE_WIDGET(QTreeView, "") +#endif +#ifndef QT_NO_TREEWIDGET +DECLARE_WIDGET(QTreeWidget, "") +#endif +DECLARE_WIDGET(QWidget, "") +#ifndef QT_NO_WORKSPACE +DECLARE_WIDGET(QWorkspace, "") +#endif +#ifndef QT_NO_SPLITTER +DECLARE_WIDGET(QSplitter, "") +#endif +#ifndef QT_NO_STACKEDWIDGET +DECLARE_WIDGET(QStackedWidget, "") +#endif +#ifndef QT_NO_STATUSBAR +DECLARE_WIDGET(QStatusBar, "") +#endif +DECLARE_WIDGET(QDialogButtonBox, "") +#ifndef QT_NO_FONTCOMBOBOX +DECLARE_WIDGET(QFontComboBox, "") +#endif +#ifndef QT_NO_CALENDARWIDGET +DECLARE_WIDGET(QCalendarWidget, "") +#endif +#ifndef QT_NO_COLUMNVIEW +DECLARE_WIDGET(QColumnView, "") +#endif + +#ifndef QT_NO_WIZARD +DECLARE_WIDGET(QWizard, "") +DECLARE_WIDGET(QWizardPage, "") +#endif + +#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW +DECLARE_WIDGET_1(QGraphicsView, "") +#endif + +// layouts +DECLARE_LAYOUT(QGridLayout, "") +DECLARE_LAYOUT(QHBoxLayout, "") +DECLARE_LAYOUT(QStackedLayout, "") +DECLARE_LAYOUT(QVBoxLayout, "") +#ifndef QT_NO_FORMLAYOUT +DECLARE_LAYOUT(QFormLayout, "") +#endif diff --git a/src/designer/src/src.pro b/src/designer/src/src.pro index 40da11ffc..9802c653d 100644 --- a/src/designer/src/src.pro +++ b/src/designer/src/src.pro @@ -2,6 +2,7 @@ TEMPLATE = subdirs CONFIG += ordered SUBDIRS = \ + uitools \ lib \ components \ designer diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp new file mode 100644 index 000000000..19d4277ae --- /dev/null +++ b/src/designer/src/uitools/quiloader.cpp @@ -0,0 +1,954 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "quiloader.h" +#include "quiloader_p.h" +#include "customwidget.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +typedef QMap widget_map; +Q_GLOBAL_STATIC(widget_map, g_widgets) + +class QUiLoader; +class QUiLoaderPrivate; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +class TranslatingTextBuilder : public QTextBuilder +{ +public: + TranslatingTextBuilder(bool trEnabled, const QByteArray &className) : + m_trEnabled(trEnabled), m_className(className) {} + + virtual QVariant loadText(const DomProperty *icon) const; + + virtual QVariant toNativeValue(const QVariant &value) const; + +private: + bool m_trEnabled; + QByteArray m_className; +}; + +QVariant TranslatingTextBuilder::loadText(const DomProperty *text) const +{ + const DomString *str = text->elementString(); + if (!str) + return QVariant(); + if (str->hasAttributeNotr()) { + const QString notr = str->attributeNotr(); + if (notr == QLatin1String("true") || notr == QLatin1String("yes")) + return QVariant::fromValue(str->text()); + } + QUiTranslatableStringValue strVal; + strVal.setValue(str->text().toUtf8()); + if (str->hasAttributeComment()) + strVal.setComment(str->attributeComment().toUtf8()); + return QVariant::fromValue(strVal); +} + +QVariant TranslatingTextBuilder::toNativeValue(const QVariant &value) const +{ + if (value.canConvert()) { + QUiTranslatableStringValue tsv = qvariant_cast(value); + if (!m_trEnabled) + return QString::fromUtf8(tsv.value().data()); + return QVariant::fromValue( + QApplication::translate(m_className, tsv.value(), tsv.comment(), + QCoreApplication::UnicodeUTF8)); + } + if (value.canConvert()) + return QVariant::fromValue(qvariant_cast(value)); + return value; +} + +// This is "exported" to linguist +const QUiItemRolePair qUiItemRoles[] = { + { Qt::DisplayRole, Qt::DisplayPropertyRole }, +#ifndef QT_NO_TOOLTIP + { Qt::ToolTipRole, Qt::ToolTipPropertyRole }, +#endif +#ifndef QT_NO_STATUSTIP + { Qt::StatusTipRole, Qt::StatusTipPropertyRole }, +#endif +#ifndef QT_NO_WHATSTHIS + { Qt::WhatsThisRole, Qt::WhatsThisPropertyRole }, +#endif + { -1 , -1 } +}; + +static void recursiveReTranslate(QTreeWidgetItem *item, const QByteArray &class_name) +{ + const QUiItemRolePair *irs = qUiItemRoles; + + int cnt = item->columnCount(); + for (int i = 0; i < cnt; ++i) { + for (unsigned j = 0; irs[j].shadowRole >= 0; j++) { + QVariant v = item->data(i, irs[j].shadowRole); + if (v.isValid()) { + QUiTranslatableStringValue tsv = qvariant_cast(v); + const QString text = QApplication::translate(class_name, + tsv.value(), tsv.comment(), + QCoreApplication::UnicodeUTF8); + item->setData(i, irs[j].realRole, text); + } + } + } + + cnt = item->childCount(); + for (int i = 0; i < cnt; ++i) + recursiveReTranslate(item->child(i), class_name); +} + +template +static void reTranslateWidgetItem(T *item, const QByteArray &class_name) +{ + const QUiItemRolePair *irs = qUiItemRoles; + + for (unsigned j = 0; irs[j].shadowRole >= 0; j++) { + QVariant v = item->data(irs[j].shadowRole); + if (v.isValid()) { + QUiTranslatableStringValue tsv = qvariant_cast(v); + const QString text = QApplication::translate(class_name, + tsv.value(), tsv.comment(), + QCoreApplication::UnicodeUTF8); + item->setData(irs[j].realRole, text); + } + } +} + +static void reTranslateTableItem(QTableWidgetItem *item, const QByteArray &class_name) +{ + if (item) + reTranslateWidgetItem(item, class_name); +} + +#define RETRANSLATE_SUBWIDGET_PROP(mainWidget, setter, propName) \ + do { \ + QVariant v = mainWidget->widget(i)->property(propName); \ + if (v.isValid()) { \ + QUiTranslatableStringValue tsv = qvariant_cast(v); \ + const QString text = QApplication::translate(m_className, \ + tsv.value(), tsv.comment(), \ + QCoreApplication::UnicodeUTF8); \ + mainWidget->setter(i, text); \ + } \ + } while (0) + +class TranslationWatcher: public QObject +{ + Q_OBJECT + +public: + TranslationWatcher(QObject *parent, const QByteArray &className): + QObject(parent), + m_className(className) + { + } + + virtual bool eventFilter(QObject *o, QEvent *event) + { + if (event->type() == QEvent::LanguageChange) { + foreach (const QByteArray &prop, o->dynamicPropertyNames()) { + if (prop.startsWith(PROP_GENERIC_PREFIX)) { + const QByteArray propName = prop.mid(sizeof(PROP_GENERIC_PREFIX) - 1); + const QUiTranslatableStringValue tsv = + qvariant_cast(o->property(prop)); + const QString text = QApplication::translate(m_className, + tsv.value(), tsv.comment(), + QCoreApplication::UnicodeUTF8); + o->setProperty(propName, text); + } + } + if (0) { +#ifndef QT_NO_TABWIDGET + } else if (QTabWidget *tabw = qobject_cast(o)) { + const int cnt = tabw->count(); + for (int i = 0; i < cnt; ++i) { + RETRANSLATE_SUBWIDGET_PROP(tabw, setTabText, PROP_TABPAGETEXT); +# ifndef QT_NO_TOOLTIP + RETRANSLATE_SUBWIDGET_PROP(tabw, setTabToolTip, PROP_TABPAGETOOLTIP); +# endif +# ifndef QT_NO_WHATSTHIS + RETRANSLATE_SUBWIDGET_PROP(tabw, setTabWhatsThis, PROP_TABPAGEWHATSTHIS); +# endif + } +#endif +#ifndef QT_NO_LISTWIDGET + } else if (QListWidget *listw = qobject_cast(o)) { + const int cnt = listw->count(); + for (int i = 0; i < cnt; ++i) + reTranslateWidgetItem(listw->item(i), m_className); +#endif +#ifndef QT_NO_TREEWIDGET + } else if (QTreeWidget *treew = qobject_cast(o)) { + if (QTreeWidgetItem *item = treew->headerItem()) + recursiveReTranslate(item, m_className); + const int cnt = treew->topLevelItemCount(); + for (int i = 0; i < cnt; ++i) { + QTreeWidgetItem *item = treew->topLevelItem(i); + recursiveReTranslate(item, m_className); + } +#endif +#ifndef QT_NO_TABLEWIDGET + } else if (QTableWidget *tablew = qobject_cast(o)) { + const int row_cnt = tablew->rowCount(); + const int col_cnt = tablew->columnCount(); + for (int j = 0; j < col_cnt; ++j) + reTranslateTableItem(tablew->horizontalHeaderItem(j), m_className); + for (int i = 0; i < row_cnt; ++i) { + reTranslateTableItem(tablew->verticalHeaderItem(i), m_className); + for (int j = 0; j < col_cnt; ++j) + reTranslateTableItem(tablew->item(i, j), m_className); + } +#endif +#ifndef QT_NO_COMBOBOX + } else if (QComboBox *combow = qobject_cast(o)) { + if (!qobject_cast(o)) { + const int cnt = combow->count(); + for (int i = 0; i < cnt; ++i) { + const QVariant v = combow->itemData(i, Qt::DisplayPropertyRole); + if (v.isValid()) { + QUiTranslatableStringValue tsv = qvariant_cast(v); + const QString text = QApplication::translate(m_className, + tsv.value(), tsv.comment(), + QCoreApplication::UnicodeUTF8); + combow->setItemText(i, text); + } + } + } +#endif +#ifndef QT_NO_TOOLBOX + } else if (QToolBox *toolw = qobject_cast(o)) { + const int cnt = toolw->count(); + for (int i = 0; i < cnt; ++i) { + RETRANSLATE_SUBWIDGET_PROP(toolw, setItemText, PROP_TOOLITEMTEXT); +# ifndef QT_NO_TOOLTIP + RETRANSLATE_SUBWIDGET_PROP(toolw, setItemToolTip, PROP_TOOLITEMTOOLTIP); +# endif + } +#endif + } + } + return false; + } + +private: + QByteArray m_className; +}; + +class FormBuilderPrivate: public QFormBuilder +{ + friend class QT_PREPEND_NAMESPACE(QUiLoader); + friend class QT_PREPEND_NAMESPACE(QUiLoaderPrivate); + typedef QFormBuilder ParentClass; + +public: + QUiLoader *loader; + + bool dynamicTr; + bool trEnabled; + + FormBuilderPrivate(): loader(0), dynamicTr(false), trEnabled(true), m_trwatch(0) {} + + QWidget *defaultCreateWidget(const QString &className, QWidget *parent, const QString &name) + { + return ParentClass::createWidget(className, parent, name); + } + + QLayout *defaultCreateLayout(const QString &className, QObject *parent, const QString &name) + { + return ParentClass::createLayout(className, parent, name); + } + + QAction *defaultCreateAction(QObject *parent, const QString &name) + { + return ParentClass::createAction(parent, name); + } + + QActionGroup *defaultCreateActionGroup(QObject *parent, const QString &name) + { + return ParentClass::createActionGroup(parent, name); + } + + virtual QWidget *createWidget(const QString &className, QWidget *parent, const QString &name) + { + if (QWidget *widget = loader->createWidget(className, parent, name)) { + widget->setObjectName(name); + return widget; + } + + return 0; + } + + virtual QLayout *createLayout(const QString &className, QObject *parent, const QString &name) + { + if (QLayout *layout = loader->createLayout(className, parent, name)) { + layout->setObjectName(name); + return layout; + } + + return 0; + } + + virtual QActionGroup *createActionGroup(QObject *parent, const QString &name) + { + if (QActionGroup *actionGroup = loader->createActionGroup(parent, name)) { + actionGroup->setObjectName(name); + return actionGroup; + } + + return 0; + } + + virtual QAction *createAction(QObject *parent, const QString &name) + { + if (QAction *action = loader->createAction(parent, name)) { + action->setObjectName(name); + return action; + } + + return 0; + } + + virtual void applyProperties(QObject *o, const QList &properties); + virtual QWidget *create(DomUI *ui, QWidget *parentWidget); + virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget); + virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget); + +private: + QByteArray m_class; + TranslationWatcher *m_trwatch; +}; + +static QString convertTranslatable(const DomProperty *p, const QByteArray &className, + QUiTranslatableStringValue *strVal) +{ + if (p->kind() != DomProperty::String) + return QString(); + const DomString *dom_str = p->elementString(); + if (!dom_str) + return QString(); + if (dom_str->hasAttributeNotr()) { + const QString notr = dom_str->attributeNotr(); + if (notr == QLatin1String("yes") || notr == QLatin1String("true")) + return QString(); + } + strVal->setValue(dom_str->text().toUtf8()); + strVal->setComment(dom_str->attributeComment().toUtf8()); + if (strVal->value().isEmpty() && strVal->comment().isEmpty()) + return QString(); + return QApplication::translate(className, + strVal->value(), strVal->comment(), + QCoreApplication::UnicodeUTF8); +} + +void FormBuilderPrivate::applyProperties(QObject *o, const QList &properties) +{ + typedef QList DomPropertyList; + + QFormBuilder::applyProperties(o, properties); + + if (!m_trwatch) + m_trwatch = new TranslationWatcher(o, m_class); + + if (properties.empty()) + return; + + // Unlike string item roles, string properties are not loaded via the textBuilder + // (as they are "shadowed" by the property sheets in designer). So do the initial + // translation here. + bool anyTrs = false; + foreach (const DomProperty *p, properties) { + QUiTranslatableStringValue strVal; + const QString text = convertTranslatable(p, m_class, &strVal); + if (text.isEmpty()) + continue; + const QByteArray name = p->attributeName().toUtf8(); + if (dynamicTr) { + o->setProperty(PROP_GENERIC_PREFIX + name, QVariant::fromValue(strVal)); + anyTrs = trEnabled; + } + o->setProperty(name, text); + } + if (anyTrs) + o->installEventFilter(m_trwatch); +} + +QWidget *FormBuilderPrivate::create(DomUI *ui, QWidget *parentWidget) +{ + m_class = ui->elementClass().toUtf8(); + m_trwatch = 0; + setTextBuilder(new TranslatingTextBuilder(trEnabled, m_class)); + return QFormBuilder::create(ui, parentWidget); +} + +QWidget *FormBuilderPrivate::create(DomWidget *ui_widget, QWidget *parentWidget) +{ + QWidget *w = QFormBuilder::create(ui_widget, parentWidget); + if (w == 0) + return 0; + + if (0) { +#ifndef QT_NO_TABWIDGET + } else if (qobject_cast(w)) { +#endif +#ifndef QT_NO_LISTWIDGET + } else if (qobject_cast(w)) { +#endif +#ifndef QT_NO_TREEWIDGET + } else if (qobject_cast(w)) { +#endif +#ifndef QT_NO_TABLEWIDGET + } else if (qobject_cast(w)) { +#endif +#ifndef QT_NO_COMBOBOX + } else if (qobject_cast(w)) { + if (qobject_cast(w)) + return w; +#endif +#ifndef QT_NO_TOOLBOX + } else if (qobject_cast(w)) { +#endif + } else { + return w; + } + if (dynamicTr && trEnabled) + w->installEventFilter(m_trwatch); + return w; +} + +#define TRANSLATE_SUBWIDGET_PROP(mainWidget, attribute, setter, propName) \ + do { \ + if (const DomProperty *p##attribute = attributes.value(strings.attribute)) { \ + QUiTranslatableStringValue strVal; \ + const QString text = convertTranslatable(p##attribute, m_class, &strVal); \ + if (!text.isEmpty()) { \ + if (dynamicTr) \ + mainWidget->widget(i)->setProperty(propName, QVariant::fromValue(strVal)); \ + mainWidget->setter(i, text); \ + } \ + } \ + } while (0) + +bool FormBuilderPrivate::addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget) +{ + if (parentWidget == 0) + return true; + + if (!ParentClass::addItem(ui_widget, widget, parentWidget)) + return false; + + // Check special cases. First: Custom container + const QString className = QLatin1String(parentWidget->metaObject()->className()); + if (!d->customWidgetAddPageMethod(className).isEmpty()) + return true; + + const QFormBuilderStrings &strings = QFormBuilderStrings::instance(); + + if (0) { +#ifndef QT_NO_TABWIDGET + } else if (QTabWidget *tabWidget = qobject_cast(parentWidget)) { + const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute()); + const int i = tabWidget->count() - 1; + TRANSLATE_SUBWIDGET_PROP(tabWidget, titleAttribute, setTabText, PROP_TABPAGETEXT); +# ifndef QT_NO_TOOLTIP + TRANSLATE_SUBWIDGET_PROP(tabWidget, toolTipAttribute, setTabToolTip, PROP_TABPAGETOOLTIP); +# endif +# ifndef QT_NO_WHATSTHIS + TRANSLATE_SUBWIDGET_PROP(tabWidget, whatsThisAttribute, setTabWhatsThis, PROP_TABPAGEWHATSTHIS); +# endif +#endif +#ifndef QT_NO_TOOLBOX + } else if (QToolBox *toolBox = qobject_cast(parentWidget)) { + const DomPropertyHash attributes = propertyMap(ui_widget->elementAttribute()); + const int i = toolBox->count() - 1; + TRANSLATE_SUBWIDGET_PROP(toolBox, labelAttribute, setItemText, PROP_TOOLITEMTEXT); +# ifndef QT_NO_TOOLTIP + TRANSLATE_SUBWIDGET_PROP(toolBox, toolTipAttribute, setItemToolTip, PROP_TOOLITEMTOOLTIP); +# endif +#endif + } + + return true; +} + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +class QUiLoaderPrivate +{ +public: +#ifdef QFORMINTERNAL_NAMESPACE + QFormInternal::FormBuilderPrivate builder; +#else + FormBuilderPrivate builder; +#endif + + void setupWidgetMap() const; +}; + +void QUiLoaderPrivate::setupWidgetMap() const +{ + if (!g_widgets()->isEmpty()) + return; + +#define DECLARE_WIDGET(a, b) g_widgets()->insert(QLatin1String(#a), true); +#define DECLARE_LAYOUT(a, b) + +#include "widgets.table" + +#undef DECLARE_WIDGET +#undef DECLARE_WIDGET_1 +#undef DECLARE_LAYOUT +} + +/*! + \class QUiLoader + \inmodule QtUiTools + + \brief The QUiLoader class enables standalone applications to + dynamically create user interfaces at run-time using the + information stored in UI files or specified in plugin paths. + + In addition, you can customize or create your own user interface by + deriving your own loader class. + + If you have a custom component or an application that embeds \QD, you can + also use the QFormBuilder class provided by the QtDesigner module to create + user interfaces from UI files. + + The QUiLoader class provides a collection of functions allowing you to + create widgets based on the information stored in UI files (created + with \QD) or available in the specified plugin paths. The specified plugin + paths can be retrieved using the pluginPaths() function. Similarly, the + contents of a UI file can be retrieved using the load() function. For + example: + + \snippet doc/src/snippets/quiloader/mywidget.cpp 0 + + By including the user interface in the form's resources (\c myform.qrc), we + ensure that it will be present at run-time: + + \quotefile doc/src/snippets/quiloader/mywidget.qrc + + The availableWidgets() function returns a QStringList with the class names + of the widgets available in the specified plugin paths. To create these + widgets, simply use the createWidget() function. For example: + + \snippet doc/src/snippets/quiloader/main.cpp 0 + + To make a custom widget available to the loader, you can use the + addPluginPath() function; to remove all available widgets, you can call + the clearPluginPaths() function. + + The createAction(), createActionGroup(), createLayout(), and createWidget() + functions are used internally by the QUiLoader class whenever it has to + create an action, action group, layout, or widget respectively. For that + reason, you can subclass the QUiLoader class and reimplement these + functions to intervene the process of constructing a user interface. For + example, you might want to have a list of the actions created when loading + a form or creating a custom widget. + + For a complete example using the QUiLoader class, see the + \l{Calculator Builder Example}. + + \sa QtUiTools, QFormBuilder +*/ + +/*! + Creates a form loader with the given \a parent. +*/ +QUiLoader::QUiLoader(QObject *parent) + : QObject(parent), d_ptr(new QUiLoaderPrivate) +{ + Q_D(QUiLoader); + + d->builder.loader = this; + + QStringList paths; + foreach (const QString &path, QApplication::libraryPaths()) { + QString libPath = path; + libPath += QDir::separator(); + libPath += QLatin1String("designer"); + paths.append(libPath); + } + + d->builder.setPluginPath(paths); +} + +/*! + Destroys the loader. +*/ +QUiLoader::~QUiLoader() +{ +} + +/*! + Loads a form from the given \a device and creates a new widget with the + given \a parentWidget to hold its contents. + + \sa createWidget(), errorString() +*/ +QWidget *QUiLoader::load(QIODevice *device, QWidget *parentWidget) +{ + Q_D(QUiLoader); + // QXmlStreamReader will report errors on open failure. + if (!device->isOpen()) + device->open(QIODevice::ReadOnly|QIODevice::Text); + return d->builder.load(device, parentWidget); +} + +/*! + Returns a list naming the paths in which the loader will search when + locating custom widget plugins. + + \sa addPluginPath(), clearPluginPaths() +*/ +QStringList QUiLoader::pluginPaths() const +{ + Q_D(const QUiLoader); + return d->builder.pluginPaths(); +} + +/*! + Clears the list of paths in which the loader will search when locating + plugins. + + \sa addPluginPath(), pluginPaths() +*/ +void QUiLoader::clearPluginPaths() +{ + Q_D(QUiLoader); + d->builder.clearPluginPaths(); +} + +/*! + Adds the given \a path to the list of paths in which the loader will search + when locating plugins. + + \sa pluginPaths(), clearPluginPaths() +*/ +void QUiLoader::addPluginPath(const QString &path) +{ + Q_D(QUiLoader); + d->builder.addPluginPath(path); +} + +/*! + Creates a new widget with the given \a parent and \a name using the class + specified by \a className. You can use this function to create any of the + widgets returned by the availableWidgets() function. + + The function is also used internally by the QUiLoader class whenever it + creates a widget. Hence, you can subclass QUiLoader and reimplement this + function to intervene process of constructing a user interface or widget. + However, in your implementation, ensure that you call QUiLoader's version + first. + + \sa availableWidgets(), load() +*/ +QWidget *QUiLoader::createWidget(const QString &className, QWidget *parent, const QString &name) +{ + Q_D(QUiLoader); + return d->builder.defaultCreateWidget(className, parent, name); +} + +/*! + Creates a new layout with the given \a parent and \a name using the class + specified by \a className. + + The function is also used internally by the QUiLoader class whenever it + creates a widget. Hence, you can subclass QUiLoader and reimplement this + function to intervene process of constructing a user interface or widget. + However, in your implementation, ensure that you call QUiLoader's version + first. + + \sa createWidget(), load() +*/ +QLayout *QUiLoader::createLayout(const QString &className, QObject *parent, const QString &name) +{ + Q_D(QUiLoader); + return d->builder.defaultCreateLayout(className, parent, name); +} + +/*! + Creates a new action group with the given \a parent and \a name. + + The function is also used internally by the QUiLoader class whenever it + creates a widget. Hence, you can subclass QUiLoader and reimplement this + function to intervene process of constructing a user interface or widget. + However, in your implementation, ensure that you call QUiLoader's version + first. + + \sa createAction(), createWidget(), load() + */ +QActionGroup *QUiLoader::createActionGroup(QObject *parent, const QString &name) +{ + Q_D(QUiLoader); + return d->builder.defaultCreateActionGroup(parent, name); +} + +/*! + Creates a new action with the given \a parent and \a name. + + The function is also used internally by the QUiLoader class whenever it + creates a widget. Hence, you can subclass QUiLoader and reimplement this + function to intervene process of constructing a user interface or widget. + However, in your implementation, ensure that you call QUiLoader's version + first. + + \sa createActionGroup(), createWidget(), load() +*/ +QAction *QUiLoader::createAction(QObject *parent, const QString &name) +{ + Q_D(QUiLoader); + return d->builder.defaultCreateAction(parent, name); +} + +/*! + Returns a list naming all available widgets that can be built using the + createWidget() function, i.e all the widgets specified within the given + plugin paths. + + \sa pluginPaths(), createWidget() + +*/ +QStringList QUiLoader::availableWidgets() const +{ + Q_D(const QUiLoader); + + d->setupWidgetMap(); + widget_map available = *g_widgets(); + + foreach (QDesignerCustomWidgetInterface *plugin, d->builder.customWidgets()) { + available.insert(plugin->name(), true); + } + + return available.keys(); +} + + +/*! + \since 4.5 + Returns a list naming all available layouts that can be built using the + createLayout() function + + \sa createLayout() +*/ + +QStringList QUiLoader::availableLayouts() const +{ + QStringList rc; +#define DECLARE_WIDGET(a, b) +#define DECLARE_LAYOUT(a, b) rc.push_back(QLatin1String(#a)); + +#include "widgets.table" + +#undef DECLARE_WIDGET +#undef DECLARE_LAYOUT + return rc; +} + +/*! + Sets the working directory of the loader to \a dir. The loader will look + for other resources, such as icons and resource files, in paths relative to + this directory. + + \sa workingDirectory() +*/ + +void QUiLoader::setWorkingDirectory(const QDir &dir) +{ + Q_D(QUiLoader); + d->builder.setWorkingDirectory(dir); +} + +/*! + Returns the working directory of the loader. + + \sa setWorkingDirectory() +*/ + +QDir QUiLoader::workingDirectory() const +{ + Q_D(const QUiLoader); + return d->builder.workingDirectory(); +} + +/*! + \internal + \since 4.3 + + If \a enabled is true, the loader will be able to execute scripts. + Otherwise, execution of scripts will be disabled. + + \sa isScriptingEnabled() +*/ + +void QUiLoader::setScriptingEnabled(bool enabled) +{ + Q_D(QUiLoader); + d->builder.setScriptingEnabled(enabled); +} + +/*! + \internal + \since 4.3 + + Returns true if execution of scripts is enabled; returns false otherwise. + + \sa setScriptingEnabled() +*/ + +bool QUiLoader::isScriptingEnabled() const +{ + Q_D(const QUiLoader); + return d->builder.isScriptingEnabled(); +} + +/*! + \since 4.5 + + If \a enabled is true, user interfaces loaded by this loader will + automatically retranslate themselves upon receiving a language change + event. Otherwise, the user interfaces will not be retranslated. + + \sa isLanguageChangeEnabled() +*/ + +void QUiLoader::setLanguageChangeEnabled(bool enabled) +{ + Q_D(QUiLoader); + d->builder.dynamicTr = enabled; +} + +/*! + \since 4.5 + + Returns true if dynamic retranslation on language change is enabled; + returns false otherwise. + + \sa setLanguageChangeEnabled() +*/ + +bool QUiLoader::isLanguageChangeEnabled() const +{ + Q_D(const QUiLoader); + return d->builder.dynamicTr; +} + +/*! + \internal + \since 4.5 + + If \a enabled is true, user interfaces loaded by this loader will be + translated. Otherwise, the user interfaces will not be translated. + + \note This is orthogonal to languageChangeEnabled. + + \sa isLanguageChangeEnabled(), setLanguageChangeEnabled() +*/ + +void QUiLoader::setTranslationEnabled(bool enabled) +{ + Q_D(QUiLoader); + d->builder.trEnabled = enabled; +} + +/*! + \internal + \since 4.5 + + Returns true if translation is enabled; returns false otherwise. + + \sa setTranslationEnabled() +*/ + +bool QUiLoader::isTranslationEnabled() const +{ + Q_D(const QUiLoader); + return d->builder.trEnabled; +} + +/*! + Returns a human-readable description of the last error occurred in load(). + + \since 5.0 + \sa load() +*/ + +QString QUiLoader::errorString() const +{ + Q_D(const QUiLoader); + return d->builder.errorString(); +} + +QT_END_NAMESPACE + +#include "quiloader.moc" diff --git a/src/designer/src/uitools/quiloader.h b/src/designer/src/uitools/quiloader.h new file mode 100644 index 000000000..4adbb01c0 --- /dev/null +++ b/src/designer/src/uitools/quiloader.h @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUILOADER_H +#define QUILOADER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QWidget; +class QLayout; +class QAction; +class QActionGroup; +class QString; +class QIODevice; +class QDir; + +class QUiLoaderPrivate; +class QUiLoader : public QObject +{ + Q_OBJECT +public: + QUiLoader(QObject *parent = 0); + virtual ~QUiLoader(); + + QStringList pluginPaths() const; + void clearPluginPaths(); + void addPluginPath(const QString &path); + + QWidget *load(QIODevice *device, QWidget *parentWidget = 0); + QStringList availableWidgets() const; + QStringList availableLayouts() const; + + virtual QWidget *createWidget(const QString &className, QWidget *parent = 0, const QString &name = QString()); + virtual QLayout *createLayout(const QString &className, QObject *parent = 0, const QString &name = QString()); + virtual QActionGroup *createActionGroup(QObject *parent = 0, const QString &name = QString()); + virtual QAction *createAction(QObject *parent = 0, const QString &name = QString()); + + void setWorkingDirectory(const QDir &dir); + QDir workingDirectory() const; + + void setScriptingEnabled(bool enabled); + bool isScriptingEnabled() const; + + void setLanguageChangeEnabled(bool enabled); + bool isLanguageChangeEnabled() const; + + void setTranslationEnabled(bool enabled); + bool isTranslationEnabled() const; + + QString errorString() const; + +private: + QScopedPointer d_ptr; + Q_DECLARE_PRIVATE(QUiLoader) + Q_DISABLE_COPY(QUiLoader) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QUILOADER_H diff --git a/src/designer/src/uitools/quiloader_p.h b/src/designer/src/uitools/quiloader_p.h new file mode 100644 index 000000000..3137e6fc8 --- /dev/null +++ b/src/designer/src/uitools/quiloader_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Designer of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QUILOADER_P_H +#define QUILOADER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +// This file is here for use by the form preview in Linguist. If you change anything +// here or in the code which uses it, remember to adapt Linguist accordingly. + +#define PROP_GENERIC_PREFIX "_q_notr_" +#define PROP_TOOLITEMTEXT "_q_toolItemText_notr" +#define PROP_TOOLITEMTOOLTIP "_q_toolItemToolTip_notr" +#define PROP_TABPAGETEXT "_q_tabPageText_notr" +#define PROP_TABPAGETOOLTIP "_q_tabPageToolTip_notr" +#define PROP_TABPAGEWHATSTHIS "_q_tabPageWhatsThis_notr" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QUiTranslatableStringValue +{ +public: + QByteArray value() const { return m_value; } + void setValue(const QByteArray &value) { m_value = value; } + QByteArray comment() const { return m_comment; } + void setComment(const QByteArray &comment) { m_comment = comment; } + +private: + QByteArray m_value; + QByteArray m_comment; +}; + +struct QUiItemRolePair { + int realRole; + int shadowRole; +}; + +#ifdef QFORMINTERNAL_NAMESPACE +namespace QFormInternal +{ +#endif + +extern const QUiItemRolePair qUiItemRoles[]; + +#ifdef QFORMINTERNAL_NAMESPACE +} +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +Q_DECLARE_METATYPE(QUiTranslatableStringValue) + + +#endif // QUILOADER_P_H diff --git a/src/designer/src/uitools/uitools.pro b/src/designer/src/uitools/uitools.pro new file mode 100644 index 000000000..ca25014c0 --- /dev/null +++ b/src/designer/src/uitools/uitools.pro @@ -0,0 +1,50 @@ +QPRO_PWD = $$PWD +TEMPLATE = lib +TARGET = $$qtLibraryTarget(QtUiTools) +QT = core + +CONFIG += qt staticlib module +MODULE = uitools +MODULE_PRI = ../modules/qt_uitools.pri + +DESTDIR = $$QMAKE_LIBDIR_QT + +symbian { + TARGET.UID3 = 0x2001E628 + load(armcc_warnings) +} + +win32|mac:!macx-xcode:CONFIG += debug_and_release build_all + +DEFINES += QFORMINTERNAL_NAMESPACE QT_DESIGNER_STATIC QT_FORMBUILDER_NO_SCRIPT +isEmpty(QT_MAJOR_VERSION) { + VERSION=4.3.0 +} else { + VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} +} +load(qt_targets) +QMAKE_TARGET_PRODUCT = UiLoader +QMAKE_TARGET_DESCRIPTION = QUiLoader + +include(../lib/uilib/uilib.pri) + +HEADERS += quiloader.h +SOURCES += quiloader.cpp + +include($$QT_BUILD_TREE/include/QtUiTools/headers.pri, "", true) +quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES +quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools +quitools_private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES +quitools_private_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools/$$QT.uitools.VERSION/QtUiTools/private +INSTALLS += quitools_headers quitools_private_headers + +target.path=$$[QT_INSTALL_LIBS] +INSTALLS += target + +unix|win32-g++* { + CONFIG += create_pc + QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig +} diff --git a/sync.profile b/sync.profile index e748d5ecc..8873defdd 100644 --- a/sync.profile +++ b/sync.profile @@ -1,6 +1,7 @@ %modules = ( # path to module name map "QtCLucene" => "$basedir/src/assistant/clucene", "QtHelp" => "$basedir/src/assistant/help", + "QtUiTools" => "$basedir/src/designer/src/uitools", "QtDesigner" => "$basedir/src/designer/src/lib", ); %moduleheaders = ( # restrict the module headers to those found in relative path @@ -8,6 +9,7 @@ %classnames = ( "qtcluceneversion.h" => "QtCLuceneVersion", "qthelpversion.h" => "QtHelpVersion", + "qtuitoolsversion.h" => "QtUiToolsVersion", "qtdesignerversion.h" => "QtDesigner", ); %mastercontent = ( @@ -24,6 +26,7 @@ %modulepris = ( "QtCLucene" => "$basedir/modules/qt_clucene.pri", "QtHelp" => "$basedir/modules/qt_help.pri", + "QtUiTools" => "$basedir/modules/qt_uitools.pri", "QtDesigner" => "$basedir/modules/qt_designer.pri", ); %dependencies = ( diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 49c179f57..78cfd74e0 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -6,5 +6,5 @@ SUBDIRS=\ qhelpindexmodel \ qhelpprojectdata \ -SUBDIRS += linguist +SUBDIRS += linguist uitools !cross_compile:SUBDIRS += host.pro diff --git a/tests/auto/uiloader/.gitignore b/tests/auto/uiloader/.gitignore new file mode 100644 index 000000000..a4b4e8f02 --- /dev/null +++ b/tests/auto/uiloader/.gitignore @@ -0,0 +1 @@ +tst_uiloader diff --git a/tests/auto/uiloader/README.TXT b/tests/auto/uiloader/README.TXT new file mode 100644 index 000000000..cbbf0ff77 --- /dev/null +++ b/tests/auto/uiloader/README.TXT @@ -0,0 +1,93 @@ + ------------------------------------------------------------------------- + TESTING WIDGETS DEFINED IN *.UI FILES (SCREENSHOT COMPARISON) + ------------------------------------------------------------------------- + This test is based on dev/qt/tests/auto/atwrapper/ + + +HOW TO RUN THE TESTS + + Compile the necessary programs: + qmake + make + + Now there should be an executable 'uiloader'. + Run the tests: + ./uiloader + + + +CONFIGURATION + + The tests can be executed on different machines. For every machine there + is a config file .ini. + + If this file is not available the tests won't be run on the machine. + + Example kayak.ini: + + [General] + ftpBaseDir=/arthurtest + ftpHost=wartburg + ftpPass=anonymouspass + ftpUser=anonymous + output=testresults + + [engines] + 1\engine=uic + size=1 + + Don't modify the [engines] section. Later it will be used for styles. The + only thing you might want to modify is the ftpHost value. At the moment + wartburg is just a server on which we test the tests. + + The actual test server is: kramer.troll.no + + + +HOW IT WORKS + + There are 3 important folders: + + tst_uiloader/ Actual program executing the tests. + tst_screenshot/ Program to generate one *.png file out of *.ui + baseline/ This is a dir with *.ui files. + + ./uiloader (compiled from tst_uiloader) will use the tst_screenshot program + and the files in baseline/. + + In order to generate screenshots the *.ui files in baseline/ will be used. + Therefore a folder testresults/ (specified in the config) will be + created/used. + + Structure of testresults/: + + |-- testresults + | `-- i686 Linux g++-4 full-config That's buildKey(). + | `-- 4.5.0 Used Qt version. + | |-- uic Here are the generated images. + | |-- uic.baseline Baseline downloaded from server. + | |-- uic.diff Diff Images of failed tests. + | `-- uic.failed Generated images of failed tests. + + If there is no baseline at the server the results in uic/ will be uploaded + as a new baseline (first run for your machine). So to create a new baseline + on the server you just need to remove your folders there. + + On the server side there is a dir /arthurtest with following structure + (it will be created if it's not there): + + |-- arthurtest + | `-- + | `-- + | `-- + | |-- uic.baseline Baseline. + | |-- uic.diff Here the local diffs will be uploaded. + | `-- uic.failed Here the local failed files will be uploaded. + + After a test run the files in local uic.diff/ and uic.failed/ will be + uploaded to the server. + + For every run the uic.diff/ and uic.failed/ on the local and remote machine + will be cleared in order to place new files there. On the local side uic/ + gets cleared, too. + diff --git a/tests/auto/uiloader/WTC0090dca226c8.ini b/tests/auto/uiloader/WTC0090dca226c8.ini new file mode 100644 index 000000000..5cf6c4fee --- /dev/null +++ b/tests/auto/uiloader/WTC0090dca226c8.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer-nokia.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/baseline/Dialog_with_Buttons_Bottom.ui b/tests/auto/uiloader/baseline/Dialog_with_Buttons_Bottom.ui new file mode 100644 index 000000000..18d31ab91 --- /dev/null +++ b/tests/auto/uiloader/baseline/Dialog_with_Buttons_Bottom.ui @@ -0,0 +1,71 @@ + + + + + Dialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 240 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/Dialog_with_Buttons_Right.ui b/tests/auto/uiloader/baseline/Dialog_with_Buttons_Right.ui new file mode 100644 index 000000000..703d594f4 --- /dev/null +++ b/tests/auto/uiloader/baseline/Dialog_with_Buttons_Right.ui @@ -0,0 +1,71 @@ + + + + + Dialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 290 + 20 + 81 + 241 + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/Dialog_without_Buttons.ui b/tests/auto/uiloader/baseline/Dialog_without_Buttons.ui new file mode 100644 index 000000000..1be629818 --- /dev/null +++ b/tests/auto/uiloader/baseline/Dialog_without_Buttons.ui @@ -0,0 +1,18 @@ + + Dialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + diff --git a/tests/auto/uiloader/baseline/Main_Window.ui b/tests/auto/uiloader/baseline/Main_Window.ui new file mode 100644 index 000000000..e324db829 --- /dev/null +++ b/tests/auto/uiloader/baseline/Main_Window.ui @@ -0,0 +1,27 @@ + + + + + MainWindow + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/tests/auto/uiloader/baseline/Widget.ui b/tests/auto/uiloader/baseline/Widget.ui new file mode 100644 index 000000000..9f6f60006 --- /dev/null +++ b/tests/auto/uiloader/baseline/Widget.ui @@ -0,0 +1,41 @@ + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + A label + + + + + + + A Group Box + + + + + + + PushButton + + + + + + + + diff --git a/tests/auto/uiloader/baseline/addlinkdialog.ui b/tests/auto/uiloader/baseline/addlinkdialog.ui new file mode 100644 index 000000000..3171159f9 --- /dev/null +++ b/tests/auto/uiloader/baseline/addlinkdialog.ui @@ -0,0 +1,112 @@ + + AddLinkDialog + + + Insert Link + + + false + + + true + + + + + + + + Title: + + + + + + + + 337 + 0 + + + + + + + + URL: + + + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + AddLinkDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AddLinkDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/addtorrentform.ui b/tests/auto/uiloader/baseline/addtorrentform.ui new file mode 100644 index 000000000..950bb6711 --- /dev/null +++ b/tests/auto/uiloader/baseline/addtorrentform.ui @@ -0,0 +1,266 @@ + + + + + AddTorrentFile + + + + 0 + 0 + 464 + 385 + + + + Add a torrent + + + false + + + true + + + + 8 + + + 6 + + + + + Select a torrent source + + + + 8 + + + 6 + + + + + Destination: + + + + + + + + + + Tracker URL: + + + + + + + Browse + + + true + + + + + + + File(s): + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Size: + + + + + + + Creator: + + + + + + + Qt::NoFocus + + + true + + + QTextEdit::NoWrap + + + true + + + + + + + Qt::StrongFocus + + + + + + + <none> + + + + + + + Torrent file: + + + + + + + Browse + + + + + + + Comment: + + + + + + + <none> + + + + + + + <none> + + + + + + + 0 + + + + + + + + 10 + 40 + 364 + 33 + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + false + + + &OK + + + + + + + &Cancel + + + + + + + + + + torrentFile + browseTorrents + torrentContents + destinationFolder + browseDestination + okButton + cancelButton + + + + + okButton + clicked() + AddTorrentFile + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + AddTorrentFile + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/tests/auto/uiloader/baseline/authenticationdialog.ui b/tests/auto/uiloader/baseline/authenticationdialog.ui new file mode 100644 index 000000000..82d908cff --- /dev/null +++ b/tests/auto/uiloader/baseline/authenticationdialog.ui @@ -0,0 +1,129 @@ + + Dialog + + + + 0 + 0 + 389 + 243 + + + + Http authentication required + + + + + + You need to supply a Username and a Password to access this site + + + false + + + + + + + Username: + + + + + + + + + + Password: + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Site: + + + + + + + + 75 + true + + + + %1 at %2 + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/backside.ui b/tests/auto/uiloader/baseline/backside.ui new file mode 100644 index 000000000..afa488c6f --- /dev/null +++ b/tests/auto/uiloader/baseline/backside.ui @@ -0,0 +1,208 @@ + + BackSide + + + + 0 + 0 + 378 + 385 + + + + BackSide + + + + + + Settings + + + true + + + true + + + + + + Title: + + + + + + + Pad Navigator Example + + + + + + + Modified: + + + + + + + Extent + + + + + + + + + 42 + + + Qt::Horizontal + + + + + + + 42 + + + + + + + + + + + + + + + Other input + + + true + + + true + + + + + + + Widgets On Graphics View + + + + + QGraphicsProxyWidget + + + + QGraphicsWidget + + + + QObject + + + + + QGraphicsItem + + + + + QGraphicsLayoutItem + + + + + + + QGraphicsGridLayout + + + + QGraphicsLayout + + + + QGraphicsLayoutItem + + + + + + + QGraphicsLinearLayout + + + + QGraphicsLayout + + + + QGraphicsLayoutItem + + + + + + + + + + + + + groupBox + hostName + dateTimeEdit + horizontalSlider + spinBox + groupBox_2 + treeWidget + + + + + horizontalSlider + valueChanged(int) + spinBox + setValue(int) + + + 184 + 125 + + + 275 + 127 + + + + + spinBox + valueChanged(int) + horizontalSlider + setValue(int) + + + 272 + 114 + + + 190 + 126 + + + + + diff --git a/tests/auto/uiloader/baseline/batchtranslation.ui b/tests/auto/uiloader/baseline/batchtranslation.ui new file mode 100644 index 000000000..6cb294360 --- /dev/null +++ b/tests/auto/uiloader/baseline/batchtranslation.ui @@ -0,0 +1,236 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + databaseTranslationDialog + + + + 0 + 0 + 425 + 370 + + + + Qt Linguist - Batch Translation + + + + 9 + + + 6 + + + + + + 5 + 4 + 0 + 0 + + + + Options + + + + 9 + + + 6 + + + + + Only translate entries with no translation + + + true + + + + + + + Set translated entries to finished + + + true + + + + + + + + + + + 5 + 1 + 0 + 0 + + + + Phrase book preference + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + true + + + + + + + 0 + + + 6 + + + + + Move up + + + + + + + Move down + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + The batch translator will search through the selected phrasebooks in the order given above. + + + true + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Run + + + + + + + &Cancel + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/bookmarkdialog.ui b/tests/auto/uiloader/baseline/bookmarkdialog.ui new file mode 100644 index 000000000..2d6470c54 --- /dev/null +++ b/tests/auto/uiloader/baseline/bookmarkdialog.ui @@ -0,0 +1,161 @@ + + BookmarkDialog + + + + 0 + 0 + 450 + 135 + + + + + 0 + 0 + + + + Add Bookmark + + + + + + + + + + Bookmark: + + + + + + + Add in Folder: + + + + + + + + + + + + + + + + + + + + + + + + 25 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + + + + + + true + + + + 0 + 0 + + + + + 1 + + + + + + + + + + New Folder + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + BookmarkWidget + QTreeWidget +
bookmarkwidget.h
+
+
+ + + + buttonBox + accepted() + BookmarkDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + BookmarkDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/tests/auto/uiloader/baseline/bookwindow.ui b/tests/auto/uiloader/baseline/bookwindow.ui new file mode 100644 index 000000000..659d32456 --- /dev/null +++ b/tests/auto/uiloader/baseline/bookwindow.ui @@ -0,0 +1,149 @@ + + + + + BookWindow + + + + 0 + 0 + 601 + 420 + + + + Books + + + + + 9 + + + 6 + + + + + Books + + + + 9 + + + 6 + + + + + QAbstractItemView::SelectRows + + + + + + + Details + + + + + + <b>Title:</b> + + + + + + + true + + + + + + + <b>Author: </b> + + + + + + + true + + + + + + + <b>Genre:</b> + + + + + + + true + + + + + + + <b>Year:</b> + + + + + + + true + + + + + + 2100 + + + -1000 + + + + + + + <b>Rating:</b> + + + + + + + 5 + + + + + + + + + + + + + + + bookTable + titleEdit + authorEdit + genreEdit + yearEdit + + + + diff --git a/tests/auto/uiloader/baseline/browserwidget.ui b/tests/auto/uiloader/baseline/browserwidget.ui new file mode 100644 index 000000000..20946f0ed --- /dev/null +++ b/tests/auto/uiloader/baseline/browserwidget.ui @@ -0,0 +1,199 @@ + + + + + Browser + + + + 0 + 0 + 765 + 515 + + + + Qt SQL Browser + + + + 8 + + + 6 + + + + + + 7 + 7 + 0 + 0 + + + + Qt::Horizontal + + + + + 13 + 7 + 1 + 0 + + + + + + + 7 + 7 + 2 + 0 + + + + Qt::ActionsContextMenu + + + QAbstractItemView::SelectRows + + + + + + + + + 5 + 3 + 0 + 0 + + + + + 16777215 + 180 + + + + SQL Query + + + + 9 + + + 6 + + + + + + 7 + 3 + 0 + 0 + + + + + 0 + 18 + + + + + 0 + 120 + + + + + + + + 1 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Clear + + + + + + + &Submit + + + + + + + + + + + + false + + + &Insert Row + + + Inserts a new Row + + + + + false + + + &Delete Row + + + Deletes the current Row + + + + + + + ConnectionWidget + QTreeView +
connectionwidget.h
+ 0 + +
+
+ + sqlEdit + clearButton + submitButton + connectionWidget + table + + + +
diff --git a/tests/auto/uiloader/baseline/calculator.ui b/tests/auto/uiloader/baseline/calculator.ui new file mode 100644 index 000000000..bb519ba2a --- /dev/null +++ b/tests/auto/uiloader/baseline/calculator.ui @@ -0,0 +1,406 @@ + + Calculator + + + + 0 + 0 + 314 + 301 + + + + + 0 + 0 + + + + + 314 + 301 + + + + + 314 + 301 + + + + Calculator + + + + + 10 + 50 + 91 + 41 + + + + Backspace + + + + + + 110 + 50 + 91 + 41 + + + + Clear + + + + + + 210 + 50 + 91 + 41 + + + + Clear All + + + + + + 10 + 100 + 41 + 41 + + + + MC + + + + + + 10 + 150 + 41 + 41 + + + + MR + + + + + + 10 + 200 + 41 + 41 + + + + MS + + + + + + 10 + 250 + 41 + 41 + + + + M+ + + + + + + 60 + 100 + 41 + 41 + + + + 7 + + + + + + 110 + 100 + 41 + 41 + + + + 8 + + + + + + 160 + 100 + 41 + 41 + + + + 9 + + + + + + 60 + 150 + 41 + 41 + + + + 4 + + + + + + 110 + 150 + 41 + 41 + + + + 5 + + + + + + 160 + 150 + 41 + 41 + + + + 6 + + + + + + 60 + 200 + 41 + 41 + + + + 1 + + + + + + 110 + 200 + 41 + 41 + + + + 2 + + + + + + 160 + 200 + 41 + 41 + + + + 3 + + + + + + 60 + 250 + 41 + 41 + + + + 0 + + + + + + 110 + 250 + 41 + 41 + + + + . + + + + + + 160 + 250 + 41 + 41 + + + + +- + + + + + + 210 + 250 + 41 + 41 + + + + + + + + + + + 210 + 100 + 41 + 41 + + + + / + + + + + + 210 + 150 + 41 + 41 + + + + * + + + + + + 210 + 200 + 41 + 41 + + + + - + + + + + + 260 + 100 + 41 + 41 + + + + Sqrt + + + + + + 260 + 150 + 41 + 41 + + + + x^2 + + + + + + 260 + 200 + 41 + 41 + + + + 1/x + + + + + + 260 + 250 + 41 + 41 + + + + = + + + + + + 10 + 10 + 291 + 31 + + + + 15 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + + + + diff --git a/tests/auto/uiloader/baseline/calculatorform.ui b/tests/auto/uiloader/baseline/calculatorform.ui new file mode 100644 index 000000000..dda0e62dd --- /dev/null +++ b/tests/auto/uiloader/baseline/calculatorform.ui @@ -0,0 +1,303 @@ + + + + + CalculatorForm + + + CalculatorForm + + + + 0 + 0 + 276 + 98 + + + + + 5 + 5 + 0 + 0 + + + + Calculator Builder + + + + + + + 9 + + + 6 + + + + + + + + 1 + + + 6 + + + + + + + + 1 + + + 6 + + + + + label + + + + 1 + 1 + 45 + 19 + + + + Input 1 + + + + + + + inputSpinBox1 + + + + 1 + 26 + 45 + 25 + + + + true + + + + + + + + + label_3 + + + + 54 + 1 + 7 + 52 + + + + + + + + Qt::AlignCenter + + + + + + + + + + 1 + + + 6 + + + + + label_2 + + + + 1 + 1 + 45 + 19 + + + + Input 2 + + + + + + + inputSpinBox2 + + + + 1 + 26 + 45 + 25 + + + + true + + + + + + + + + label_3_2 + + + + 120 + 1 + 7 + 52 + + + + = + + + Qt::AlignCenter + + + + + + + + + + 1 + + + 6 + + + + + label_2_2_2 + + + + 1 + 1 + 37 + 17 + + + + Output + + + + + + + outputWidget + + + + 1 + 24 + 37 + 27 + + + + QFrame::Box + + + QFrame::Sunken + + + 0 + + + Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask + + + + + + + + + + + verticalSpacer + + + + 85 + 69 + 20 + 20 + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + horizontalSpacer + + + + 188 + 26 + 79 + 20 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/certificateinfo.ui b/tests/auto/uiloader/baseline/certificateinfo.ui new file mode 100644 index 000000000..3761fe8f5 --- /dev/null +++ b/tests/auto/uiloader/baseline/certificateinfo.ui @@ -0,0 +1,85 @@ + + CertificateInfo + + + + 0 + 0 + 400 + 397 + + + + Display Certificate Information + + + + + + Certification Path + + + + + + + + + + + + Certificate Information + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + clicked(QAbstractButton*) + CertificateInfo + accept() + + + 343 + 374 + + + 352 + 422 + + + + + diff --git a/tests/auto/uiloader/baseline/chatdialog.ui b/tests/auto/uiloader/baseline/chatdialog.ui new file mode 100644 index 000000000..c85e0d0f5 --- /dev/null +++ b/tests/auto/uiloader/baseline/chatdialog.ui @@ -0,0 +1,79 @@ + + ChatDialog + + + + 0 + 0 + 513 + 349 + + + + Chat + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + Qt::NoFocus + + + true + + + + + + + + 180 + 16777215 + + + + Qt::NoFocus + + + + + + + + + 0 + + + 6 + + + + + Message: + + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/chatmainwindow.ui b/tests/auto/uiloader/baseline/chatmainwindow.ui new file mode 100644 index 000000000..0616dcb13 --- /dev/null +++ b/tests/auto/uiloader/baseline/chatmainwindow.ui @@ -0,0 +1,185 @@ + + + + + ChatMainWindow + + + + 0 + 0 + 800 + 600 + + + + QtDBus Chat + + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + false + + + Messages sent and received from other users + + + true + + + + + + + 0 + + + 6 + + + + + Message: + + + messageLineEdit + + + + + + + + + + + 1 + 0 + 0 + 0 + + + + Sends a message to other people + + + + + + Send + + + + + + + + + + + + + 0 + 0 + 800 + 31 + + + + + Help + + + + + + File + + + + + + + + + + + + Quit + + + Ctrl+Q + + + + + About Qt... + + + + + Change nickname... + + + Ctrl+N + + + + + + chatHistory + messageLineEdit + sendButton + + + + + messageLineEdit + returnPressed() + sendButton + animateClick() + + + 299 + 554 + + + 744 + 551 + + + + + actionQuit + triggered(bool) + ChatMainWindow + close() + + + -1 + -1 + + + 399 + 299 + + + + + diff --git a/tests/auto/uiloader/baseline/chatsetnickname.ui b/tests/auto/uiloader/baseline/chatsetnickname.ui new file mode 100644 index 000000000..fb9894e09 --- /dev/null +++ b/tests/auto/uiloader/baseline/chatsetnickname.ui @@ -0,0 +1,149 @@ + + + + + NicknameDialog + + + + 0 + 0 + 396 + 105 + + + + + 1 + 1 + 0 + 0 + + + + Set nickname + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + + 1 + 1 + 0 + 0 + + + + New nickname: + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + okButton + clicked() + NicknameDialog + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + NicknameDialog + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/tests/auto/uiloader/baseline/config.ui b/tests/auto/uiloader/baseline/config.ui new file mode 100644 index 000000000..bebe17b41 --- /dev/null +++ b/tests/auto/uiloader/baseline/config.ui @@ -0,0 +1,2528 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + Config + + + + 0 + 0 + 600 + 650 + + + + Configure + + + true + + + + 6 + + + 8 + + + 8 + + + 8 + + + 8 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Size + + + + 6 + + + 11 + + + 11 + + + 11 + + + 11 + + + + + 176x220 "SmartPhone" + + + + + + + 240x320 "PDA" + + + + + + + 320x240 "TV" / "QVGA" + + + + + + + 640x480 "VGA" + + + + + + + 800x600 + + + + + + + 1024x768 + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Custom + + + + + + + 1 + + + 1280 + + + 16 + + + 400 + + + + + + + 1 + + + 1024 + + + 16 + + + 300 + + + + + + + + + + + + Depth + + + + 6 + + + 11 + + + 11 + + + 11 + + + 11 + + + + + 1 bit monochrome + + + + + + + 4 bit grayscale + + + + + + + 8 bit + + + + + + + 12 (16) bit + + + + + + + 15 bit + + + + + + + 16 bit + + + + + + + 18 bit + + + + + + + 24 bit + + + + + + + 32 bit + + + + + + + 32 bit ARGB + + + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Skin + + + + + + + + 0 + 0 + + + + + None + + + + + + + + + + Emulate touch screen (no mouse move) + + + + + + + Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) + + + + + + + Qt::Vertical + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. + + + true + + + + + + + Gamma + + + + 11 + + + 11 + + + 11 + + + 11 + + + 6 + + + 6 + + + + + Blue + + + + + + + + + + + + 128 + 128 + 128 + + + + + + + 0 + 0 + 255 + + + + + + + 127 + 127 + 255 + + + + + + + 38 + 38 + 255 + + + + + + + 0 + 0 + 127 + + + + + + + 0 + 0 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 0 + 0 + 255 + + + + + + + 127 + 127 + 255 + + + + + + + 38 + 38 + 255 + + + + + + + 0 + 0 + 127 + + + + + + + 0 + 0 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 0 + 0 + 255 + + + + + + + 127 + 127 + 255 + + + + + + + 38 + 38 + 255 + + + + + + + 0 + 0 + 127 + + + + + + + 0 + 0 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + 400 + + + 100 + + + Qt::Horizontal + + + + + + + 1.0 + + + + + + + Green + + + + + + + + + + + + 128 + 128 + 128 + + + + + + + 0 + 255 + 0 + + + + + + + 127 + 255 + 127 + + + + + + + 38 + 255 + 38 + + + + + + + 0 + 127 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 0 + 255 + 0 + + + + + + + 127 + 255 + 127 + + + + + + + 38 + 255 + 38 + + + + + + + 0 + 127 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 0 + 255 + 0 + + + + + + + 127 + 255 + 127 + + + + + + + 38 + 255 + 38 + + + + + + + 0 + 127 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + 400 + + + 100 + + + Qt::Horizontal + + + + + + + 1.0 + + + + + + + All + + + + + + + 1.0 + + + + + + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 170 + 170 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 170 + 170 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 127 + 127 + 127 + + + + + + + 170 + 170 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + 400 + + + 100 + + + Qt::Horizontal + + + + + + + Red + + + + + + + 1.0 + + + + + + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 127 + 127 + + + + + + + 255 + 38 + 38 + + + + + + + 127 + 0 + 0 + + + + + + + 170 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 127 + 127 + + + + + + + 255 + 38 + 38 + + + + + + + 127 + 0 + 0 + + + + + + + 170 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 0 + 0 + + + + + + + 255 + 127 + 127 + + + + + + + 255 + 38 + 38 + + + + + + + 127 + 0 + 0 + + + + + + + 170 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 10 + 95 + 137 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + 232 + 232 + 232 + + + + + + + + 400 + + + 100 + + + Qt::Horizontal + + + + + + + Set all to 1.0 + + + + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &OK + + + true + + + true + + + + + + + &Cancel + + + true + + + + + + + + + + + GammaView + +
gammaview.h
+
+
+ + + + size_width + valueChanged(int) + size_custom + click() + + + 152 + 193 + + + 94 + 199 + + + + + size_height + valueChanged(int) + size_custom + click() + + + 259 + 196 + + + 64 + 188 + + + + +
diff --git a/tests/auto/uiloader/baseline/connectdialog.ui b/tests/auto/uiloader/baseline/connectdialog.ui new file mode 100644 index 000000000..bd062ebaa --- /dev/null +++ b/tests/auto/uiloader/baseline/connectdialog.ui @@ -0,0 +1,150 @@ + + ConnectDialog + + + + 0 + 0 + 585 + 361 + + + + Configure Connection + + + + + + GroupBox + + + + + + Qt::ElideMiddle + + + + + + + + + Edit... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + GroupBox + + + + + + Qt::ElideMiddle + + + + + + + + + Edit... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Show signals and slots inherited from QWidget + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ConnectDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ConnectDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/controller.ui b/tests/auto/uiloader/baseline/controller.ui new file mode 100644 index 000000000..379015bf3 --- /dev/null +++ b/tests/auto/uiloader/baseline/controller.ui @@ -0,0 +1,64 @@ + + Controller + + + + 0 + 0 + 255 + 111 + + + + Controller + + + + 9 + + + 6 + + + + + Controller + + + Qt::AlignCenter + + + + + + + Decelerate + + + + + + + Accelerate + + + + + + + Right + + + + + + + Left + + + + + + + + diff --git a/tests/auto/uiloader/baseline/cookies.ui b/tests/auto/uiloader/baseline/cookies.ui new file mode 100644 index 000000000..c4bccc548 --- /dev/null +++ b/tests/auto/uiloader/baseline/cookies.ui @@ -0,0 +1,106 @@ + + CookiesDialog + + + + 0 + 0 + 550 + 370 + + + + Cookies + + + + + + Qt::Horizontal + + + + 252 + 20 + + + + + + + + + + + + + + + + &Remove + + + + + + + Remove &All Cookies + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QDialogButtonBox::Ok + + + + + + + + + + SearchLineEdit + QLineEdit +
searchlineedit.h
+
+ + EditTableView + QTableView +
edittableview.h
+
+
+ + + + buttonBox + accepted() + CookiesDialog + accept() + + + 472 + 329 + + + 461 + 356 + + + + +
diff --git a/tests/auto/uiloader/baseline/cookiesexceptions.ui b/tests/auto/uiloader/baseline/cookiesexceptions.ui new file mode 100644 index 000000000..3d9ef6241 --- /dev/null +++ b/tests/auto/uiloader/baseline/cookiesexceptions.ui @@ -0,0 +1,184 @@ + + CookiesExceptionsDialog + + + + 0 + 0 + 466 + 446 + + + + Cookie Exceptions + + + + + + New Exception + + + + + + + + Domain: + + + + + + + + + + + + + + Qt::Horizontal + + + + 81 + 25 + + + + + + + + false + + + Block + + + + + + + false + + + Allow For Session + + + + + + + false + + + Allow + + + + + + + + + + + + Exceptions + + + + + + Qt::Horizontal + + + + 252 + 20 + + + + + + + + + + + + + + &Remove + + + + + + + Remove &All + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + SearchLineEdit + QLineEdit +
searchlineedit.h
+
+ + EditTableView + QTableView +
edittableview.h
+
+
+ + + + buttonBox + accepted() + CookiesExceptionsDialog + accept() + + + 381 + 428 + + + 336 + 443 + + + + +
diff --git a/tests/auto/uiloader/baseline/css_borderimage.ui b/tests/auto/uiloader/baseline/css_borderimage.ui new file mode 100644 index 000000000..4a59ca2e0 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_borderimage.ui @@ -0,0 +1,125 @@ + + + Form + + + + 0 + 0 + 530 + 309 + + + + Form + + + QLabel { border-width: 28; color: #0f0; background-color: white; } + +#label_repeat_repeat { + border-image: url("images/borderimage.png") 28 repeat repeat; +} + +#label_stretch_repeat { + border-image: url("images/borderimage.png") 28 stretch repeat; +} + +#label_round_repeat { + border-image: url("images/borderimage.png") 28 round repeat; +} + + +#label_repeat_round { + border-image: url("images/borderimage.png") 28 repeat round; +} + +#label_stretch_round { + border-image: url("images/borderimage.png") 28 stretch round; +} + +#label_round_round { + border-image: url("images/borderimage.png") 28 round round; +} + +#label_repeat_stretch { + border-image: url("images/borderimage.png") 28 repeat stretch; +} + +#label_stretch_stretch { + border-image: url("images/borderimage.png") 28 stretch stretch; +} + +#label_round_stretch { + border-image: url("images/borderimage.png") 28 round stretch; +} + + + + + + + Strecth Stretch + + + + + + + Stretch Round + + + + + + + Stretch repeat + + + + + + + Round Stretch + + + + + + + Round Round + + + + + + + Round Repeat + + + + + + + Repeat Stretch + + + + + + + Repeat Round + + + + + + + Repeat Repeat + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui b/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui new file mode 100644 index 000000000..0ece79a08 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui @@ -0,0 +1,247 @@ + + + MainWindow + + + + 0 + 0 + 606 + 388 + + + + MainWindow + + + * { border-image: url("images/pushbutton.png") 6 6 6 6; border-width:6px; } + + + + + + + + + + + + Each widget should have a background image. including the top level + + + true + + + + + + + PushButton + + + + + + + 24 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + PushButton + + + + + + + + + + RadioButton + + + + + + + true + + + + + 0 + 0 + 260 + 197 + + + + + + + Qt::Horizontal + + + + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + CheckBox + + + + + + + + + + + + + + GroupBox + + + + + + CheckBox + + + + + + + Line Edit + + + + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + 0 + 0 + 606 + 36 + + + + + File + + + + + + + Edit + + + + + + + + + Open + + + + + Close + + + + + + diff --git a/tests/auto/uiloader/baseline/css_borderradius_allwidgets.ui b/tests/auto/uiloader/baseline/css_borderradius_allwidgets.ui new file mode 100644 index 000000000..8c5f57cb1 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_borderradius_allwidgets.ui @@ -0,0 +1,458 @@ + + + MainWindow + + + + 0 + 0 + 698 + 589 + + + + MainWindow + + + * { + background: yellow; + padding: 2px; + border-radius: 4px; +} + +QGroupBox { + border: 1px solid gray; +} + +QAbstractButton { + background: cyan; +} + +QFrame, QMenuBar { + background: magenta; +} + +QLineEdit, QSpinBox { + background: white; +} + +#gb1 * { +} + +#gb2 * { + border: 1px solid blue; +} + +#gb3 * { + border: 0px solid blue; +} + +#gb4 * { + border-image: url("images/pushbutton.png") 6 6 6 6; + border-width:6px; +} + + + + + + + + No border + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + PushButton + + + + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + LineEdit + + + + + + + + ComboBox + + + + + + + + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + 0px border + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + PushButton + + + + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + LineEdit + + + + + + + + ComboBox + + + + + + + + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + border-image + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + PushButton + + + + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + LineEdit + + + + + + + + ComboBox + + + + + + + + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + 1px border + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + PushButton + + + + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + LineEdit + + + + + + + + ComboBox + + + + + + + + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + + + 0 + 0 + 698 + 24 + + + + + File + + + + + + + Edit + + + + + + + + + Open + + + + + Close + + + + + + diff --git a/tests/auto/uiloader/baseline/css_buttons_background.ui b/tests/auto/uiloader/baseline/css_buttons_background.ui new file mode 100644 index 000000000..3d80aeb4b --- /dev/null +++ b/tests/auto/uiloader/baseline/css_buttons_background.ui @@ -0,0 +1,271 @@ + + + Dialog + + + + 0 + 0 + 449 + 254 + + + + Dialog + + + #box_color QAbstractButton { +background: pink; +color: purple; +} + +#box_gradiant QAbstractButton { + background-color: qconicalgradient(cx:0.5, cy:0.5, angle:0, stop:0 rgba(255, 255, 255, 255), stop:0.373979 rgba(255, 255, 255, 255), stop:0.373991 rgba(33, 30, 255, 255), stop:0.624018 rgba(33, 30, 255, 255), stop:0.624043 rgba(255, 0, 0, 255), stop:1 rgba(255, 0, 0, 255)); +color: cyan; +} + +#box_pixmap QAbstractButton { +background: url("images/pagefold.png") no-repeat top right; +color: yellow; +} + + + + + + + + color + + + + + + PushButton + + + + + + + ... + + + + + + + Qt::Horizontal + + + + 70 + 27 + + + + + + + + CheckBox + + + + + + + RadioButton + + + + + + + autoraise + + + true + + + + + + + Checked + + + true + + + true + + + + + + + + + + gradiant + + + + + + PushButton + + + + + + + ... + + + + + + + Qt::Horizontal + + + + 78 + 24 + + + + + + + + CheckBox + + + + + + + RadioButton + + + + + + + autoraise + + + true + + + + + + + Checked + + + true + + + true + + + + + + + + + + pixmap + + + + + + PushButton + + + + + + + ... + + + + + + + Qt::Horizontal + + + + 78 + 24 + + + + + + + + CheckBox + + + + + + + RadioButton + + + + + + + autoraise + + + true + + + + + + + Checked + + + true + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 51 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_combobox_background.ui b/tests/auto/uiloader/baseline/css_combobox_background.ui new file mode 100644 index 000000000..387b37197 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_combobox_background.ui @@ -0,0 +1,306 @@ + + + Dialog + + + + 0 + 0 + 295 + 229 + + + + Dialog + + + #box_color QComboBox { +background: pink; +color: purple; +} + +#box_gradiant QComboBox { + background-color: qconicalgradient(cx:0.5, cy:0.5, angle:0, stop:0 rgba(255, 255, 255, 255), stop:0.373979 rgba(255, 255, 255, 255), stop:0.373991 rgba(33, 30, 255, 255), stop:0.624018 rgba(33, 30, 255, 255), stop:0.624043 rgba(255, 0, 0, 255), stop:1 rgba(255, 0, 0, 255)); +color: cyan; +} + +#box_pixmap QAbstractButton { +background: url("images/pagefold.png") no-repeat top right; +color: yellow; +} + +#comboBox_A , #comboBox_B{ border: 3px solid #4e5; } + + + + + + + + color + + + false + + + + + + false + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + true + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + + ComboText + + + + + Bar + + + + + Bouz + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + color + + + false + + + + + + false + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + true + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + + Foo + + + + + Bar + + + + + Bouz + + + + + + + + + ComboText + + + + + Bar + + + + + Bouz + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_exemple_coffee.ui b/tests/auto/uiloader/baseline/css_exemple_coffee.ui new file mode 100644 index 000000000..619f912a9 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_exemple_coffee.ui @@ -0,0 +1,469 @@ + + + MainWindow + + + + 0 + 0 + 400 + 413 + + + + Style Sheet + + + .QWidget { + background-color: beige; +} + +/* Nice Windows-XP-style password character. */ +QLineEdit[echoMode="2"] { + lineedit-password-character: 9679; +} + +/* We provide a min-width and min-height for push buttons + so that they look elegant regardless of the width of the text. */ +QPushButton { + background-color: palegoldenrod; + border-width: 2px; + border-color: darkkhaki; + border-style: solid; + border-radius: 5; + padding: 3px; + min-width: 9ex; + min-height: 2.5ex; +} + +QPushButton:hover { + background-color: khaki; +} + +/* Increase the padding, so the text is shifted when the button is + pressed. */ +QPushButton:pressed { + padding-left: 5px; + padding-top: 5px; + background-color: #d0d67c; +} + +QLabel, QAbstractButton { + font: bold; +} + +/* Mark mandatory fields with a brownish color. */ +.mandatory { + color: brown; +} + +/* Bold text on status bar looks awful. */ +QStatusBar QLabel { + font: normal; +} + +QStatusBar::item { + border-width: 1; + border-color: darkkhaki; + border-style: solid; + border-radius: 2; +} + +QComboBox, QLineEdit, QSpinBox, QTextEdit, QListView { + background-color: cornsilk; + selection-color: #0a214c; + selection-background-color: #C19A6B; +} + +QListView { + show-decoration-selected: 1; +} + +QListView::item:hover { + background-color: wheat; +} + +/* We reserve 1 pixel space in padding. When we get the focus, + we kill the padding and enlarge the border. This makes the items + glow. */ +QLineEdit, QFrame { + border-width: 2px; + padding: 1px; + border-style: solid; + border-color: darkkhaki; + border-radius: 5px; +} + +/* As mentioned above, eliminate the padding and increase the border. */ +QLineEdit:focus, QFrame:focus { + border-width: 3px; + padding: 0px; +} + +/* A QLabel is a QFrame ... */ +QLabel { + border: none; + padding: 0; + background: none; +} + +/* A QToolTip is a QLabel ... */ +QToolTip { + border: 2px solid darkkhaki; + padding: 5px; + border-radius: 3px; + opacity: 200; +} + +/* Nice to have the background color change when hovered. */ +QRadioButton:hover, QCheckBox:hover { + background-color: wheat; +} + +/* Force the dialog's buttons to follow the Windows guidelines. */ +QDialogButtonBox { + button-layout: 0; +} + + + + + + + + 6 + + + 9 + + + + + QFrame::StyledPanel + + + + 9 + + + 6 + + + + + Please read the LICENSE file before checking + + + I &accept the terms and &conditions + + + + + + + Profession: + + + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing + + + professionList + + + + + + + &Name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + nameCombo + + + + + + + Check this if you are male + + + &Male + + + + + + + &Password: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + passwordEdit + + + + + + + Specify country of origin + + + Specify country of origin + + + 6 + + + + Egypt + + + + + France + + + + + Germany + + + + + India + + + + + Italy + + + + + Norway + + + + + Pakistan + + + + + + + + &Age: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + ageSpinBox + + + + + + + Country: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + countryCombo + + + + + + + Gender: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Specify your password + + + Specify your password + + + Password + + + QLineEdit::Password + + + + + + + Check this if you are female + + + &Female + + + + + + + Specify your age + + + Specify your age + + + 12 + + + 22 + + + + + + + Specify your name + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 61 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Select your profession + + + Specify your name here + + + Specify your name here + + + 0 + + + + Developer + + + + + Student + + + + + Fisherman + + + + + + + + + + + + + 0 + 0 + 400 + 31 + + + + + &File + + + + + + + + &Help + + + + + + + + + + + &Exit + + + + + About Qt + + + + + Edit &Style... + + + + + About + + + + + + diff --git a/tests/auto/uiloader/baseline/css_exemple_pagefold.ui b/tests/auto/uiloader/baseline/css_exemple_pagefold.ui new file mode 100644 index 000000000..d23fad34c --- /dev/null +++ b/tests/auto/uiloader/baseline/css_exemple_pagefold.ui @@ -0,0 +1,656 @@ + + + MainWindow + + + + 0 + 0 + 426 + 413 + + + + Style Sheet + + + /* Customize any plain widget that is a child of a QMainWindow. */ +QMainWindow > .QWidget { + background-color: gainsboro; + background-image: url(images/pagefold.png); + background-position: top right; + background-repeat: no-repeat +} + +/* Provide a padding for the layout inside the frame. The frame + exists only to provide a padding for the top-right image, so we + explicitly disable the border. */ +#mainFrame { + padding-right: 30px; + border-style: none; + border-image: none; /* since we set a border-image below */ +} + +/* mainFrame won't have this border-image since we have + explicitly set it to 'none' using a more specific selector. */ +QFrame, QLineEdit, QComboBox[editable="true"], QSpinBox { + border-image: url(images/frame.png) 4; + border-width: 3; +} + +QLabel { + border: none; + border-image: none; + padding: 0; + background: none; +} + +/* Make text in message boxes selectable. */ +QMessageBox { + /* LinksAccessibleByMouse | TextSelectableByMouse */ + messagebox-text-interaction-flags: 5; +} + +/* Set the selection colors for all widgets. */ +QWidget { + selection-color: black; + selection-background-color: Silver; + color: black; +} + +/* Make the entire row selected in item views. */ +QAbstractItemView { + show-decoration-selected: 1; +} + +/* Nice WindowsXP-style password character for password line edits. */ +QLineEdit[echoMode="2"] { + lineedit-password-character: 9679; +} + +/* Customize tooltips. */ +QToolTip { + background-color: rgb(200,200,255); + border-color: darkslategray; + border-width: 1px; + border-style: solid; + padding: 3px; + font: bold; + border-radius: 3px; + opacity: 200; +} + +/* Customize radio buttons. */ + +QRadioButton { + spacing: 5px; +} + +QRadioButton::indicator { + width: 13px; + height: 13px; +} + +QRadioButton::indicator::unchecked { + image: url(images/radiobutton_unchecked.png); +} + +QRadioButton::indicator:unchecked:hover { + image: url(images/radiobutton_unchecked_hover.png); +} + +QRadioButton::indicator:unchecked:pressed { + image: url(images/radiobutton_unchecked_pressed.png); +} + +QRadioButton::indicator::checked { + image: url(images/radiobutton_checked.png); +} + +QRadioButton::indicator:checked:hover { + image: url(images/radiobutton_checked_hover.png); +} + +QRadioButton::indicator:checked:pressed { + image: url(images/radiobutton_checked_pressed.png); +} + +/* Customize arrows. */ + +*::down-arrow, *::menu-indicator { + image: url(images/down_arrow.png); + width: 7px; + height: 7px; +} + +*::down-arrow:disabled, *::down-arrow:off { + image: url(images/down_arrow_disabled.png); +} + +*::up-arrow { + image: url(images/up_arrow.png); + width: 7px; + height: 7px; +} + +*::up-arrow:disabled, *::up-arrow:off { + image: url(images/up_arrow_disabled.png); +} + +/* Customize push buttons and comboboxes. Our read-only combobox + is very similar to a push button, so they share the same border image. */ + +QPushButton { + min-width: 4em; +} + +QPushButton, QComboBox[editable="false"], +QComboBox[editable="true"]::drop-down { + border-image: url(images/pushbutton.png) 5; + border-width: 5; +} + +QPushButton:hover, QComboBox[editable="false"]:hover, +QComboBox[editable="true"]::drop-down:hover, QMenuBar::item:hover { + border-image: url(images/pushbutton_hover.png) 5; + border-width: 5; +} + +QPushButton:pressed, QComboBox[editable="false"]:on, +QComboBox[editable="true"]::drop-down:on, QMenuBar::item:on { + border-image: url(images/pushbutton_pressed.png) 5; + border-width: 5; +} + +/* Customize read-only comboboxes. */ + +QComboBox[editable="false"] { + padding-left: 3px; + padding-right: 20px; /* space for the arrow */ +} + +QComboBox[editable="false"]::drop-down { + subcontrol-origin: padding; + subcontrol-position: top right; + width: 15px; + border-left-style: solid; + border-left-color: darkgray; + border-left-width: 1px; +} + +QComboBox[editable="false"]::down-arrow { + subcontrol-origin: content; + subcontrol-position: center; + position: relative; + left: 1px; /* 1 pixel dropdown border */ +} + +/* The combobox arrow is on when the popup is open. */ +QComboBox[editable="false"]::down-arrow:on { + position: relative; + top: 1px; + left: 2px; +} + +/* Customize editable comboboxes. */ + +QComboBox[editable="true"] { + padding-right: 16px; +} + +QComboBox[editable="true"]::drop-down { + subcontrol-origin: border; + subcontrol-position: top right; + width: 13px; + position: absolute; + top: 2px; + bottom: 2px; + right: 2px; +} + +QComboBox[editable="true"]::drop-down, +QComboBox[editable="true"]::drop-down:hover, +QComboBox[editable="true"]::drop-down:on { + border-width: 0px; + border-left-width: 3px; /* we need only left and center part */ +} + +/* Shift the arrow when it's open. */ +QComboBox[editable="true"]::down-arrow:on { + position: relative; + top: 1px; + left: 1px; +} + +/* Customize check boxes. */ +QCheckBox { + spacing: 5px; +} + +QCheckBox::indicator { + width: 13px; + height: 13px; +} + +QCheckBox::indicator:unchecked { + image: url(images/checkbox_unchecked.png); +} + +QCheckBox::indicator:unchecked:hover { + image: url(images/checkbox_unchecked_hover.png); +} + +QCheckBox::indicator:unchecked:pressed { + image: url(images/checkbox_unchecked_pressed.png); +} + +QCheckBox::indicator:checked { + image: url(images/checkbox_checked.png); +} + +QCheckBox::indicator:checked:hover { + image: url(images/checkbox_checked_hover.png); +} + +QCheckBox::indicator:checked:pressed { + image: url(images/checkbox_checked_pressed.png); +} + +/* Customize the size grip. */ +QSizeGrip { + image: url(images/sizegrip.png); + width: 16px; + height: 16px; +} + +/* Customize the menu bar. */ +QMenuBar { + border-image: none; + border-style: none; + border-width: 1px; + border-bottom-style: solid; + border-bottom-color: darkslategray; + padding: 2px; +} + +/* Customize spin boxes. */ + +QSpinBox { + padding-right: 15px; +} + +QSpinBox::up-button { + subcontrol-origin: border; + subcontrol-position: top right; + + width: 16px; /* 16 + 2*1px border-width = 15px padding + 3px parent border */ + border-image: url(images/spinup.png) 1; + border-width: 1px; +} + +QSpinBox::up-button:hover { + border-image: url(images/spinup_hover.png) 1; +} + +QSpinBox::up-button:pressed { + border-image: url(images/spinup_pressed.png) 1; +} + +QSpinBox::down-button { + subcontrol-origin: border; + subcontrol-position: bottom right; + + width: 16px; + border-image: url(images/spindown.png) 1; + border-width: 1px; + border-top-width: 0; +} + +QSpinBox::down-button:hover { + border-image: url(images/spindown_hover.png) 1; +} + +QSpinBox::down-button:pressed { + border-image: url(images/spindown_pressed.png) 1; +} + + + + + + 6 + + + 9 + + + + + QFrame::StyledPanel + + + + 9 + + + 6 + + + + + Please read the LICENSE file before checking + + + I &accept the terms and &conditions + + + + + + + Profession: + + + Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing + + + professionList + + + + + + + &Name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + nameCombo + + + + + + + Check this if you are male + + + &Male + + + + + + + &Password: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + passwordEdit + + + + + + + Specify country of origin + + + Specify country of origin + + + 6 + + + + Egypt + + + + + France + + + + + Germany + + + + + India + + + + + Italy + + + + + Norway + + + + + Pakistan + + + + + + + + &Age: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + ageSpinBox + + + + + + + Country: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + countryCombo + + + + + + + Gender: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Specify your password + + + Specify your password + + + Password + + + QLineEdit::Password + + + + + + + Check this if you are female + + + &Female + + + + + + + Specify your age + + + Specify your age + + + 12 + + + 22 + + + + + + + Specify your name + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 61 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Select your profession + + + Specify your name here + + + Specify your name here + + + 0 + + + + Developer + + + + + Student + + + + + Fisherman + + + + + + + + + + + + + 0 + 0 + 426 + 29 + + + + + &File + + + + + + + + &Help + + + + + + + + + + + &Exit + + + + + About Qt + + + + + Edit &Style... + + + + + About + + + + + + diff --git a/tests/auto/uiloader/baseline/css_exemple_usage.ui b/tests/auto/uiloader/baseline/css_exemple_usage.ui new file mode 100644 index 000000000..0ddd2ed79 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_exemple_usage.ui @@ -0,0 +1,91 @@ + + + Form + + + + 0 + 0 + 322 + 203 + + + + Form + + + QPushButton#evilButton { + background-color: red; + border-style: outset; + border-width: 2px; + border-radius: 10px; + border-color: beige; + font: bold 14px; + min-width: 10em; + padding: 6px; + } + QPushButton#evilButton:pressed { + background-color: rgb(224, 0, 0); + border-style: inset; + } + +QLineEdit { color: red } + QLineEdit[readOnly="true"] { color: gray } + + + + + + + Format C: + + + + + + + Qt::Horizontal + + + + 95 + 20 + + + + + + + + Foo + + + + + + + ReadOnly + + + true + + + + + + + Qt::Vertical + + + + 20 + 102 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_frames.ui b/tests/auto/uiloader/baseline/css_frames.ui new file mode 100644 index 000000000..d1397bb1d --- /dev/null +++ b/tests/auto/uiloader/baseline/css_frames.ui @@ -0,0 +1,319 @@ + + + Form + + + + 0 + 0 + 884 + 327 + + + + Form + + + QLabel +{ + border: 2px dashed rgb(0, 85, 255) +} + +QGroupBox .QFrame { +margin: 20px 10px 5px 0px; +padding: 0px 10px 15px 20px; +} + +QGroupBox { +border: 5px solid white; +} + +#line1 { background-color: yellow; } +#line2 { background-color: pink; } +#line1, #line2 { + border: 1px solid rgb(170, 85, 255); +} + + +QFrame::no-frame { + background: orange; + border-color: #000; + } + + + + + + + + GroupBox + + + false + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Styled + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Box + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + None + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + QFrame::StyledPanel + + + + + + Box Plain + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Panel + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + WinPanel + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + Qt::Vertical + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + 0 + + + This test that all the frame style can handle margins and paddings correctly + (and the background of this label should be orange) + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_groupboxes.ui b/tests/auto/uiloader/baseline/css_groupboxes.ui new file mode 100644 index 000000000..7f5464aa5 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_groupboxes.ui @@ -0,0 +1,150 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + #groupBox_1:checked { color:magenta; } + +#groupBox_2 { background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(0, 0, 0, 255), stop:0.05 rgba(14, 8, 73, 255), stop:0.36 rgba(28, 17, 145, 255), stop:0.6 rgba(126, 14, 81, 255), stop:0.75 rgba(234, 11, 11, 255), stop:0.79 rgba(244, 70, 5, 255), stop:0.86 rgba(255, 136, 0, 255), stop:0.935 rgba(239, 236, 55, 255)); +color: rgb(33, 255, 181); } + +#groupBox_3 { padding: 20px; margin: 20px; } +#groupBox_3 QLabel { background-color: #46e; } + +#groupBox_4::title { subcontrol-position: bottom left; border: 1px solid white;} + +#groupBox_5::indicator {border: 1px solid white;} + +#groupBox_6 { border: 5px dashed pink;} + + + + + + GroupBox + + + true + + + + + + TextLabel + + + + + + + + + + GroupBox + + + true + + + + + + TextLabel + + + + + + + + + + GroupBox + + + true + + + + + + TextLabel + + + + + + + + + + GroupBox + + + true + + + + + + TextLabel + + + + + + + + + + GroupBox + + + true + + + + + + TextLabel + + + + + + + + + + GroupBox + + + true + + + + + + TextLabel + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_itemview_task258382.ui b/tests/auto/uiloader/baseline/css_itemview_task258382.ui new file mode 100644 index 000000000..11c56b4ba --- /dev/null +++ b/tests/auto/uiloader/baseline/css_itemview_task258382.ui @@ -0,0 +1,179 @@ + + + Form + + + + 0 + 0 + 437 + 352 + + + + Form + + + ::item { border: 1px solid black; background-color: purple; } +::item {margin-left: 20px; } + +QAbstractItemView { selection-background-color: red; +show-decoration- selected: 0; + } + +::item:selected { background-color: yellow; } + + + + + + + 1 + + + + + New Column + + + + + New Item + + + + + New Item + + + + + New Item + + + + New Subitem + + + + New Subitem + + + + + New Item + + + + + New Item + + + + + + + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + mljkh mh mjl + + + + + h jlh mjklh + + + + + mjklh mlhj mjlh m + + + + + mlhj lmhj + + + + + mlkj l + + + + + mlkj + + + + + mlkj lmkj + + + + + mlkhj mlh + + + + + mlkj lmkj + + + + + mlkj lmkj + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_qprogressbar.ui b/tests/auto/uiloader/baseline/css_qprogressbar.ui new file mode 100644 index 000000000..6b3e2f0e9 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qprogressbar.ui @@ -0,0 +1,125 @@ + + + Form + + + + 0 + 0 + 326 + 170 + + + + Form + + + + + + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + } + + QProgressBar::chunk { + background-color: #05B8CC; + width: 20px; + } + + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; + } + + + 24 + + + + + + + QProgressBar::chunk { + background-color: #CD96CD; + width: 10px; + margin: 0.5px; + } + + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; + } + + + 24 + + + + + + + QProgressBar:horizontal {border: 1px solid gray; border-radius: 3px; background: white; padding: 1px; } + QProgressBar::chunk:horizontal { background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop: 1 lightgrey);} + + + 25 + + + 100 + + + 75 + + + + + + + + + QProgressBar::chunk { +background: +qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, +stop:0 rgba(0, 0, 0,0), stop:0.5 rgba(235, 148, 61, 255), stop:1 rgba(0, 0, 0, 0)) ; + + width: 100px; + + } + + QProgressBar { + border: 2px dashed grey; + border-radius: 5px; + } + + + 0 + + + 0 + + + -1 + + + + + + + Qt::Vertical + + + + 20 + 41 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_qtabwidget.ui b/tests/auto/uiloader/baseline/css_qtabwidget.ui new file mode 100644 index 000000000..7c2d24f3a --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qtabwidget.ui @@ -0,0 +1,224 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + + + QTabWidget::pane { / * The tab widget frame * / + border-top: 2px solid #C2C7CB; + } + + QTabWidget::tab-bar { + left: 5px; / * move to the right by 5px * / + } + + / * Style the tab using the tab sub-control. Note that + it reads QTabBar _not_ QTabWidget * / + QTabBar::tab { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); + border: 2px solid #C4C4C3; + border-bottom-color: #C2C7CB; / * same as the pane color * / + border-top-left-radius: 4px; + border-top-right-radius: 4px; + min-width: 8ex; + padding: 2px; + } + + QTabBar::tab:selected, QTabBar::tab:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #fafafa, stop: 0.4 #f4f4f4, + stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); + } + + QTabBar::tab:selected { + border-color: #9B9B9B; + border-bottom-color: #C2C7CB; / * same as pane color * / + } + + QTabBar::tab:!selected { + margin-top: 2px; / * make non-selected tabs look smaller * / + } + + + + + + 1 + + + + Tab 1 + + + + + Tab 2 + + + + + + + + + + + + + QTabWidget::pane { / * The tab widget frame * / + border-top: 2px solid #C2C7CB; + } + + QTabWidget::tab-bar { + left: 5px; / * move to the right by 5px * / + } + + / * Style the tab using the tab sub-control. Note that + it reads QTabBar _not_ QTabWidget * / + QTabBar::tab { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); + border: 2px solid #C4C4C3; + border-bottom-color: #C2C7CB; / * same as the pane color * / + border-top-left-radius: 4px; + border-top-right-radius: 4px; + min-width: 8ex; + padding: 2px; + } + + QTabBar::tab:selected, QTabBar::tab:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #fafafa, stop: 0.4 #f4f4f4, + stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); + } + + QTabBar::tab:selected { + border-color: #9B9B9B; + border-bottom-color: #C2C7CB; / * same as pane color * / + } + + QTabBar::tab:!selected { + margin-top: 2px; / * make non-selected tabs look smaller * / + } + + / * make use of negative margins for overlapping tabs * / + QTabBar::tab:selected { + / * expand/overlap to the left and right by 4px * / + margin-left: -4px; + margin-right: -4px; + } + + QTabBar::tab:first:selected { + margin-left: 0; / * the first selected tab has nothing to overlap with on the left * / + } + + QTabBar::tab:last:selected { + margin-right: 0; / * the last selected tab has nothing to overlap with on the right * / + } + + QTabBar::tab:only-one { + margin: 0; / * if there is only one tab, we don't want overlapping margins * / + } + + + 1 + + + + Tab 1 + + + + + Tab 2 + + + + + + + + + + + + + QTabWidget::pane { / * The tab widget frame * / + border-top: 2px solid #C2C7CB; + position: absolute; + top: -0.5em; + } + + QTabWidget::tab-bar { + alignment: center; + } + + / * Style the tab using the tab sub-control. Note that + it reads QTabBar _not_ QTabWidget * / + QTabBar::tab { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); + border: 2px solid #C4C4C3; + border-bottom-color: #C2C7CB; / * same as the pane color * / + border-top-left-radius: 4px; + border-top-right-radius: 4px; + min-width: 8ex; + padding: 2px; + } + + QTabBar::tab:selected, QTabBar::tab:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #fafafa, stop: 0.4 #f4f4f4, + stop: 0.5 #e7e7e7, stop: 1.0 #fafafa); + } + + QTabBar::tab:selected { + border-color: #9B9B9B; + border-bottom-color: #C2C7CB; / * same as pane color * / + } + + + 1 + + + + Tab 1 + + + + + Tab 2 + + + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_qtbug6855.ui b/tests/auto/uiloader/baseline/css_qtbug6855.ui new file mode 100644 index 000000000..0727f6ba9 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qtbug6855.ui @@ -0,0 +1,57 @@ + + + Form + + + + 0 + 0 + 212 + 108 + + + + Form + + + QPushButton { padding: 20px; } + + + + + + Text not cropped + + + + + + + Qt::Horizontal + + + + 258 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 218 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui b/tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui new file mode 100644 index 000000000..089cb76a1 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qtbug7737_borderimageradius.ui @@ -0,0 +1,44 @@ + + + Form + + + + 0 + 0 + 207 + 69 + + + + Form + + + QPushButton { border-image: url("images/pushbutton.png") 5 5 5 5; border-radius:8px; } + + + + + + Border image and radius + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_scroll.ui b/tests/auto/uiloader/baseline/css_scroll.ui new file mode 100644 index 000000000..6ac688604 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_scroll.ui @@ -0,0 +1,601 @@ + + + Form + + + + 0 + 0 + 393 + 347 + + + + Form + + + QScrollArea { background:red; + border: 5px dashed blue; } +QScrollArea .QWidget { background:transparent; + border: 5px dotted green;} +QScrollArea::corner { background:yellow; } + + + QScrollBar:horizontal { + border: 2px solid green; + background: cyan; + height: 15px; + margin: 0px 40px 0 0px; + } + + QScrollBar::handle:horizontal { + background: gray; + min-width: 20px; + } + + QScrollBar::add-line:horizontal { + background: blue; + width: 16px; + subcontrol-position: right; + subcontrol-origin: margin; + border: 2px solid black; + } + + QScrollBar::sub-line:horizontal { + background: magenta; + width: 16px; + subcontrol-position: top right; + subcontrol-origin: margin; + border: 2px solid black; + position: absolute; + right: 20px; + } + + QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal { + width: 3px; + height: 3px; + background: pink; + } + + QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { + background: none; + } + + + + QScrollBar:vertical { + border: 2px solid grey; + background: #32CC99; + width: 15px; + margin: 20px 0px 20px 0px; + } + QScrollBar::handle:vertical { + background: white; + min-height: 20px; + } + QScrollBar::add-line:vertical { + border: 2px solid grey; + background: #32CC99; + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; + } + + QScrollBar::sub-line:vertical { + border: 2px solid grey; + background: #32CC99; + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; + } + + QScrollBar:left-arrow:vertical, QScrollBar::right-arrow:vertical { + border: 2px solid grey; + width: 3px; + height: 3px; + background: white; + } + + QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; + } + + + + + + + + + + true + + + + + 0 + 0 + 520 + 532 + + + + + + + GroupBox + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + Qt::Vertical + + + + 20 + 81 + + + + + + + + + + + GroupBox + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + + + + GroupBox + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + + + + + + GroupBox + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + + + + GroupBox + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + + + + GroupBox + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_scrollarea_base.ui b/tests/auto/uiloader/baseline/css_scrollarea_base.ui new file mode 100644 index 000000000..495401f40 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_scrollarea_base.ui @@ -0,0 +1,197 @@ + + + Form + + + + 0 + 0 + 407 + 339 + + + + Form + + + QAbstractScrollArea { border: 2px dashed #e12; } +QHeaderView { border-color: blue; } + + + + + + + + Note that the task 257517 requires to scroll down, and check that the backgroud is still filled with the base color (white by default) + +x +x + +x +x + +x +x + +x +x + + + + + + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Row + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + New Column + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">x</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_splitter.ui b/tests/auto/uiloader/baseline/css_splitter.ui new file mode 100644 index 000000000..99dbc180a --- /dev/null +++ b/tests/auto/uiloader/baseline/css_splitter.ui @@ -0,0 +1,63 @@ + + + Form + + + + 0 + 0 + 424 + 364 + + + + Form + + + QSplitter::handle:vertical { + image: url(images/splitter_horizontal.png); + } + + QSplitter::handle:horizontal { + image: url(images/splitter_vertical.png); + } + +#big_splitter::handle { background-color: blue; border: 3px dashed green; height:50px; } + + + QSplitter::handle:hover { + background-color: qlineargradient(spread:repeat, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 255), stop:0.17 rgba(255, 0, 0, 255), stop:0.18 rgba(255, 255, 255, 255), stop:0.210212 rgba(255, 255, 255, 255), stop:0.220212 rgba(0, 16, 255, 255), stop:0.279897 rgba(0, 16, 255, 255), stop:0.289897 rgba(255, 255, 255, 255), stop:0.32 rgba(255, 255, 255, 255), stop:0.33 rgba(255, 0, 0, 255), stop:1 rgba(255, 0, 0, 255)) + } + + QSplitter::handle:pressed { + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(9, 41, 4, 255), stop:0.085 rgba(2, 79, 0, 255), stop:0.19 rgba(50, 147, 22, 255), stop:0.275 rgba(236, 191, 49, 255), stop:0.39 rgba(243, 61, 34, 255), stop:0.555 rgba(135, 81, 60, 255), stop:0.667 rgba(121, 75, 255, 255), stop:0.825 rgba(164, 255, 244, 255), stop:0.885 rgba(104, 222, 71, 255), stop:1 rgba(93, 128, 0, 255)); + } + + + + + + Qt::Horizontal + + + + Qt::Vertical + + + + + + + + Qt::Vertical + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_tab_border.ui b/tests/auto/uiloader/baseline/css_tab_border.ui new file mode 100644 index 000000000..cefb9d8fd --- /dev/null +++ b/tests/auto/uiloader/baseline/css_tab_border.ui @@ -0,0 +1,104 @@ + + + Form + + + + 0 + 0 + 379 + 277 + + + + Form + + + #tabWidget QTabBar::tab { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); + border: 2px solid #C4C4C3; + border-bottom-color: #C2C7CB; /* same as the pane color */ + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding: 2px; + } + +#tabWidget_2 QTabBar::tab { + border: 3px solid red; + } + +#tabWidget_3 QTabBar::tab { + margin: 5px; + } + + + + + + + + + 1 + + + true + + + + Tab 1 + + + + + Tab 2 + + + + + + + + 1 + + + false + + + + Tab 1 + + + + + Tab 2 + + + + + + + + 1 + + + true + + + + Tab 1 + + + + + Tab 2 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_tab_closebutton.ui b/tests/auto/uiloader/baseline/css_tab_closebutton.ui new file mode 100644 index 000000000..82bd2b550 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_tab_closebutton.ui @@ -0,0 +1,128 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + *{} + +#tabWidget QTabBar::close-button +{ + background: blue; + border: 2px dotted red; + subcontrol-position: top; +} + + +#tabWidget_2 QTabBar::close-button +{ + image: url(images/checkbox_checked.png); + subcontrol-position: left; +} + +#tabWidget_2 QTabBar::close-button:hover +{ + image: url(images/checkbox_unchecked_hover.png); +} + + +#tabWidget_3 QTabBar::close-button +{ + border-image: url(images/pushbutton.png) 3px; + border-width:3px; +} + + + + + + + + + true + + + + Tab 1 + + + + + + Test the close button in the tabbar + + + true + + + + + + + + Tab 2 + + + + + + + + QTabWidget::East + + + 0 + + + true + + + + Tab 1 + + + + + Tab 2 + + + + + + + + QTabWidget::South + + + 0 + + + true + + + + Tab 1 + + + + + Tab 2 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_tab_task213374.ui b/tests/auto/uiloader/baseline/css_tab_task213374.ui new file mode 100644 index 000000000..f3567aede --- /dev/null +++ b/tests/auto/uiloader/baseline/css_tab_task213374.ui @@ -0,0 +1,306 @@ + + Dialog + + + + 0 + 0 + 400 + 646 + + + + Dialog + + + + + + +QTabBar::tab:bottom { + + min-width: 15px; + padding: 3px 15px 3px 10px; + border: 1px solid #7f7f7f; + + background: qlineargradient(x1: 0, y1: 1, x2: 0,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-right-radius: 35px 21px; + +} +QTabBar::tab:left { + padding: 10px 3px 15px 3px; + border: 1px solid #7f7f7f; + border-left-width: 0px; + background: qlineargradient(x1: 1, y1: 0, x2: 0,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-right-radius: 21px 35px; + margin-right: 2px; +} +QTabBar:right {subcontrol-origin: padding;} +QTabBar::tab:right { + padding: 10px 3px 15px 5px; + border: 1px solid #7f7f7f; + background: qlineargradient(x1: 0, y1: 0, x2: 1,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-left-radius: 21px 35px; + margin-left: 2px; +} +QTabBar::tab:bottom:!last { margin-right: -10px;} +QTabBar::tab:left:!last { margin-bottom: -10px;} +QTabBar::tab:right:!last { margin-bottom: -10px;} + +QTabBar::tab:bottom:selected { + background: qlineargradient(x1: 0, y1: 1, x2: 0,y2: 0, + stop: .3 #CFCFCF, stop: 1 #FFFFFF); +} +QTabBar::tab:left:selected { + background: qlineargradient(x1: 1, y1: 0, x2: 0,y2: 0, + stop: .3 #DFDFDF, stop: 1 #F0F0F0); +} +QTabBar::tab:right:selected { + background: qlineargradient(x1: 0, y1: 0, x2: 1,y2: 0, + stop: .3 #DFDFDF, stop: 1 #F0F0F0); +} + + + + + + QTabWidget::South + + + 3 + + + + Tab 1 + + + + + Page + + + + + Page + + + + + Tab 2 + + + + + + + + +QTabBar::tab:bottom { + + min-width: 15px; + padding: 3px 15px 3px 10px; + border: 1px solid #7f7f7f; + + background: qlineargradient(x1: 0, y1: 1, x2: 0,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-right-radius: 35px 21px; + +} +QTabBar::tab:left { + padding: 10px 3px 15px 3px; + border: 1px solid #7f7f7f; + border-left-width: 0px; + background: qlineargradient(x1: 1, y1: 0, x2: 0,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-right-radius: 21px 35px; + margin-right: 2px; +} +QTabBar:right {subcontrol-origin: padding;} +QTabBar::tab:right { + padding: 10px 3px 15px 5px; + border: 1px solid #7f7f7f; + background: qlineargradient(x1: 0, y1: 0, x2: 1,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-left-radius: 21px 35px; + margin-left: 2px; +} +QTabBar::tab:bottom:!last { margin-right: -10px;} +QTabBar::tab:left:!last { margin-bottom: -10px;} +QTabBar::tab:right:!last { margin-bottom: -10px;} + +QTabBar::tab:bottom:selected { + background: qlineargradient(x1: 0, y1: 1, x2: 0,y2: 0, + stop: .3 #CFCFCF, stop: 1 #FFFFFF); +} +QTabBar::tab:left:selected { + background: qlineargradient(x1: 1, y1: 0, x2: 0,y2: 0, + stop: .3 #DFDFDF, stop: 1 #F0F0F0); +} +QTabBar::tab:right:selected { + background: qlineargradient(x1: 0, y1: 0, x2: 1,y2: 0, + stop: .3 #DFDFDF, stop: 1 #F0F0F0); +} + + + + + + QTabWidget::East + + + 3 + + + + Tab 1 + + + + + Page + + + + + Page + + + + + Tab 2 + + + + + + + + +QTabBar::tab:bottom { + + min-width: 15px; + padding: 3px 15px 3px 10px; + border: 1px solid #7f7f7f; + + background: qlineargradient(x1: 0, y1: 1, x2: 0,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-right-radius: 35px 21px; + +} +QTabBar::tab:left { + padding: 10px 3px 15px 3px; + border: 1px solid #7f7f7f; + border-left-width: 0px; + background: qlineargradient(x1: 1, y1: 0, x2: 0,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-right-radius: 21px 35px; + margin-right: 2px; +} +QTabBar:right {subcontrol-origin: padding;} +QTabBar::tab:right { + padding: 10px 3px 15px 5px; + border: 1px solid #7f7f7f; + background: qlineargradient(x1: 0, y1: 0, x2: 1,y2: 0, + stop: .3 #FFFFFF, stop: 1 #909090); + border-bottom-left-radius: 21px 35px; + margin-left: 2px; +} +QTabBar::tab:bottom:!last { margin-right: -10px;} +QTabBar::tab:left:!last { margin-bottom: -10px;} +QTabBar::tab:right:!last { margin-bottom: -10px;} + +QTabBar::tab:bottom:selected { + background: qlineargradient(x1: 0, y1: 1, x2: 0,y2: 0, + stop: .3 #CFCFCF, stop: 1 #FFFFFF); +} +QTabBar::tab:left:selected { + background: qlineargradient(x1: 1, y1: 0, x2: 0,y2: 0, + stop: .3 #DFDFDF, stop: 1 #F0F0F0); +} +QTabBar::tab:right:selected { + background: qlineargradient(x1: 0, y1: 0, x2: 1,y2: 0, + stop: .3 #DFDFDF, stop: 1 #F0F0F0); +} + + + + + + QTabWidget::West + + + 3 + + + + Tab 1 + + + + + Page + + + + + Page + + + + + Tab 2 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/css_task255849_downarrow.ui b/tests/auto/uiloader/baseline/css_task255849_downarrow.ui new file mode 100644 index 000000000..d3e99b161 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_task255849_downarrow.ui @@ -0,0 +1,144 @@ + + + Form + + + + 0 + 0 + 275 + 175 + + + + Form + + + /* Some widget were not displaying the arrow if only the arrow was set */ +*::down-arrow { image: url("images/arrow-down.png") } +*::up-arrow { image: url("images/arrow-up.png") } + + + + + + + + + + + + true + + + true + + + true + + + + 1 + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + foo + + + Qt::DownArrow + + + + + + + + + + Qt::NoContextMenu + + + PushButton + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/css_task259226_spinboxes.ui b/tests/auto/uiloader/baseline/css_task259226_spinboxes.ui new file mode 100644 index 000000000..eb9ade316 --- /dev/null +++ b/tests/auto/uiloader/baseline/css_task259226_spinboxes.ui @@ -0,0 +1,83 @@ + + + Form + + + + 0 + 0 + 320 + 116 + + + + Form + + + #spinbox1::up-button{ + subcontrol-origin: border; + subcontrol-position: top left; + } +#spinbox1::down-button { + subcontrol-origin: border; + subcontrol-position: bottom left; + } + + +#spinbox2::up-button{ + subcontrol-origin: border; + subcontrol-position: center left; + left: 0px; + height: 100%; + top: 0px; + } +#spinbox2::down-button { + subcontrol-origin: border; + subcontrol-position: center right; + right: 0px; + height: 100%; + top: 0px; + } + + + +#spinbox3::up-button{ + subcontrol-origin: border; + subcontrol-position: top left; + } + + +#spinbox4 { padding: 20px 1px; } +#spinbox4::up-button{ + subcontrol-origin: border; + subcontrol-position: top center; + width:100%; + height: 20px; + } +#spinbox4::down-button { + subcontrol-origin: border; + subcontrol-position: bottom center; + width:100%; + height: 20px; + } + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/default.ui b/tests/auto/uiloader/baseline/default.ui new file mode 100644 index 000000000..431a40956 --- /dev/null +++ b/tests/auto/uiloader/baseline/default.ui @@ -0,0 +1,329 @@ + + MainWindow + + + + 0 + 0 + 388 + 413 + + + + MainWindow + + + + + 9 + + + 6 + + + + + &Name: + + + nameCombo + + + + + + + Specify your name + + + true + + + -1 + + + + Girish + + + + + Jasmin + + + + + Simon + + + + + Zack + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Check this if you are female + + + &Female + + + + + + + Please read the license before checking this + + + I &accept the terms and conditions + + + + + + + Check this if you are male + + + &Male + + + + + + + Gender: + + + + + + + Specify your age + + + Specify your age here + + + 12 + + + 22 + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + &Age: + + + ageSpinBox + + + + + + + &Password: + + + passwordEdit + + + + + + + Specify your password + + + Specify your password here + + + Password + + + QLineEdit::Password + + + + + + + Profession + + + professionList + + + + + + + &Country + + + professionList + + + + + + + Select your profession + + + Select your profession + + + Select your profession + + + 1 + + + + Developer + + + + + Student + + + + + Fisherman + + + + + + + + Specify your country + + + Specify your country here + + + 2 + + + + Germany + + + + + India + + + + + Norway + + + + + United States Of America + + + + + United Kingdom + + + + + + + + + + 0 + 0 + 388 + 21 + + + + + &File + + + + + + + + &Help + + + + + + + + + + + + &Exit + + + + + About Qt + + + + + Edit &Style + + + + + About + + + + + maleRadioButton + femaleRadioButton + ageSpinBox + passwordEdit + professionList + agreeCheckBox + + + + diff --git a/tests/auto/uiloader/baseline/dialog.ui b/tests/auto/uiloader/baseline/dialog.ui new file mode 100644 index 000000000..e99d6fb3c --- /dev/null +++ b/tests/auto/uiloader/baseline/dialog.ui @@ -0,0 +1,47 @@ + + Dialog + + + + 0 + 0 + 451 + 322 + + + + Dialog + + + + + + Load Image From File... + + + + + + + Launch two of these dialogs. In the first, press the top button and load an image from a file. In the second, press the bottom button and display the loaded image from shared memory. + + + Qt::AlignCenter + + + true + + + + + + + Display Image From Shared Memory + + + + + + + + diff --git a/tests/auto/uiloader/baseline/downloaditem.ui b/tests/auto/uiloader/baseline/downloaditem.ui new file mode 100644 index 000000000..4a0a0fd9a --- /dev/null +++ b/tests/auto/uiloader/baseline/downloaditem.ui @@ -0,0 +1,134 @@ + + DownloadItem + + + + 0 + 0 + 423 + 110 + + + + Form + + + + 0 + + + + + + 0 + 0 + + + + Ico + + + + + + + + + + 0 + 0 + + + + Filename + + + + + + + 0 + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + Qt::Vertical + + + + 17 + 1 + + + + + + + + false + + + Try Again + + + + + + + Stop + + + + + + + Open + + + + + + + Qt::Vertical + + + + 17 + 5 + + + + + + + + + + + SqueezeLabel + QWidget +
squeezelabel.h
+
+
+ + +
diff --git a/tests/auto/uiloader/baseline/downloads.ui b/tests/auto/uiloader/baseline/downloads.ui new file mode 100644 index 000000000..a2e256935 --- /dev/null +++ b/tests/auto/uiloader/baseline/downloads.ui @@ -0,0 +1,83 @@ + + DownloadDialog + + + + 0 + 0 + 332 + 252 + + + + Downloads + + + + 0 + + + 0 + + + + + + + + + + false + + + Clean up + + + + + + + Qt::Horizontal + + + + 58 + 24 + + + + + + + + + + 0 Items + + + + + + + Qt::Horizontal + + + + 148 + 20 + + + + + + + + + EditTableView + QTableView +
edittableview.h
+
+
+ + +
diff --git a/tests/auto/uiloader/baseline/embeddeddialog.ui b/tests/auto/uiloader/baseline/embeddeddialog.ui new file mode 100644 index 000000000..f967b1008 --- /dev/null +++ b/tests/auto/uiloader/baseline/embeddeddialog.ui @@ -0,0 +1,87 @@ + + embeddedDialog + + + + 0 + 0 + 407 + 134 + + + + Embedded Dialog + + + + + + Layout Direction: + + + layoutDirection + + + + + + + + Left to Right + + + + + Right to Left + + + + + + + + Select Font: + + + fontComboBox + + + + + + + + + + Style: + + + style + + + + + + + + + + Layout spacing: + + + spacing + + + + + + + Qt::Horizontal + + + + + + + + diff --git a/tests/auto/uiloader/baseline/filespage.ui b/tests/auto/uiloader/baseline/filespage.ui new file mode 100644 index 000000000..d308b9664 --- /dev/null +++ b/tests/auto/uiloader/baseline/filespage.ui @@ -0,0 +1,79 @@ + + FilesPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Files: + + + true + + + + + + + + + + + 0 + 0 + + + + Remove + + + + + + + Remove All + + + + + + + Qt::Vertical + + + + 75 + 16 + + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/filternamedialog.ui b/tests/auto/uiloader/baseline/filternamedialog.ui new file mode 100644 index 000000000..be6f17dfb --- /dev/null +++ b/tests/auto/uiloader/baseline/filternamedialog.ui @@ -0,0 +1,67 @@ + + FilterNameDialogClass + + + + 0 + 0 + 312 + 95 + + + + FilterNameDialog + + + + 9 + + + 6 + + + + + Filter Name: + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/filterpage.ui b/tests/auto/uiloader/baseline/filterpage.ui new file mode 100644 index 000000000..7cda3d9be --- /dev/null +++ b/tests/auto/uiloader/baseline/filterpage.ui @@ -0,0 +1,125 @@ + + FilterPage + + + + 0 + 0 + 419 + 243 + + + + Form + + + + + + Filter attributes for current documentation (comma separated list): + + + + + + + + + + Custom Filters + + + + + + 2 + + + + 1 + + + + + 2 + + + + + + + + Add + + + + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/finddialog.ui b/tests/auto/uiloader/baseline/finddialog.ui new file mode 100644 index 000000000..913a868ad --- /dev/null +++ b/tests/auto/uiloader/baseline/finddialog.ui @@ -0,0 +1,265 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + FindDialog + + + + 0 + 0 + 414 + 170 + + + + + 0 + 0 + + + + Find + + + This window allows you to search for some text in the translation source file. + + + + 6 + + + 11 + + + + + 6 + + + 0 + + + + + 6 + + + 0 + + + + + &Find what: + + + led + + + + + + + Type in the text to search for. + + + + + + + + + Options + + + + 9 + + + 6 + + + + + Source texts are searched when checked. + + + &Source texts + + + true + + + + + + + Translations are searched when checked. + + + &Translations + + + true + + + + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + + + &Match case + + + + + + + Comments and contexts are searched when checked. + + + &Comments + + + true + + + + + + + Ignore &accelerators + + + true + + + + + + + + + + + + 6 + + + 0 + + + + + Click here to find the next occurrence of the text you typed in. + + + Find Next + + + true + + + false + + + + + + + Click here to close this window. + + + Cancel + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 51 + + + + + + + + + + + led + findNxt + cancel + comments + sourceText + translations + matchCase + + + + + cancel + clicked() + FindDialog + reject() + + + 372 + 58 + + + 373 + 109 + + + + + diff --git a/tests/auto/uiloader/baseline/formwindowsettings.ui b/tests/auto/uiloader/baseline/formwindowsettings.ui new file mode 100644 index 000000000..fea18fe87 --- /dev/null +++ b/tests/auto/uiloader/baseline/formwindowsettings.ui @@ -0,0 +1,311 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + FormWindowSettings + + + + 0 + 0 + 433 + 465 + + + + Form Settings + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + Qt::Horizontal + + + + + + + 0 + + + 6 + + + + + Layout &Default + + + true + + + + 8 + + + 6 + + + + + &Spacing: + + + defaultSpacingSpinBox + + + + + + + &Margin: + + + defaultMarginSpinBox + + + + + + + + + + + + + + + + &Layout Function + + + true + + + + 8 + + + 6 + + + + + + + + + + + Ma&rgin: + + + marginFunctionLineEdit + + + + + + + Spa&cing: + + + spacingFunctionLineEdit + + + + + + + + + + + + &Author + + + + 8 + + + 6 + + + + + + + + + + + &Include Hints + + + + 8 + + + 6 + + + + + + + + + + + 0 + + + 6 + + + + + &Pixmap Function + + + true + + + + 8 + + + 6 + + + + + + + + + + + + + Qt::Vertical + + + + 111 + 115 + + + + + + + + Grid + + + + + + + + qdesigner_internal::GridPanel + QGroupBox +
gridpanel_p.h
+ 1 +
+
+ + authorLineEdit + defaultMarginSpinBox + defaultSpacingSpinBox + marginFunctionLineEdit + spacingFunctionLineEdit + pixmapFunctionLineEdit + + + + + buttonBox + accepted() + FormWindowSettings + accept() + + + 294 + 442 + + + 150 + 459 + + + + + buttonBox + rejected() + FormWindowSettings + reject() + + + 373 + 444 + + + 357 + 461 + + + + +
diff --git a/tests/auto/uiloader/baseline/generalpage.ui b/tests/auto/uiloader/baseline/generalpage.ui new file mode 100644 index 000000000..9c2babb0a --- /dev/null +++ b/tests/auto/uiloader/baseline/generalpage.ui @@ -0,0 +1,69 @@ + + GeneralPage + + + + 0 + 0 + 417 + 243 + + + + Form + + + + + + Namespace: + + + + + + + + + + Virtual Folder: + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/gridpanel.ui b/tests/auto/uiloader/baseline/gridpanel.ui new file mode 100644 index 000000000..adfdd3684 --- /dev/null +++ b/tests/auto/uiloader/baseline/gridpanel.ui @@ -0,0 +1,144 @@ + + qdesigner_internal::GridPanel + + + + 0 + 0 + 393 + 110 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Grid + + + + + + + 0 + 0 + + + + Visible + + + + + + + Grid &X + + + m_deltaXSpinBox + + + + + + + 2 + + + 100 + + + + + + + + 0 + 0 + + + + Snap + + + + + + + + + Reset + + + + + + + Qt::Horizontal + + + + 20 + 20 + + + + + + + + + + Grid &Y + + + m_deltaYSpinBox + + + + + + + 2 + + + 100 + + + + + + + + 0 + 0 + + + + Snap + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/helpdialog.ui b/tests/auto/uiloader/baseline/helpdialog.ui new file mode 100644 index 000000000..133f3d2af --- /dev/null +++ b/tests/auto/uiloader/baseline/helpdialog.ui @@ -0,0 +1,404 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + HelpDialog + + + + 0 + 0 + 274 + 417 + + + + Help + + + <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> + + + + 0 + + + 6 + + + + + Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. + + + + Con&tents + + + + 5 + + + 6 + + + + + Qt::CustomContextMenu + + + <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> + + + true + + + true + + + + column 1 + + + + + + + + + &Index + + + + 5 + + + 6 + + + + + &Look For: + + + editIndex + + + + + + + Enter keyword + + + <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> + + + + + + + Qt::CustomContextMenu + + + <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> + + + + + + + + &Bookmarks + + + + 5 + + + 6 + + + + + Qt::CustomContextMenu + + + Displays the list of bookmarks. + + + true + + + + column 1 + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + Add new bookmark + + + Add the currently displayed page as a new bookmark. + + + &New + + + + + + + Delete bookmark + + + Delete the selected bookmark. + + + &Delete + + + + + + + + + + &Search + + + + 5 + + + 6 + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Searching f&or: + + + termsEdit + + + + + + + Enter searchword(s). + + + <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> + + + + + + + Qt::CustomContextMenu + + + <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> + + + + + + + Found &Documents: + + + resultBox + + + + + + + 1 + + + 6 + + + + + Display the help page. + + + Display the help page for the full text search. + + + He&lp + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 61 + 21 + + + + + + + + Start searching. + + + Pressing this button starts the search. + + + &Search + + + false + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 3 + + + 6 + + + + + Preparing... + + + + + + + + + + + + + + tabWidget + listContents + editIndex + listIndex + listBookmarks + buttonAdd + buttonRemove + termsEdit + searchButton + helpButton + resultBox + + + + diff --git a/tests/auto/uiloader/baseline/history.ui b/tests/auto/uiloader/baseline/history.ui new file mode 100644 index 000000000..0944940e7 --- /dev/null +++ b/tests/auto/uiloader/baseline/history.ui @@ -0,0 +1,106 @@ + + HistoryDialog + + + + 0 + 0 + 758 + 450 + + + + History + + + + + + Qt::Horizontal + + + + 252 + 20 + + + + + + + + + + + + + + + + &Remove + + + + + + + Remove &All + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QDialogButtonBox::Ok + + + + + + + + + + SearchLineEdit + QLineEdit +
searchlineedit.h
+
+ + EditTreeView + QTreeView +
edittreeview.h
+
+
+ + + + buttonBox + accepted() + HistoryDialog + accept() + + + 472 + 329 + + + 461 + 356 + + + + +
diff --git a/tests/auto/uiloader/baseline/identifierpage.ui b/tests/auto/uiloader/baseline/identifierpage.ui new file mode 100644 index 000000000..cd0df7563 --- /dev/null +++ b/tests/auto/uiloader/baseline/identifierpage.ui @@ -0,0 +1,132 @@ + + IdentifierPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Create identifiers + + + + + + + Qt::Horizontal + + + + 161 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + false + + + Global prefix: + + + true + + + + + + + false + + + + + + + false + + + Inherit prefix from file names + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + + globalButton + toggled(bool) + prefixLineEdit + setEnabled(bool) + + + 122 + 72 + + + 161 + 71 + + + + + diff --git a/tests/auto/uiloader/baseline/imagedialog.ui b/tests/auto/uiloader/baseline/imagedialog.ui new file mode 100644 index 000000000..1c5e546f2 --- /dev/null +++ b/tests/auto/uiloader/baseline/imagedialog.ui @@ -0,0 +1,389 @@ + + + ImageDialog + + + ImageDialog + + + + 0 + 0 + 320 + 180 + + + + Create Image + + + + + + + 9 + + + 6 + + + + + + + + 1 + + + 6 + + + + + widthLabel + + + + 1 + 27 + 67 + 22 + + + + QFrame::NoFrame + + + QFrame::Plain + + + Width: + + + Qt::AutoText + + + + + + + heightLabel + + + + 1 + 55 + 67 + 22 + + + + QFrame::NoFrame + + + QFrame::Plain + + + Height: + + + Qt::AutoText + + + + + + + colorDepthCombo + + + + 74 + 83 + 227 + 22 + + + + + 5 + 0 + 0 + 0 + + + + QComboBox::InsertAtBottom + + + + + + + nameLineEdit + + + + 74 + 83 + 227 + 22 + + + + + 5 + 0 + 1 + 0 + + + + Untitled image + + + QLineEdit::Normal + + + + + + + spinBox + + + + 74 + 1 + 227 + 20 + + + + + 5 + 0 + 0 + 0 + + + + QAbstractSpinBox::UpDownArrows + + + 32 + + + 1024 + + + 1 + + + + + + + spinBox_2 + + + + 74 + 27 + 227 + 22 + + + + + 5 + 0 + 0 + 0 + + + + QAbstractSpinBox::UpDownArrows + + + 32 + + + 1024 + + + 1 + + + + + + + nameLabel + + + + 1 + 1 + 67 + 20 + + + + QFrame::NoFrame + + + QFrame::Plain + + + Name: + + + Qt::AutoText + + + + + + + colorDepthLabel + + + + 1 + 83 + 67 + 22 + + + + QFrame::NoFrame + + + QFrame::Plain + + + Color depth: + + + Qt::AutoText + + + + + + + + + + + + + 9 + 121 + 302 + 18 + + + + Qt::Vertical + + + + + + + + + + 1 + + + 6 + + + + + + + + + 1 + 1 + 128 + 24 + + + + Qt::Horizontal + + + + + + + okButton + + + + 135 + 1 + 80 + 24 + + + + OK + + + + + + + cancelButton + + + + 221 + 1 + 80 + 24 + + + + Cancel + + + + + + + + + + nameLineEdit + spinBox + spinBox_2 + colorDepthCombo + okButton + cancelButton + + + + nameLineEdit + returnPressed() + okButton + animateClick() + + + -1 + 7 + + + -1 + 7 + + + + + diff --git a/tests/auto/uiloader/baseline/images/arrow-down.png b/tests/auto/uiloader/baseline/images/arrow-down.png new file mode 100644 index 000000000..7c9274f30 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/arrow-down.png differ diff --git a/tests/auto/uiloader/baseline/images/arrow-up.png b/tests/auto/uiloader/baseline/images/arrow-up.png new file mode 100644 index 000000000..758a0d1af Binary files /dev/null and b/tests/auto/uiloader/baseline/images/arrow-up.png differ diff --git a/tests/auto/uiloader/baseline/images/borderimage.png b/tests/auto/uiloader/baseline/images/borderimage.png new file mode 100644 index 000000000..199fc890f Binary files /dev/null and b/tests/auto/uiloader/baseline/images/borderimage.png differ diff --git a/tests/auto/uiloader/baseline/images/checkbox_checked.png b/tests/auto/uiloader/baseline/images/checkbox_checked.png new file mode 100644 index 000000000..cbf06f651 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/checkbox_checked.png differ diff --git a/tests/auto/uiloader/baseline/images/checkbox_checked_hover.png b/tests/auto/uiloader/baseline/images/checkbox_checked_hover.png new file mode 100644 index 000000000..fb4d4d3fd Binary files /dev/null and b/tests/auto/uiloader/baseline/images/checkbox_checked_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/checkbox_checked_pressed.png b/tests/auto/uiloader/baseline/images/checkbox_checked_pressed.png new file mode 100644 index 000000000..852fcc030 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/checkbox_checked_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/checkbox_unchecked.png b/tests/auto/uiloader/baseline/images/checkbox_unchecked.png new file mode 100644 index 000000000..5f5465582 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/checkbox_unchecked.png differ diff --git a/tests/auto/uiloader/baseline/images/checkbox_unchecked_hover.png b/tests/auto/uiloader/baseline/images/checkbox_unchecked_hover.png new file mode 100644 index 000000000..687364497 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/checkbox_unchecked_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/checkbox_unchecked_pressed.png b/tests/auto/uiloader/baseline/images/checkbox_unchecked_pressed.png new file mode 100644 index 000000000..6a768c44d Binary files /dev/null and b/tests/auto/uiloader/baseline/images/checkbox_unchecked_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/down_arrow.png b/tests/auto/uiloader/baseline/images/down_arrow.png new file mode 100644 index 000000000..85004aeaf Binary files /dev/null and b/tests/auto/uiloader/baseline/images/down_arrow.png differ diff --git a/tests/auto/uiloader/baseline/images/down_arrow_disabled.png b/tests/auto/uiloader/baseline/images/down_arrow_disabled.png new file mode 100644 index 000000000..d9eefed4c Binary files /dev/null and b/tests/auto/uiloader/baseline/images/down_arrow_disabled.png differ diff --git a/tests/auto/uiloader/baseline/images/frame.png b/tests/auto/uiloader/baseline/images/frame.png new file mode 100644 index 000000000..05a600502 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/frame.png differ diff --git a/tests/auto/uiloader/baseline/images/pagefold.png b/tests/auto/uiloader/baseline/images/pagefold.png new file mode 100644 index 000000000..69be8f2a3 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/pagefold.png differ diff --git a/tests/auto/uiloader/baseline/images/pushbutton.png b/tests/auto/uiloader/baseline/images/pushbutton.png new file mode 100644 index 000000000..c7529ba02 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/pushbutton.png differ diff --git a/tests/auto/uiloader/baseline/images/pushbutton_hover.png b/tests/auto/uiloader/baseline/images/pushbutton_hover.png new file mode 100644 index 000000000..af0ef9d56 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/pushbutton_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/pushbutton_pressed.png b/tests/auto/uiloader/baseline/images/pushbutton_pressed.png new file mode 100644 index 000000000..f7381f752 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/pushbutton_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/radiobutton_checked.png b/tests/auto/uiloader/baseline/images/radiobutton_checked.png new file mode 100644 index 000000000..8ab915757 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/radiobutton_checked.png differ diff --git a/tests/auto/uiloader/baseline/images/radiobutton_checked_hover.png b/tests/auto/uiloader/baseline/images/radiobutton_checked_hover.png new file mode 100644 index 000000000..d68cb009a Binary files /dev/null and b/tests/auto/uiloader/baseline/images/radiobutton_checked_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/radiobutton_checked_pressed.png b/tests/auto/uiloader/baseline/images/radiobutton_checked_pressed.png new file mode 100644 index 000000000..e3cd5a59e Binary files /dev/null and b/tests/auto/uiloader/baseline/images/radiobutton_checked_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/radiobutton_unchecked.png b/tests/auto/uiloader/baseline/images/radiobutton_unchecked.png new file mode 100644 index 000000000..321a9a155 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/radiobutton_unchecked.png differ diff --git a/tests/auto/uiloader/baseline/images/radiobutton_unchecked_hover.png b/tests/auto/uiloader/baseline/images/radiobutton_unchecked_hover.png new file mode 100644 index 000000000..666a3b0bd Binary files /dev/null and b/tests/auto/uiloader/baseline/images/radiobutton_unchecked_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/radiobutton_unchecked_pressed.png b/tests/auto/uiloader/baseline/images/radiobutton_unchecked_pressed.png new file mode 100644 index 000000000..c4b0567aa Binary files /dev/null and b/tests/auto/uiloader/baseline/images/radiobutton_unchecked_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/sizegrip.png b/tests/auto/uiloader/baseline/images/sizegrip.png new file mode 100644 index 000000000..350583aaa Binary files /dev/null and b/tests/auto/uiloader/baseline/images/sizegrip.png differ diff --git a/tests/auto/uiloader/baseline/images/spindown.png b/tests/auto/uiloader/baseline/images/spindown.png new file mode 100644 index 000000000..7ff3c6492 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spindown.png differ diff --git a/tests/auto/uiloader/baseline/images/spindown_hover.png b/tests/auto/uiloader/baseline/images/spindown_hover.png new file mode 100644 index 000000000..1486c4dfe Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spindown_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/spindown_off.png b/tests/auto/uiloader/baseline/images/spindown_off.png new file mode 100644 index 000000000..a90ab3f03 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spindown_off.png differ diff --git a/tests/auto/uiloader/baseline/images/spindown_pressed.png b/tests/auto/uiloader/baseline/images/spindown_pressed.png new file mode 100644 index 000000000..f6271cbde Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spindown_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/spinup.png b/tests/auto/uiloader/baseline/images/spinup.png new file mode 100644 index 000000000..1069dd00d Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spinup.png differ diff --git a/tests/auto/uiloader/baseline/images/spinup_hover.png b/tests/auto/uiloader/baseline/images/spinup_hover.png new file mode 100644 index 000000000..884c8d77c Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spinup_hover.png differ diff --git a/tests/auto/uiloader/baseline/images/spinup_off.png b/tests/auto/uiloader/baseline/images/spinup_off.png new file mode 100644 index 000000000..02dad1fb2 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spinup_off.png differ diff --git a/tests/auto/uiloader/baseline/images/spinup_pressed.png b/tests/auto/uiloader/baseline/images/spinup_pressed.png new file mode 100644 index 000000000..b1843e2a1 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/spinup_pressed.png differ diff --git a/tests/auto/uiloader/baseline/images/splitter_horizontal.png b/tests/auto/uiloader/baseline/images/splitter_horizontal.png new file mode 100644 index 000000000..66107cf54 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/splitter_horizontal.png differ diff --git a/tests/auto/uiloader/baseline/images/splitter_vertical.png b/tests/auto/uiloader/baseline/images/splitter_vertical.png new file mode 100644 index 000000000..f907c0b57 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/splitter_vertical.png differ diff --git a/tests/auto/uiloader/baseline/images/up_arrow.png b/tests/auto/uiloader/baseline/images/up_arrow.png new file mode 100644 index 000000000..e7f7ddb3a Binary files /dev/null and b/tests/auto/uiloader/baseline/images/up_arrow.png differ diff --git a/tests/auto/uiloader/baseline/images/up_arrow_disabled.png b/tests/auto/uiloader/baseline/images/up_arrow_disabled.png new file mode 100644 index 000000000..4d2c27770 Binary files /dev/null and b/tests/auto/uiloader/baseline/images/up_arrow_disabled.png differ diff --git a/tests/auto/uiloader/baseline/inputpage.ui b/tests/auto/uiloader/baseline/inputpage.ui new file mode 100644 index 000000000..e7cd3a0fa --- /dev/null +++ b/tests/auto/uiloader/baseline/inputpage.ui @@ -0,0 +1,79 @@ + + InputPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + File name: + + + + + + + 0 + + + + + + + + ... + + + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/installdialog.ui b/tests/auto/uiloader/baseline/installdialog.ui new file mode 100644 index 000000000..21a05da77 --- /dev/null +++ b/tests/auto/uiloader/baseline/installdialog.ui @@ -0,0 +1,118 @@ + + InstallDialog + + + + 0 + 0 + 436 + 245 + + + + Install Documentation + + + + + + Available Documentation: + + + + + + + + + + Install + + + + + + + Cancel + + + + + + + Close + + + + + + + Qt::Vertical + + + + 20 + 56 + + + + + + + + Installation Path: + + + + + + + + + + ... + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + + + Qt::Horizontal + + + + + + + + + closeButton + clicked() + InstallDialog + accept() + + + 330 + 107 + + + 332 + 158 + + + + + diff --git a/tests/auto/uiloader/baseline/languagesdialog.ui b/tests/auto/uiloader/baseline/languagesdialog.ui new file mode 100644 index 000000000..93b490e9e --- /dev/null +++ b/tests/auto/uiloader/baseline/languagesdialog.ui @@ -0,0 +1,160 @@ + + LanguagesDialog + + + + 0 + 0 + 400 + 300 + + + + Auxiliary Languages + + + + + + 0 + + + + Locale + + + + + File + + + + + + + + + + false + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Move selected language up</p></body></html> + + + up + + + + :/images/up.png:/images/up.png + + + + + + + false + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;">Move selected language down</p></body></html> + + + down + + + + :/images/down.png:/images/down.png + + + + + + + false + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Remove selected language</p></body></html> + + + remove + + + + :/images/editdelete.png:/images/editdelete.png + + + + + + + true + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Open auxiliary language files</p></body></html> + + + ... + + + + :/images/mac/fileopen.png:/images/mac/fileopen.png + + + + + + + Qt::Horizontal + + + + 121 + 20 + + + + + + + + OK + + + + + + + + + + + + + okButton + clicked() + LanguagesDialog + accept() + + + 352 + 39 + + + 233 + 29 + + + + + diff --git a/tests/auto/uiloader/baseline/listwidgeteditor.ui b/tests/auto/uiloader/baseline/listwidgeteditor.ui new file mode 100644 index 000000000..fa7d962bd --- /dev/null +++ b/tests/auto/uiloader/baseline/listwidgeteditor.ui @@ -0,0 +1,226 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::ListWidgetEditor + + + + 0 + 0 + 223 + 245 + + + + Dialog + + + + 6 + + + 9 + + + + + Items List + + + + + + Items List + + + + + + + + + New Item + + + &New + + + + + + + Delete Item + + + &Delete + + + + + + + Qt::Horizontal + + + + 16 + 10 + + + + + + + + Move Item Up + + + U + + + + + + + Move Item Down + + + D + + + + + + + + + + + Icon + + + + + + + + + + Qt::Horizontal + + + + 108 + 21 + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + buttonBox + groupBox + + + + qdesigner_internal::IconSelector + QWidget +
iconselector_p.h
+ 1 +
+
+ + listWidget + newItemButton + deleteItemButton + moveItemUpButton + moveItemDownButton + + + + + buttonBox + accepted() + qdesigner_internal::ListWidgetEditor + accept() + + + 140 + 291 + + + 73 + 301 + + + + + buttonBox + rejected() + qdesigner_internal::ListWidgetEditor + reject() + + + 230 + 289 + + + 253 + 304 + + + + +
diff --git a/tests/auto/uiloader/baseline/mainwindow.ui b/tests/auto/uiloader/baseline/mainwindow.ui new file mode 100644 index 000000000..f6eda4fdd --- /dev/null +++ b/tests/auto/uiloader/baseline/mainwindow.ui @@ -0,0 +1,502 @@ + + MainWindow + + + + 0 + 0 + 829 + 813 + + + + MakeQPF + + + + + 9 + + + 6 + + + + + Font Properties + + + + 9 + + + 6 + + + + + Family: + + + + + + + + + + Pixel Size: + + + + + + + 1 + + + + + + + Weight: + + + + + + + + + + Italic + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Glyph Coverage + + + + 9 + + + 6 + + + + + Choose from Unicode Codepoints: + + + true + + + + + + + 0 + + + 6 + + + + + + + + 0 + + + 6 + + + + + Select &All + + + + + + + &Deselect All + + + + + + + &Invert Selection + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Choose from Sample Text File (UTF-8 Encoded): + + + + + + + 0 + + + 6 + + + + + false + + + Path: + + + + + + + false + + + + + + + false + + + Browse... + + + + + + + false + + + TextLabel + + + + + + + + + + + + Preview + + + + 9 + + + 6 + + + + + + + + + + + Output Options + + + + 9 + + + 6 + + + + + Path: + + + + + + + + + + Browse... + + + + + + + Filename: + + + + + + + false + + + + + + + + + + 0 + + + 6 + + + + + Generate Pre-Rendered Font... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 0 + 829 + 29 + + + + + File + + + + + + + + + + + &Add Custom Font... + + + + + &Exit + + + + + + + action_Exit + triggered() + MainWindow + close() + + + -1 + -1 + + + 383 + 215 + + + + + chooseFromCodePoints + toggled(bool) + characterRangeView + setEnabled(bool) + + + 183 + 144 + + + 146 + 295 + + + + + chooseFromCodePoints + toggled(bool) + selectAll + setEnabled(bool) + + + 236 + 146 + + + 46 + 508 + + + + + chooseFromCodePoints + toggled(bool) + deselectAll + setEnabled(bool) + + + 280 + 147 + + + 158 + 502 + + + + + chooseFromCodePoints + toggled(bool) + invertSelection + setEnabled(bool) + + + 364 + 143 + + + 281 + 509 + + + + + chooseFromSampleFile + toggled(bool) + sampleFile + setEnabled(bool) + + + 134 + 544 + + + 64 + 569 + + + + + chooseFromSampleFile + toggled(bool) + browseSampleFile + setEnabled(bool) + + + 79 + 545 + + + 710 + 582 + + + + + chooseFromSampleFile + toggled(bool) + charCount + setEnabled(bool) + + + 274 + 544 + + + 790 + 569 + + + + + chooseFromSampleFile + toggled(bool) + label_5 + setEnabled(bool) + + + 112 + 541 + + + 37 + 579 + + + + + diff --git a/tests/auto/uiloader/baseline/mainwindowbase.ui b/tests/auto/uiloader/baseline/mainwindowbase.ui new file mode 100644 index 000000000..27fbdc968 --- /dev/null +++ b/tests/auto/uiloader/baseline/mainwindowbase.ui @@ -0,0 +1,1214 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + MainWindowBase + + + + 0 + 0 + 724 + 615 + + + + Qt Configuration + + + + + 0 + 28 + 724 + 587 + + + + + 8 + + + 4 + + + + + + 200 + 0 + + + + true + + + + + + + + Appearance + + + + 4 + + + 4 + + + + + GUI Style + + + + 8 + + + 4 + + + + + Select GUI &Style: + + + gstylecombo + + + + + + + + + + + + + + 5 + 4 + 0 + 0 + + + + Build Palette + + + + 8 + + + 4 + + + + + &3-D Effects: + + + buttonMainColor + + + + + + + + + + + 1 + 1 + 0 + 0 + + + + + 50 + 0 + + + + 1 + + + 0 + + + Window Back&ground: + + + Qt::AlignVCenter + + + 0 + + + buttonMainColor2 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 70 + 20 + + + + + + + + &Tune Palette... + + + + + + + + + + + 5 + 7 + 0 + 0 + + + + Preview + + + + 8 + + + 4 + + + + + Select &Palette: + + + paletteCombo + + + + + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + + + + + + 7 + 7 + 0 + 0 + + + + + 410 + 260 + + + + + + + + + + + + Fonts + + + + 8 + + + 4 + + + + + Default Font + + + + 8 + + + 4 + + + + + true + + + false + + + + + + + true + + + false + + + + + + + true + + + true + + + false + + + + + + + &Style: + + + stylecombo + + + + + + + &Point Size: + + + psizecombo + + + + + + + F&amily: + + + familycombo + + + + + + + Sample Text + + + Qt::AlignHCenter + + + + + + + + + + Font Substitution + + + + 8 + + + 4 + + + + + 0 + + + 4 + + + + + S&elect or Enter a Family: + + + familysubcombo + + + + + + + true + + + true + + + false + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + Qt::Horizontal + + + + + + + Current Substitutions: + + + + + + + + + + 0 + + + 4 + + + + + Up + + + + + + + Down + + + + + + + Remove + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + Qt::Horizontal + + + + + + + 0 + + + 4 + + + + + Select s&ubstitute Family: + + + choosesubcombo + + + + + + + true + + + false + + + + + + + Add + + + + + + + + + + + + + Interface + + + + 7 + + + 4 + + + + + Feel Settings + + + + 8 + + + 4 + + + + + ms + + + 10000 + + + 10 + + + + + + + &Double Click Interval: + + + dcispin + + + + + + + No blinking + + + ms + + + 10000 + + + 9 + + + + + + + &Cursor Flash Time: + + + cfispin + + + + + + + lines + + + 20 + + + 1 + + + + + + + Wheel &Scroll Lines: + + + wslspin + + + + + + + Resolve symlinks in URLs + + + + + + + + + + GUI Effects + + + + 8 + + + 4 + + + + + &Enable + + + Alt+E + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 4 + + + + + &Menu Effect: + + + menueffect + + + + + + + C&omboBox Effect: + + + comboeffect + + + + + + + &ToolTip Effect: + + + tooltipeffect + + + + + + + Tool&Box Effect: + + + toolboxeffect + + + + + + + 0 + + + true + + + + Disable + + + + + Animate + + + + + Fade + + + + + + + + + Disable + + + + + Animate + + + + + + + + + Disable + + + + + Animate + + + + + Fade + + + + + + + + + Disable + + + + + Animate + + + + + + + + + + + + + + Global Strut + + + + 8 + + + 4 + + + + + Minimum &Width: + + + strutwidth + + + + + + + Minimum Hei&ght: + + + strutheight + + + + + + + pixels + + + 1000 + + + + + + + pixels + + + 1000 + + + + + + + + + + Enhanced support for languages written right-to-left + + + + + + + XIM Input Style: + + + + + + + 0 + + + + On The Spot + + + + + Over The Spot + + + + + Off The Spot + + + + + Root + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + Printer + + + + 8 + + + 4 + + + + + Enable Font embedding + + + true + + + + + + + + 5 + 7 + 0 + 0 + + + + Font Paths + + + + 8 + + + 4 + + + + + 0 + + + 4 + + + + + Up + + + + + + + Remove + + + + + + + Down + + + + + + + + + + + + 0 + + + 4 + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + Add + + + + + + + Browse... + + + + + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 724 + 27 + + + + + + 0 + 0 + 800 + 480 + + + + &File + + + + + + + + + + + + 0 + 0 + 800 + 480 + + + + &Help + + + + + + + + + + + + + + &Save + + + Save + + + Ctrl+S + + + + + E&xit + + + Exit + + + + + + + + &About + + + About + + + + + + + + About &Qt + + + About Qt + + + + + + + Q3ListBox + +
q3listbox.h
+ 0 + +
+ + ColorButton + +
colorbutton.h
+ 0 + +
+ + Q3Frame + +
Qt3Support/Q3Frame
+ 1 + +
+ + PreviewFrame + +
previewframe.h
+ 0 + +
+ + Q3MainWindow + +
q3mainwindow.h
+ 1 + +
+
+ + helpview + TabWidget3 + familycombo + stylecombo + psizecombo + samplelineedit + familysubcombo + PushButton2 + PushButton3 + PushButton4 + choosesubcombo + PushButton1 + dcispin + cfispin + wslspin + effectcheckbox + menueffect + comboeffect + tooltipeffect + strutwidth + strutheight + sublistbox + + + +
diff --git a/tests/auto/uiloader/baseline/mydialog.ui b/tests/auto/uiloader/baseline/mydialog.ui new file mode 100644 index 000000000..d765b3076 --- /dev/null +++ b/tests/auto/uiloader/baseline/mydialog.ui @@ -0,0 +1,47 @@ + + + + + MyDialog + + + + 0 + 0 + 401 + 70 + + + + Mach 2! + + + + 9 + + + 6 + + + + + Join the life in the fastlane; - PCH enable your project today! - + + + + + + + &Quit + + + Alt+Q + + + + + + qPixmapFromMimeSource + + + diff --git a/tests/auto/uiloader/baseline/myform.ui b/tests/auto/uiloader/baseline/myform.ui new file mode 100644 index 000000000..00702e860 --- /dev/null +++ b/tests/auto/uiloader/baseline/myform.ui @@ -0,0 +1,130 @@ + + + + + Form + + + + 0 + 0 + 258 + 224 + + + + Export Document + + + + 8 + + + 6 + + + + + Export Options + + + + 8 + + + 6 + + + + + &DocBook + + + + + + + &LaTeX + + + true + + + + + + + Include p&ictures + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + &Compress + + + + + + + &HTML + + + + + + + &PostScript + + + + + + + PD&F + + + + + + + Include &metadata + + + + + + + Create inde&x + + + true + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/newactiondialog.ui b/tests/auto/uiloader/baseline/newactiondialog.ui new file mode 100644 index 000000000..ae6212f86 --- /dev/null +++ b/tests/auto/uiloader/baseline/newactiondialog.ui @@ -0,0 +1,202 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::NewActionDialog + + + + 0 + 0 + 363 + 156 + + + + New Action... + + + + + + + + &Text: + + + editActionText + + + + + + + + 255 + 0 + + + + + + + + Object &name: + + + editObjectName + + + + + + + + + + &Icon: + + + iconSelector + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + qdesigner_internal::IconSelector + QWidget +
iconselector_p.h
+ 1 +
+
+ + editActionText + editObjectName + + + + + buttonBox + accepted() + qdesigner_internal::NewActionDialog + accept() + + + 165 + 162 + + + 291 + 94 + + + + + buttonBox + rejected() + qdesigner_internal::NewActionDialog + reject() + + + 259 + 162 + + + 293 + 128 + + + + +
diff --git a/tests/auto/uiloader/baseline/newdynamicpropertydialog.ui b/tests/auto/uiloader/baseline/newdynamicpropertydialog.ui new file mode 100644 index 000000000..2aa91f3e9 --- /dev/null +++ b/tests/auto/uiloader/baseline/newdynamicpropertydialog.ui @@ -0,0 +1,106 @@ + + qdesigner_internal::NewDynamicPropertyDialog + + + + 0 + 0 + 340 + 118 + + + + Create Dynamic Property + + + + + + + + + 220 + 0 + + + + + + + + + 0 + 0 + + + + Property Name + + + + + + + + + + + + horizontalSpacer + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + Property Type + + + + + + + + + + + + Qt::Vertical + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + false + + + + + + + + diff --git a/tests/auto/uiloader/baseline/newform.ui b/tests/auto/uiloader/baseline/newform.ui new file mode 100644 index 000000000..3f0a92dfb --- /dev/null +++ b/tests/auto/uiloader/baseline/newform.ui @@ -0,0 +1,153 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + NewForm + + + + 0 + 0 + 495 + 319 + + + + New Form + + + + 9 + + + 6 + + + + + 1 + + + 6 + + + + + + 128 + 128 + + + + false + + + 1 + + + + 0 + + + + + + + + + 7 + 5 + 0 + 0 + + + + 1 + + + Choose a template for a preview + + + Qt::AlignCenter + + + 5 + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + + + + + Show this Dialog on Startup + + + + + + + + + + + + QDialogButtonBox + QWidget +
qdialogbuttonbox.h
+ 1 + +
+
+ + +
diff --git a/tests/auto/uiloader/baseline/orderdialog.ui b/tests/auto/uiloader/baseline/orderdialog.ui new file mode 100644 index 000000000..b44824778 --- /dev/null +++ b/tests/auto/uiloader/baseline/orderdialog.ui @@ -0,0 +1,198 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::OrderDialog + + + + 0 + 0 + 467 + 310 + + + + Change Page Order + + + + + + Page Order + + + + 6 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + + 344 + 0 + + + + QAbstractItemView::InternalMove + + + QAbstractItemView::ContiguousSelection + + + QListView::Snap + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Move page up + + + + + + + Move page down + + + + + + + + 0 + 0 + + + + Qt::Vertical + + + + 20 + 99 + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset + + + + + + + + + buttonBox + accepted() + qdesigner_internal::OrderDialog + accept() + + + 50 + 163 + + + 6 + 151 + + + + + buttonBox + rejected() + qdesigner_internal::OrderDialog + reject() + + + 300 + 160 + + + 348 + 148 + + + + + diff --git a/tests/auto/uiloader/baseline/outputpage.ui b/tests/auto/uiloader/baseline/outputpage.ui new file mode 100644 index 000000000..755f81808 --- /dev/null +++ b/tests/auto/uiloader/baseline/outputpage.ui @@ -0,0 +1,95 @@ + + OutputPage + + + + 0 + 0 + 417 + 242 + + + + Form + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + Project file name: + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Collection file name: + + + + + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/pagefold.ui b/tests/auto/uiloader/baseline/pagefold.ui new file mode 100644 index 000000000..7ae313c33 --- /dev/null +++ b/tests/auto/uiloader/baseline/pagefold.ui @@ -0,0 +1,349 @@ + + MainWindow + + + + 0 + 0 + 392 + 412 + + + + MainWindow + + + + + 9 + + + 6 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 9 + + + 6 + + + + + Specify your name + + + true + + + -1 + + + + Girish + + + + + Jasmin + + + + + Simon + + + + + Zack + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Check this if you are female + + + &Female + + + + + + + Gender: + + + + + + + &Age: + + + ageSpinBox + + + + + + + Check this if you are male + + + &Male + + + + + + + &Name: + + + nameCombo + + + + + + + &Password: + + + passwordEdit + + + + + + + Specify your age + + + Specify your age + + + 12 + + + 22 + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + Please read the LICENSE file before checking + + + I &accept the terms and &conditions + + + + + + + Specify your password + + + Specify your password + + + Password + + + QLineEdit::Password + + + + + + + Select your profession + + + Specify your name here + + + Specify your name here + + + 0 + + + + Developer + + + + + Student + + + + + Fisherman + + + + + + + + Profession: + + + professionList + + + + + + + Specify country of origin + + + Specify country of origin + + + 6 + + + + Egypt + + + + + France + + + + + Germany + + + + + India + + + + + Italy + + + + + Korea + + + + + Norway + + + + + + + + Pro&fession + + + professionList + + + + + + + + + + + + 0 + 0 + 392 + 25 + + + + + &File + + + + + + + + &Help + + + + + + + + + + + + &Exit + + + + + About Qt + + + + + Edit &Style + + + + + About + + + + + + diff --git a/tests/auto/uiloader/baseline/paletteeditor.ui b/tests/auto/uiloader/baseline/paletteeditor.ui new file mode 100644 index 000000000..1cc6a1858 --- /dev/null +++ b/tests/auto/uiloader/baseline/paletteeditor.ui @@ -0,0 +1,264 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::PaletteEditor + + + + 0 + 0 + 365 + 409 + + + + + 7 + 7 + 0 + 0 + + + + Edit Palette + + + + 9 + + + 6 + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Tune Palette + + + + 9 + + + 6 + + + + + + 7 + 13 + 0 + 0 + + + + + + + + + + + + 0 + 200 + + + + + + + + Show Details + + + + + + + Compute Details + + + true + + + + + + + Quick + + + + + + + + + + + 5 + 7 + 0 + 0 + + + + Preview + + + + 8 + + + 6 + + + + + Disabled + + + + + + + Inactive + + + + + + + Active + + + true + + + + + + + + 7 + 7 + 0 + 0 + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + QtColorButton + QToolButton +
qtcolorbutton.h
+
+ + qdesigner_internal::PreviewFrame + QWidget +
previewframe.h
+
+
+ + + + buttonBox + accepted() + qdesigner_internal::PaletteEditor + accept() + + + 180 + 331 + + + 134 + 341 + + + + + buttonBox + rejected() + qdesigner_internal::PaletteEditor + reject() + + + 287 + 329 + + + 302 + 342 + + + + +
diff --git a/tests/auto/uiloader/baseline/paletteeditoradvancedbase.ui b/tests/auto/uiloader/baseline/paletteeditoradvancedbase.ui new file mode 100644 index 000000000..4de888aa3 --- /dev/null +++ b/tests/auto/uiloader/baseline/paletteeditoradvancedbase.ui @@ -0,0 +1,617 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + PaletteEditorAdvancedBase + + + PaletteEditorAdvancedBase + + + true + + + + 0 + 0 + 295 + 346 + + + + Tune Palette + + + true + + + <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> + + + + unnamed + + + 11 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + TextLabel1 + + + Select &Palette: + + + paletteCombo + + + + + + + paletteCombo + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + + + + + + + ButtonGroup1 + + + + 5 + 4 + 0 + 0 + + + + Auto + + + + unnamed + + + 11 + + + 6 + + + + + checkBuildInactive + + + Build inactive palette from active + + + true + + + + + + + checkBuildDisabled + + + Build disabled palette from active + + + true + + + + + + + + + + groupCentral + + + Central color &roles + + + + unnamed + + + 11 + + + 6 + + + + + comboCentral + + + Choose central color role + + + <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> + + + + Window + + + + + WindowText + + + + + Button + + + + + Base + + + + + Text + + + + + BrightText + + + + + ButtonText + + + + + Highlight + + + + + HighlightedText + + + + + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + labelCentral + + + + 1 + 1 + 0 + 0 + + + + + 0 + 0 + + + + &Select Color: + + + buttonCentral + + + + + + + buttonCentral + + + + 0 + 0 + 0 + 0 + + + + Qt::TabFocus + + + Choose a color + + + Choose a color for the selected central color role. + + + + + + + + + + + + groupEffect + + + 3-D shadow &effects + + + + unnamed + + + 11 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + checkBuildEffect + + + Build &from button color + + + true + + + Generate shadings + + + Check to let 3D-effect colors be calculated from button-color. + + + + + + + comboEffect + + + Choose 3D-effect color role + + + <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> + + + + Light + + + + + Midlight + + + + + Mid + + + + + Dark + + + + + Shadow + + + + + + + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + labelEffect + + + + 1 + 1 + 0 + 0 + + + + + 0 + 0 + + + + Select Co&lor: + + + buttonEffect + + + + + + + buttonEffect + + + + 0 + 0 + 0 + 0 + + + + Qt::TabFocus + + + Choose a color + + + Choose a color for the selected effect color role. + + + + + + + + + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + buttonOk + + + OK + + + true + + + true + + + Close dialog and apply all changes. + + + + + + + buttonCancel + + + Cancel + + + true + + + Close dialog and discard all changes. + + + + + + + + + + + ColorButton + +
colorbutton.h
+ + 40 + 25 + + 0 + + 5 + 5 + + image0 + + color + pixmap + +
+
+ + buttonOk + buttonCancel + paletteCombo + checkBuildInactive + checkBuildDisabled + comboCentral + buttonCentral + checkBuildEffect + comboEffect + buttonEffect + + + + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + +
diff --git a/tests/auto/uiloader/baseline/passworddialog.ui b/tests/auto/uiloader/baseline/passworddialog.ui new file mode 100644 index 000000000..7c1665867 --- /dev/null +++ b/tests/auto/uiloader/baseline/passworddialog.ui @@ -0,0 +1,111 @@ + + PasswordDialog + + + + 0 + 0 + 399 + 148 + + + + Authentication Required + + + + + + + + DUMMY ICON + + + + + + + + 0 + 0 + + + + INTRO TEXT DUMMY + + + + + + + + + Username: + + + + + + + + + + Password: + + + + + + + QLineEdit::Password + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + PasswordDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + PasswordDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/pathpage.ui b/tests/auto/uiloader/baseline/pathpage.ui new file mode 100644 index 000000000..89083915d --- /dev/null +++ b/tests/auto/uiloader/baseline/pathpage.ui @@ -0,0 +1,114 @@ + + PathPage + + + + 0 + 0 + 417 + 243 + + + + Form + + + + + + + 0 + 0 + + + + File filters: + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Documentation source file paths: + + + + + + + + + + + 0 + 0 + + + + Add + + + + + + + + 0 + 0 + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 51 + + + + + + + + Qt::Vertical + + + + 20 + 31 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/phrasebookbox.ui b/tests/auto/uiloader/baseline/phrasebookbox.ui new file mode 100644 index 000000000..66558ea28 --- /dev/null +++ b/tests/auto/uiloader/baseline/phrasebookbox.ui @@ -0,0 +1,211 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + PhraseBookBox + + + + 0 + 0 + 596 + 454 + + + + Edit Phrase Book + + + This window allows you to add, modify, or delete phrases in a phrase book. + + + + + + + + + + &Translation: + + + targetLed + + + + + + + This is the phrase in the target language corresponding to the source phrase. + + + + + + + S&ource phrase: + + + sourceLed + + + + + + + This is a definition for the source phrase. + + + + + + + This is the phrase in the source language. + + + + + + + &Definition: + + + definitionLed + + + + + + + + + false + + + true + + + false + + + true + + + false + + + + + + + + + + + Click here to add the phrase to the phrase book. + + + &New Phrase + + + + + + + Click here to remove the phrase from the phrase book. + + + &Remove Phrase + + + + + + + Click here to save the changes made. + + + &Save + + + + + + + Click here to close this window. + + + Close + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 51 + + + + + + + + + + + sourceLed + targetLed + definitionLed + newBut + removeBut + saveBut + closeBut + + + + diff --git a/tests/auto/uiloader/baseline/plugindialog.ui b/tests/auto/uiloader/baseline/plugindialog.ui new file mode 100644 index 000000000..d4bec9883 --- /dev/null +++ b/tests/auto/uiloader/baseline/plugindialog.ui @@ -0,0 +1,153 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + PluginDialog + + + + 0 + 0 + 401 + 331 + + + + Plugin Information + + + + 6 + + + 8 + + + 8 + + + 8 + + + 8 + + + + + TextLabel + + + true + + + + + + + Qt::ElideNone + + + + 1 + + + + + + + + TextLabel + + + true + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + buttonBox + rejected() + PluginDialog + reject() + + + 154 + 307 + + + 401 + 280 + + + + + diff --git a/tests/auto/uiloader/baseline/preferencesdialog.ui b/tests/auto/uiloader/baseline/preferencesdialog.ui new file mode 100644 index 000000000..3092fcb53 --- /dev/null +++ b/tests/auto/uiloader/baseline/preferencesdialog.ui @@ -0,0 +1,165 @@ + + PreferencesDialog + + + + 0 + 0 + 455 + 359 + + + + Preferences + + + true + + + + + + + + + + User Interface Mode + + + + + + + + + + + + + + + + + + + + + + Additional Template Paths + + + + + + + + + ... + + + + + + + ... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + FontPanel + QGroupBox +
fontpanel.h
+ 1 +
+ + qdesigner_internal::GridPanel + QGroupBox +
gridpanel_p.h
+ 1 +
+ + qdesigner_internal::PreviewConfigurationWidget + QGroupBox +
previewconfigurationwidget_p.h
+ 1 +
+
+ + + + m_dialogButtonBox + accepted() + PreferencesDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + m_dialogButtonBox + rejected() + PreferencesDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +
diff --git a/tests/auto/uiloader/baseline/previewconfigurationwidget.ui b/tests/auto/uiloader/baseline/previewconfigurationwidget.ui new file mode 100644 index 000000000..2f18766ff --- /dev/null +++ b/tests/auto/uiloader/baseline/previewconfigurationwidget.ui @@ -0,0 +1,91 @@ + + PreviewConfigurationWidget + + + Form + + + Print/Preview Configuration + + + true + + + + + + Style + + + + + + + + + + Style sheet + + + + + + + + + + 149 + 0 + + + + + + + + ... + + + + + + + ... + + + + + + + + + Device skin + + + + + + + + + + + + ... + + + + + + + + + + qdesigner_internal::TextPropertyEditor + QLineEdit +
textpropertyeditor_p.h
+
+
+ + +
diff --git a/tests/auto/uiloader/baseline/previewdialogbase.ui b/tests/auto/uiloader/baseline/previewdialogbase.ui new file mode 100644 index 000000000..593ee3357 --- /dev/null +++ b/tests/auto/uiloader/baseline/previewdialogbase.ui @@ -0,0 +1,224 @@ + + PreviewDialogBase + + + + 0 + 0 + 733 + 479 + + + + Print Preview + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + &Paper Size: + + + paperSizeCombo + + + + + + + + 1 + 0 + 0 + 0 + + + + + + + + &Orientation: + + + paperOrientationCombo + + + + + + + + 1 + 0 + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 6 + + + + + 0 + + + false + + + true + + + false + + + 1 + + + + 1 + + + + + + + + + 5 + 5 + 1 + 0 + + + + + + + + + + 0 + + + 6 + + + + + false + + + + 7 + 0 + 1 + 0 + + + + 0 + + + false + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + + QScrollArea + QWidget +
qscrollarea.h
+ 1 +
+
+ + + + buttonBox + accepted() + PreviewDialogBase + accept() + + + 696 + 526 + + + 677 + 446 + + + + + buttonBox + rejected() + PreviewDialogBase + reject() + + + 587 + 529 + + + 547 + 448 + + + + +
diff --git a/tests/auto/uiloader/baseline/previewwidget.ui b/tests/auto/uiloader/baseline/previewwidget.ui new file mode 100644 index 000000000..d38ab7cf3 --- /dev/null +++ b/tests/auto/uiloader/baseline/previewwidget.ui @@ -0,0 +1,238 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::PreviewWidget + + + + 0 + 0 + 471 + 251 + + + + + 1 + 1 + 0 + 0 + + + + Preview Window + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + LineEdit + + + + + + + + ComboBox + + + + + + + + 0 + + + 6 + + + + + + + + PushButton + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + + + + + 32767 + 50 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + Qt::Horizontal + + + + + + + ButtonGroup2 + + + + 9 + + + 6 + + + + + CheckBox1 + + + true + + + + + + + CheckBox2 + + + + + + + + + + ButtonGroup + + + + 9 + + + 6 + + + + + RadioButton1 + + + true + + + + + + + RadioButton2 + + + + + + + RadioButton3 + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/previewwidgetbase.ui b/tests/auto/uiloader/baseline/previewwidgetbase.ui new file mode 100644 index 000000000..3e0570092 --- /dev/null +++ b/tests/auto/uiloader/baseline/previewwidgetbase.ui @@ -0,0 +1,340 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + PreviewWidgetBase + + + PreviewWidgetBase + + + + 0 + 0 + 378 + 236 + + + + + 1 + 1 + 0 + 0 + + + + Preview Window + + + + unnamed + + + 11 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + ButtonGroup1 + + + ButtonGroup + + + + unnamed + + + 11 + + + 6 + + + + + RadioButton1 + + + RadioButton1 + + + true + + + + + + + RadioButton2 + + + RadioButton2 + + + + + + + RadioButton3 + + + RadioButton3 + + + + + + + + + + ButtonGroup2 + + + ButtonGroup2 + + + + unnamed + + + 11 + + + 6 + + + + + CheckBox1 + + + CheckBox1 + + + true + + + + + + + CheckBox2 + + + CheckBox2 + + + + + + + + + + ProgressBar1 + + + 50 + + + + + + + + + unnamed + + + 0 + + + 6 + + + + + LineEdit1 + + + LineEdit + + + + + + + ComboBox1 + + + + ComboBox + + + + + + + + unnamed + + + 0 + + + 6 + + + + + SpinBox1 + + + + + + + PushButton1 + + + PushButton + + + + + + + + + ScrollBar1 + + + Qt::Horizontal + + + + + + + Slider1 + + + Qt::Horizontal + + + + + + + textView + + + + 32767 + 50 + + + + true + + + <p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p> + + + + + + + + + + + + 20 + 20 + + + + Expanding + + + Vertical + + + + + + qPixmapFromMimeSource + diff --git a/tests/auto/uiloader/baseline/proxy.ui b/tests/auto/uiloader/baseline/proxy.ui new file mode 100644 index 000000000..62a8be627 --- /dev/null +++ b/tests/auto/uiloader/baseline/proxy.ui @@ -0,0 +1,104 @@ + + ProxyDialog + + + + 0 + 0 + 369 + 144 + + + + Proxy Authentication + + + + + + ICON + + + + + + + Connect to proxy + + + true + + + + + + + Username: + + + + + + + + + + Password: + + + + + + + QLineEdit::Password + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ProxyDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ProxyDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/qfiledialog.ui b/tests/auto/uiloader/baseline/qfiledialog.ui new file mode 100644 index 000000000..85f599172 --- /dev/null +++ b/tests/auto/uiloader/baseline/qfiledialog.ui @@ -0,0 +1,320 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + QFileDialog + + + + 0 + 0 + 521 + 316 + + + + true + + + + + + Look in: + + + + + + + + + + 1 + 0 + + + + + 50 + 0 + + + + + + + + Back + + + + + + + Forward + + + + + + + Parent Directory + + + + + + + Create New Folder + + + + + + + List View + + + + + + + Detail View + + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + 1 + 0 + + + + + + + + Qt::Vertical + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + 0 + 0 + + + + Files of type: + + + + + + + + 0 + 0 + + + + + + + + + QFileDialogTreeView + QTreeView +
qfiledialog_p.h
+
+ + QFileDialogListView + QListView +
qfiledialog_p.h
+
+ + QSidebar + QListWidget +
qsidebar_p.h
+
+ + QFileDialogLineEdit + QLineEdit +
qfiledialog_p.h
+
+ + QFileDialogComboBox + QComboBox +
qfiledialog_p.h
+
+
+ + lookInCombo + backButton + forwardButton + toParentButton + newFolderButton + listModeButton + detailModeButton + sidebar + listView + fileNameEdit + fileTypeCombo + buttonBox + treeView + + + +
diff --git a/tests/auto/uiloader/baseline/qpagesetupwidget.ui b/tests/auto/uiloader/baseline/qpagesetupwidget.ui new file mode 100644 index 000000000..ace2ab8f4 --- /dev/null +++ b/tests/auto/uiloader/baseline/qpagesetupwidget.ui @@ -0,0 +1,353 @@ + + QPageSetupWidget + + + + 0 + 0 + 416 + 488 + + + + Form + + + + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Paper + + + + + + Page size: + + + paperSize + + + + + + + + + + Width: + + + paperWidth + + + + + + + + + 9999.989999999999782 + + + + + + + Height: + + + paperHeight + + + + + + + 9999.989999999999782 + + + + + + + + + Paper source: + + + paperSource + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Orientation + + + + + + Portrait + + + true + + + + + + + Landscape + + + + + + + Reverse landscape + + + + + + + Reverse portrait + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + + + + + Margins + + + + + + + + top margin + + + top margin + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 999.990000000000009 + + + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + left margin + + + left margin + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 999.990000000000009 + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 0 + 0 + + + + + + + + right margin + + + right margin + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 999.990000000000009 + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + bottom margin + + + bottom margin + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 999.990000000000009 + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 0 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 0 + 20 + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/qprintpropertieswidget.ui b/tests/auto/uiloader/baseline/qprintpropertieswidget.ui new file mode 100644 index 000000000..26fa09599 --- /dev/null +++ b/tests/auto/uiloader/baseline/qprintpropertieswidget.ui @@ -0,0 +1,70 @@ + + QPrintPropertiesWidget + + + + 0 + 0 + 396 + 288 + + + + Form + + + + 0 + + + + + 0 + + + + + 0 + 0 + 392 + 261 + + + + Page + + + + + + + + + + Advanced + + + + + + true + + + + + + + + + + + + QPageSetupWidget + QWidget +
qpagesetupdialog_unix_p.h
+ 1 +
+
+ + +
diff --git a/tests/auto/uiloader/baseline/qprintsettingsoutput.ui b/tests/auto/uiloader/baseline/qprintsettingsoutput.ui new file mode 100644 index 000000000..de8f4faee --- /dev/null +++ b/tests/auto/uiloader/baseline/qprintsettingsoutput.ui @@ -0,0 +1,371 @@ + + QPrintSettingsOutput + + + + 0 + 0 + 416 + 166 + + + + Form + + + + 0 + + + + + 0 + + + + + 0 + 0 + 412 + 139 + + + + Copies + + + + + + + 0 + 0 + + + + Print range + + + + 4 + + + 6 + + + + + Print all + + + true + + + + + + + 6 + + + 0 + + + + + Pages from + + + + + + + false + + + 1 + + + 999 + + + + + + + to + + + + + + + false + + + 1 + + + 999 + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + Selection + + + + + + + Qt::Vertical + + + + 1 + 1 + + + + + + + + + + + Output Settings + + + + + + Copies: + + + copies + + + + + + + 1 + + + 999 + + + + + + + Qt::Horizontal + + + + 91 + 20 + + + + + + + + Collate + + + + + + + + 0 + 0 + + + + + + + + Reverse + + + + + + + Qt::Vertical + + + + 0 + 1 + + + + + + + + + + + + + 0 + 0 + 412 + 139 + + + + Options + + + + + + Color Mode + + + + + + Qt::Vertical + + + + 1 + 0 + + + + + + + + Color + + + + + + + + + + Grayscale + + + + + + + + + + Duplex Printing + + + + + + None + + + true + + + + + + + Long side + + + + + + + Short side + + + + + + + Qt::Vertical + + + + 1 + 0 + + + + + + + + + + + + + + + + + printRange + toggled(bool) + from + setEnabled(bool) + + + 76 + 59 + + + 122 + 57 + + + + + printRange + toggled(bool) + to + setEnabled(bool) + + + 69 + 67 + + + 215 + 67 + + + + + diff --git a/tests/auto/uiloader/baseline/qprintwidget.ui b/tests/auto/uiloader/baseline/qprintwidget.ui new file mode 100644 index 000000000..8a4f3bde0 --- /dev/null +++ b/tests/auto/uiloader/baseline/qprintwidget.ui @@ -0,0 +1,116 @@ + + QPrintWidget + + + + 0 + 0 + 443 + 175 + + + + Form + + + + 0 + + + + + Printer + + + + + + &Name: + + + printers + + + + + + + + 3 + 0 + + + + + + + + + 1 + 0 + + + + P&roperties + + + + + + + Location: + + + + + + + + + + Preview + + + + + + + Type: + + + + + + + + + + Output &file: + + + filename + + + + + + + + + + + + ... + + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/qsqlconnectiondialog.ui b/tests/auto/uiloader/baseline/qsqlconnectiondialog.ui new file mode 100644 index 000000000..91a870057 --- /dev/null +++ b/tests/auto/uiloader/baseline/qsqlconnectiondialog.ui @@ -0,0 +1,224 @@ + + + + + QSqlConnectionDialogUi + + + + 0 + 0 + 315 + 302 + + + + Connect... + + + + 8 + + + 6 + + + + + Connection settings + + + + 8 + + + 6 + + + + + + + + &Username: + + + editUsername + + + + + + + D&river + + + comboDriver + + + + + + + + + + Default + + + 65535 + + + -1 + + + -1 + + + + + + + Database Name: + + + editDatabase + + + + + + + QLineEdit::Password + + + + + + + + + + + + + &Hostname: + + + editHostname + + + + + + + P&ort: + + + portSpinBox + + + + + + + &Password: + + + editPassword + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Us&e predefined in-memory database + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + &OK + + + true + + + + + + + &Cancel + + + + + + + + + + comboDriver + editDatabase + editUsername + editPassword + editHostname + portSpinBox + dbCheckBox + okButton + cancelButton + + + + diff --git a/tests/auto/uiloader/baseline/qtgradientdialog.ui b/tests/auto/uiloader/baseline/qtgradientdialog.ui new file mode 100644 index 000000000..0c5578fd0 --- /dev/null +++ b/tests/auto/uiloader/baseline/qtgradientdialog.ui @@ -0,0 +1,121 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + QtGradientDialog + + + + 0 + 0 + 178 + 81 + + + + Edit Gradient + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + QtGradientEditor + QFrame +
qtgradienteditor.h
+ 1 +
+
+ + + + buttonBox + accepted() + QtGradientDialog + accept() + + + 72 + 224 + + + 21 + 243 + + + + + buttonBox + rejected() + QtGradientDialog + reject() + + + 168 + 233 + + + 152 + 251 + + + + +
diff --git a/tests/auto/uiloader/baseline/qtgradienteditor.ui b/tests/auto/uiloader/baseline/qtgradienteditor.ui new file mode 100644 index 000000000..7d7a33441 --- /dev/null +++ b/tests/auto/uiloader/baseline/qtgradienteditor.ui @@ -0,0 +1,1377 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + QtGradientEditor + + + + 0 + 0 + 364 + 518 + + + + Form + + + + + 10 + 69 + 193 + 150 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Gradient Editor + + + This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop. + + + + + + + + + 209 + 69 + 64 + 23 + + + + 1 + + + + + + 279 + 69 + 73 + 23 + + + + false + + + 3 + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + 209 + 99 + 64 + 23 + + + + 2 + + + + + + 279 + 99 + 73 + 23 + + + + false + + + 3 + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + 209 + 129 + 64 + 23 + + + + 3 + + + + + + 279 + 129 + 73 + 23 + + + + false + + + 3 + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + 209 + 159 + 64 + 23 + + + + 4 + + + + + + 279 + 159 + 73 + 23 + + + + false + + + 3 + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + 209 + 189 + 64 + 23 + + + + 5 + + + + + + 279 + 189 + 73 + 23 + + + + false + + + 3 + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + 10 + 225 + 193 + 67 + + + + Gradient Stops Editor + + + This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. + + + + + + 209 + 231 + 64 + 23 + + + + Zoom + + + + + + 279 + 260 + 72 + 26 + + + + + 0 + 0 + + + + Reset Zoom + + + Reset Zoom + + + + + + 209 + 304 + 64 + 23 + + + + Position + + + + + + 10 + 335 + 32 + 18 + + + + + 0 + 0 + + + + Hue + + + H + + + + + + 48 + 333 + 155 + 23 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Hue + + + + + + + + + 209 + 335 + 64 + 18 + + + + + 0 + 0 + + + + Hue + + + + + + 10 + 364 + 32 + 18 + + + + + 0 + 0 + + + + Saturation + + + S + + + + + + 48 + 362 + 155 + 23 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Saturation + + + + + + + + + 209 + 364 + 64 + 18 + + + + + 0 + 0 + + + + Sat + + + + + + 10 + 393 + 32 + 18 + + + + + 0 + 0 + + + + Value + + + V + + + + + + 48 + 391 + 155 + 23 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Value + + + + + + + + + 209 + 393 + 64 + 18 + + + + + 0 + 0 + + + + Val + + + + + + 10 + 422 + 32 + 18 + + + + + 0 + 0 + + + + Alpha + + + A + + + + + + 48 + 420 + 155 + 23 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Alpha + + + + + + + + + 209 + 422 + 64 + 18 + + + + + 0 + 0 + + + + Alpha + + + + + + 10 + 40 + 79 + 22 + + + + Type + + + + + + 96 + 40 + 72 + 22 + + + + Spread + + + + + + 10 + 298 + 32 + 29 + + + + + 0 + 0 + + + + Color + + + + + + 48 + 300 + 26 + 25 + + + + Current stop's color + + + + + + + + + 80 + 301 + 49 + 23 + + + + + 0 + 0 + + + + Show HSV specification + + + HSV + + + true + + + + + + 135 + 301 + 49 + 23 + + + + + 0 + 0 + + + + Show RGB specification + + + RGB + + + + + + 279 + 304 + 73 + 23 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Current stop's position + + + false + + + 3 + + + 0.000000000000000 + + + 1.000000000000000 + + + 0.010000000000000 + + + 0.000000000000000 + + + + + + + + + 279 + 333 + 73 + 23 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + 359 + + + + + + + + + 279 + 362 + 73 + 23 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + 255 + + + + + + + + + 279 + 391 + 73 + 23 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + 255 + + + + + + + + + 279 + 420 + 73 + 23 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + 255 + + + + + + + + + 279 + 231 + 73 + 23 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + % + + + 100 + + + 10000 + + + 100 + + + 100 + + + + + + + + + 209 + 219 + 143 + 16 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + + + + + + 209 + 292 + 143 + 16 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + + + + + + 209 + 260 + 64 + 26 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Zoom In + + + + + + + Zoom Out + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + 176 + 40 + 25 + 22 + + + + + 0 + 0 + + + + Toggle details extension + + + > + + + true + + + true + + + + + + 10 + 10 + 30 + 26 + + + + Linear Type + + + ... + + + true + + + true + + + + + + 40 + 10 + 30 + 26 + + + + Radial Type + + + ... + + + true + + + true + + + + + + 70 + 10 + 30 + 26 + + + + Conical Type + + + ... + + + true + + + true + + + + + + 110 + 10 + 30 + 26 + + + + Pad Spread + + + ... + + + true + + + true + + + + + + 140 + 10 + 30 + 26 + + + + Repeat Spread + + + ... + + + true + + + true + + + + + + 170 + 10 + 30 + 26 + + + + Reflect Spread + + + ... + + + true + + + true + + + + + + QtColorButton + QToolButton +
qtcolorbutton.h
+
+ + QtColorLine + QWidget +
qtcolorline.h
+ 1 +
+ + QtGradientStopsWidget + QWidget +
qtgradientstopswidget.h
+ 1 +
+ + QtGradientWidget + QWidget +
qtgradientwidget.h
+ 1 +
+
+ + typeComboBox + spreadComboBox + detailsButton + spinBox1 + spinBox2 + spinBox3 + spinBox4 + spinBox5 + zoomSpinBox + zoomInButton + zoomOutButton + zoomAllButton + colorButton + hsvRadioButton + rgbRadioButton + positionSpinBox + hueSpinBox + saturationSpinBox + valueSpinBox + alphaSpinBox + + + +
diff --git a/tests/auto/uiloader/baseline/qtgradientview.ui b/tests/auto/uiloader/baseline/qtgradientview.ui new file mode 100644 index 000000000..af7267ea2 --- /dev/null +++ b/tests/auto/uiloader/baseline/qtgradientview.ui @@ -0,0 +1,135 @@ + + QtGradientView + + + + 0 + 0 + 484 + 228 + + + + Gradient View + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + 0 + 0 + + + + New... + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 0 + 0 + + + + Edit... + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 0 + 0 + + + + Rename + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 0 + 0 + + + + Remove + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Qt::Horizontal + + + + 71 + 26 + + + + + + + + + + + + + listWidget + newButton + editButton + renameButton + removeButton + + + + diff --git a/tests/auto/uiloader/baseline/qtgradientviewdialog.ui b/tests/auto/uiloader/baseline/qtgradientviewdialog.ui new file mode 100644 index 000000000..c84907289 --- /dev/null +++ b/tests/auto/uiloader/baseline/qtgradientviewdialog.ui @@ -0,0 +1,121 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + QtGradientViewDialog + + + + 0 + 0 + 178 + 72 + + + + Select Gradient + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + QtGradientView + QFrame +
qtgradientview.h
+ 1 +
+
+ + + + buttonBox + accepted() + QtGradientViewDialog + accept() + + + 72 + 224 + + + 21 + 243 + + + + + buttonBox + rejected() + QtGradientViewDialog + reject() + + + 168 + 233 + + + 152 + 251 + + + + +
diff --git a/tests/auto/uiloader/baseline/qtresourceeditordialog.ui b/tests/auto/uiloader/baseline/qtresourceeditordialog.ui new file mode 100644 index 000000000..2205da4d5 --- /dev/null +++ b/tests/auto/uiloader/baseline/qtresourceeditordialog.ui @@ -0,0 +1,180 @@ + + QtResourceEditorDialog + + + + 0 + 0 + 469 + 317 + + + + Dialog + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + + + + New File + + + N + + + + + + + Remove File + + + R + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Ignored + + + + 21 + 20 + + + + + + + + I + + + + + + + + + + + + + + New Resource + + + N + + + + + + + A + + + + + + + Remove Resource or File + + + R + + + + + + + horizontalSpacer + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + QtResourceEditorDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + QtResourceEditorDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/qttoolbardialog.ui b/tests/auto/uiloader/baseline/qttoolbardialog.ui new file mode 100644 index 000000000..c4ad934f8 --- /dev/null +++ b/tests/auto/uiloader/baseline/qttoolbardialog.ui @@ -0,0 +1,207 @@ + + QtToolBarDialog + + + + 0 + 0 + 583 + 508 + + + + Customize Toolbars + + + + 8 + + + 6 + + + + + + 1 + + + + + + + + Actions + + + + + + + 6 + + + 0 + + + + + Toolbars + + + + + + + Add new toolbar + + + New + + + + + + + Remove selected toolbar + + + Remove + + + + + + + Rename toolbar + + + Rename + + + + + + + + + 6 + + + 0 + + + + + + 0 + 0 + + + + Move action up + + + Up + + + + + + + + 0 + 0 + + + + Remove action from toolbar + + + <- + + + + + + + + 0 + 0 + + + + Add action to toolbar + + + -> + + + + + + + + 0 + 0 + + + + Move action down + + + Down + + + + + + + Qt::Vertical + + + + 29 + 16 + + + + + + + + + + + + + Current Toolbar Actions + + + + + + + + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults + + + + + + + newButton + removeButton + renameButton + toolBarList + upButton + leftButton + rightButton + downButton + currentToolBarList + + + + diff --git a/tests/auto/uiloader/baseline/querywidget.ui b/tests/auto/uiloader/baseline/querywidget.ui new file mode 100644 index 000000000..53fa62227 --- /dev/null +++ b/tests/auto/uiloader/baseline/querywidget.ui @@ -0,0 +1,163 @@ + + QueryWidget + + + + 0 + 0 + 545 + 531 + + + + Recipes XQuery Example + + + + + 0 + 29 + 545 + 480 + + + + + + + 6 + + + 0 + + + + + + 550 + 120 + + + + Input Document + + + + + + 6 + + + 0 + + + + + + + + + + + + + + 550 + 120 + + + + Select your query: + + + + + + + + + + 400 + 60 + + + + true + + + false + + + + + + + + + + + 550 + 120 + + + + Output Document + + + + + + 6 + + + 0 + + + + + + 500 + 80 + + + + true + + + false + + + + + + + + + + + + + + + + 0 + 0 + 545 + 29 + + + + + + + 0 + 509 + 545 + 22 + + + + + + + diff --git a/tests/auto/uiloader/baseline/remotecontrol.ui b/tests/auto/uiloader/baseline/remotecontrol.ui new file mode 100644 index 000000000..1cfc7f540 --- /dev/null +++ b/tests/auto/uiloader/baseline/remotecontrol.ui @@ -0,0 +1,228 @@ + + RemoteControlClass + + + + 0 + 0 + 344 + 364 + + + + RemoteControl + + + + + + + Start URL: + + + + + + + + + + Launch Qt HelpViewer + + + + + + + Qt::Horizontal + + + + 101 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 113 + 16 + + + + + + + + false + + + Actions + + + + + + Search in Index: + + + + + + + 0 + + + + + + + + + + + :/remotecontrol/enter.png + + + + + + + + + Identifier: + + + + + + + 0 + + + + + + + + + + + :/remotecontrol/enter.png + + + + + + + + + Show URL: + + + + + + + 0 + + + + + + + + + + + :/remotecontrol/enter.png + + + + + + + + + Sync Contents + + + + + + + Qt::Horizontal + + + + 81 + 20 + + + + + + + + Show Contents + + + + + + + Show Index + + + + + + + Show Bookmarks + + + + + + + + + + + + 0 + 0 + 344 + 21 + + + + + File + + + + + + + + + Quit + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/saveformastemplate.ui b/tests/auto/uiloader/baseline/saveformastemplate.ui new file mode 100644 index 000000000..81d55d3b6 --- /dev/null +++ b/tests/auto/uiloader/baseline/saveformastemplate.ui @@ -0,0 +1,166 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + SaveFormAsTemplate + + + Save Form As Template + + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + &Name: + + + Qt::AutoText + + + templateNameEdit + + + + + + + + 222 + 0 + + + + + + + QLineEdit::Normal + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + &Category: + + + Qt::AutoText + + + categoryCombo + + + + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + SaveFormAsTemplate + accept() + + + 256 + 124 + + + 113 + 143 + + + + + buttonBox + rejected() + SaveFormAsTemplate + reject() + + + 332 + 127 + + + 372 + 147 + + + + + diff --git a/tests/auto/uiloader/baseline/settings.ui b/tests/auto/uiloader/baseline/settings.ui new file mode 100644 index 000000000..fcf698ba8 --- /dev/null +++ b/tests/auto/uiloader/baseline/settings.ui @@ -0,0 +1,262 @@ + + Dialog + + + + 0 + 0 + 392 + 176 + + + + Dialog + + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + Audio device: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + Audio effect: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + Cross fade: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + 0 + 0 + + + + -20 + + + 20 + + + 1 + + + 2 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + + + + + + + + 9 + + + + -10 Sec + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 9 + + + + 0 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 9 + + + + 10 Sec + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/tests/auto/uiloader/baseline/signalslotdialog.ui b/tests/auto/uiloader/baseline/signalslotdialog.ui new file mode 100644 index 000000000..1a8a8d921 --- /dev/null +++ b/tests/auto/uiloader/baseline/signalslotdialog.ui @@ -0,0 +1,129 @@ + + SignalSlotDialogClass + + + + 0 + 0 + 617 + 535 + + + + Signals and slots + + + + + + Slots + + + + + + + + + + + Add + + + ... + + + + + + + Delete + + + ... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Signals + + + + + + + + + + + Add + + + ... + + + + + + + Delete + + + ... + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/sslclient.ui b/tests/auto/uiloader/baseline/sslclient.ui new file mode 100644 index 000000000..5a2475116 --- /dev/null +++ b/tests/auto/uiloader/baseline/sslclient.ui @@ -0,0 +1,190 @@ + + Form + + + + 0 + 0 + 343 + 320 + + + + Secure Socket Client + + + + + + + + Host name: + + + + + + + imap.example.com + + + + + + + Port: + + + + + + + 1 + + + 65535 + + + 993 + + + + + + + + + true + + + Connect to host + + + true + + + + + + + false + + + Active session + + + + + + + + Cryptographic Cipher: + + + + + + + <none> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + false + + + Qt::NoFocus + + + true + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + + + + + + + Input: + + + + + + + false + + + + + + + false + + + Qt::TabFocus + + + &Send + + + true + + + + + + + + + + + + + + hostNameEdit + returnPressed() + connectButton + animateClick() + + + 126 + 20 + + + 142 + 78 + + + + + sessionInput + returnPressed() + sendButton + animateClick() + + + 142 + 241 + + + 297 + 234 + + + + + diff --git a/tests/auto/uiloader/baseline/sslerrors.ui b/tests/auto/uiloader/baseline/sslerrors.ui new file mode 100644 index 000000000..4aac18cdd --- /dev/null +++ b/tests/auto/uiloader/baseline/sslerrors.ui @@ -0,0 +1,110 @@ + + SslErrors + + + + 0 + 0 + 371 + 216 + + + + Unable To Validate The Connection + + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">Warning</span><span style=" color:#ff0000;">:</span><span style=" color:#000000;"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click </span><span style=" color:#000000;">Ignore</span><span style=" color:#000000;"> to continue, or </span><span style=" color:#000000;">Cancel</span><span style=" color:#000000;"> to abort the connection.</span></p></body></html> + + + true + + + + + + + + + + + + View Certificate Chain + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Ignore + + + + + + + Cancel + + + + + + + + + + + pushButton + clicked() + SslErrors + accept() + + + 235 + 185 + + + 228 + 287 + + + + + pushButton_2 + clicked() + SslErrors + reject() + + + 325 + 192 + + + 333 + 231 + + + + + diff --git a/tests/auto/uiloader/baseline/statistics.ui b/tests/auto/uiloader/baseline/statistics.ui new file mode 100644 index 000000000..ba752e386 --- /dev/null +++ b/tests/auto/uiloader/baseline/statistics.ui @@ -0,0 +1,242 @@ + + Statistics + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + + linguist_stats + + + + 0 + 0 + 336 + 164 + + + + Statistics + + + + unnamed + + + + + unnamed + + + + + + 40 + 20 + + + + Expanding + + + Horizontal + + + + + + + closeBtn + + + &Close + + + + + + + + 40 + 20 + + + + Expanding + + + Horizontal + + + + + + + + + frame4 + + + QFrame::StyledPanel + + + QFrame::Raised + + + + unnamed + + + + + textLabel4 + + + Translation + + + + + + + textLabel5 + + + Source + + + + + + + untrWords + + + 0 + + + + + + + trWords + + + 0 + + + + + + + textLabel1 + + + Words: + + + + + + + trChars + + + 0 + + + + + + + untrChars + + + 0 + + + + + + + textLabel3 + + + Characters: + + + + + + + textLabel6 + + + Characters (with spaces): + + + + + + + trCharsSpc + + + 0 + + + + + + + untrCharsSpc + + + 0 + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/stringlisteditor.ui b/tests/auto/uiloader/baseline/stringlisteditor.ui new file mode 100644 index 000000000..96fff1c3e --- /dev/null +++ b/tests/auto/uiloader/baseline/stringlisteditor.ui @@ -0,0 +1,265 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::Dialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + 9 + + + 6 + + + + + StringList + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + New String + + + &New + + + Qt::ToolButtonTextBesideIcon + + + + + + + Delete String + + + &Delete + + + Qt::ToolButtonTextBesideIcon + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 6 + + + + + &Value: + + + valueEdit + + + + + + + + + + + + + + 0 + + + 6 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Move String Up + + + Up + + + + + + + Move String Down + + + Down + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + qdesigner_internal::Dialog + accept() + + + 258 + 283 + + + 138 + 294 + + + + + buttonBox + rejected() + qdesigner_internal::Dialog + reject() + + + 350 + 284 + + + 369 + 295 + + + + + diff --git a/tests/auto/uiloader/baseline/stylesheeteditor.ui b/tests/auto/uiloader/baseline/stylesheeteditor.ui new file mode 100644 index 000000000..34cd7f6d0 --- /dev/null +++ b/tests/auto/uiloader/baseline/stylesheeteditor.ui @@ -0,0 +1,171 @@ + + StyleSheetEditor + + + + 0 + 0 + 445 + 289 + + + + Style Editor + + + + 9 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 32 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 32 + 20 + + + + + + + + + Default + + + + + Coffee + + + + + Pagefold + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 16 + + + + + + + + + 5 + 0 + 0 + 0 + + + + + + + + + 0 + 5 + 0 + 0 + + + + Style: + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 321 + 20 + + + + + + + + false + + + &Apply + + + + + + + + + + + + + 0 + 5 + 0 + 0 + + + + Style Sheet: + + + + + + + + diff --git a/tests/auto/uiloader/baseline/tabbedbrowser.ui b/tests/auto/uiloader/baseline/tabbedbrowser.ui new file mode 100644 index 000000000..6bb608f79 --- /dev/null +++ b/tests/auto/uiloader/baseline/tabbedbrowser.ui @@ -0,0 +1,233 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + TabbedBrowser + + + + 0 + 0 + 710 + 664 + + + + TabbedBrowser + + + + 0 + + + 0 + + + + + + Untitled + + + + 8 + + + 6 + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 6 + + + + + + + + :/trolltech/assistant/images/close.png + + + true + + + + + + + + 0 + 0 + 0 + 0 + + + + + 150 + 0 + + + + + + + + Previous + + + :/trolltech/assistant/images/win/previous.png + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + + 0 + 0 + + + + Next + + + :/trolltech/assistant/images/win/next.png + + + Qt::ToolButtonTextBesideIcon + + + true + + + Qt::NoArrow + + + + + + + Case Sensitive + + + + + + + Whole words + + + + + + + + 0 + 20 + + + + + 105 + 20 + + + + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + + + Qt::RichText + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 81 + 21 + + + + + + + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/tablewidgeteditor.ui b/tests/auto/uiloader/baseline/tablewidgeteditor.ui new file mode 100644 index 000000000..ebd15a2f8 --- /dev/null +++ b/tests/auto/uiloader/baseline/tablewidgeteditor.ui @@ -0,0 +1,403 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::TableWidgetEditor + + + + 0 + 0 + 591 + 455 + + + + Edit Table Widget + + + + + + Table Items + + + + + + Table Items + + + + + + + + + Icon + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + 0 + 0 + + + + + 0 + + + + + Columns + + + + + + + 0 + 0 + + + + Qt::TabFocus + + + Table Columns + + + + + + + + + New Column + + + New + + + + + + + Delete Column + + + Delete + + + + + + + Qt::Horizontal + + + + 0 + 23 + + + + + + + + Move Column Up + + + U + + + + + + + Move Column Down + + + D + + + + + + + + + + + Icon + + + + + + + + + + Qt::Horizontal + + + + 0 + 21 + + + + + + + + + + + + + Rows + + + + + + + 0 + 0 + + + + Qt::TabFocus + + + Table Rows + + + + + + + + + New Row + + + New + + + + + + + Delete Row + + + Delete + + + + + + + Qt::Horizontal + + + + 0 + 23 + + + + + + + + Move Row Up + + + U + + + + + + + Move Row Down + + + D + + + + + + + + + + + Icon + + + + + + + + + + Qt::Horizontal + + + + 0 + 21 + + + + + + + + + + + + + + itemsBox + buttonBox + widget + + + + qdesigner_internal::IconSelector + QWidget +
iconselector_p.h
+ 1 +
+
+ + tableWidget + columnsListWidget + newColumnButton + deleteColumnButton + moveColumnUpButton + moveColumnDownButton + rowsListWidget + newRowButton + deleteRowButton + moveRowUpButton + moveRowDownButton + + + + + buttonBox + accepted() + qdesigner_internal::TableWidgetEditor + accept() + + + 431 + 351 + + + 373 + 362 + + + + + buttonBox + rejected() + qdesigner_internal::TableWidgetEditor + reject() + + + 547 + 354 + + + 562 + 362 + + + + +
diff --git a/tests/auto/uiloader/baseline/tetrixwindow.ui b/tests/auto/uiloader/baseline/tetrixwindow.ui new file mode 100644 index 000000000..a13f538aa --- /dev/null +++ b/tests/auto/uiloader/baseline/tetrixwindow.ui @@ -0,0 +1,164 @@ + + TetrixWindow + + + + 0 + 0 + 537 + 475 + + + + Tetrix + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + Qt::NoFocus + + + &Start + + + + + + + QLCDNumber::Filled + + + + + + + LINES REMOVED + + + Qt::AlignBottom|Qt::AlignHCenter + + + + + + + Qt::NoFocus + + + &Pause + + + + + + + QLCDNumber::Filled + + + + + + + Qt::StrongFocus + + + QFrame::Panel + + + QFrame::Sunken + + + + + + + LEVEL + + + Qt::AlignBottom|Qt::AlignHCenter + + + + + + + NEXT + + + Qt::AlignBottom|Qt::AlignHCenter + + + + + + + QLCDNumber::Filled + + + + + + + SCORE + + + Qt::AlignBottom|Qt::AlignHCenter + + + + + + + QFrame::Box + + + QFrame::Raised + + + + + + Qt::AlignCenter + + + + + + + Qt::NoFocus + + + &Quit + + + + + + + + + + TetrixBoard + QFrame +
tetrixboard.h
+ 1 +
+
+ + +
diff --git a/tests/auto/uiloader/baseline/textfinder.ui b/tests/auto/uiloader/baseline/textfinder.ui new file mode 100644 index 000000000..af05192db --- /dev/null +++ b/tests/auto/uiloader/baseline/textfinder.ui @@ -0,0 +1,89 @@ + + Form + + + + 0 + 0 + 378 + 158 + + + + Find Text + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + + + + &Keyword: + + + lineEdit + + + + + + + &Find + + + + + + + + + + + + Qt::Vertical + + + + 20 + 16 + + + + + + + + + + lineEdit + returnPressed() + findButton + animateClick() + + + 261 + 17 + + + 320 + 17 + + + + + diff --git a/tests/auto/uiloader/baseline/topicchooser.ui b/tests/auto/uiloader/baseline/topicchooser.ui new file mode 100644 index 000000000..d4c90bb4b --- /dev/null +++ b/tests/auto/uiloader/baseline/topicchooser.ui @@ -0,0 +1,116 @@ + + TopicChooser + + + TopicChooser + + + + 0 + 0 + 391 + 223 + + + + Choose Topic + + + true + + + + unnamed + + + 11 + + + 6 + + + + + label + + + &Topics + + + listWidget + + + + + + + listWidget + + + + + + + Layout16 + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + buttonDisplay + + + &Display + + + true + + + true + + + + + + + buttonCancel + + + &Close + + + true + + + + + + + + + diff --git a/tests/auto/uiloader/baseline/translatedialog.ui b/tests/auto/uiloader/baseline/translatedialog.ui new file mode 100644 index 000000000..b1cd99cbe --- /dev/null +++ b/tests/auto/uiloader/baseline/translatedialog.ui @@ -0,0 +1,301 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + TranslateDialog + + + + 0 + 0 + 407 + 145 + + + + + 0 + 0 + + + + Qt Linguist + + + This window allows you to search for some text in the translation source file. + + + + 6 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + 6 + + + + + Type in the text to search for. + + + + + + + Find &source text: + + + ledFindWhat + + + + + + + &Translate to: + + + ledTranslateTo + + + + + + + Type in the text to search for. + + + + + + + + + Search options + + + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + + + Match &case + + + + + + + Mark new translation as &finished + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Click here to find the next occurrence of the text you typed in. + + + Find Next + + + true + + + false + + + + + + + Translate + + + + + + + Translate All + + + + + + + Click here to close this window. + + + Cancel + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 51 + + + + + + + + + + + ledFindWhat + ledTranslateTo + findNxt + translate + translateAll + cancel + ckMatchCase + ckMarkFinished + + + + + cancel + clicked() + TranslateDialog + reject() + + + 397 + 157 + + + 373 + 109 + + + + + diff --git a/tests/auto/uiloader/baseline/translationsettings.ui b/tests/auto/uiloader/baseline/translationsettings.ui new file mode 100644 index 000000000..4bd4be9e0 --- /dev/null +++ b/tests/auto/uiloader/baseline/translationsettings.ui @@ -0,0 +1,107 @@ + + TranslationSettings + + + + 0 + 0 + 346 + 125 + + + + Qt Linguist - Translation file settings + + + + 9 + + + 6 + + + + + Target language + + + + 9 + + + 6 + + + + + + + + Language + + + cbLanguageList + + + + + + + + + + Country/Region + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + TranslationSettings + accept() + + + 244 + 224 + + + 157 + 242 + + + + + buttonBox + rejected() + TranslationSettings + reject() + + + 312 + 230 + + + 286 + 242 + + + + + diff --git a/tests/auto/uiloader/baseline/treewidgeteditor.ui b/tests/auto/uiloader/baseline/treewidgeteditor.ui new file mode 100644 index 000000000..1256a0a2f --- /dev/null +++ b/tests/auto/uiloader/baseline/treewidgeteditor.ui @@ -0,0 +1,379 @@ + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + qdesigner_internal::TreeWidgetEditor + + + + 0 + 0 + 619 + 321 + + + + Edit Tree Widget + + + + + + Tree Items + + + + + + Qt::TabFocus + + + Tree Items + + + + 1 + + + + + + + + + + New Item + + + &New + + + + + + + New Subitem + + + New &Subitem + + + + + + + Delete Item + + + &Delete + + + + + + + Qt::Horizontal + + + + 28 + 23 + + + + + + + + Move Item Left (before Parent Item) + + + L + + + + + + + Move Item Right (as a First Subitem of the Next Sibling Item) + + + R + + + + + + + Move Item Up + + + U + + + + + + + Move Item Down + + + D + + + + + + + + + + + Icon + + + + + + + + + + Qt::Horizontal + + + + 288 + 21 + + + + + + + + + + + + + + 0 + 0 + + + + Columns + + + + + + + 0 + 0 + + + + Qt::TabFocus + + + Tree Columns + + + + + + + + + New Column + + + New + + + + + + + Delete Column + + + Delete + + + + + + + Qt::Horizontal + + + + 13 + 23 + + + + + + + + Move Column Up + + + U + + + + + + + Move Column Down + + + D + + + + + + + + + + + Icon + + + + + + + + + + Qt::Horizontal + + + + 0 + 10 + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + qdesigner_internal::IconSelector + QWidget +
iconselector_p.h
+ 1 +
+
+ + treeWidget + newItemButton + newSubItemButton + deleteItemButton + moveItemLeftButton + moveItemRightButton + moveItemUpButton + moveItemDownButton + listWidget + newColumnButton + deleteColumnButton + moveColumnUpButton + moveColumnDownButton + + + + + buttonBox + accepted() + qdesigner_internal::TreeWidgetEditor + accept() + + + 450 + 259 + + + 292 + 272 + + + + + buttonBox + rejected() + qdesigner_internal::TreeWidgetEditor + reject() + + + 539 + 266 + + + 556 + 275 + + + + +
diff --git a/tests/auto/uiloader/baseline/trpreviewtool.ui b/tests/auto/uiloader/baseline/trpreviewtool.ui new file mode 100644 index 000000000..03441139e --- /dev/null +++ b/tests/auto/uiloader/baseline/trpreviewtool.ui @@ -0,0 +1,189 @@ + + + ********************************************************************* +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the autotests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +********************************************************************* + + TrPreviewToolClass + + + + 0 + 0 + 593 + 466 + + + + Qt Translation Preview Tool + + + + + + 0 + 0 + 593 + 21 + + + + + &View + + + + &Views + + + + + + + &Help + + + + + + + &File + + + + + + + + + + + + + + Qt::Horizontal + + + 4 + + + + + + + + + Forms + + + 1 + + + + + 0 + + + 0 + + + + + QAbstractItemView::NoEditTriggers + + + true + + + true + + + + + + + + + :/images/open_form.png + + + &Open Form... + + + + + :/images/load_translation.png + + + &Load Translation... + + + + + :/images/reload_translations.png + + + &Reload Translations + + + F5 + + + + + &Close + + + + + About + + + + + About Qt + + + + + + + + diff --git a/tests/auto/uiloader/baseline/validators.ui b/tests/auto/uiloader/baseline/validators.ui new file mode 100644 index 000000000..f05b96fbe --- /dev/null +++ b/tests/auto/uiloader/baseline/validators.ui @@ -0,0 +1,467 @@ + + ValidatorsForm + + + + 0 + 0 + 526 + 668 + + + + Form + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + QIntValidator + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + Min: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 1 + 0 + + + + -1000000 + + + 1000000 + + + + + + + Max: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 1 + 0 + + + + -1000000 + + + 1000000 + + + 1000 + + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + 9 + + + 6 + + + + + + 0 + 0 + + + + :/ledoff.png + + + Qt::AlignCenter + + + + + + + editingFinished() + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + + + + QDoubleValidator + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + Min: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 1 + 0 + + + + -100000.000000000000000 + + + 100000.000000000000000 + + + 0.000000000000000 + + + + + + + Format: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Standard + + + + + Scientific + + + + + + + + Max: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 1 + 0 + + + + -100000.000000000000000 + + + 100000.000000000000000 + + + 1000.000000000000000 + + + + + + + Decimals: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 2 + + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + 9 + + + 6 + + + + + + + + :/ledoff.png + + + Qt::AlignCenter + + + + + + + editingFinished() + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 111 + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Quit + + + + + + + + + + LEDWidget + QLabel +
ledwidget.h
+
+ + LocaleSelector + QComboBox +
localeselector.h
+
+
+ + + + + + pushButton + clicked() + ValidatorsForm + close() + + + 94 + 274 + + + 131 + 260 + + + + +
diff --git a/tests/auto/uiloader/baseline/wateringconfigdialog.ui b/tests/auto/uiloader/baseline/wateringconfigdialog.ui new file mode 100644 index 000000000..a7f5349d7 --- /dev/null +++ b/tests/auto/uiloader/baseline/wateringconfigdialog.ui @@ -0,0 +1,446 @@ + + WateringConfigDialog + + + + 0 + 0 + 334 + 550 + + + + Watering Configuration + + + + + + + + Plant: + + + + + + + + 0 + 0 + + + + + Squash + + + + + Bean + + + + + Carrot + + + + + Strawberry + + + + + Raspberry + + + + + Blueberry + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 67 + 16 + + + + + + + + Water when: + + + + + + + Temperature is higher than: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + false + + + + + + C + + + 10 + + + 60 + + + 20 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Rain less than: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + false + + + + + + mm + + + 1 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Starting Time: + + + + + + + + + + Amount: + + + + + + + l + + + 100 + + + 10000 + + + 100 + + + 1000 + + + + + + + Source: + + + + + + + + Foundain + + + + + River + + + + + Lake + + + + + Public Water System + + + + + + + + Filter: + + + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + <a href="test">Show Details</a> + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + HelpBrowser + QTextBrowser +
helpbrowser.h
+
+
+ + + + buttonBox + accepted() + WateringConfigDialog + accept() + + + 227 + 372 + + + 157 + 274 + + + + + buttonBox + rejected() + WateringConfigDialog + reject() + + + 286 + 378 + + + 286 + 274 + + + + + temperatureCheckBox + toggled(bool) + temperatureSpinBox + setEnabled(bool) + + + 132 + 101 + + + 132 + 125 + + + + + rainCheckBox + toggled(bool) + rainSpinBox + setEnabled(bool) + + + 110 + 154 + + + 113 + 169 + + + + +
diff --git a/tests/auto/uiloader/desert.ini b/tests/auto/uiloader/desert.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/desert.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/dole.ini b/tests/auto/uiloader/dole.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/dole.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/gravlaks.ini b/tests/auto/uiloader/gravlaks.ini new file mode 100644 index 000000000..3a11cf2a4 --- /dev/null +++ b/tests/auto/uiloader/gravlaks.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=gravlaks.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/jackychan.ini b/tests/auto/uiloader/jackychan.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/jackychan.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/jeunehomme.ini b/tests/auto/uiloader/jeunehomme.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/jeunehomme.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/kangaroo.ini b/tests/auto/uiloader/kangaroo.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/kangaroo.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/kayak.ini b/tests/auto/uiloader/kayak.ini new file mode 100644 index 000000000..751a3883f --- /dev/null +++ b/tests/auto/uiloader/kayak.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=wartburg +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/scruffy.ini b/tests/auto/uiloader/scruffy.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/scruffy.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/troll15.ini b/tests/auto/uiloader/troll15.ini new file mode 100644 index 000000000..57f5cd826 --- /dev/null +++ b/tests/auto/uiloader/troll15.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.nokia.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/tundra.ini b/tests/auto/uiloader/tundra.ini new file mode 100644 index 000000000..799b22449 --- /dev/null +++ b/tests/auto/uiloader/tundra.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=kramer.troll.no +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 diff --git a/tests/auto/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader.pro new file mode 100644 index 000000000..30ecb2fa1 --- /dev/null +++ b/tests/auto/uiloader/uiloader.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS += tst_screenshot \ + uiloader diff --git a/tests/auto/uiloader/uiloader/tst_uiloader.cpp b/tests/auto/uiloader/uiloader/tst_uiloader.cpp new file mode 100644 index 000000000..30b0c3c9d --- /dev/null +++ b/tests/auto/uiloader/uiloader/tst_uiloader.cpp @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "uiloader.h" + +#include +#include +#include + +#ifdef Q_OS_SYMBIAN +#define SRCDIR "" +#endif + +class uiLoaderAutotest: public QObject +{ + +Q_OBJECT + +public slots: + void init(); + +private slots: + void imageDiffTest(); + +private: + QString currentDir; + +}; + + + +void uiLoaderAutotest::init() +{ + currentDir = QDir::currentPath(); +#ifndef Q_OS_IRIX + QDir::setCurrent(QString(SRCDIR) + QString("/..")); +#endif +} + +void uiLoaderAutotest::imageDiffTest() +{ + //QApplication app(argc, argv); + + QString pathToProgram = currentDir + "/tst_screenshot/tst_screenshot"; + +#ifdef Q_WS_MAC + pathToProgram += ".app/Contents/MacOS/tst_screenshot"; +#endif + +#ifdef Q_WS_WIN + pathToProgram += ".exe"; +#endif + uiLoader wrapper(pathToProgram); + QString errorMessage; + switch(wrapper.runAutoTests(&errorMessage)) { + case uiLoader::TestRunDone: + break; + case uiLoader::TestConfigError: + QVERIFY2(false, qPrintable(errorMessage)); + break; + case uiLoader::TestNoConfig: + QSKIP(qPrintable(errorMessage), SkipAll); + break; + } +} + +QTEST_MAIN(uiLoaderAutotest) +#include "tst_uiloader.moc" diff --git a/tests/auto/uiloader/uiloader/uiloader.cpp b/tests/auto/uiloader/uiloader/uiloader.cpp new file mode 100644 index 000000000..9246c30d8 --- /dev/null +++ b/tests/auto/uiloader/uiloader/uiloader.cpp @@ -0,0 +1,814 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include "uiloader.h" + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +/* + * Our own QVERIFY since the one from QTest can't be used in non-void functions. + * Just pass the desired return value as third argument. + */ + +#define QVERIFY3(statement, description, returnValue) \ +do {\ + if (statement) {\ + if (!QTest::qVerify(true, #statement, (description), __FILE__, __LINE__))\ + return returnValue;\ + } else {\ + if (!QTest::qVerify(false, #statement, (description), __FILE__, __LINE__))\ + return returnValue;\ + }\ +} while (0) + + + +uiLoader::uiLoader(const QString &_pathToProgram) + : pathToProgram(_pathToProgram) +{ + // initTests(); +} + + + + +/* + * Load the configuration file for your machine. + * Return true if everything was loaded, else false. + * + * If the hostname is 'kayak', the config file should be 'kayak.ini': + * + * [General] + * ftpBaseDir=/arthurtest + * ftpHost=wartburg + * ftpPass=anonymouspass + * ftpUser=anonymous + * output=testresults + * + * [engines] + * 1\engine=uic + * size=1 + */ + +bool uiLoader::loadConfig(const QString &filePath, QString *errorMessage) +{ + qDebug() << " ========== Loading config file " << filePath; + configPath = filePath; + + // If there is no config file, dont proceed; + QSettings settings( filePath, QSettings::IniFormat, this ); + + // all keys available? + QStringList keyList; + keyList << QLatin1String("output") << QLatin1String("ftpUser") << QLatin1String("ftpPass") << QLatin1String("ftpHost") << QLatin1String("ftpBaseDir"); + for (int i = 0; i < keyList.size(); ++i) { + const QString currentKey = keyList.at(i); + if (!settings.contains(currentKey)) { + *errorMessage = QString::fromLatin1("Config file '%1' does not contain the required key '%2'.").arg(filePath, currentKey); + return false; + } + + qDebug() << "\t\t(I)" << currentKey << "\t" << settings.value(currentKey).toString(); + } + + const int size = settings.beginReadArray(QLatin1String("engines")); + if (!size) { + *errorMessage = QString::fromLatin1("Config file '%1' does not contain the necessary section engines.").arg(filePath); + return false; + } + + // get the values + for ( int i = 0; i < size; ++i ) { + settings.setArrayIndex(i); + qDebug() << "\t\t(I)" << "engine" << "\t" << settings.value( "engine" ).toString(); + enginesToTest.insert(settings.value(QLatin1String("engine")).toString(), QLatin1String("Info here please :p")); + } + settings.endArray(); + + output = settings.value(QLatin1String("output")).toString(); + output += QDir::separator() + QLibraryInfo::buildKey() + QDir::separator() + QString( qVersion() ); + ftpUser = settings.value( QLatin1String("ftpUser") ).toString(); + ftpPass = settings.value( QLatin1String("ftpPass") ).toString(); + ftpHost = settings.value( QLatin1String("ftpHost") ).toString(); + ftpBaseDir = settings.value( QLatin1String("ftpBaseDir") ).toString() + QDir::separator() + QHostInfo::localHostName().split( QLatin1Char('.')).first(); + threshold = settings.value( QLatin1String("threshold") ).toString(); + + qDebug() << "\t(I) Values adapted:"; + qDebug() << "\t\t(I)" << "ftpBaseDir" << "\t" << ftpBaseDir; + qDebug() << "\t\t(I)" << "output" << "\t" << output; + + return true; +} + +/* + * Upload testresults to the server in order to create the new baseline. + */ + +void uiLoader::createBaseline() +{ + // can't use ftpUploadFile() here + qDebug() << " ========== Uploading baseline of only the latest test values "; + + QFtp ftp; + ftp.connectToHost( ftpHost ); + ftp.login( ftpUser, ftpPass ); + ftp.cd( ftpBaseDir ); + + QDir dir( output ); + + // Upload all the latest test results to the FTP server's baseline directory. + QHashIterator i(enginesToTest); + while ( i.hasNext() ) { + i.next(); + + dir.cd( i.key() ); + ftp.cd( i.key() + ".baseline" ); + + dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); + dir.setNameFilters( QStringList() << "*.png" ); + QFileInfoList list = dir.entryInfoList(); + + dir.cd( ".." ); + + for (int n = 0; n < list.size(); n++) { + QFileInfo fileInfo = list.at( n ); + QFile file( QString( output ) + "/" + i.key() + "/" + fileInfo.fileName() ); + + errorMsg = "could not open file " + fileInfo.fileName(); + QVERIFY2( file.open(QIODevice::ReadOnly), qPrintable(errorMsg)); + + QByteArray fileData = file.readAll(); + file.close(); + + ftp.put( fileData, fileInfo.fileName(), QFtp::Binary ); + qDebug() << "\t(I) Uploading:" << fileInfo.fileName() << "with file size" << fileData.size(); + } + + ftp.cd( ".." ); + } + + ftp.close(); + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); +} + + + +/* + * Download baseline from server in order to compare results. + */ + +void uiLoader::downloadBaseline() +{ + qDebug() << " ========== Downloading baseline..."; + + QHashIterator i(enginesToTest); + while ( i.hasNext() ) { + i.next(); + QString engineName = i.key(); + + QString dirWithFiles = ftpBaseDir + '/' + engineName + ".baseline"; + QString ftpDir = ftpBaseDir + '/' + engineName + ".baseline"; + QString saveToDir = QDir::currentPath() + '/' + output + '/' + engineName + ".baseline"; + + ftpList(dirWithFiles); + + QList filesToDownload(lsDirList); + ftpGetFiles(filesToDownload, ftpDir, saveToDir); + } +} + + + +/* + * Enter the dir pathDir local and remove all files (not recursive!) + */ + +void uiLoader::clearDirectory(const QString& pathDir) +{ + qDebug() << "\t(I) Clearing directory local: " << pathDir; + + QDir dir(pathDir); + dir.setFilter(QDir::Files); + QStringList list = dir.entryList(); + + for (int n = 0; n < list.size(); n++) { + QString filePath = pathDir + "/" + list.at(n); + QFile file(filePath); + + errorMsg = "could not remove file " + filePath; + QVERIFY2( file.remove(), qPrintable(errorMsg)); + } + +} + + + +/* + * Setup the local environment. + */ + +void uiLoader::setupLocal() +{ + qDebug( " ========== Setting up local environment" ); + + QDir dir; + + errorMsg = "could not create path " + output; + QVERIFY2( dir.mkpath(output), qPrintable(errorMsg) ); + + QHashIterator j(enginesToTest); + while ( j.hasNext() ) { + j.next(); + + QString engineName = j.key(); + QString engineDir = output + '/' + engineName; + + // create or clean it + QString tmpPath = output + '/' + engineName; + if ( dir.exists(tmpPath) ) { + clearDirectory(tmpPath); + } else { + dir.mkdir(tmpPath); + } + + // create *.baseline or clean it + tmpPath = output + '/' + engineName + ".baseline"; + if ( dir.exists(tmpPath) ) { + clearDirectory(tmpPath); + } else { + dir.mkdir(tmpPath); + } + + // create *.diff or clean it + tmpPath = output + '/' + engineName + ".diff"; + if ( dir.exists(tmpPath) ) { + clearDirectory(tmpPath); + } else { + dir.mkdir(tmpPath); + } + + // create *.failed or clean it + tmpPath = output + '/' + engineName + ".failed"; + if ( dir.exists(tmpPath) ) { + clearDirectory(tmpPath); + } else { + dir.mkdir(tmpPath); + } + } + + qDebug() << "\t(I) Created on local machine:" << output; +} + + + +/* + * Setup the remote environment. + */ + +void uiLoader::setupFTP() +{ + qDebug( " ========== Setting up FTP environment" ); + + // create dirs on ftp server + ftpMkDir( ftpBaseDir ); + ftpBaseDir += "/" + QLibraryInfo::buildKey(); + ftpMkDir( ftpBaseDir ); + ftpBaseDir += "/" + QString( qVersion() ); + ftpMkDir( ftpBaseDir ); + + QString dir = ""; + ftpList(ftpBaseDir + '/' + dir); + QList dirListing(lsDirList); + + // create *.failed, *.diff if necessary, else remove the files in it + // if *.baseline does not exist, memorize it + QHashIterator j(enginesToTest); + while ( j.hasNext() ) { + j.next(); + + QString curDir = QString( j.key() ) + ".failed"; + if ( dirListing.contains( curDir ) ) { + ftpClearDirectory(ftpBaseDir + "/" + curDir + "/"); + } else { + ftpMkDir(ftpBaseDir + "/" + curDir + "/"); + } + + curDir = QString( j.key() ) + ".diff"; + if ( dirListing.contains( curDir ) ) { + ftpClearDirectory(ftpBaseDir + "/" + curDir + "/"); + } else { + ftpMkDir(ftpBaseDir + "/" + curDir + "/"); + } + + curDir = QString( j.key() ) + ".baseline"; + lsNeedBaseline.clear(); + if ( !dirListing.contains( curDir ) ) { + ftpMkDir(ftpBaseDir + "/" + curDir + "/"); + lsNeedBaseline << j.key(); + } else { + qDebug() << "\t(I)" << curDir << "exists on server."; + } + } +} + + + +/* + * Download files listed in fileLisiting from dir pathRemoteDir on sever and save + * them in pathSaveDir. + */ + +void uiLoader::ftpGetFiles(QList& fileListing, const QString& pathRemoteDir, const QString& pathSaveDir) +{ + QFtp ftp; + ftp.connectToHost( ftpHost ); + ftp.login( ftpUser, ftpPass ); + + if ( !fileListing.empty() ) { + for ( int i = 0; i < fileListing.size(); ++i ) { + QFile file( pathSaveDir + "/" + fileListing.at(i) ); + + errorMsg = "could not open file for writing: " + file.fileName(); + QVERIFY2( file.open(QIODevice::WriteOnly), qPrintable(errorMsg) ); + + QString ftpFileName = pathRemoteDir + '/' + fileListing.at(i); + ftp.get( ftpFileName, &file ); + //qDebug() << "\t(I) Got" << file.fileName(); + ftp.list(); //Only there to fill up a slot in the pendingCommands queue. + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); + + file.close(); + } + } + + ftp.close(); + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); + + fileListing.clear(); +} + + + +/* + * Upload the file filePath to the server and save it there at filePathRemote. + * + * HINT: It seems you can't use this function in a loop, to many connections + * are established?! + */ + +bool uiLoader::ftpUploadFile(const QString& filePathRemote, const QString& filePath) +{ + QFile file(filePath); + + errorMsg = "could not open file: " + filePath; + QVERIFY3( file.open(QIODevice::ReadOnly), qPrintable(errorMsg), false ); + + QByteArray contents = file.readAll(); + file.close(); + + qDebug() << "\t(I) Uploading file to" << filePathRemote; + + QFtp ftp; + ftp.connectToHost( ftpHost ); + ftp.login( ftpUser, ftpPass ); + + ftp.put( contents, filePathRemote, QFtp::Binary ); + + ftp.close(); + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); + + return true; +} + + + +/* + * Enter the dir dir on the server and remove all files (not recursive!) + */ + +void uiLoader::ftpClearDirectory(const QString& pathDir) +{ + qDebug() << "\t(I) Clearing directory remote: " << pathDir; + + ftpList(pathDir); + QList dirListing(lsDirList); + + QFtp ftp; + ftp.connectToHost( ftpHost ); + ftp.login( ftpUser, ftpPass ); + + for (int i = 0; i < dirListing.size(); ++i) { + QString file = dirListing.at(i); + qDebug() << "\t(I) Removing" << pathDir + file; + ftp.remove(pathDir + file); + } + + ftp.close(); + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); +} + + + +/* + * Get a directory listing from the server in the dir dir. + * You can access it via lsDirList. + */ + +void uiLoader::ftpList(const QString & dir) { + qDebug() << "\t(I) Getting list of files in dir" << dir; + + lsDirList.clear(); + + QFtp ftp; + QObject::connect( &ftp, SIGNAL( listInfo( const QUrlInfo & ) ), this, SLOT( ftpAddLsEntry(const QUrlInfo & ) ) ); + //QObject::connect( &ftp, SIGNAL( done( bool ) ), this, SLOT( ftpAddLsDone( bool ) ) ); + + ftp.connectToHost( ftpHost ); + ftp.login( ftpUser, ftpPass ); + + ftp.list( dir ); + ftp.close(); + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); +} + + + +/* + * Creates a dir on the ftp server. + * + * Hint: If the ftp.mkdir() fails we just assume the dir already exist. + */ + +void uiLoader::ftpMkDir( QString pathDir ) +{ + QFtp ftp; + + QSignalSpy commandSpy(&ftp, SIGNAL(commandFinished(int, bool))); + + ftp.connectToHost( ftpHost ); + ftp.login( ftpUser, ftpPass ); + const int command = ftp.mkdir( pathDir ); + ftp.close(); + + while ( ftp.hasPendingCommands() ) + QCoreApplication::instance()->processEvents(); + + // check wheter there was an error or not + for (int i = 0; i < commandSpy.count(); ++i) { + if (commandSpy.at(i).at(0) == command) { + if ( !commandSpy.at(i).at(1).toBool() ) { + qDebug() << "\t(I) Created at remote machine:" << pathDir; + } else { + qDebug() << "\t(I) Could not create on remote machine - probably the dir exists"; + } + } + } +} + + + +/* + * Just a slot, needed for ftpList(). + */ + +void uiLoader::ftpAddLsEntry( const QUrlInfo &urlInfo ) +{ + //Just adding the file to the list + lsDirList << urlInfo.name(); +} + +/* + * Return a list of the test case ui files + */ + +QStringList uiLoader::uiFiles() const +{ + QString baselinePath = QDir::currentPath(); + baselinePath += QLatin1String("/baseline"); + QDir dir(baselinePath); + dir.setFilter(QDir::Files); + dir.setNameFilters(QStringList(QLatin1String("*.ui"))); + const QFileInfoList list = dir.entryInfoList(); + QStringList rc; + const QChar slash = QLatin1Char('/'); + foreach (const QFileInfo &fi, list) { + QString fileAbsolutePath = baselinePath; + fileAbsolutePath += slash; + fileAbsolutePath += fi.fileName(); + rc.push_back(fileAbsolutePath); + } + return rc; +} +/* + * The actual method for generating local files that will be compared + * to the baseline. + * + * The external program uiscreenshot/uiscreenshot is called to generate + * *.png files of *.ui files. + */ + +void uiLoader::executeTests() +{ + qDebug(" ========== Executing the tests...[generating pngs from uis]"); + + qDebug() << "Current Dir" << QDir::currentPath(); + + qDebug() << "\t(I) Using" << pathToProgram; + + QProcess myProcess; + foreach(const QString &fileAbsolutePath, uiFiles()) { + qDebug() << "\t(I) Current file:" << fileAbsolutePath; + + QHashIterator j(enginesToTest); + while ( j.hasNext() ) { + j.next(); + + QString outputDirectory = output + '/' + j.key(); + + QStringList arguments; + arguments << fileAbsolutePath; + arguments << outputDirectory; + + myProcess.start(pathToProgram, arguments); + + // took too long? + errorMsg = "process does not exited normally (QProcess timeout) - " + pathToProgram; + QVERIFY2( myProcess.waitForFinished(), qPrintable(errorMsg) ); + + qDebug() << "\n" << myProcess.readAllStandardError(); + + // check exit code/status + errorMsg = "process does not exited normally - " + pathToProgram; + QVERIFY2( myProcess.exitStatus() == QProcess::NormalExit, qPrintable(errorMsg) ); + QVERIFY2( myProcess.exitCode() == EXIT_SUCCESS, qPrintable(errorMsg) ); + } + } +} + +/* + * Comparing generated files to the baseline. + */ + +bool uiLoader::compare() +{ + qDebug( " ========== Now comparing the results to the baseline" ); + + QDir dir(output); + + QHashIterator i(enginesToTest); + while ( i.hasNext() ) { + i.next(); + + QString engineName = i.key(); + + // Perform comparisons between the two directories. + dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); + dir.setNameFilters( QStringList() << "*.png" ); + dir.cd( engineName + ".baseline" ); + + QFileInfoList list = dir.entryInfoList(); + + for (int i = 0; i < list.size(); ++i) { + QFileInfo fileInfo = list.at(i); + diff(output, engineName, fileInfo.fileName()); + } + } + + return true; +} + + + + +void uiLoader::diff(const QString& basedir, const QString& engine, const QString& fileName) +{ + QString filePathBaseline = basedir + "/" + engine + ".baseline/" + fileName; + QString filePathGenerated = basedir + "/" + engine + '/' + fileName; + + qDebug() << "\t(I) Comparing" << filePathBaseline; + qDebug() << "\t(I) Comparing" << filePathGenerated; + + QString filePathDiffImage = basedir + "/" + engine + ".diff/" + fileName; + + if ( QFile::exists(filePathGenerated) ) { + QString filePathDiffImage = basedir + "/" + engine + ".diff/" + fileName; + int pixelDiff = imgDiff(filePathBaseline, filePathGenerated, filePathDiffImage); + + if ( pixelDiff <= threshold.toInt() ) { + qDebug() << "\t(I) TEST OK"; + QVERIFY(true); + } else { + qDebug() << "\t(I) TEST FAILED"; + qDebug() << "\t(I)\t...saving baseline in *.failed"; + + // local: save in *.failed + QString filePathFailed = basedir + "/" + engine + ".failed/" + fileName; + errorMsg = "Could not save " + filePathGenerated + " to " + filePathFailed; + QVERIFY2( QFile::copy(filePathGenerated, filePathFailed), qPrintable(errorMsg) ); + + // remote: save in *.failed + QString filePathFailedRemote = ftpBaseDir + "/" + engine + ".failed" + "/" + fileName; + ftpUploadFile(filePathFailedRemote, filePathGenerated); + + errorMsg = "Something broke in the image comparison with " + filePathDiffImage; + QVERIFY2( (pixelDiff != -1), qPrintable(errorMsg) ); + + // remote: save in *.diff + QString filePathDiffRemote = ftpBaseDir + "/" + engine + ".diff" + "/" + fileName; + ftpUploadFile(filePathDiffRemote, filePathDiffImage); + QFAIL(qPrintable(fileName)); + } + + } else { + qWarning() << "\t(W) Expected generated file" << filePathGenerated << "does not exist."; + qWarning() << "\t(W) ...saving baseline in *.failed"; + + // save local + QString filePathMissing = basedir + '/' + engine + ".failed/" + fileName + "_missing"; + errorMsg = "Could not save " + filePathMissing; + QVERIFY2( QFile::copy(filePathBaseline, filePathMissing), qPrintable(errorMsg) ); + + // save remote + QString filePathDiffRemote = ftpBaseDir + "/" + engine + ".diff" + "/" + fileName; + ftpUploadFile(filePathDiffRemote, filePathBaseline); + + errorMsg = filePathGenerated + " was not generated, but baseline for this file exists"; + QVERIFY2(false, qPrintable(errorMsg)); + } + +} + +/* + * Execution starts here. + */ + +uiLoader::TestResult uiLoader::runAutoTests(QString *errorMessage) +{ + // SVG needs this widget... + QWidget dummy; + + qDebug() << "Running test on buildkey:" << QLibraryInfo::buildKey() << " qt version:" << qVersion(); + qDebug() << "Initializing tests..."; + + // load config + const QString configFileName = QHostInfo::localHostName().split(QLatin1Char('.')).first() + QLatin1String(".ini"); + const QFileInfo fi(configFileName); + if (!fi.isFile() || !fi.isReadable()) { + *errorMessage = QString::fromLatin1("Config file '%1' does not exist or is not readable.").arg(configFileName); + return TestNoConfig; + } + + if (!loadConfig(configFileName, errorMessage)) + return TestConfigError; + + // reset the local environment where the results are stored + setupLocal(); + + // reset the FTP environment where the results are stored + setupFTP(); + + // retrieve the latest test result baseline from the FTP server. + downloadBaseline(); + + // execute tests + executeTests(); + + // upload testresults as new baseline or compare results + if ( lsNeedBaseline.size() ) + createBaseline(); + else + compare(); + + return TestRunDone; +} + +int uiLoader::imgDiff(const QString fileA, const QString fileB, const QString output) +{ +// qDebug() << "Comparing " << fileA << " and " << fileB << " outputting to " << output; + QImage imageA(fileA); + QImage imageB(fileB); + + // Invalid images + if (imageA.isNull() || imageB.isNull()) + { + qDebug() << "Fatal error: unable to open one or more input images."; + return false; + } + + //Choose the largest image size, so that the output can capture the entire diff. + QSize largestSize = imageA.size(); + QSize otherSize = imageB.size(); + + if (largestSize.width() < otherSize.width()) + largestSize.setWidth(otherSize.width()); + + if (largestSize.height() < otherSize.height()) + largestSize.setHeight(otherSize.height()); + + QImage imageDiff(largestSize, QImage::Format_ARGB32); + + imageA = imageA.convertToFormat(QImage::Format_ARGB32); + imageB = imageB.convertToFormat(QImage::Format_ARGB32); + + int pixelDiff = 0; + + for (int y = 0; y < imageDiff.height(); ++y) + { + for (int x = 0; x < imageDiff.width(); ++x) + { + //Are the pixels within range? Else, draw a black pixel in diff. + if (imageA.valid(x,y) && imageB.valid(x,y)) + { + //Both images have a pixel at x,y - are they the same? If not, black pixel in diff. + if (imageA.pixel(x,y) != imageB.pixel(x,y)) + { + imageDiff.setPixel(x,y,0xff000000); + pixelDiff++; + } + else + imageDiff.setPixel(x,y,0xffffffff); + } + else + { + imageDiff.setPixel(x,y,0xff000000); + pixelDiff++; + } + } + } + + imageDiff.setText("comment", QString::number(pixelDiff)); + + if (!imageDiff.save(output, "PNG")) + pixelDiff = -1; + + return pixelDiff; +} diff --git a/tests/auto/uiloader/uiloader/uiloader.h b/tests/auto/uiloader/uiloader/uiloader.h new file mode 100644 index 000000000..b7ee45fd5 --- /dev/null +++ b/tests/auto/uiloader/uiloader/uiloader.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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.1, 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef ATWRAPPER_H +#define ATWRAPPER_H + +#include +#include +#include +#include +#include + +class uiLoader : public QObject +{ + Q_OBJECT + + public: + uiLoader(const QString &pathToProgram); + + enum TestResult { TestRunDone, TestConfigError, TestNoConfig }; + TestResult runAutoTests(QString *errorMessage); + + private: + bool loadConfig(const QString &, QString *errorMessage); + void initTests(); + + void setupFTP(); + void setupLocal(); + void clearDirectory(const QString&); + + void ftpMkDir( QString ); + void ftpGetFiles(QList&, const QString&, const QString&); + void ftpList(const QString&); + void ftpClearDirectory(const QString&); + bool ftpUploadFile(const QString&, const QString&); + void executeTests(); + + void createBaseline(); + void downloadBaseline(); + + bool compare(); + + void diff(const QString&, const QString&, const QString&); + int imgDiff(const QString fileA, const QString fileB, const QString output); + QStringList uiFiles() const; + + QHash enginesToTest; + + QString framework; + QString suite; + QString output; + QString ftpUser; + QString ftpPass; + QString ftpHost; + QString ftpBaseDir; + QString threshold; + + QString errorMsg; + + QList lsDirList; + QList lsNeedBaseline; + + QString configPath; + + QString pathToProgram; + + private slots: + //void ftpAddLsDone( bool ); + void ftpAddLsEntry( const QUrlInfo &urlInfo ); +}; + +#endif diff --git a/tests/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro new file mode 100644 index 000000000..12624703f --- /dev/null +++ b/tests/auto/uiloader/uiloader/uiloader.pro @@ -0,0 +1,30 @@ +load(qttest_p4) + +TEMPLATE = app +!embedded:CONFIG += uitools +TARGET = ../tst_uiloader +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" + +win32 { + CONFIG(debug, debug|release) { + TARGET = ../../debug/tst_uiloader +} else { + TARGET = ../../release/tst_uiloader + } +} + +QT += widgets network + +wince*|symbian: { + configuration.files = ../*.ini + configuration.path = . + + screenapp.files = ../tst_screenshot/tst_screenshot.exe + screenapp.path = tst_screenshot + + DEPLOYMENT += configuration screenapp +} + +# Input +HEADERS += uiloader.h +SOURCES += tst_uiloader.cpp uiloader.cpp diff --git a/tests/auto/uiloader/wartburg.ini b/tests/auto/uiloader/wartburg.ini new file mode 100644 index 000000000..751a3883f --- /dev/null +++ b/tests/auto/uiloader/wartburg.ini @@ -0,0 +1,11 @@ +[General] +ftpBaseDir=/arthurtest +ftpHost=wartburg +ftpPass=anonymouspass +ftpUser=anonymous +output=testresults +threshold=20 + +[engines] +1\engine=uic +size=1 -- cgit v1.2.1 From 8a8fca2f853cd007d568438f5807441f75b6cd68 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 13 Sep 2011 15:40:42 +0200 Subject: Get designer to compile again. And it actually runs! ;-) Change-Id: I593991e3b5d423189f00d1bd9c51daca6b9e9bd0 Reviewed-on: http://codereview.qt-project.org/4831 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- modules/qt_designercomponents.pri | 16 +++++++++ src/designer/data/generate_impl.xsl | 2 +- src/designer/src/components/component.pri | 1 - .../src/components/formeditor/formwindow.cpp | 2 +- .../components/formeditor/formwindow_dnditem.cpp | 2 +- .../components/formeditor/layout_propertysheet.cpp | 4 +-- .../components/formeditor/qdesigner_resource.cpp | 9 +++-- src/designer/src/components/lib/lib.pro | 38 +++++----------------- .../propertyeditor/fontpropertymanager.cpp | 2 +- .../signalsloteditor/signalsloteditor.cpp | 2 +- .../signalsloteditor/signalsloteditor_tool.cpp | 2 +- .../signalsloteditor/signalsloteditorwindow.cpp | 2 +- .../src/components/widgetbox/widgetbox_dnditem.cpp | 4 +-- .../components/widgetbox/widgetboxtreewidget.cpp | 2 +- src/designer/src/designer/designer.pro | 2 +- src/designer/src/designer/qdesigner_actions.cpp | 2 +- src/designer/src/designer/qdesigner_actions.h | 2 +- src/designer/src/lib/lib.pro | 16 +++------ sync.profile | 4 +++ 19 files changed, 53 insertions(+), 61 deletions(-) create mode 100644 modules/qt_designercomponents.pri diff --git a/modules/qt_designercomponents.pri b/modules/qt_designercomponents.pri new file mode 100644 index 000000000..a453c7949 --- /dev/null +++ b/modules/qt_designercomponents.pri @@ -0,0 +1,16 @@ +QT.designercomponents.VERSION = 5.0.0 +QT.designercomponents.MAJOR_VERSION = 5 +QT.designercomponents.MINOR_VERSION = 0 +QT.designercomponents.PATCH_VERSION = 0 + +QT.designercomponents.name = QtDesignerComponents +QT.designercomponents.bins = $$QT_MODULE_BIN_BASE +QT.designercomponents.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtDesignerComponents +QT.designercomponents.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDesignerComponents/$$QT.designercomponents.VERSION +QT.designercomponents.sources = $$QT_MODULE_BASE/src/designer/src/components/lib +QT.designercomponents.libs = $$QT_MODULE_LIB_BASE +QT.designercomponents.plugins = $$QT_MODULE_PLUGIN_BASE +QT.designercomponents.imports = $$QT_MODULE_IMPORT_BASE +QT.designercomponents.depends = core xml gui widgets + +QT_CONFIG += designercomponents diff --git a/src/designer/data/generate_impl.xsl b/src/designer/data/generate_impl.xsl index a22862e0c..440d59e6f 100644 --- a/src/designer/data/generate_impl.xsl +++ b/src/designer/data/generate_impl.xsl @@ -1131,7 +1131,7 @@ ** ****************************************************************************/ - #include "ui4_p.h"&endl; + #include "private/ui4_p.h"&endl; &endl; #ifdef QUILOADER_QDOM_READ&endl; #include <QtXml/QDomElement>&endl; diff --git a/src/designer/src/components/component.pri b/src/designer/src/components/component.pri index 1dd8cf0b4..a5b02c31f 100644 --- a/src/designer/src/components/component.pri +++ b/src/designer/src/components/component.pri @@ -1,3 +1,2 @@ load(qt_module) TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end -INCLUDEPATH += $$QT_SOURCE_TREE/tools/uilib diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp index e9600da27..fc06810a5 100644 --- a/src/designer/src/components/formeditor/formwindow.cpp +++ b/src/designer/src/components/formeditor/formwindow.cpp @@ -69,7 +69,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/designer/src/components/formeditor/formwindow_dnditem.cpp b/src/designer/src/components/formeditor/formwindow_dnditem.cpp index 8f16f3830..d93219991 100644 --- a/src/designer/src/components/formeditor/formwindow_dnditem.cpp +++ b/src/designer/src/components/formeditor/formwindow_dnditem.cpp @@ -42,7 +42,7 @@ #include "formwindow_dnditem.h" #include "formwindow.h" -#include +#include #include #include diff --git a/src/designer/src/components/formeditor/layout_propertysheet.cpp b/src/designer/src/components/formeditor/layout_propertysheet.cpp index 72e709e8a..384abf514 100644 --- a/src/designer/src/components/formeditor/layout_propertysheet.cpp +++ b/src/designer/src/components/formeditor/layout_propertysheet.cpp @@ -46,9 +46,9 @@ #include // shared -#include +#include #include -#include +#include #include diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index 959a50f6d..d9a6709cb 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -55,10 +55,10 @@ #include "qwizard_container.h" #include "layout_propertysheet.h" -#include -#include -#include -#include +#include +#include +#include +#include #include // shared @@ -74,7 +74,6 @@ #include #include -#include // sdk #include diff --git a/src/designer/src/components/lib/lib.pro b/src/designer/src/components/lib/lib.pro index 2a394dc52..62354d0f5 100644 --- a/src/designer/src/components/lib/lib.pro +++ b/src/designer/src/components/lib/lib.pro @@ -1,23 +1,19 @@ +MODULE = designercomponents load(qt_module) TEMPLATE = lib TARGET = QtDesignerComponents -contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols -CONFIG += qt depend_prl no_objective_c designer -QT += gui-private -win32|mac: CONFIG += debug_and_release -DESTDIR = $$QT_BUILD_TREE/lib -!wince*:DLLDESTDIR = $$QT.designer.bins -QT += widgets widgets-private designer-private uilib-private + +QT += gui-private widgets widgets-private designer designer-private + +CONFIG += module +MODULE_PRI = ../../../../modules/qt_designercomponents.pri + +load(qt_module_config) # QtDesignerComponents uses DEFINES += QT_STATICPLUGIN - -isEmpty(QT_MAJOR_VERSION) { - VERSION=4.3.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} +DEFINES += QDESIGNER_COMPONENTS_LIBRARY include($$QT_SOURCE_TREE/src/qt_targets.pri) QMAKE_TARGET_PRODUCT = Designer @@ -37,19 +33,10 @@ mac:!static:contains(QT_CONFIG, qt_framework) { SOURCES += qdesigner_components.cpp -!contains(CONFIG, static) { - DEFINES += QDESIGNER_COMPONENTS_LIBRARY - CONFIG += dll - LIBS += -lQtDesigner -} else { - DEFINES += QT_DESIGNER_STATIC -} - INCLUDEPATH += . .. \ $$PWD/../../lib/components \ $$PWD/../../lib/sdk \ $$PWD/../../lib/extension \ - $$QT_SOURCE_TREE/tools/uilib \ $$PWD/../../lib/shared include(../propertyeditor/propertyeditor.pri) @@ -70,10 +57,3 @@ unix|win32-g++* { QMAKE_PKGCONFIG_REQUIRES = QtCore QtDesigner QtGui QtXml contains(QT_CONFIG, script): QMAKE_PKGCONFIG_REQUIRES += QtScript } - -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget -} diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp index d04bfe6e2..c547a8108 100644 --- a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp @@ -52,7 +52,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp index 77b9fbe96..a69b1b05f 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor.cpp @@ -45,7 +45,7 @@ #include "signalslot_utils_p.h" #include -#include +#include #include #include diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp index 559e9bc93..3c3f673e8 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp @@ -41,7 +41,7 @@ #include "signalsloteditor_tool.h" #include "signalsloteditor.h" -#include "ui4_p.h" +#include "private/ui4_p.h" #include diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index c8568ecc5..1f88019ab 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -445,7 +445,7 @@ void InlineEditorModel::addTitle(const QString &title) const int cnt = rowCount(); insertRows(cnt, 1); QModelIndex cat_idx = index(cnt, 0); - setData(cat_idx, title + QLatin1Char(':'), Qt::DisplayRole); + setData(cat_idx, QString(title + QLatin1Char(':')), Qt::DisplayRole); setData(cat_idx, TitleItem, Qt::UserRole); QFont font = QApplication::font(); font.setBold(true); diff --git a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp index 5964de8c3..fd0320f3e 100644 --- a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp +++ b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp @@ -40,13 +40,13 @@ ****************************************************************************/ #include "widgetbox_dnditem.h" -#include "ui4_p.h" +#include "private/ui4_p.h" #include #include #include #include -#include +#include #include #include #include diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp index 6b84aa354..8f597215f 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -45,7 +45,7 @@ // shared #include #include -#include +#include #include #include diff --git a/src/designer/src/designer/designer.pro b/src/designer/src/designer/designer.pro index e922b688f..849335019 100644 --- a/src/designer/src/designer/designer.pro +++ b/src/designer/src/designer/designer.pro @@ -1,7 +1,7 @@ load(qt_module) DESTDIR = $$QT.designer.bins -QT += core-private widgets xml network designer-private uilib-private +QT += core-private widgets xml network designer-private uilib-private printsupport CONFIG += module MODULE_PRI = ../../../../modules/qt_designer.pri diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index c19abefc4..1e2eb65de 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -85,7 +85,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/designer/src/designer/qdesigner_actions.h b/src/designer/src/designer/qdesigner_actions.h index 4bd4de95e..f295c9486 100644 --- a/src/designer/src/designer/qdesigner_actions.h +++ b/src/designer/src/designer/qdesigner_actions.h @@ -47,7 +47,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/designer/src/lib/lib.pro b/src/designer/src/lib/lib.pro index 7219ad57f..0302c467b 100644 --- a/src/designer/src/lib/lib.pro +++ b/src/designer/src/lib/lib.pro @@ -14,17 +14,11 @@ load(qt_module_config) HEADERS += qtdesignerversion.h -#!contains(CONFIG, static) { -# CONFIG += dll - -# DEFINES += \ -# QDESIGNER_SDK_LIBRARY \ -# QDESIGNER_EXTENSION_LIBRARY \ -# QDESIGNER_UILIB_LIBRARY \ -# QDESIGNER_SHARED_LIBRARY -#} else { -# DEFINES += QT_DESIGNER_STATIC -#} +DEFINES += \ + QDESIGNER_SDK_LIBRARY \ + QDESIGNER_EXTENSION_LIBRARY \ + QDESIGNER_UILIB_LIBRARY \ + QDESIGNER_SHARED_LIBRARY #mac frameworks mac:CONFIG += explicitlib diff --git a/sync.profile b/sync.profile index 8873defdd..260187a51 100644 --- a/sync.profile +++ b/sync.profile @@ -3,6 +3,7 @@ "QtHelp" => "$basedir/src/assistant/help", "QtUiTools" => "$basedir/src/designer/src/uitools", "QtDesigner" => "$basedir/src/designer/src/lib", + "QtDesignerComponents" => "$basedir/src/designer/src/components/lib", ); %moduleheaders = ( # restrict the module headers to those found in relative path ); @@ -11,6 +12,7 @@ "qthelpversion.h" => "QtHelpVersion", "qtuitoolsversion.h" => "QtUiToolsVersion", "qtdesignerversion.h" => "QtDesigner", + "qtdesignercomponentsversion.h" => "QtDesignerComponents", ); %mastercontent = ( "sql" => "#include \n", @@ -21,6 +23,7 @@ "clucene" => "#include \n", "help" => "#include \n", "designer" => "#include \n", + "designercomponents" => "#include \n", "uitools" => "#include \n", ); %modulepris = ( @@ -28,6 +31,7 @@ "QtHelp" => "$basedir/modules/qt_help.pri", "QtUiTools" => "$basedir/modules/qt_uitools.pri", "QtDesigner" => "$basedir/modules/qt_designer.pri", + "QtDesignerComponents" => "$basedir/modules/qt_designercomponents.pri", ); %dependencies = ( "qtbase" => "refs/heads/master", -- cgit v1.2.1 From 650dc4fc2856339805a80e3170f4de6ce1003588 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 13 Sep 2011 16:19:53 +0200 Subject: Get Linguist to compile again Change-Id: If65b0e046a277bd2c83c5188285de4e8d14101b8 Reviewed-on: http://codereview.qt-project.org/4832 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/linguist/linguist/formpreviewview.h | 2 +- src/linguist/linguist/linguist.pro | 9 ++----- src/linguist/lupdate/lupdate.pro | 4 +-- src/linguist/lupdate/qdeclarative.cpp | 42 +++++++++++++++----------------- src/linguist/shared/profileevaluator.cpp | 2 -- src/linguist/shared/qph.cpp | 3 +-- src/linguist/shared/ts.cpp | 3 +-- 7 files changed, 26 insertions(+), 39 deletions(-) diff --git a/src/linguist/linguist/formpreviewview.h b/src/linguist/linguist/formpreviewview.h index 15fafc4b7..506fd2c96 100644 --- a/src/linguist/linguist/formpreviewview.h +++ b/src/linguist/linguist/formpreviewview.h @@ -42,7 +42,7 @@ #ifndef FORMPREVIEWVIEW_H #define FORMPREVIEWVIEW_H -#include +#include #include #include diff --git a/src/linguist/linguist/linguist.pro b/src/linguist/linguist/linguist.pro index db68e9130..d92996409 100644 --- a/src/linguist/linguist/linguist.pro +++ b/src/linguist/linguist/linguist.pro @@ -4,11 +4,9 @@ TEMPLATE = app LANGUAGE = C++ DESTDIR = $$QT.designer.bins -QT += core-private widgets xml designer +QT += core-private widgets xml designer uitools-private printsupport -CONFIG += qt \ - warn_on \ - uitools +CONFIG += qt warn_on DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII build_all:!build_pass { @@ -20,9 +18,6 @@ include(../shared/formats.pri) DEFINES += QFORMINTERNAL_NAMESPACE -INCLUDEPATH += $$QT_SOURCE_TREE/src/uitools -INCLUDEPATH += $$QT_SOURCE_TREE/tools/uilib - SOURCES += \ batchtranslationdialog.cpp \ errorsview.cpp \ diff --git a/src/linguist/lupdate/lupdate.pro b/src/linguist/lupdate/lupdate.pro index 02e315ed6..6ad523edb 100644 --- a/src/linguist/lupdate/lupdate.pro +++ b/src/linguist/lupdate/lupdate.pro @@ -18,8 +18,8 @@ build_all:!build_pass { include(../shared/formats.pri) include(../shared/proparser.pri) -include($$QT.declarative.sources/qml/parser/parser.pri) -INCLUDEPATH += $$QT.declarative.sources/qml $$QT.declarative.includes +#include($$QT.declarative.sources/qml/parser/parser.pri) +#INCLUDEPATH += $$QT.declarative.sources/qml $$QT.declarative.includes SOURCES += \ main.cpp \ diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp index 6bf9cf469..23001ebab 100644 --- a/src/linguist/lupdate/qdeclarative.cpp +++ b/src/linguist/lupdate/qdeclarative.cpp @@ -47,12 +47,11 @@ #include #include -#include "parser/qdeclarativejsengine_p.h" -#include "parser/qdeclarativejsparser_p.h" -#include "parser/qdeclarativejslexer_p.h" -#include "parser/qdeclarativejsnodepool_p.h" -#include "parser/qdeclarativejsastvisitor_p.h" -#include "parser/qdeclarativejsast_p.h" +#include "private/qdeclarativejsengine_p.h" +#include "private/qdeclarativejsparser_p.h" +#include "private/qdeclarativejslexer_p.h" +#include "private/qdeclarativejsastvisitor_p.h" +#include "private/qdeclarativejsast_p.h" #include #include @@ -110,8 +109,8 @@ protected: { m_bSource.clear(); if (AST::IdentifierExpression *idExpr = AST::cast(node->base)) { - if (idExpr->name->asString() == QLatin1String("qsTr") || - idExpr->name->asString() == QLatin1String("QT_TR_NOOP")) { + if (idExpr->name == QLatin1String("qsTr") || + idExpr->name == QLatin1String("QT_TR_NOOP")) { if (!node->arguments) return; AST::BinaryExpression *binary = AST::cast(node->arguments->expression); @@ -121,14 +120,14 @@ protected: } AST::StringLiteral *literal = AST::cast(node->arguments->expression); if (literal || !m_bSource.isEmpty()) { - const QString source = literal ? literal->value->asString() : m_bSource; + const QString source = literal ? literal->value.toString() : m_bSource; QString comment; bool plural = false; AST::ArgumentList *commentNode = node->arguments->next; if (commentNode && AST::cast(commentNode->expression)) { literal = AST::cast(commentNode->expression); - comment = literal->value->asString(); + comment = literal->value.toString(); AST::ArgumentList *nNode = commentNode->next; if (nNode) @@ -154,11 +153,11 @@ protected: msg.setExtras(extra); m_translator->extend(msg); } - } else if (idExpr->name->asString() == QLatin1String("qsTranslate") || - idExpr->name->asString() == QLatin1String("QT_TRANSLATE_NOOP")) { + } else if (idExpr->name == QLatin1String("qsTranslate") || + idExpr->name == QLatin1String("QT_TRANSLATE_NOOP")) { if (node->arguments && AST::cast(node->arguments->expression)) { AST::StringLiteral *literal = AST::cast(node->arguments->expression); - const QString context = literal->value->asString(); + const QString context = literal->value.toString(); QString source; QString comment; @@ -185,11 +184,11 @@ protected: id = scomment.msgid; } - source = literal ? literal->value->asString() : m_bSource; + source = literal ? literal->value.toString() : m_bSource; AST::ArgumentList *commentNode = sourceNode->next; if (commentNode && AST::cast(commentNode->expression)) { literal = AST::cast(commentNode->expression); - comment = literal->value->asString(); + comment = literal->value.toString(); AST::ArgumentList *nNode = commentNode->next; if (nNode) @@ -205,8 +204,8 @@ protected: msg.setExtras(extra); m_translator->extend(msg); } - } else if (idExpr->name->asString() == QLatin1String("qsTrId") || - idExpr->name->asString() == QLatin1String("QT_TRID_NOOP")) { + } else if (idExpr->name == QLatin1String("qsTrId") || + idExpr->name == QLatin1String("QT_TRID_NOOP")) { if (!node->arguments) return; @@ -223,7 +222,7 @@ protected: extra = comment.extra; } - const QString id = literal->value->asString(); + const QString id = literal->value.toString(); bool plural = node->arguments->next; TranslatorMessage msg(QString(), sourcetext, @@ -254,13 +253,13 @@ private: if (!createString(l)) return false; } else - m_bSource.prepend(ls->value->asString()); + m_bSource.prepend(ls->value.toString()); if (r) { if (!createString(r)) return false; } else - m_bSource.append(rs->value->asString()); + m_bSource.append(rs->value); return true; } @@ -393,9 +392,6 @@ bool loadQml(Translator &translator, const QString &filename, ConversionData &cd Engine driver; Parser parser(&driver); - NodePool nodePool(filename, &driver); - driver.setNodePool(&nodePool); - Lexer lexer(&driver); lexer.setCode(code, /*line = */ 1); driver.setLexer(&lexer); diff --git a/src/linguist/shared/profileevaluator.cpp b/src/linguist/shared/profileevaluator.cpp index 94e66745b..0a399f2f2 100644 --- a/src/linguist/shared/profileevaluator.cpp +++ b/src/linguist/shared/profileevaluator.cpp @@ -1022,8 +1022,6 @@ QString ProFileEvaluator::Private::propertyValue(const QString &name) const return QLibraryInfo::location(QLibraryInfo::SettingsPath); if (name == QLatin1String("QT_INSTALL_EXAMPLES")) return QLibraryInfo::location(QLibraryInfo::ExamplesPath); - if (name == QLatin1String("QT_INSTALL_DEMOS")) - return QLibraryInfo::location(QLibraryInfo::DemosPath); if (name == QLatin1String("QMAKE_MKSPECS")) return qmake_mkspec_paths().join(Option::dirlist_sep); if (name == QLatin1String("QMAKE_VERSION")) diff --git a/src/linguist/shared/qph.cpp b/src/linguist/shared/qph.cpp index b22aa3fe8..6452b012f 100644 --- a/src/linguist/shared/qph.cpp +++ b/src/linguist/shared/qph.cpp @@ -46,8 +46,7 @@ #include #include -#include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/linguist/shared/ts.cpp b/src/linguist/shared/ts.cpp index 4523bc55d..ba6edc724 100644 --- a/src/linguist/shared/ts.cpp +++ b/src/linguist/shared/ts.cpp @@ -46,8 +46,7 @@ #include #include -#include -#include +#include #define STRINGIFY_INTERNAL(x) #x #define STRINGIFY(x) STRINGIFY_INTERNAL(x) -- cgit v1.2.1